summaryrefslogtreecommitdiff
path: root/src/mem/protocol/MOESI_CMP_token-dir.sm
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2012-01-07 02:16:37 -0800
committerGabe Black <gblack@eecs.umich.edu>2012-01-07 02:16:37 -0800
commit241cc0c8402f1b9f2ec20d1cc152d96930959b2a (patch)
tree666717370cc9db4775ef46c10f7d8a92a34f40e2 /src/mem/protocol/MOESI_CMP_token-dir.sm
parentec936364b7238cddea7734ea79c6e04b52a683c6 (diff)
parent4b772782871f265cf7372c984ad750803396938c (diff)
downloadgem5-241cc0c8402f1b9f2ec20d1cc152d96930959b2a.tar.xz
Another merge with the main repository.
Diffstat (limited to 'src/mem/protocol/MOESI_CMP_token-dir.sm')
-rw-r--r--src/mem/protocol/MOESI_CMP_token-dir.sm12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mem/protocol/MOESI_CMP_token-dir.sm b/src/mem/protocol/MOESI_CMP_token-dir.sm
index 9e6c6c99b..39e8a8d27 100644
--- a/src/mem/protocol/MOESI_CMP_token-dir.sm
+++ b/src/mem/protocol/MOESI_CMP_token-dir.sm
@@ -165,8 +165,16 @@ machine(Directory, "Token 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;
}
DataBlock getDataBlock(Address addr), return_by_ref="yes" {