From da1eaaca0ec7f65525dd2706f4b6b207bf9ee691 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 5 Jul 2011 18:30:05 -0700 Subject: 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. --- src/mem/protocol/SConscript | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/mem/protocol/SConscript') 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: -- cgit v1.2.3