Deleted Added
sdiff udiff text old ( 5798:edbf23127462 ) new ( 5799:0af61da2b66a )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 161 unchanged lines hidden (view full) ---

170Export('SimObject')
171Export('SwigSource')
172Export('UnitTest')
173
174########################################################################
175#
176# Trace Flags
177#
178all_flags = {}
179trace_flags = []
180def TraceFlag(name, desc=''):
181 if name in all_flags:
182 raise AttributeError, "Flag %s already specified" % name
183 flag = (name, (), desc)
184 trace_flags.append(flag)
185 all_flags[name] = ()
186
187def CompoundFlag(name, flags, desc=''):
188 if name in all_flags:
189 raise AttributeError, "Flag %s already specified" % name
190
191 compound = tuple(flags)
192 for flag in compound:
193 if flag not in all_flags:
194 raise AttributeError, "Trace flag %s not found" % flag
195 if all_flags[flag]:
196 raise AttributeError, \
197 "Compound flag can't point to another compound flag"
198
199 flag = (name, compound, desc)
200 trace_flags.append(flag)
201 all_flags[name] = compound
202
203Export('TraceFlag')
204Export('CompoundFlag')
205
206########################################################################
207#
208# Set some compiler variables
209#

--- 451 unchanged lines hidden (view full) ---

661
662 f = file(str(target[0]), 'w')
663
664 allFlags = []
665 for s in source:
666 val = eval(s.get_contents())
667 allFlags.append(val)
668
669 print >>f, 'baseFlags = ['
670 for flag, compound, desc in allFlags:
671 if not compound:
672 print >>f, " '%s'," % flag
673 print >>f, " ]"
674 print >>f
675
676 print >>f, 'compoundFlags = ['
677 print >>f, " 'All',"
678 for flag, compound, desc in allFlags:
679 if compound:
680 print >>f, " '%s'," % flag
681 print >>f, " ]"
682 print >>f
683
684 print >>f, "allFlags = frozenset(baseFlags + compoundFlags)"
685 print >>f
686
687 print >>f, 'compoundFlagMap = {'
688 all = tuple([flag for flag,compound,desc in allFlags if not compound])
689 print >>f, " 'All' : %s," % (all, )
690 for flag, compound, desc in allFlags:
691 if compound:
692 print >>f, " '%s' : %s," % (flag, compound)
693 print >>f, " }"
694 print >>f
695
696 print >>f, 'flagDescriptions = {'
697 print >>f, " 'All' : 'All flags',"
698 for flag, compound, desc in allFlags:
699 print >>f, " '%s' : '%s'," % (flag, desc)
700 print >>f, " }"
701
702 f.close()
703
704def traceFlagsCC(target, source, env):

--- 137 unchanged lines hidden (view full) ---

842
843/* namespace Trace */ }
844
845#endif // __BASE_TRACE_FLAGS_HH__
846'''
847
848 f.close()
849
850flags = [ Value(f) for f in trace_flags ]
851env.Command('base/traceflags.py', flags, traceFlagsPy)
852PySource('m5', 'base/traceflags.py')
853
854env.Command('base/traceflags.hh', flags, traceFlagsHH)
855env.Command('base/traceflags.cc', flags, traceFlagsCC)
856Source('base/traceflags.cc')
857
858# embed python files. All .py files that have been indicated by a

--- 214 unchanged lines hidden ---