changeset 7cb9ce17a56f in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=7cb9ce17a56f
description:
scons: Make it so that the processing of trace flags does not depend on
order
diffstat:
1 file changed, 25 insertions(+), 22 deletions(-)
src/SConscript | 47 +++++++++++++++++++++++++----------------------
diffs (83 lines):
diff -r a2c8a951a63e -r 7cb9ce17a56f src/SConscript
--- a/src/SConscript Fri Jun 05 11:40:02 2009 -0700
+++ b/src/SConscript Fri Jun 05 15:20:09 2009 -0700
@@ -209,13 +209,6 @@
raise AttributeError, "Flag %s already specified" % name
compound = tuple(flags)
- for flag in compound:
- if flag not in trace_flags:
- raise AttributeError, "Trace flag %s not found" % flag
- if trace_flags[flag][1]:
- raise AttributeError, \
- "Compound flag can't point to another compound flag"
-
trace_flags[name] = (name, compound, desc)
Export('TraceFlag')
@@ -630,18 +623,34 @@
makeSwigInit)
Source('python/swig/init.cc')
+def getFlags(source_flags):
+ flagsMap = {}
+ flagsList = []
+ for s in source_flags:
+ val = eval(s.get_contents())
+ name, compound, desc = val
+ flagsList.append(val)
+ flagsMap[name] = bool(compound)
+
+ for name, compound, desc in flagsList:
+ for flag in compound:
+ if flag not in flagsMap:
+ raise AttributeError, "Trace flag %s not found" % flag
+ if flagsMap[flag]:
+ raise AttributeError, \
+ "Compound flag can't point to another compound flag"
+
+ flagsList.sort()
+ return flagsList
+
+
# Generate traceflags.py
def traceFlagsPy(target, source, env):
assert(len(target) == 1)
f = file(str(target[0]), 'w')
-
- allFlags = []
- for s in source:
- val = eval(s.get_contents())
- allFlags.append(val)
-
- allFlags.sort()
+
+ allFlags = getFlags(source)
print >>f, 'basic = ['
for flag, compound, desc in allFlags:
@@ -683,10 +692,7 @@
f = file(str(target[0]), 'w')
- allFlags = []
- for s in source:
- val = eval(s.get_contents())
- allFlags.append(val)
+ allFlags = getFlags(source)
# file header
print >>f, '''
@@ -759,10 +765,7 @@
f = file(str(target[0]), 'w')
- allFlags = []
- for s in source:
- val = eval(s.get_contents())
- allFlags.append(val)
+ allFlags = getFlags(source)
# file header boilerplate
print >>f, '''
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev