Fix/reversed caches - with tests#687
Conversation
This fixes were the caches and PTW walkers are built in the reversed direction due to the builders using `emplace_front()`
ngober
left a comment
There was a problem hiding this comment.
I have a small change request.
Co-authored-by: Nathan Gober <[email protected]>
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'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. |
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]>
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.