diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2011-12-31 16:38:30 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2011-12-31 16:38:30 -0600 |
commit | 734ef9a209279ea3c391bcb0097241b2235661dc (patch) | |
tree | d6be8c137f17431a2c8ec5556899df02c495c087 /src/mem/protocol/MOESI_hammer-dir.sm | |
parent | 19e65a650266a526ca47389188f21bbde79d5054 (diff) | |
download | gem5-734ef9a209279ea3c391bcb0097241b2235661dc.tar.xz |
SLICC: Use pointers for directory entries
SLICC uses pointers for cache and TBE entries but not for directory entries.
This patch changes the protocols, SLICC and Ruby memory system so that even
directory entries are referenced using pointers.
--HG--
extra : rebase_source : abeb4ac78033d003153751f216fd1948251fcfad
Diffstat (limited to 'src/mem/protocol/MOESI_hammer-dir.sm')
-rw-r--r-- | src/mem/protocol/MOESI_hammer-dir.sm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mem/protocol/MOESI_hammer-dir.sm b/src/mem/protocol/MOESI_hammer-dir.sm index a4f4bf17a..a20619d46 100644 --- a/src/mem/protocol/MOESI_hammer-dir.sm +++ b/src/mem/protocol/MOESI_hammer-dir.sm @@ -186,8 +186,16 @@ machine(Directory, "AMD Hammer-like protocol") TBETable TBEs, template_hack="<Directory_TBE>"; - Entry getDirectoryEntry(Address addr), return_by_ref="yes" { - return static_cast(Entry, directory[addr]); + Entry getDirectoryEntry(Address addr), return_by_pointer="yes" { + Entry dir_entry := static_cast(Entry, "pointer", directory[addr]); + + if (is_valid(dir_entry)) { + return dir_entry; + } + + dir_entry := static_cast(Entry, "pointer", + directory.allocate(addr, new Entry)); + return dir_entry; } DataBlock getDataBlock(Address addr), return_by_ref="yes" { |