Esempio n. 1
0
        public SortNet_CALF_FBFLY(SortNode.Rank r, Router router)
        {
            // 4x4 sorting network
            nodes = new SortNode[12];

            // Domain 1 (x-axis) goes 0. Domain 2 (y-axis) goes 1.
            SortNode.Steer crossDomain = delegate(Flit f)
            {
                if (f == null)
                    return 0;
                return (f.prefDir <= Simulator.DIR_X_3)?0:1;
            };

            // within first half domain, goes 0; otherwise goes 1.
            SortNode.Steer intraDomain = delegate(Flit f)
            {
                if (f == null)
                    return 0;
                return (f.prefDir%4 < 2)?0:1;
            };

            // even channel number (e.g. DIR_X_0) goes 0; otherwise goes 1.
            SortNode.Steer evenSteer = delegate(Flit f)
            {
                if (f == null)
                    return 0;
                return (f.prefDir%2 == 0)?0:1;
            };
           
            for (int i = 0; i < 4; i++)
            {
                nodes[i]   = new SortNode(crossDomain, r);
                nodes[i+4] = new SortNode(intraDomain, r);
                nodes[i+8] = new SortNode(evenSteer, r);
            }

            LOCAL_INDEX = Router.LOCAL_INDEX;
            TOTAL_DIR   = Router.TOTAL_DIR;
            coord       = router.coord;
            loopBackX   = null;
            loopBackY   = null;
            rbuf        = new ResubBuffer();
            rb_inject_block_count = 0;
        }
Esempio n. 2
0
        // helpers

        public static bool hasNeighbor(int dir, Router router)
        {
            int x, y;
            x = router.coord.x;
            y = router.coord.y;
            switch (dir)
            {
                case DIR_DOWN: y--; break;
                case DIR_UP: y++; break;
                case DIR_LEFT: x--; break;
                case DIR_RIGHT: x++; break;
            }

            return x >= 0 && x < Config.network_nrX && y >= 0 && y < Config.network_nrY;
        }
Esempio n. 3
0
 public void setRouter(Router r)
 {
     m_router = r;
 }