summaryrefslogtreecommitdiff
path: root/src/mem/protocol
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2011-12-31 16:38:30 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2011-12-31 16:38:30 -0600
commit734ef9a209279ea3c391bcb0097241b2235661dc (patch)
treed6be8c137f17431a2c8ec5556899df02c495c087 /src/mem/protocol
parent19e65a650266a526ca47389188f21bbde79d5054 (diff)
downloadgem5-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')
-rw-r--r--src/mem/protocol/MESI_CMP_directory-dir.sm12
-rw-r--r--src/mem/protocol/MI_example-dir.sm12
-rw-r--r--src/mem/protocol/MOESI_CMP_directory-dir.sm12
-rw-r--r--src/mem/protocol/MOESI_CMP_token-dir.sm12
-rw-r--r--src/mem/protocol/MOESI_hammer-dir.sm12
-rw-r--r--src/mem/protocol/RubySlicc_Types.sm1
6 files changed, 51 insertions, 10 deletions
diff --git a/src/mem/protocol/MESI_CMP_directory-dir.sm b/src/mem/protocol/MESI_CMP_directory-dir.sm
index 423272905..d026e7b90 100644
--- a/src/mem/protocol/MESI_CMP_directory-dir.sm
+++ b/src/mem/protocol/MESI_CMP_directory-dir.sm
@@ -110,8 +110,16 @@ machine(Directory, "MESI_CMP_filter_directory protocol")
void set_tbe(TBE tbe);
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) {
diff --git a/src/mem/protocol/MI_example-dir.sm b/src/mem/protocol/MI_example-dir.sm
index 2bd3afa44..40b919c92 100644
--- a/src/mem/protocol/MI_example-dir.sm
+++ b/src/mem/protocol/MI_example-dir.sm
@@ -79,8 +79,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) {
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) {
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" {
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" {
diff --git a/src/mem/protocol/RubySlicc_Types.sm b/src/mem/protocol/RubySlicc_Types.sm
index cc404394d..c76e0fe3e 100644
--- a/src/mem/protocol/RubySlicc_Types.sm
+++ b/src/mem/protocol/RubySlicc_Types.sm
@@ -125,6 +125,7 @@ structure(AbstractEntry, primitive="yes", external = "yes") {
}
structure (DirectoryMemory, external = "yes") {
+ AbstractEntry allocate(Address, AbstractEntry);
AbstractEntry lookup(Address);
bool isPresent(Address);
void invalidateBlock(Address);