diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2012-01-07 02:16:37 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2012-01-07 02:16:37 -0800 |
commit | 241cc0c8402f1b9f2ec20d1cc152d96930959b2a (patch) | |
tree | 666717370cc9db4775ef46c10f7d8a92a34f40e2 /src/mem/protocol/MOESI_CMP_token-dir.sm | |
parent | ec936364b7238cddea7734ea79c6e04b52a683c6 (diff) | |
parent | 4b772782871f265cf7372c984ad750803396938c (diff) | |
download | gem5-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.sm | 12 |
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" { |