diff options
| author | Tor Aamodt <[email protected]> | 2011-01-02 12:23:52 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2011-01-02 12:23:52 -0800 |
| commit | 36397be09f07bf5cdb47913a7e5e1790d32c00ed (patch) | |
| tree | 94c02395ff8fbb62ee780e88db33d472336e1f2d | |
| parent | 30022ecfff2ac894c0477f0ab3aac00708ac0550 (diff) | |
integrate bug fix (passes fast regression)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 8310]
| -rw-r--r-- | src/gpgpu-sim/dram.cc | 14 | ||||
| -rw-r--r-- | src/gpgpu-sim/dram.h | 5 | ||||
| -rw-r--r-- | src/gpgpu-sim/l2cache.cc | 7 | ||||
| -rw-r--r-- | src/gpgpu-sim/l2cache.h | 1 |
4 files changed, 21 insertions, 6 deletions
diff --git a/src/gpgpu-sim/dram.cc b/src/gpgpu-sim/dram.cc index bd6758b..288baaa 100644 --- a/src/gpgpu-sim/dram.cc +++ b/src/gpgpu-sim/dram.cc @@ -70,6 +70,7 @@ #include "mem_latency_stat.h" #include "dram_sched.h" #include "mem_fetch.h" +#include "l2cache.h" #ifdef DRAM_VERIFY int PRINT_CYCLE = 0; @@ -78,9 +79,11 @@ int PRINT_CYCLE = 0; template class fifo_pipeline<mem_fetch>; template class fifo_pipeline<dram_req_t>; -dram_t::dram_t( unsigned int partition_id, const struct memory_config *config, memory_stats_t *stats ) +dram_t::dram_t( unsigned int partition_id, const struct memory_config *config, memory_stats_t *stats, + memory_partition_unit *mp ) { id = partition_id; + m_memory_partition_unit = mp; m_stats = stats; m_config = config; @@ -237,8 +240,13 @@ void dram_t::cycle() if (cmd->dqbytes >= cmd->nbytes) { mem_fetch *data = cmd->data; data->set_status(IN_PARTITION_MC_RETURNQ,gpu_sim_cycle+gpu_tot_sim_cycle); - data->set_reply(); - returnq->push(data); + if( data->get_access_type() != L1_WRBK_ACC && data->get_access_type() != L2_WRBK_ACC ) { + data->set_reply(); + returnq->push(data); + } else { + m_memory_partition_unit->set_done(data); + delete data; + } delete cmd; } #ifdef DRAM_VIEWCMD diff --git a/src/gpgpu-sim/dram.h b/src/gpgpu-sim/dram.h index 1a684c2..d4e8255 100644 --- a/src/gpgpu-sim/dram.h +++ b/src/gpgpu-sim/dram.h @@ -123,7 +123,8 @@ struct mem_fetch; class dram_t { public: - dram_t( unsigned int parition_id, const struct memory_config *config, class memory_stats_t *stats ); + dram_t( unsigned int parition_id, const struct memory_config *config, class memory_stats_t *stats, + class memory_partition_unit *mp ); bool full() const; void print( FILE* simFile ) const; @@ -139,7 +140,7 @@ public: void cycle(); void dram_log (int task); - struct memory_partition_unit *m_memory_partition_unit; + class memory_partition_unit *m_memory_partition_unit; unsigned int id; private: diff --git a/src/gpgpu-sim/l2cache.cc b/src/gpgpu-sim/l2cache.cc index bb13cbc..5c19c32 100644 --- a/src/gpgpu-sim/l2cache.cc +++ b/src/gpgpu-sim/l2cache.cc @@ -105,7 +105,7 @@ memory_partition_unit::memory_partition_unit( unsigned partition_id, m_id = partition_id; m_config=config; m_stats=stats; - m_dram = new dram_t(m_id,m_config,m_stats); + m_dram = new dram_t(m_id,m_config,m_stats,this); char L2c_name[32]; snprintf(L2c_name, 32, "L2_bank_%03d", m_id); @@ -317,6 +317,11 @@ mem_fetch* memory_partition_unit::top() return mf; } +void memory_partition_unit::set_done( mem_fetch *mf ) +{ + m_request_tracker.erase(mf); +} + void memory_partition_unit::dram_cycle() { // pop completed memory request from dram and push it to dram-to-L2 queue diff --git a/src/gpgpu-sim/l2cache.h b/src/gpgpu-sim/l2cache.h index 761a220..fb0c6e2 100644 --- a/src/gpgpu-sim/l2cache.h +++ b/src/gpgpu-sim/l2cache.h @@ -105,6 +105,7 @@ public: void push( class mem_fetch* mf, unsigned long long clock_cycle ); class mem_fetch* pop(); class mem_fetch* top(); + void set_done( mem_fetch *mf ); unsigned flushL2(); |
