mem-ruby: Fix missing RubySystem in PerfectCacheMemory's entries (#1864)

MOESI_CMP_directory protocol crashes with one of the several assertions
in NetDest.cc. It happens because the entry type used to instantiate a
PerfectCacheMemory object in MOESI_CMP_directory-L2cache.sm contains a
NetDest object, so it requires a RubySystem object to be manually set
for it.

Instead of just receiving the block size, change PerfectCacheMemory to
receive a RubySystem object and use it to set the block size and call
ENTRY::setRubySystem if the entries require it.
This commit is contained in:
Marleson Graf
2024-12-19 01:59:47 -03:00
committed by Bobby R. Bruce
parent 0fe31664f3
commit b6c941c9ca
2 changed files with 20 additions and 3 deletions

View File

@@ -833,11 +833,11 @@ $c_ident::init()
# For objects that require knowing the cache line size,
# set the value here.
if vtype.c_ident in ("TBETable", "PerfectCacheMemory"):
if vtype.c_ident in ("TBETable"):
block_size_func = "m_ruby_system->getBlockSizeBytes()"
code(f"(*{vid}).setBlockSize({block_size_func});")
if vtype.c_ident in ("NetDest"):
if vtype.c_ident in ("NetDest", "PerfectCacheMemory"):
code(f"(*{vid}).setRubySystem(m_ruby_system);")
for param in self.config_parameters: