Exemplo n.º 1
0
        public void setup_TorusSingleRing()
        {
            nodeRouters    = new Router_TorusRingNode[Config.N];
            connectRouters = new Router_TorusRingConnect[8];
            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();

            for (int n = 0; n < Config.N; n++)
            {
                Coord c = new Coord(n);
                nodes[n]       = new Node(mapping, c);
                nodeRouters[n] = new Router_TorusRingNode(c);
                nodes[n].setRouter(nodeRouters[n]);
                nodeRouters[n].setNode(nodes[n]);
            }
            for (int n = 0; n < 8; n++)
            {
                connectRouters[n] = new Router_TorusRingConnect(n);
            }

            int[] CW_Connect = new int[16] {
                7, 0, 6, 1, 3, 1, 2, 0, 2, 5, 3, 4, 6, 4, 7, 5
            };
            int[] CCW_Connect = new int[16] {
                1, 7, 0, 6, 0, 3, 1, 2, 4, 2, 5, 3, 5, 6, 4, 7
            };
            int[] dirCW = new int[16] {
                1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1
            };
            int[] dirCCW = new int[16] {
                1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0
            };
            for (int n = 0; n < Config.N; n++)
            {
                Link dirA = new Link(Config.router.linkLatency - 1);
                Link dirB = new Link(Config.router.linkLatency - 1);
                links.Add(dirA);
                links.Add(dirB);
                nodeRouters[n].linkOut[0] = dirA;
                nodeRouters[n].linkIn[0]  = dirB;
                connectRouters[CW_Connect[n]].linkIn[dirCW[n]]    = dirA;
                connectRouters[CCW_Connect[n]].linkOut[dirCCW[n]] = dirB;
            }
        }
Exemplo n.º 2
0
       	public void setup_TorusSingleRing()
       	{
       		nodeRouters = new Router_TorusRingNode[Config.N];
       		connectRouters = new Router_TorusRingConnect[8];
            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();
            
            for (int n = 0; n < Config.N; n++)
            {
                Coord c = new Coord(n);
                nodes[n] = new Node(mapping, c);                 
                nodeRouters[n] = new Router_TorusRingNode(c); 
                nodes[n].setRouter(nodeRouters[n]);                                
                nodeRouters[n].setNode(nodes[n]);
            }
            for (int n = 0; n < 8; n++)
            	connectRouters[n] = new Router_TorusRingConnect(n);

       		int[] CW_Connect = new int[16] {7,0,6,1,3,1,2,0,2,5,3,4,6,4,7,5};
       		int[] CCW_Connect = new int[16] {1,7,0,6,0,3,1,2,4,2,5,3,5,6,4,7};	
       		int[] dirCW = new int[16] {1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1};
       		int[] dirCCW = new int[16] {1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0};
       		for (int n = 0; n < Config.N; n++)
       		{
       			Link dirA = new Link(Config.router.linkLatency - 1);	            	
            	Link dirB = new Link(Config.router.linkLatency - 1);
            	links.Add(dirA);
            	links.Add(dirB);
            	nodeRouters[n].linkOut[0] = dirA;
            	nodeRouters[n].linkIn[0] = dirB;
            	connectRouters[CW_Connect[n]].linkIn[dirCW[n]] = dirA;
            	connectRouters[CCW_Connect[n]].linkOut[dirCCW[n]] = dirB;
       		}
       	}