Merge ktlim@zizzer:/bk/newmem
[gem5.git] / src / arch / SConscript
index dd616174c3d573bf8c27fb35008a0858910acac1..59cea6211b328f2b1d15bbcc38bf6558b0b6cc0f 100644 (file)
@@ -28,7 +28,7 @@
 #
 # Authors: Steve Reinhardt
 
-import os.path
+import os.path, sys
 
 # Import build environment variable from SConstruct.
 Import('env')
@@ -48,12 +48,12 @@ sources = []
 # List of headers to generate
 isa_switch_hdrs = Split('''
        arguments.hh
-       constants.hh
        faults.hh
        isa_traits.hh
        process.hh
        regfile.hh
        stacktrace.hh
+       syscallreturn.hh
        tlb.hh
        types.hh
        utility.hh
@@ -128,14 +128,27 @@ isa_desc_gen_files = Split('decoder.cc decoder.hh')
 isa_desc_gen_files += [CpuModel.dict[cpu].filename
                        for cpu in env['CPU_MODELS']]
 
+# Also include the CheckerCPU as one of the models if it is being
+# enabled via command line.
+if env['USE_CHECKER']:
+    isa_desc_gen_files += [CpuModel.dict['CheckerCPU'].filename]
+
 # The emitter patches up the sources & targets to include the
 # autogenerated files as targets and isa parser itself as a source.
 def isa_desc_emitter(target, source, env):
     return (isa_desc_gen_files, [isa_parser, cpu_models_file] + source)
 
 # Pieces are in place, so create the builder.
-isa_desc_builder = Builder(action='python2.4 $SOURCES $TARGET.dir $CPU_MODELS',
-                           emitter = isa_desc_emitter)
+python = sys.executable  # use same Python binary used to run scons
+
+# Also include the CheckerCPU as one of the models if it is being
+# enabled via command line.
+if env['USE_CHECKER']:
+    isa_desc_builder = Builder(action=python + ' $SOURCES $TARGET.dir $CPU_MODELS CheckerCPU',
+                               emitter = isa_desc_emitter)
+else:
+    isa_desc_builder = Builder(action=python + ' $SOURCES $TARGET.dir $CPU_MODELS',
+                               emitter = isa_desc_emitter)
 
 env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })
 
@@ -146,7 +159,6 @@ env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })
 isa = env['TARGET_ISA'] # someday this may be a list of ISAs
 
 # Let the target architecture define what additional sources it needs
-sources += SConscript(os.path.join(isa, 'SConscript'),
-                      exports = 'env', duplicate = False)
+sources += SConscript(os.path.join(isa, 'SConscript'), exports = 'env')
 
 Return('sources')