diff options
| author | JRPAN <[email protected]> | 2021-06-16 10:22:57 -0400 |
|---|---|---|
| committer | JRPAN <[email protected]> | 2021-06-16 10:22:57 -0400 |
| commit | 0f088dc11a47cb3de905de3483f6a1c019b7d283 (patch) | |
| tree | c53213dea1c27b669e0f0edf50772522b29e303d /src | |
| parent | e9d781a467dd21c3ec3f1508aede803cb3ffb2c3 (diff) | |
correct dirty counter
Diffstat (limited to 'src')
| -rw-r--r-- | src/gpgpu-sim/gpu-cache.cc | 8 |
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 |
