summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/dram_sched.cc
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-10-01 08:55:28 -0800
committerTor Aamodt <[email protected]>2010-10-01 08:55:28 -0800
commit11b308e7363e937966b035b4891db32b4eece3bf (patch)
tree50ca4c9ad6f163ac4acb2bf505e64dfebed66947 /src/gpgpu-sim/dram_sched.cc
parentbb820c116764d7a1b8e071137d32b74e7f34dd2f (diff)
integrating recent changes from fermi-test into fermi
(i'll use "fermi" for more disruptive changes to the pipeline model such as updating the MSHRs and getting rid of the warp tracker, ripping out DWF, etc...) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7805]
Diffstat (limited to 'src/gpgpu-sim/dram_sched.cc')
-rw-r--r--src/gpgpu-sim/dram_sched.cc47
1 files changed, 9 insertions, 38 deletions
diff --git a/src/gpgpu-sim/dram_sched.cc b/src/gpgpu-sim/dram_sched.cc
index e678042..1e36b05 100644
--- a/src/gpgpu-sim/dram_sched.cc
+++ b/src/gpgpu-sim/dram_sched.cc
@@ -170,21 +170,13 @@ void ideal_dram_scheduler::print( FILE *fp )
}
}
-void* alloc_fast_ideal_scheduler(dram_t *dm)
+void dram_t::fast_scheduler_ideal()
{
- return new ideal_dram_scheduler(dm);
-}
-
-void fast_scheduler_ideal(dram_t* dm)
-{
-
-
+ dram_t* dm=this;
unsigned mrq_latency;
- // replacement for scheduler_ideal()
-
- ideal_dram_scheduler *sched = reinterpret_cast<ideal_dram_scheduler*>( dm->m_fast_ideal_scheduler );
- while ( !dq_empty(dm->mrqq) && (!gpgpu_dram_sched_queue_size || sched->num_pending() < (unsigned) gpgpu_dram_sched_queue_size)) {
- dram_req_t *req = (dram_req_t*)dq_pop(dm->mrqq);
+ ideal_dram_scheduler *sched = dm->m_fast_ideal_scheduler;
+ while ( !dm->mrqq->empty() && (!m_config->gpgpu_dram_sched_queue_size || sched->num_pending() < m_config->gpgpu_dram_sched_queue_size)) {
+ dram_req_t *req = dm->mrqq->pop(gpu_sim_cycle);
sched->add_req(req);
}
@@ -199,12 +191,12 @@ void fast_scheduler_ideal(dram_t* dm)
if ( req ) {
dm->prio = (dm->prio+1)%dm->nbk;
dm->bk[b]->mrq = req;
- if (gpgpu_memlatency_stat) {
+ if (m_config->gpgpu_memlatency_stat) {
mrq_latency = gpu_sim_cycle + gpu_tot_sim_cycle - dm->bk[b]->mrq->timestamp;
dm->bk[b]->mrq->timestamp = gpu_tot_sim_cycle + gpu_sim_cycle;
- mrq_lat_table[LOGB2(mrq_latency)]++;
- if (mrq_latency > max_mrq_latency) {
- max_mrq_latency = mrq_latency;
+ m_stats->mrq_lat_table[LOGB2(mrq_latency)]++;
+ if (mrq_latency > m_stats->max_mrq_latency) {
+ m_stats->max_mrq_latency = mrq_latency;
}
}
@@ -213,24 +205,3 @@ void fast_scheduler_ideal(dram_t* dm)
}
}
}
-
-
-
-void dump_fast_ideal_scheduler( dram_t *dm )
-{
- ideal_dram_scheduler *sched = reinterpret_cast<ideal_dram_scheduler*>( dm->m_fast_ideal_scheduler );
- sched->print(stdout);
-}
-
-unsigned fast_scheduler_queue_length(dram_t *dm)
-{
- if (dm->m_fast_ideal_scheduler ) {
- ideal_dram_scheduler *sched = reinterpret_cast<ideal_dram_scheduler*>( dm->m_fast_ideal_scheduler );
- return sched->num_pending();
- } else {
- printf("fast_scheduler_queue_length(): Where did the scheduler go?\n");
- exit(1);
- }
-}
-
-