summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJRPAN <[email protected]>2021-06-16 10:22:57 -0400
committerJRPAN <[email protected]>2021-06-16 10:22:57 -0400
commit0f088dc11a47cb3de905de3483f6a1c019b7d283 (patch)
treec53213dea1c27b669e0f0edf50772522b29e303d /src
parente9d781a467dd21c3ec3f1508aede803cb3ffb2c3 (diff)
correct dirty counter
Diffstat (limited to 'src')
-rw-r--r--src/gpgpu-sim/gpu-cache.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gpgpu-sim/gpu-cache.cc b/src/gpgpu-sim/gpu-cache.cc
index a35f502..c93ac5f 100644
--- a/src/gpgpu-sim/gpu-cache.cc
+++ b/src/gpgpu-sim/gpu-cache.cc
@@ -428,9 +428,11 @@ void tag_array::fill(new_addr_type addr, unsigned time,
void tag_array::fill(unsigned index, unsigned time, mem_fetch *mf) {
assert(m_config.m_alloc_policy == ON_MISS);
- m_lines[index]->fill(time, mf->get_access_sector_mask(),
- mf->get_access_byte_mask());
- m_dirty++;
+ bool before = m_lines[index]->is_modified_line();
+ m_lines[index]->fill(time, mf->get_access_sector_mask(), mf->get_access_byte_mask());
+ if (m_lines[index]->is_modified_line() && !before) {
+ m_dirty++;
+ }
}
// TODO: we need write back the flushed data to the upper level