Skip to content

Fix/reversed caches - with tests#687

Merged
ngober merged 6 commits intoChampSim:developfrom
maccoymerrell:fix/reversed-caches
Feb 14, 2026
Merged

Fix/reversed caches - with tests#687
ngober merged 6 commits intoChampSim:developfrom
maccoymerrell:fix/reversed-caches

Conversation

@maccoymerrell
Copy link
Copy Markdown
Contributor

This pr addresses issues identified by @aaarunan, adds testing, and replaces the forward_list containers with regular vectors.

To facilitate testing, the build() function which was previously defined in environment.cc had to be moved to environment.h.

aaarunan and others added 3 commits January 29, 2026 17:40
This fixes were the caches and PTW walkers are built in the reversed
direction due to the builders using `emplace_front()`
Copy link
Copy Markdown
Collaborator

@ngober ngober left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a small change request.

Comment thread inc/environment.h
@ngober ngober linked an issue Feb 13, 2026 that may be closed by this pull request
@ngober ngober added the bug label Feb 13, 2026
@maccoymerrell
Copy link
Copy Markdown
Contributor Author

maccoymerrell commented Feb 13, 2026

I have a small change request.

I wonder if having modules referenced exclusively by name would be worthwhile - we incur the overhead of the std::map string -> pointer conversion but it prevents modules from getting bad pointers (assuming that the map is maintained properly and everything is provided a unique name).

This also relies on enforcing that modules cannot and should not be moved after instantiation. Using a centralized system like what I am trying for module runtime selection could work - but it would need applied to everything.
I guess what I am saying is that moving pointers is probably better than moving actual objects, even when considering the de-reference cost.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 68.294% (+0.1%) from 68.197%
when pulling b0af905 on maccoymerrell:fix/reversed-caches
into dfb21c2 on ChampSim:develop.

@ngober
Copy link
Copy Markdown
Collaborator

ngober commented Feb 14, 2026

I'm pretty averse to prohibiting moves. This is a philosophical position: an object's identity is not defined by its location in memory, it is defined by it's value (in the case of a cache, perhaps only its name, but also maybe it's contents). One should be able to construct it and move it around in memory without violating its identity. We're not quite there in ChampSim, but we're pretty close. Most of the time we look through queues to find an identity match. Anyway, that's a topic for another patch.

@ngober ngober merged commit 48e085a into ChampSim:develop Feb 14, 2026
32 checks passed
github-actions Bot added a commit that referenced this pull request Feb 14, 2026
Author: maccoymerrell
Committer: GitHub

Fix/reversed caches - with tests (#687)

This pr addresses issues identified by @aaarunan, adds testing, and
replaces the forward_list containers with regular vectors.

To facilitate testing, the build() function which was previously defined
in environment.cc had to be moved to environment.h.

---------

Co-authored-by: Arunan Gnanasekaran <[email protected]>
Co-authored-by: Nathan Gober <[email protected]>
@maccoymerrell maccoymerrell deleted the fix/reversed-caches branch February 14, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L1I is swapped with the ITLB in O3_CPU

4 participants