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_CMP_directory-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_CMP_directory-dir.sm')
-rw-r--r-- | src/mem/protocol/MOESI_CMP_directory-dir.sm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mem/protocol/MOESI_CMP_directory-dir.sm b/src/mem/protocol/MOESI_CMP_directory-dir.sm index b71518b3f..202bd11f6 100644 --- a/src/mem/protocol/MOESI_CMP_directory-dir.sm +++ b/src/mem/protocol/MOESI_CMP_directory-dir.sm @@ -126,8 +126,16 @@ machine(Directory, "Directory protocol") void set_tbe(TBE b); void unset_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; } State getState(TBE tbe, Address addr) { |