public ulong[,] total_req_per_procbank; //total number of requests per processor for each bank [proc, bank] public MemSchedStat(int proc_max, Bank[] bank, int bank_max) { //collect stats is_collect_stat = new bool[Config.N]; for (int p = 0; p < Config.N; p++) { is_collect_stat[p] = true; } //components this.bank = bank; this.bank_max = bank_max; //this.proc_max = proc_max; //other stats tick_load_per_proc = new ulong[proc_max]; time_avg_load_per_proc = new double[proc_max]; tick_req = new ulong[proc_max]; tick_req_cnt = new ulong[proc_max]; tick_marked = new ulong[proc_max]; tick_marked_req = new ulong[proc_max]; tick_unmarked = new ulong[proc_max]; tick_unmarked_req = new ulong[proc_max]; total_req_per_procbank = new ulong[proc_max, bank_max]; }
public OUR(int total_size, Bank[] bank) : base(total_size, bank) { num_groups = Simulator.network.workload.GroupCount; priority = new int[num_groups]; for(int g = 0; g < num_groups; g++) { priority[g] = 1; } rankGroups = new int[num_groups]; AU = new float[Config.N]; AUMinFrame = new float[Config.N]; groupAU = new float[Config.N]; groupAUMinFrame = new float[Config.N]; totAU = new float[Config.N]; rankGroups = new int[num_groups]; utilityMinFrame = new int[Config.N]; utility = new int[Config.N]; rank = new int[Config.N]; priority = new int[num_groups]; nCoresInGroup = new int[num_groups]; }
public FR_FCFS_Cap(int totalSize, Bank[] bank) : base(totalSize, bank) { bankTimers = new ulong[Config.memory.bank_max_per_mem]; bankRowHitCount = new int[Config.memory.bank_max_per_mem]; Console.WriteLine("Initialized FR_FCFS_Cap_MemoryScheduler"); }
public BatchMemSchedHelper bhelper; //ranking algorithm helper /** * Constructor */ public BatchMemSched(int buf_size, Bank[] bank, RankAlgo rank_algo, BatchSchedAlgo batch_sched_algo) : base(buf_size, bank) { //stat bstat = new BatchMemSchedStat(this); //components this.rank_algo = rank_algo; this.batch_sched_algo = batch_sched_algo; rank_to_proc = new int[Config.N]; proc_to_rank = new int[Config.N]; for (int p = 0; p < Config.N; p++) { rank_to_proc[p] = p; proc_to_rank[p] = Config.N - 1; } //batch formulation; marking markable = new MemoryRequest[Config.N][][]; for (int p = 0; p < Config.N; p++) { markable[p] = new MemoryRequest[bank_max][]; for (int b = 0; b < bank_max; b++) { markable[p][b] = new MemoryRequest[markable_len]; } } markable_cnt = new int[Config.N][]; for (int p = 0; p < Config.N; p++) { markable_cnt[p] = new int[bank_max]; } markable_cnt_unbound = new int[Config.N][]; for (int p = 0; p < Config.N; p++) { markable_cnt_unbound[p] = new int[bank_max]; } //marked requests per processor cur_marked_per_proc = new int[Config.N]; cur_period_marked_per_proc = new int[Config.N]; //marked requests per processor, bank cur_marked_per_procbank = new int[Config.N, bank_max]; cur_period_marked_per_procbank = new int[Config.N, bank_max]; //bhelper bhelper = new BatchMemSchedHelper(this); Console.WriteLine("Initialized BATCH_MemoryScheduler"); Console.WriteLine("Ranking Scheme: " + rank_algo.ToString()); Console.WriteLine("WithinBatch Priority: " + batch_sched_algo.ToString()); Console.WriteLine("BatchingCap: " + Config.memory.batch_cap); }
public ulong[] row_miss_per_proc; //total row misses (conflicts), by originating processor /** * Constructor */ public BankStat(Bank bank) { //collecting stats is_collect_stat = true; //owning processor this.bank = bank; bank_id = bank.bank_id; //hit or miss per originating processor row_hit_per_proc = new ulong[Config.N]; row_miss_per_proc = new ulong[Config.N]; }
public BATCH_WITH_PRIORITIES_MemoryScheduler(int totalSize, Bank[] bank, RankAlgo rankingScheme) : base(totalSize, bank) { this.rankingScheme = rankingScheme; procRank = new int[Config.N]; Rank = new int[Config.N]; markedReqThisBatchPerPriority = new int[Config.memory.prio_max]; curMarkedPerProc = new int[Config.N]; curMarkedPerProcBank = new int[Config.N, Config.memory.bank_max_per_mem]; exceedsBatchingCap = new bool[Config.N, Config.memory.bank_max_per_mem]; threadPriority = new int[Config.N]; minimumPriorityLevel = Config.memory.prio_max + 1; for (int p = 0; p < Config.N; p++) { threadPriority[p] = (int)Config.memory.weight[p]; // TODO: Properly rescale between weights and priorities! Console.WriteLine("Processor " + p + " has priority-level: " + threadPriority[p]); if (threadPriority[p] < minimumPriorityLevel) minimumPriorityLevel = threadPriority[p]; } avgNumReqPerProcRemark = new double[Config.N]; avgMaxReqPerProcRemark = new double[Config.N]; avgNumReqPerProcRecomp = new ulong[Config.N]; avgMaxReqPerProcRecomp = new ulong[Config.N]; avgMarkedReqAtBatchEnd = new ulong[Config.N]; avgNumMarkedReqPerProcRemark = new double[Config.N]; avgMaxMarkedReqPerProcRemark = new double[Config.N]; finalavgNumMarkedReqPerProcRemark = new double[Config.N]; finalavgMaxMarkedReqPerProcRemark = new double[Config.N]; markCountPerPriority = new ulong[Config.memory.prio_max]; finalmarkCountPerPriority = new ulong[Config.N]; finalavgNumReqPerProcRemark = new double[Config.N]; finalavgMaxReqPerProcRemark = new double[Config.N]; finalavgNumReqPerProcRecomp = new double[Config.N]; finalavgMaxReqPerProcRecomp = new double[Config.N]; finalavgMarkedReqAtBatchEnd = new double[Config.N]; avgFullBatchingDuration = new ulong[Config.N]; finalavgFullBatchingDuration = new double[Config.N]; batchStart = new ulong[Config.memory.prio_max]; for (int i = 0; i < Config.N; i++) { procRank[i] = i; Rank[i] = Config.N - 1; } Console.WriteLine("Initialized BATCH_WITH_PRIORITIES_MemoryScheduler"); Console.WriteLine("Ranking Scheme: " + rankingScheme.ToString()); }
/** * Constructor */ protected AbstractMemSched(int buf_size, Bank[] bank) { //parameters bank_max = bank.Length; //shared MC see global, non-shared this.buf_size = buf_size; shared_size = buf_size - Config.N * Config.memory.buf_size_per_proc; Debug.Assert(shared_size >= 0); //components this.bank = bank; buf = new MemoryRequest[bank_max, buf_size]; buf_load = new int[bank_max]; //load cur_load = 0; cur_nonwb_load = 0; cur_shared_load = 0; //load per proc cur_load_per_proc = new int[Config.N]; cur_load_per_procbank = new int[Config.N, bank_max]; cur_nonwb_per_proc = new int[Config.N]; cur_nonwb_per_procbank = new int[Config.N, bank_max]; bankRank = new int[Config.N]; bankRankPerThread = new int[Config.memory.mem_max * Config.memory.bank_max_per_mem,Config.N]; //max-load per proc cur_max_load_per_proc = new int[Config.N]; //helper helper = new MemSchedHelper(bank, bank_max, cur_max_load_per_proc); //stat stat = new MemSchedStat(Config.N, bank, bank_max); }
public FULL_BATCH(int total_size, Bank[] bank, RankAlgo rank_algo, BatchSchedAlgo batch_sched_algo) : base(total_size, bank, rank_algo, batch_sched_algo) { Console.WriteLine("Initialized FULL_BATCH_MemoryScheduler"); }
public FCFS_MemoryScheduler_WB(int totalSize, Bank[] bank) : base(totalSize, bank) { Console.WriteLine("Initialized FCFS_MemoryScheduler_WB"); }
public Rank(int index, DRAM mem, Channel chan) { this.index = index; this.mem = mem; this.chan = chan; numBanks = Config.memory.numBanks; banks = new Bank[numBanks]; for(int i=0;i<numBanks;i++) banks[i] = new Bank(i,mem,chan,this); }
public PERBANK_BATCH_MemoryScheduler(int totalSize, Bank[] bank, RankAlgo rankingScheme, BatchSchedAlgo withinBatchPriority) : base(totalSize, bank) { this.rankingScheme = rankingScheme; this.withinBatchPriority = withinBatchPriority; procRank = new int[Config.N]; Rank = new int[Config.N]; perBankprocRank = new int[Config.N, Config.memory.bank_max_per_mem]; perBankRank = new int[Config.N, Config.memory.bank_max_per_mem]; curMarkedPerProc = new int[Config.N]; thisPeriodMarkedPerProc = new int[Config.N]; avgNumReqPerProcRemark = new double[Config.N]; avgMaxReqPerProcRemark = new double[Config.N]; avgNumMarkedReqPerProcRemark = new double[Config.N]; avgMaxMarkedReqPerProcRemark = new double[Config.N]; avgNumReqPerProcRecomp = new ulong[Config.N]; avgMaxReqPerProcRecomp = new ulong[Config.N]; avgMarkedReqAtBatchEnd = new ulong[Config.N]; totalBatchCompletionTime = new ulong[Config.N]; numberOfActiveBatches = new ulong[Config.N]; sample_totalBatchCompletionTime = new ulong[Config.N]; sample_numberOfActiveBatches = new ulong[Config.N]; LPoptimal_totalBatchCompletionTime = new ulong[Config.N]; LPoptimal_numberOfActiveBatches = new ulong[Config.N]; nrTotalMarkedRequests = new ulong[Config.N]; nrTotalRequests = new ulong[Config.N]; finalavgNumReqPerProcRemark = new double[Config.N]; finalavgMaxReqPerProcRemark = new double[Config.N]; finalavgNumMarkedReqPerProcRemark = new double[Config.N]; finalavgMaxMarkedReqPerProcRemark = new double[Config.N]; finalavgNumReqPerProcRecomp = new double[Config.N]; finalavgMaxReqPerProcRecomp = new double[Config.N]; finalavgMarkedReqAtBatchEnd = new double[Config.N]; finaltotalBatchCompletionTime = new ulong[Config.N]; finalnumberOfActiveBatches = new ulong[Config.N]; final_sample_totalBatchCompletionTime = new ulong[Config.N]; final_sample_numberOfActiveBatches = new ulong[Config.N]; final_LPoptimal_totalBatchCompletionTime = new ulong[Config.N]; final_LPoptimal_numberOfActiveBatches = new ulong[Config.N]; finalnrTotalMarkedRequests = new ulong[Config.N]; finalnrTotalRequests = new ulong[Config.N]; curMarkedPerProcBank = new int[Config.N, Config.memory.bank_max_per_mem]; thisPeriodMarkedPerProcBank = new int[Config.N, Config.memory.bank_max_per_mem]; exceedsBatchingCap = new bool[Config.N, Config.memory.bank_max_per_mem]; thisPeriodMarkedMaxPerProc = new int[Config.N]; thisPeriodMarkedTotalPerProc = new int[Config.N]; for (int i = 0; i < Config.N; i++) { procRank[i] = i; Rank[i] = Config.N - 1; for (int b = 0; b < Config.memory.bank_max_per_mem; b++) { perBankprocRank[i, b] = i; perBankRank[i, b] = Config.N - 1; } } Console.WriteLine("Initialized PERBANK_BATCH_MemoryScheduler"); Console.WriteLine("Ranking Scheme: " + rankingScheme.ToString() + " Sampling: " + Config.memory.ACTSamplingBatchInterval); Console.WriteLine("WithinBatch Priority: " + withinBatchPriority.ToString()); Console.WriteLine("BatchingCap: " + Config.memory.batch_cap); }
public LAS_FR_FCFS(int total_size, Bank[] bank) : base(total_size, bank) { Console.WriteLine("LAS_FR_FCFS"); }
public FR_LAS_BA(int total_size, Bank[] bank) : base(total_size, bank) { }
public Nesbit_Full_MemoryScheduler_WB(int totalSize, Bank[] bank) : base(totalSize, bank) { Console.WriteLine("Initialized Nesbit_Full_MemoryScheduler_WB"); }
/** * A */ public static MemSched alloc_sched(Bank[] bank, int buf_size, MemSchedAlgo mem_sched_algo, bool wb_special_sched) { if (wb_special_sched) switch (mem_sched_algo) { case MemSchedAlgo.FairMemScheduler: return new Ideal_MM_MemoryScheduler_WB(buf_size, bank); case MemSchedAlgo.FRFCFS: return new FR_FCFS_WB(buf_size, bank); case MemSchedAlgo.FCFS: return new FCFS_MemoryScheduler_WB(buf_size, bank); case MemSchedAlgo.NesbitBasic: return new Nesbit_Basic_MemoryScheduler_WB(buf_size, bank); case MemSchedAlgo.NesbitFull: return new Nesbit_Full_MemoryScheduler_WB(buf_size, bank); case MemSchedAlgo.FairMemMicro: return new Ideal_MICRO_MemoryScheduler_WB(buf_size, bank); case MemSchedAlgo.FR_FCFS_Cap: return new FR_FCFS_Cap_WB(buf_size, bank); default: Debug.Assert(false); return null; } switch (mem_sched_algo) { //LAS_BA --- start case MemSchedAlgo.LAS_BA_FR: return new LAS_BA_FR(buf_size, bank); case MemSchedAlgo.FR_LAS_BA: return new FR_LAS_BA(buf_size, bank); case MemSchedAlgo.LAS_BA2_FR: return new LAS_BA2_FR(buf_size, bank); //LAS_BA --- end case MemSchedAlgo.FairMemScheduler: return new Ideal_MM_MemoryScheduler(buf_size, bank); case MemSchedAlgo.LAS_FCFS_F1: return new LAS_FCFS_F1(buf_size, bank); case MemSchedAlgo.LAS_FCFS_F2: return new LAS_FCFS_F2(buf_size, bank); case MemSchedAlgo.LAS_FCFS: return new LAS_FCFS(buf_size, bank); case MemSchedAlgo.LAS_FR_FCFS: return new LAS_FR_FCFS(buf_size, bank); case MemSchedAlgo.LAS_QT_FCFS: return new LAS_QT_FCFS(buf_size, bank); case MemSchedAlgo.LAS_QT_FR_FCFS: return new LAS_QT_FR_FCFS(buf_size, bank); case MemSchedAlgo.FR_LAS_QT_FCFS: return new FR_LAS_QT_FCFS(buf_size, bank); case MemSchedAlgo.FR_SLACK_LAS_QT_FCFS: return new FR_SLACK_LAS_QT_FCFS(buf_size, bank); case MemSchedAlgo.OUR: return new OUR(buf_size, bank); case MemSchedAlgo.LAS_FR_FCFS_FAIR_TS: return new LAS_FR_FCFS_FAIR_TS(buf_size, bank); case MemSchedAlgo.LAS_FCFS_FAIR_TS: return new LAS_FCFS_FAIR_TS(buf_size, bank); case MemSchedAlgo.FR_LAS_FCFS: return new FR_LAS_FCFS(buf_size, bank); case MemSchedAlgo.FRFCFS: Console.WriteLine("FRFCFS initiated"); return new FR_FCFS(buf_size, bank); case MemSchedAlgo.FCFS: Console.WriteLine("FCFS initiated"); return new FCFS(buf_size, bank); case MemSchedAlgo.PLL: Console.WriteLine("PLL initiated"); return new PLL_MemoryScheduler(buf_size, bank); case MemSchedAlgo.PURE_PRIORITY_SCHEME: return new PURE_PRIORITY_SCHEME_MemoryScheduler(buf_size, bank); case MemSchedAlgo.STATIC_BATCH: return new STATIC_BATCH(buf_size, bank, Config.memory.ranking_algo, Config.memory.batch_sched_algo); case MemSchedAlgo.FULL_BATCH: return new FULL_BATCH(buf_size, bank, Config.memory.ranking_algo, Config.memory.batch_sched_algo); case MemSchedAlgo.FULL_BATCH_RV: return new FULL_BATCH_RV(buf_size, bank, Config.memory.ranking_algo, Config.memory.batch_sched_algo); case MemSchedAlgo.PERBANK_FULL_BATCH: return new PERBANK_FULL_BATCH_MemoryScheduler(buf_size, bank, Config.memory.ranking_algo, Config.memory.batch_sched_algo); case MemSchedAlgo.EMPTY_SLOT_FULL_BATCH: return new EMPTY_SLOT_FULL_BATCH_MemoryScheduler(buf_size, bank, Config.memory.ranking_algo, Config.memory.batch_sched_algo); case MemSchedAlgo.STATIC_BATCH_WITH_PRIORITIES: return new STATIC_BATCH_WITH_PRIORITIES_MemoryScheduler(buf_size, bank, Config.memory.ranking_algo); case MemSchedAlgo.FULL_BATCH_WITH_PRIORITIES: return new FULL_BATCH_WITH_PRIORITIES_MemoryScheduler(buf_size, bank, Config.memory.ranking_algo); case MemSchedAlgo.NesbitBasic: return new Nesbit_Basic_MemoryScheduler(buf_size, bank); case MemSchedAlgo.NesbitFull: return new Nesbit_Full_MemoryScheduler(buf_size, bank); case MemSchedAlgo.FairMemMicro: return new Ideal_MICRO_MemoryScheduler(buf_size, bank); case MemSchedAlgo.FR_FCFS_Cap: return new FR_FCFS_Cap(buf_size, bank); default: Debug.Assert(false); return null; }//switch }//alloc_sched
public LAS_BA2_FR(int total_size, Bank[] bank) : base(total_size, bank) { }
public Ideal_MM_MemoryScheduler_WB(int totalSize, Bank[] bank) : base(totalSize, bank) { Console.WriteLine("Initialized Ideal_MM_WB_MemoryScheduler"); }
public STATIC_BATCH(int buf_size, Bank[] bank, RankAlgo rank_algo, BatchSchedAlgo batch_sched_algo) : base(buf_size, bank, rank_algo, batch_sched_algo) { Console.WriteLine("Initialized STATIC_BATCH_MemoryScheduler"); }
public Ideal_MM_MemoryScheduler(int totalSize, Bank[] bank) : base(totalSize, bank) { // Initialization of variables. timeCounter = 0; currentRowBuffer = new ulong[Config.N, Config.memory.bank_max_per_mem]; realLatency = new ulong[Config.N]; idealLatency = new ulong[Config.N]; nrOfSamples = new int[Config.N]; for (int i = 0; i < Config.N; i++) { realLatency[i] = 0; idealLatency[i] = 0; nrOfSamples[i] = 0; for (int j = 0; j < Config.memory.bank_max_per_mem; j++) { currentRowBuffer[i, j] = EMPTY_SLOT; } } Console.WriteLine("Initialized Ideal_MM_MemoryScheduler"); }
public PURE_PRIORITY_SCHEME_MemoryScheduler(int totalSize, Bank[] bank) : base(totalSize, bank) { Console.WriteLine("Initialized PURE_PRIORITY_SCHEME_MemoryScheduler"); }
public EMPTY_SLOT_FULL_BATCH_MemoryScheduler(int totalSize, Bank[] bank, RankAlgo rankingScheme, BatchSchedAlgo withinBatchPriority) : base(totalSize, bank, rankingScheme, withinBatchPriority) { Console.WriteLine("Initialized EMPTY_SLOT_FULL_BATCH_MemoryScheduler"); }
public FULL_BATCH_WITH_PRIORITIES_MemoryScheduler(int totalSize, Bank[] bank, RankAlgo rankingScheme) : base(totalSize, bank, rankingScheme) { Console.WriteLine("Initialized FULL_WITH_PRIORITIES_BATCH_MemoryScheduler"); }
public Nesbit_Full_MemoryScheduler(int totalSize, Bank[] bank) : base(totalSize, bank) { totalScheduled = new ulong[Config.N, Config.memory.bank_max_per_mem]; wonDueToFR = new ulong[Config.N, Config.memory.bank_max_per_mem]; lostDueToFR = new ulong[Config.N, Config.memory.bank_max_per_mem]; bankTimers = new ulong[Config.memory.bank_max_per_mem]; Console.WriteLine("Initialized Nesbit_Full_MemoryScheduler"); }
public Nesbit_Basic_MemoryScheduler(int totalSize, Bank[] bank) : base(totalSize, bank) { queueSize = 10 * totalSize; // Nesbit data structures vtmsBankFinishTime = new ulong[Config.N, Config.memory.bank_max_per_mem]; vtmsBusFinishTime = new ulong[Config.N]; oldestArrivalTime = new ulong[Config.N]; toaQueue = new ulong[Config.N, queueSize]; for (int i = 0; i < Config.N; i++) { oldestArrivalTime[i] = EMPTY_SLOT; for (int j = 0; j < queueSize; j++) { toaQueue[i, j] = EMPTY_SLOT; } } oldest = new int[Config.N]; youngest = new int[Config.N]; Console.WriteLine("Initialized Nesbit_Basic_MemoryScheduler"); }
/** * Constructor */ public MemCtlr(Node node) { this.node = node; /* //locally visible bank bank = new Bank[Config.memory.bank_max_per_mem]; //allocate scheduler (sees local banks) sched = MemCtlr.alloc_sched(bank, Config.memory.buf_size_per_bank, Config.memory.mem_sched_algo, Config.memory.wb_special_sched); //allocate individual banks for (int b = 0; b < Config.memory.bank_max_per_mem; b++) bank[b] = new Bank(sched, this); //memory id mem_id = index++; //size this.bank_max = bank.Length; */ //Yoongu: giant hack to support shared MCs if(Config.memory.is_shared_MC == false) { bank = new Bank[Config.memory.bank_max_per_mem]; //allocate scheduler (sees local banks) sched = MemCtlr.alloc_sched(bank, Config.memory.buf_size_per_mem, Config.memory.mem_sched_algo, Config.memory.wb_special_sched); //allocate individual banks for (int b = 0; b < Config.memory.bank_max_per_mem; b++) bank[b] = new Bank(sched, this); //memory id mem_id = index++; //size this.bank_max = bank.Length; } else { //memory id mem_id = index++; if(mem_id == 0){ //only the first memory allocates the global banks bank_global = new Bank[Config.memory.bank_max_per_mem * Config.memory.mem_max]; //allocate scheduler (sees local banks) sched_global = MemCtlr.alloc_sched(bank_global, Config.memory.buf_size_per_mem * Config.memory.mem_max, Config.memory.mem_sched_algo, Config.memory.wb_special_sched); //allocate individual banks for (int b = 0; b < bank_global.Length; b++) bank_global[b] = new Bank(sched_global, this); } sched = sched_global; bank = new Bank[Config.memory.bank_max_per_mem]; for(int b = 0; b < bank.Length; b++) { bank[b] = bank_global[mem_id * Config.memory.bank_max_per_mem + b]; } //size this.bank_max = bank.Length; } }
public Ideal_MICRO_MemoryScheduler(int totalSize, Bank[] bank) : base(totalSize, bank) { // Initialization of variables. timeCounter = 0; currentRowBuffer = new ulong[Config.N, Config.memory.bank_max_per_mem]; stallShared = new ulong[Config.N]; stallAlone = new ulong[Config.N]; stallDelta = new ulong[Config.N]; totParallelism = new ulong[Config.N]; totParallelismSamples = new ulong[Config.N]; maxParallelism = new int[Config.N]; totExecParallelism = new ulong[Config.N]; totExecParallelismSamples = new ulong[Config.N]; maxExecParallelism = new int[Config.N]; for (int i = 0; i < Config.N; i++) { stallShared[i] = 5 * (ulong)Config.memory.row_conflict_latency; for (int j = 0; j < Config.memory.bank_max_per_mem; j++) { currentRowBuffer[i, j] = EMPTY_SLOT; } } Console.WriteLine("Initialized Ideal_MICRO_MemoryScheduler"); }
public MemSchedHelper(Bank[] bank, int bank_max, int[] cur_max_load_per_proc) { this.bank = bank; this.bank_max = bank_max; this.cur_max_load_per_proc = cur_max_load_per_proc; }
protected LAS(int total_size, Bank[] bank) : base(total_size, bank) { }
public Ideal_MICRO_MemoryScheduler_WB(int totalSize, Bank[] bank) : base(totalSize, bank) { // Initialization of variables. Console.WriteLine("Initialized Ideal_MICRO_WB_MemoryScheduler"); }