summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJRPAN <[email protected]>2021-05-04 15:17:57 -0400
committerJRPAN <[email protected]>2021-05-18 16:33:08 -0400
commit994fb19e160e3897b5662fb7e6946a3802fde794 (patch)
treeea4568bf985d5f9e3b4cd8f5c41bfc1bfdd3fe4e /src
parentf6fb56ba32141030803ecfe01b52a6f6c93d8e6c (diff)
reset dirty counter
Diffstat (limited to 'src')
-rw-r--r--src/gpgpu-sim/gpu-cache.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gpgpu-sim/gpu-cache.cc b/src/gpgpu-sim/gpu-cache.cc
index 9c65476..e88a646 100644
--- a/src/gpgpu-sim/gpu-cache.cc
+++ b/src/gpgpu-sim/gpu-cache.cc
@@ -428,12 +428,10 @@ void tag_array::fill(new_addr_type addr, unsigned time,
// assert(status==MISS||status==SECTOR_MISS); // MSHR should have prevented
// redundant memory request
if (status == MISS) {
- before = m_lines[idx]->is_modified_line();
m_lines[idx]->allocate(m_config.tag(addr), m_config.block_addr(addr), time,
mask);
} else if (status == SECTOR_MISS) {
assert(m_config.m_cache_type == SECTOR);
- before = m_lines[idx]->is_modified_line();
((sector_cache_block *)m_lines[idx])->allocate_sector(time, mask);
}
if (before && !m_lines[idx]->is_modified_line()) {
@@ -458,10 +456,10 @@ void tag_array::fill(unsigned index, unsigned time, mem_fetch *mf) {
// TODO: we need write back the flushed data to the upper level
void tag_array::flush() {
if (!is_used) return;
+ m_dirty = 0;
for (unsigned i = 0; i < m_config.get_num_lines(); i++)
if (m_lines[i]->is_modified_line()) {
- m_dirty--;
for (unsigned j = 0; j < SECTOR_CHUNCK_SIZE; j++) {
m_lines[i]->set_status(INVALID, mem_access_sector_mask_t().set(j));
}
@@ -472,6 +470,7 @@ void tag_array::flush() {
void tag_array::invalidate() {
if (!is_used) return;
+ m_dirty = 0;
for (unsigned i = 0; i < m_config.get_num_lines(); i++)
for (unsigned j = 0; j < SECTOR_CHUNCK_SIZE; j++)