Example #1
0
        public override void setup()
        {
            if (Config.bBufferedRing)
            {
                nodeRouters = new Router_Node_Buffer[Config.N];
            }
            else
            {
                nodeRouters = new Router_Node[Config.N];
            }

            nodes = new Node[Config.N];
            links = new List <Link>();
            cache = new CmpCache();

            ParseFinish(Config.finish);

            workload = new Workload(Config.traceFilenames);

            mapping = new NodeMapping_AllCPU_SharedCache();

            // create routers and nodes
            for (int n = 0; n < Config.N; n++)
            {
                Coord    c    = new Coord(n);
                RC_Coord RC_c = new RC_Coord(n);

                nodes[n] = new Node(mapping, c);
                if (Config.bBufferedRing)
                {
                    nodeRouters[n] = new Router_Node_Buffer(RC_c, c);
                }
                else
                {
                    nodeRouters[n] = new Router_Node(RC_c, c);
                }
                nodes[n].setRouter(nodeRouters[n]);
                nodeRouters[n].setNode(nodes[n]);
            }
            // connect the network with Links
            for (int n = 0; n < Config.N; n++)
            {
                int  next = (n + 1) % Config.N;
                Link dirA = new Link(Config.router.switchLinkLatency - 1);
                Link dirB = new Link(Config.router.switchLinkLatency - 1);
                links.Add(dirA);
                links.Add(dirB);
                nodeRouters[n].linkOut[CW]     = dirA;
                nodeRouters[next].linkIn[CW]   = dirA;
                nodeRouters[n].linkIn[CCW]     = dirB;
                nodeRouters[next].linkOut[CCW] = dirB;
            }
        }
Example #2
0
      	public override void setup()
       	{
            if (Config.bBufferedRing)
                nodeRouters = new Router_Node_Buffer[Config.N];
            else
                nodeRouters = new Router_Node[Config.N];

            nodes = new Node[Config.N];
            links = new List<Link>();
            cache = new CmpCache();

            ParseFinish(Config.finish);

            workload = new Workload(Config.traceFilenames);

            mapping = new NodeMapping_AllCPU_SharedCache();

            // create routers and nodes
            for (int n = 0; n < Config.N; n++)
           	{
                Coord c = new Coord(n);
                RC_Coord RC_c = new RC_Coord(n);

                nodes[n] = new Node(mapping, c);
                if (Config.bBufferedRing)
                    nodeRouters[n] = new Router_Node_Buffer(RC_c, c);
                else
                    nodeRouters[n] = new Router_Node(RC_c, c);
                nodes[n].setRouter(nodeRouters[n]);
                nodeRouters[n].setNode(nodes[n]);
            }
            // connect the network with Links
            for (int n = 0; n < Config.N; n++)
            {
				int next = (n + 1) % Config.N;
				Link dirA = new Link(Config.router.switchLinkLatency - 1);
				Link dirB = new Link(Config.router.switchLinkLatency - 1);
				links.Add(dirA);
				links.Add(dirB);
				nodeRouters[n].linkOut[CW] = dirA;
				nodeRouters[next].linkIn[CW] = dirA;
				nodeRouters[n].linkIn[CCW] = dirB;
				nodeRouters[next].linkOut[CCW] = dirB;
			}
       	}