summaryrefslogtreecommitdiff
path: root/src/mem/protocol
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-07-05 18:30:05 -0700
committerNathan Binkert <nate@binkert.org>2011-07-05 18:30:05 -0700
commitda1eaaca0ec7f65525dd2706f4b6b207bf9ee691 (patch)
treea31cf8470838a496894cfb9fb74b806895dfa555 /src/mem/protocol
parent831e9b3b7a658663f5bffafef175d4f4a5615cfd (diff)
downloadgem5-da1eaaca0ec7f65525dd2706f4b6b207bf9ee691.tar.xz
slicc: add a protocol statement and an include statement
All protocols must specify their name The include statement allows any file to include another file.
Diffstat (limited to 'src/mem/protocol')
-rw-r--r--src/mem/protocol/MESI_CMP_directory.slicc14
-rw-r--r--src/mem/protocol/MI_example.slicc12
-rw-r--r--src/mem/protocol/MOESI_CMP_directory.slicc14
-rw-r--r--src/mem/protocol/MOESI_CMP_token.slicc14
-rw-r--r--src/mem/protocol/MOESI_hammer.slicc12
-rw-r--r--src/mem/protocol/Network_test.slicc10
-rw-r--r--src/mem/protocol/RubySlicc_interfaces.slicc14
-rw-r--r--src/mem/protocol/SConscript21
8 files changed, 61 insertions, 50 deletions
diff --git a/src/mem/protocol/MESI_CMP_directory.slicc b/src/mem/protocol/MESI_CMP_directory.slicc
index 3ba85fb40..07b55620b 100644
--- a/src/mem/protocol/MESI_CMP_directory.slicc
+++ b/src/mem/protocol/MESI_CMP_directory.slicc
@@ -1,6 +1,8 @@
-MESI_CMP_directory-msg.sm
-MESI_CMP_directory-L1cache.sm
-MESI_CMP_directory-L2cache.sm
-MESI_CMP_directory-dir.sm
-MESI_CMP_directory-dma.sm
-standard_CMP-protocol.sm
+protocol "MESI_CMP_directory";
+include "RubySlicc_interfaces.slicc";
+include "MESI_CMP_directory-msg.sm";
+include "MESI_CMP_directory-L1cache.sm";
+include "MESI_CMP_directory-L2cache.sm";
+include "MESI_CMP_directory-dir.sm";
+include "MESI_CMP_directory-dma.sm";
+include "standard_CMP-protocol.sm";
diff --git a/src/mem/protocol/MI_example.slicc b/src/mem/protocol/MI_example.slicc
index 523668177..00508673b 100644
--- a/src/mem/protocol/MI_example.slicc
+++ b/src/mem/protocol/MI_example.slicc
@@ -1,5 +1,7 @@
-MI_example-msg.sm
-MI_example-cache.sm
-MI_example-dir.sm
-MI_example-dma.sm
-standard_1level_CMP-protocol.sm
+protocol "MI_example";
+include "RubySlicc_interfaces.slicc";
+include "MI_example-msg.sm";
+include "MI_example-cache.sm";
+include "MI_example-dir.sm";
+include "MI_example-dma.sm";
+include "standard_1level_CMP-protocol.sm";
diff --git a/src/mem/protocol/MOESI_CMP_directory.slicc b/src/mem/protocol/MOESI_CMP_directory.slicc
index f288aa4b0..199ea174d 100644
--- a/src/mem/protocol/MOESI_CMP_directory.slicc
+++ b/src/mem/protocol/MOESI_CMP_directory.slicc
@@ -1,6 +1,8 @@
-MOESI_CMP_directory-msg.sm
-MOESI_CMP_directory-L2cache.sm
-MOESI_CMP_directory-L1cache.sm
-MOESI_CMP_directory-dma.sm
-MOESI_CMP_directory-dir.sm
-standard_CMP-protocol.sm
+protocol "MOESI_CMP_directory";
+include "RubySlicc_interfaces.slicc";
+include "MOESI_CMP_directory-msg.sm";
+include "MOESI_CMP_directory-L2cache.sm";
+include "MOESI_CMP_directory-L1cache.sm";
+include "MOESI_CMP_directory-dma.sm";
+include "MOESI_CMP_directory-dir.sm";
+include "standard_CMP-protocol.sm";
diff --git a/src/mem/protocol/MOESI_CMP_token.slicc b/src/mem/protocol/MOESI_CMP_token.slicc
index a41226f90..9818561d6 100644
--- a/src/mem/protocol/MOESI_CMP_token.slicc
+++ b/src/mem/protocol/MOESI_CMP_token.slicc
@@ -1,6 +1,8 @@
-MOESI_CMP_token-msg.sm
-MOESI_CMP_token-L1cache.sm
-MOESI_CMP_token-L2cache.sm
-MOESI_CMP_token-dir.sm
-MOESI_CMP_token-dma.sm
-standard_CMP-protocol.sm
+protocol "MOESI_CMP_token";
+include "RubySlicc_interfaces.slicc";
+include "MOESI_CMP_token-msg.sm";
+include "MOESI_CMP_token-L1cache.sm";
+include "MOESI_CMP_token-L2cache.sm";
+include "MOESI_CMP_token-dir.sm";
+include "MOESI_CMP_token-dma.sm";
+include "standard_CMP-protocol.sm";
diff --git a/src/mem/protocol/MOESI_hammer.slicc b/src/mem/protocol/MOESI_hammer.slicc
index 31ad47c2e..66d217c9c 100644
--- a/src/mem/protocol/MOESI_hammer.slicc
+++ b/src/mem/protocol/MOESI_hammer.slicc
@@ -1,5 +1,7 @@
-MOESI_hammer-msg.sm
-MOESI_hammer-cache.sm
-MOESI_hammer-dir.sm
-MOESI_hammer-dma.sm
-standard_1level_CMP-protocol.sm
+protocol "MOESI_hammer";
+include "RubySlicc_interfaces.slicc";
+include "MOESI_hammer-msg.sm";
+include "MOESI_hammer-cache.sm";
+include "MOESI_hammer-dir.sm";
+include "MOESI_hammer-dma.sm";
+include "standard_1level_CMP-protocol.sm";
diff --git a/src/mem/protocol/Network_test.slicc b/src/mem/protocol/Network_test.slicc
index 9629a385c..b122b149c 100644
--- a/src/mem/protocol/Network_test.slicc
+++ b/src/mem/protocol/Network_test.slicc
@@ -1,4 +1,6 @@
-Network_test-msg.sm
-Network_test-cache.sm
-Network_test-dir.sm
-standard_1level_CMP-protocol.sm
+protocol "Network_test";
+include "RubySlicc_interfaces.slicc";
+include "Network_test-msg.sm";
+include "Network_test-cache.sm";
+include "Network_test-dir.sm";
+include "standard_1level_CMP-protocol.sm";
diff --git a/src/mem/protocol/RubySlicc_interfaces.slicc b/src/mem/protocol/RubySlicc_interfaces.slicc
index 280a84763..4b6800847 100644
--- a/src/mem/protocol/RubySlicc_interfaces.slicc
+++ b/src/mem/protocol/RubySlicc_interfaces.slicc
@@ -1,7 +1,7 @@
-RubySlicc_Exports.sm
-RubySlicc_Types.sm
-RubySlicc_Util.sm
-RubySlicc_ComponentMapping.sm
-RubySlicc_Profiler.sm
-RubySlicc_Defines.sm
-RubySlicc_MemControl.sm
+include "RubySlicc_Exports.sm";
+include "RubySlicc_Types.sm";
+include "RubySlicc_Util.sm";
+include "RubySlicc_ComponentMapping.sm";
+include "RubySlicc_Profiler.sm";
+include "RubySlicc_Defines.sm";
+include "RubySlicc_MemControl.sm";
diff --git a/src/mem/protocol/SConscript b/src/mem/protocol/SConscript
index 47a19aecb..a4e2a5264 100644
--- a/src/mem/protocol/SConscript
+++ b/src/mem/protocol/SConscript
@@ -63,10 +63,10 @@ slicc_scanner = Classic("SliccScanner", ['.sm', '.slicc'], "SLICC_PATH",
env.Append(SCANNERS=slicc_scanner)
def slicc_emitter(target, source, env):
- protocol = source[0].get_contents()
- files = [s.srcnode().abspath for s in source[1:]]
- slicc = SLICC(protocol, verbose=False)
- slicc.load(files)
+ assert len(source) == 1
+ filepath = source[0].srcnode().abspath
+
+ slicc = SLICC(filepath, verbose=False)
slicc.process()
slicc.writeCodeFiles(protocol_dir.abspath)
if not env['NO_HTML']:
@@ -76,10 +76,10 @@ def slicc_emitter(target, source, env):
return target, source
def slicc_action(target, source, env):
- protocol = source[0].get_contents()
- files = [s.srcnode().abspath for s in source[1:]]
- slicc = SLICC(protocol, verbose=True)
- slicc.load(files)
+ assert len(source) == 1
+ filepath = source[0].srcnode().abspath
+
+ slicc = SLICC(filepath, verbose=True)
slicc.process()
slicc.writeCodeFiles(protocol_dir.abspath)
if not env['NO_HTML']:
@@ -89,11 +89,10 @@ slicc_builder = Builder(action=MakeAction(slicc_action, Transform("SLICC")),
emitter=slicc_emitter)
protocol = env['PROTOCOL']
-sources = [ protocol_dir.File("RubySlicc_interfaces.slicc"),
- protocol_dir.File("%s.slicc" % protocol) ]
+sources = [ protocol_dir.File("%s.slicc" % protocol) ]
env.Append(BUILDERS={'SLICC' : slicc_builder})
-nodes = env.SLICC([], [ Value(protocol) ] + sources)
+nodes = env.SLICC([], sources)
env.Depends(nodes, slicc_depends)
for f in nodes: