summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/l2cache.cc
diff options
context:
space:
mode:
authorTimothy G Rogers <[email protected]>2018-10-03 17:52:06 -0400
committerGitHub Enterprise <[email protected]>2018-10-03 17:52:06 -0400
commit73c95f79a8cc6fef19d787855b4c50df0edcb743 (patch)
tree6a118dd1529d647a0e01748b5e96e35a8b8cf56e /src/gpgpu-sim/l2cache.cc
parent067eac2a618bbca0c6be019f047f14ecdb266efb (diff)
parentab80c6b75b7479caf8f0711ea1a6fbd7f93697f9 (diff)
Merge pull request #21 from abdallm/dev-purdue-integration
A few little things and some sizeable changes: Added memory partition indexing, some configuration file updates, fixed the texture cache so apps that use tex memory will no longer crash.
Diffstat (limited to 'src/gpgpu-sim/l2cache.cc')
-rw-r--r--src/gpgpu-sim/l2cache.cc29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/gpgpu-sim/l2cache.cc b/src/gpgpu-sim/l2cache.cc
index b1465a8..25da107 100644
--- a/src/gpgpu-sim/l2cache.cc
+++ b/src/gpgpu-sim/l2cache.cc
@@ -362,10 +362,11 @@ void memory_sub_partition::cache_cycle( unsigned cycle )
}else{
if(m_config->m_L2_config.m_write_alloc_policy == FETCH_ON_WRITE)
{
- assert(mf->original_wr_mf);
- mf->original_wr_mf->set_reply();
- mf->original_wr_mf->set_status(IN_PARTITION_L2_TO_ICNT_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
- m_L2_icnt_queue->push(mf->original_wr_mf);
+ mem_fetch* original_wr_mf = mf->get_original_wr_mf();
+ assert(original_wr_mf);
+ original_wr_mf->set_reply();
+ original_wr_mf->set_status(IN_PARTITION_L2_TO_ICNT_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
+ m_L2_icnt_queue->push(original_wr_mf);
}
m_request_tracker.erase(mf);
delete mf;
@@ -428,7 +429,7 @@ void memory_sub_partition::cache_cycle( unsigned cycle )
m_icnt_L2_queue->pop();
}
} else if ( status != RESERVATION_FAIL ) {
- if(mf->is_write() && m_config->m_L2_config.m_write_alloc_policy == FETCH_ON_WRITE && !was_writeallocate_sent(events)) {
+ if(mf->is_write() && (m_config->m_L2_config.m_write_alloc_policy == FETCH_ON_WRITE || m_config->m_L2_config.m_write_alloc_policy == LAZY_FETCH_ON_READ) && !was_writeallocate_sent(events)) {
mf->set_reply();
mf->set_status(IN_PARTITION_L2_TO_ICNT_QUEUE,gpu_sim_cycle+gpu_tot_sim_cycle);
m_L2_icnt_queue->push(mf);
@@ -568,7 +569,15 @@ unsigned memory_sub_partition::flushL2()
if (!m_config->m_L2_config.disabled()) {
m_L2cache->flush();
}
- return 0; // L2 is read only in this version
+ return 0; //TODO: write the flushed data to the main memory
+}
+
+unsigned memory_sub_partition::invalidateL2()
+{
+ if (!m_config->m_L2_config.disabled()) {
+ m_L2cache->invalidate();
+ }
+ return 0;
}
bool memory_sub_partition::busy() const
@@ -600,7 +609,7 @@ std::vector<mem_fetch*> memory_sub_partition::breakdown_request_to_sector_reques
} else
{
printf("Invalid sector received, address = 0x%06x, sector mask = %s, data size = %d",
- mf->get_addr(), mf->get_access_sector_mask(), mf->get_data_size(), mf->get_data_size());
+ mf->get_addr(), mf->get_access_sector_mask(), mf->get_data_size());
assert(0 && "Undefined sector mask is received");
}
@@ -631,7 +640,11 @@ std::vector<mem_fetch*> memory_sub_partition::breakdown_request_to_sector_reques
result.push_back(n_mf);
byte_sector_mask <<= SECTOR_SIZE;
}
- } else assert(0 && "Undefined data size is received");
+ } else {
+ printf("Invalid sector received, address = 0x%06x, sector mask = %d, byte mask = , data size = %d",
+ mf->get_addr(), mf->get_access_sector_mask().count(), mf->get_data_size());
+ assert(0 && "Undefined data size is received");
+ }
return result;
}