diff options
author | Nathan Binkert <nate@binkert.org> | 2011-07-05 18:30:05 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2011-07-05 18:30:05 -0700 |
commit | da1eaaca0ec7f65525dd2706f4b6b207bf9ee691 (patch) | |
tree | a31cf8470838a496894cfb9fb74b806895dfa555 /src/mem/protocol/SConscript | |
parent | 831e9b3b7a658663f5bffafef175d4f4a5615cfd (diff) | |
download | gem5-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/SConscript')
-rw-r--r-- | src/mem/protocol/SConscript | 21 |
1 files changed, 10 insertions, 11 deletions
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: |