Exemplo n.º 1
0
        //constructor
        public MemCtrl2(uint rmax, DDR3DRAM ddr3)
        {
            this.cid = cmax;
            cmax++;

            //states
            this.rmax = rmax;
            this.bmax = ddr3.BANK_MAX;

            //DDR3
            timing        = ddr3.timing;
            this.col_max  = ddr3.COL_MAX;
            this.row_size = ddr3.COL_MAX * ddr3.CHANNEL_WIDTH;

            //components
            chan = new Channel2(this, rmax, ddr3.BANK_MAX);

            //row-hit finder
            rh_finder = new RowHitFinder2(this);

            //queues
//            int readq_max = Config.mctrl.readq_max_per_bank;
            int readq_max = (int)this.rmax * (int)this.bmax * Config.mctrl.readq_max_per_bank;

            writeq_max = (int)this.rmax * (int)this.bmax * Config.mctrl.writeq_max_per_bank;

            readqs       = new List <Req> [rmax, bmax];
            writeqs      = new List <Req> [rmax, bmax];
            mctrl_writeq = new List <Req>(writeq_max);
            inflightqs   = new List <Req> [rmax, bmax];
            cmdqs        = new List <Cmd> [rmax, bmax];
            for (uint r = 0; r < rmax; r++)
            {
                for (uint b = 0; b < bmax; b++)
                {
                    readqs[r, b]     = new List <Req>(readq_max);
                    writeqs[r, b]    = new List <Req>(writeq_max);
                    inflightqs[r, b] = new List <Req>(INFLIGHTQ_MAX);
                    cmdqs[r, b]      = new List <Cmd>(CMDQ_MAX);
                }
            }
            bus_q = new List <BusTransaction>((int)BUS_TRANSACTIONS_MAX);

            //stats
            rload_per_proc                = new uint[Config.N];
            rload_per_procrankbank        = new uint[Config.N, rmax, bmax];
            shadow_rowid_per_procrankbank = new ulong[Config.N, rmax, bmax];

            wload_per_proc         = new uint[Config.N];
            wload_per_procrankbank = new uint[Config.N, rmax, bmax];

            //writeback throttler
            wbthrottle = Activator.CreateInstance(Config.sched.typeof_wbthrottle_algo) as WBThrottle;
        }
Exemplo n.º 2
0
        //constructor
        public Rank2(MemCtrl2 mc, Channel2 chan, uint rid, uint bmax)
        {
            this.cid = mc.cid;
            this.rid = rid;

            this.mc   = mc;
            this.bmax = bmax;
            banks     = new Bank2[bmax];
            for (uint i = 0; i < banks.Length; i++)
            {
                banks[i] = new Bank2(mc, this, i);
            }
        }
Exemplo n.º 3
0
 private void set_banks()
 {
     banks = new List <Bank2>();
     foreach (MemCtrl2 mc in this.mctrls)
     {
         Channel2 chan = mc.chan;
         for (uint r = 0; r < chan.rmax; r++)
         {
             Rank2 rank = chan.ranks[r];
             for (uint b = 0; b < rank.bmax; b++)
             {
                 Bank2 bank = rank.banks[b];
                 banks.Add(bank);
             }
         }
     }
 }
Exemplo n.º 4
0
        //constructor
        public BLPTracker2(MemCtrl2[] mctrls)
        {
            this.mctrls = mctrls;

            //banks
            banks = new List <Bank2>();
            foreach (MemCtrl2 mc in this.mctrls)
            {
                Channel2 chan = mc.chan;
                for (uint r = 0; r < chan.rmax; r++)
                {
                    Rank2 rank = chan.ranks[r];
                    for (uint b = 0; b < rank.bmax; b++)
                    {
                        Bank2 bank = rank.banks[b];
                        banks.Add(bank);
                    }
                }
            }

            //blp
            blp_perproc = new int[Config.N];
        }