public BufRingMultiNetwork_NIC(BufRingMultiNetwork_Coord coord)
        {
            _coord   = coord;
            _buf     = new Queue <Flit>();
            _credits = Config.bufrings_localbuf;

            _inject = null;
        }
Example #2
0
        // if this is a coordinate at a non-leaf node (IRI), should we
        // route the given flit up the hierarchy? Yes if its
        // prefix does not match our prefix.
        public bool routeG(BufRingMultiNetwork_Coord flitCoord)
        {
            //Console.WriteLine("routeG: my coord {0}, flitCoord {1}", this, flitCoord);
            for (int i = 0; i <= level; i++)
                if (flitCoord.coord[i] != coord[i])
                    return true;
            return false;

        }
Example #3
0
        public BufRingMultiNetwork_Coord(BufRingMultiNetwork_Coord other)
        {
            id = other.id;
            level = other.level;
            coord = new int[Config.bufrings_levels];

            for (int i = 0; i < Config.bufrings_levels; i++)
                coord[i] = other.coord[i];
        }
        public BufRingMultiNetwork_Coord(BufRingMultiNetwork_Coord other)
        {
            id    = other.id;
            level = other.level;
            coord = new int[Config.bufrings_levels];

            for (int i = 0; i < Config.bufrings_levels; i++)
            {
                coord[i] = other.coord[i];
            }
        }
 // if this is a coordinate at a non-leaf node (IRI), should we
 // route the given flit down the hierarchy? Yes if its
 // prefix does match our prefix.
 public bool routeL(BufRingMultiNetwork_Coord flitCoord)
 {
     for (int i = 0; i <= level; i++)
     {
         if (flitCoord.coord[i] != coord[i])
         {
             return(false);
         }
     }
     return(true);
 }
 // if this is a coordinate at a non-leaf node (IRI), should we
 // route the given flit up the hierarchy? Yes if its
 // prefix does not match our prefix.
 public bool routeG(BufRingMultiNetwork_Coord flitCoord)
 {
     //Console.WriteLine("routeG: my coord {0}, flitCoord {1}", this, flitCoord);
     for (int i = 0; i <= level; i++)
     {
         if (flitCoord.coord[i] != coord[i])
         {
             return(true);
         }
     }
     return(false);
 }
Example #7
0
        public static void trace(Flit f, string loc, BufRingMultiNetwork_Coord c)
        {
            //return;

            if (f.packet.ID >= id && f.packet.ID < id2 && f.flitNr == 0) {
                BufRingMultiNetwork_Coord srcC = new BufRingMultiNetwork_Coord(f.packet.src.ID, Config.bufrings_levels - 1);
                BufRingMultiNetwork_Coord destC = new BufRingMultiNetwork_Coord(f.packet.dest.ID,
                        Config.bufrings_levels - 1);

                Console.WriteLine("cycle {0} flit {3}.0 (src {4} dest {5} ID {6}) at coord {1} loc {2}",
                        Simulator.CurrentRound, c, loc, f.packet.ID,
                        srcC, destC, f.packet.dest.ID);
            }
        }
        public static void trace(Flit f, string loc, BufRingMultiNetwork_Coord c)
        {
            //return;

            if (f.packet.ID >= id && f.packet.ID < id2 && f.flitNr == 0)
            {
                BufRingMultiNetwork_Coord srcC  = new BufRingMultiNetwork_Coord(f.packet.src.ID, Config.bufrings_levels - 1);
                BufRingMultiNetwork_Coord destC = new BufRingMultiNetwork_Coord(f.packet.dest.ID,
                                                                                Config.bufrings_levels - 1);

                Console.WriteLine("cycle {0} flit {3}.0 (src {4} dest {5} ID {6}) at coord {1} loc {2}",
                                  Simulator.CurrentRound, c, loc, f.packet.ID,
                                  srcC, destC, f.packet.dest.ID);
            }
        }
        public BufRingMultiNetwork_IRI(BufRingMultiNetwork_Coord c)
        {
            _coord = c;

            //Console.WriteLine("new IRI: coord {0}", c);

            _bufGL = new Queue <Flit>();
            _bufLG = new Queue <Flit>();
            _bufL  = new Queue <Flit>();
            _bufG  = new Queue <Flit>();

            _creditGL = Config.bufrings_G2L;
            _creditLG = Config.bufrings_L2G;
            _creditL  = Config.bufrings_localbuf;
            _creditG  = Config.bufrings_globalbuf;

            _localBack  = new BufRingMultiNetwork_IRI_LocalPort(this);
            _globalBack = new BufRingMultiNetwork_IRI_GlobalPort(this);
        }
        public override void setup()
        {
            // boilerplate
            nodes = new Node[Config.N];
            cache = new CmpCache();
            ParseFinish(Config.finish);
            workload = new Workload(Config.traceFilenames);
            mapping  = new NodeMapping_AllCPU_SharedCache();

            _nics = new List <BufRingMultiNetwork_NIC>();
            _iris = new List <BufRingMultiNetwork_IRI>();

            links    = new List <Link>();
            _routers = new BufRingMultiNetwork_Router[Config.N];

            //Console.WriteLine("setup: N = {0}", Config.N);

            // create routers and nodes
            for (int n = 0; n < Config.N; n++)
            {
                Coord c = new Coord(n);
                nodes[n]    = new Node(mapping, c);
                _routers[n] = new BufRingMultiNetwork_Router(c);
                _routers[n].setNode(nodes[n]);
                nodes[n].setRouter(_routers[n]);
            }

            // for each copy of the network...
            for (int copy = 0; copy < Config.bufrings_n; copy++)
            {
                BufRingMultiNetwork_Coord c = new BufRingMultiNetwork_Coord(0, 0);
                BufRingMultiNetwork_IRI   iri;
                int count;
                setup_ring(c, 0, out iri, out count);
            }
        }
Example #11
0
 // if this is a coordinate at a non-leaf node (IRI), should we
 // route the given flit down the hierarchy? Yes if its
 // prefix does match our prefix.
 public bool routeL(BufRingMultiNetwork_Coord flitCoord)
 {
     for (int i = 0; i <= level; i++)
         if (flitCoord.coord[i] != coord[i])
             return false;
     return true;
 }
Example #12
0
        public override void setup()
        {
            // boilerplate
            nodes = new Node[Config.N];
            cache = new CmpCache();
            ParseFinish(Config.finish);
            workload = new Workload(Config.traceFilenames);
            mapping = new NodeMapping_AllCPU_SharedCache();

            _nics = new List<BufRingMultiNetwork_NIC>();
            _iris = new List<BufRingMultiNetwork_IRI>();

            links = new List<Link>();
            _routers = new BufRingMultiNetwork_Router[Config.N];

            //Console.WriteLine("setup: N = {0}", Config.N);

            // create routers and nodes
            for (int n = 0; n < Config.N; n++)
            {
                Coord c = new Coord(n);
                nodes[n] = new Node(mapping, c);
                _routers[n] = new BufRingMultiNetwork_Router(c);
                _routers[n].setNode(nodes[n]);
                nodes[n].setRouter(_routers[n]);
            }

            // for each copy of the network...
            for (int copy = 0; copy < Config.bufrings_n; copy++) {
                BufRingMultiNetwork_Coord c = new BufRingMultiNetwork_Coord(0, 0);
                BufRingMultiNetwork_IRI iri;
                int count;
                setup_ring(c, 0, out iri, out count);
            }

        }
Example #13
0
        // set up a ring with local nodes at level 'level'
        void setup_ring(BufRingMultiNetwork_Coord coord, int level, out BufRingMultiNetwork_IRI iri, out int count)
        {
            count = 0;

            //Console.WriteLine("setup_ring: coord {0}, level {1}", coord, level);

            if (level == (Config.bufrings_levels - 1)) {
                BufRingMultiNetwork_NIC first = null, last = null;
                for (int n = 0; n < Config.bufrings_branching; n++) {
                    int id = coord.id + n;
                    //Console.WriteLine("setup_ring: coord {0}, level {1}: node {2}, global id {3}",
                    //        coord, level, n, id);
                    BufRingMultiNetwork_Coord c = new BufRingMultiNetwork_Coord(id, level);
                    BufRingMultiNetwork_NIC nic = new BufRingMultiNetwork_NIC(c);
                    _routers[id].addNIC(nic);
                    _nics.Add(nic);

                    if (last != null) {
                        Link l = new Link(Config.bufrings_locallat);
                        links.Add(l);
                        nic.setInput(l);
                        last.setOutput(l, nic);
                        //Console.WriteLine("link nic coord {0} -> nic coord {1}",
                        //        last.Coord, nic.Coord);
                    }
                    else {
                        first = nic;
                    }
                    last = nic;
                }

                BufRingMultiNetwork_Coord iricoord = new BufRingMultiNetwork_Coord(coord);
                iricoord.level--;

                iri = new BufRingMultiNetwork_IRI(iricoord);
                _iris.Add(iri);
                Link iriIn = new Link(Config.bufrings_locallat - 1), iriOut = new Link(Config.bufrings_locallat - 1);
                links.Add(iriIn);
                links.Add(iriOut);

                last.setOutput(iriIn, iri.LocalPort);
                iri.setLocalInput(iriIn);
                iri.setLocalOutput(iriOut, first);
                first.setInput(iriOut);

                //Console.WriteLine("link nic coord {0} -> IRI coord {1} local",
                //        last.Coord, iri.Coord);
                //Console.WriteLine("link IRI coord {0} local -> nic coord {1}",
                //        iri.Coord, first.Coord);

                count = Config.bufrings_branching;
            }
            else {
                BufRingMultiNetwork_IRI first = null, last = null;
                int id = coord.id;
                for (int n = 0; n < Config.bufrings_branching; n++) {
                    BufRingMultiNetwork_Coord c = new BufRingMultiNetwork_Coord(coord);
                    BufRingMultiNetwork_IRI I;
                    int subcount;

                    c.level++;
                    c.coord[c.level - 1] = n;
                    c.id = id;

                    setup_ring(c, level + 1, out I, out subcount);
                    id += subcount;
                    count += subcount;

                    if (last != null) {
                        Link l = new Link(Config.bufrings_globallat - 1);
                        links.Add(l);
                        I.setGlobalInput(l);
                        last.setGlobalOutput(l, I.GlobalPort);
                        //Console.WriteLine("link IRI coord {0} global -> IRI coord {1} global",
                        //        last.Coord, I.Coord);
                    }
                    else {
                        first = I;
                    }
                    last = I;
                }

                if (level > 0) {
                    BufRingMultiNetwork_Coord iricoord = new BufRingMultiNetwork_Coord(coord);
                    iricoord.level--;
                    iri = new BufRingMultiNetwork_IRI(iricoord);
                    _iris.Add(iri);
                    Link iriIn = new Link(Config.bufrings_globallat - 1), iriOut = new Link(Config.bufrings_globallat - 1);
                    links.Add(iriIn);
                    links.Add(iriOut);

                    last.setGlobalOutput(iriIn, iri.LocalPort);
                    iri.setLocalInput(iriIn);
                    iri.setLocalOutput(iriOut, first.GlobalPort);
                    first.setGlobalInput(iriOut);

                    //Console.WriteLine("link IRI coord {0} global -> IRI coord {1} local",
                    //        last.Coord, iri.Coord);
                    //Console.WriteLine("link IRI coord {0} local -> IRI coord {1} global",
                    //        iri.Coord, first.Coord);
                }
                else {
                    Link l = new Link(Config.bufrings_globallat - 1);
                    links.Add(l);

                    last.setGlobalOutput(l, first.GlobalPort);
                    first.setGlobalInput(l);
                    
                    //Console.WriteLine("link IRI coord {0} global -> IRI coord {1} global",
                    //        last.Coord, first.Coord);

                    iri = null;
                }
            }
        }
Example #14
0
        public BufRingMultiNetwork_IRI(BufRingMultiNetwork_Coord c)
        {
            _coord = c;

            //Console.WriteLine("new IRI: coord {0}", c);

            _bufGL = new Queue<Flit>();
            _bufLG = new Queue<Flit>();
            _bufL = new Queue<Flit>();
            _bufG = new Queue<Flit>();

            _creditGL = Config.bufrings_G2L;
            _creditLG = Config.bufrings_L2G;
            _creditL = Config.bufrings_localbuf;
            _creditG = Config.bufrings_globalbuf;

            _localBack = new BufRingMultiNetwork_IRI_LocalPort(this);
            _globalBack = new BufRingMultiNetwork_IRI_GlobalPort(this);
        }
Example #15
0
        public BufRingMultiNetwork_NIC(BufRingMultiNetwork_Coord coord)
        {
            _coord = coord;
            _buf = new Queue<Flit>();
            _credits = Config.bufrings_localbuf;

            _inject = null;
        }
        // set up a ring with local nodes at level 'level'
        void setup_ring(BufRingMultiNetwork_Coord coord, int level, out BufRingMultiNetwork_IRI iri, out int count)
        {
            count = 0;

            //Console.WriteLine("setup_ring: coord {0}, level {1}", coord, level);

            if (level == (Config.bufrings_levels - 1))
            {
                BufRingMultiNetwork_NIC first = null, last = null;
                for (int n = 0; n < Config.bufrings_branching; n++)
                {
                    int id = coord.id + n;
                    //Console.WriteLine("setup_ring: coord {0}, level {1}: node {2}, global id {3}",
                    //        coord, level, n, id);
                    BufRingMultiNetwork_Coord c   = new BufRingMultiNetwork_Coord(id, level);
                    BufRingMultiNetwork_NIC   nic = new BufRingMultiNetwork_NIC(c);
                    _routers[id].addNIC(nic);
                    _nics.Add(nic);

                    if (last != null)
                    {
                        Link l = new Link(Config.bufrings_locallat);
                        links.Add(l);
                        nic.setInput(l);
                        last.setOutput(l, nic);
                        //Console.WriteLine("link nic coord {0} -> nic coord {1}",
                        //        last.Coord, nic.Coord);
                    }
                    else
                    {
                        first = nic;
                    }
                    last = nic;
                }

                BufRingMultiNetwork_Coord iricoord = new BufRingMultiNetwork_Coord(coord);
                iricoord.level--;

                iri = new BufRingMultiNetwork_IRI(iricoord);
                _iris.Add(iri);
                Link iriIn = new Link(Config.bufrings_locallat - 1), iriOut = new Link(Config.bufrings_locallat - 1);
                links.Add(iriIn);
                links.Add(iriOut);

                last.setOutput(iriIn, iri.LocalPort);
                iri.setLocalInput(iriIn);
                iri.setLocalOutput(iriOut, first);
                first.setInput(iriOut);

                //Console.WriteLine("link nic coord {0} -> IRI coord {1} local",
                //        last.Coord, iri.Coord);
                //Console.WriteLine("link IRI coord {0} local -> nic coord {1}",
                //        iri.Coord, first.Coord);

                count = Config.bufrings_branching;
            }
            else
            {
                BufRingMultiNetwork_IRI first = null, last = null;
                int id = coord.id;
                for (int n = 0; n < Config.bufrings_branching; n++)
                {
                    BufRingMultiNetwork_Coord c = new BufRingMultiNetwork_Coord(coord);
                    BufRingMultiNetwork_IRI   I;
                    int subcount;

                    c.level++;
                    c.coord[c.level - 1] = n;
                    c.id = id;

                    setup_ring(c, level + 1, out I, out subcount);
                    id    += subcount;
                    count += subcount;

                    if (last != null)
                    {
                        Link l = new Link(Config.bufrings_globallat - 1);
                        links.Add(l);
                        I.setGlobalInput(l);
                        last.setGlobalOutput(l, I.GlobalPort);
                        //Console.WriteLine("link IRI coord {0} global -> IRI coord {1} global",
                        //        last.Coord, I.Coord);
                    }
                    else
                    {
                        first = I;
                    }
                    last = I;
                }

                if (level > 0)
                {
                    BufRingMultiNetwork_Coord iricoord = new BufRingMultiNetwork_Coord(coord);
                    iricoord.level--;
                    iri = new BufRingMultiNetwork_IRI(iricoord);
                    _iris.Add(iri);
                    Link iriIn = new Link(Config.bufrings_globallat - 1), iriOut = new Link(Config.bufrings_globallat - 1);
                    links.Add(iriIn);
                    links.Add(iriOut);

                    last.setGlobalOutput(iriIn, iri.LocalPort);
                    iri.setLocalInput(iriIn);
                    iri.setLocalOutput(iriOut, first.GlobalPort);
                    first.setGlobalInput(iriOut);

                    //Console.WriteLine("link IRI coord {0} global -> IRI coord {1} local",
                    //        last.Coord, iri.Coord);
                    //Console.WriteLine("link IRI coord {0} local -> IRI coord {1} global",
                    //        iri.Coord, first.Coord);
                }
                else
                {
                    Link l = new Link(Config.bufrings_globallat - 1);
                    links.Add(l);

                    last.setGlobalOutput(l, first.GlobalPort);
                    first.setGlobalInput(l);

                    //Console.WriteLine("link IRI coord {0} global -> IRI coord {1} global",
                    //        last.Coord, first.Coord);

                    iri = null;
                }
            }
        }