arch: teach ISA parser how to split code across files
[gem5.git] / src / arch / alpha / SConscript
index 9a5680649edd2d64fdc1954beedc0f86b1833a94..2f923f313c80fe84357798361c35b26f291c6c8c 100644 (file)
 # Authors: Gabe Black
 #          Steve Reinhardt
 
-import os
-import sys
-from os.path import isdir
+Import('*')
 
-# This file defines how to build a particular configuration of M5
-# based on variable settings in the 'env' build environment.
+if env['TARGET_ISA'] == 'alpha':
+    Source('decoder.cc')
+    Source('ev5.cc')
+    Source('faults.cc')
+    Source('freebsd/system.cc')
+    Source('idle_event.cc')
+    Source('interrupts.cc')
+    Source('ipr.cc')
+    Source('isa.cc')
+    Source('kernel_stats.cc')
+    Source('linux/linux.cc')
+    Source('linux/process.cc')
+    Source('linux/system.cc')
+    Source('osfpal.cc')
+    Source('pagetable.cc')
+    Source('process.cc')
+    Source('regredir.cc')
+    Source('remote_gdb.cc')
+    Source('stacktrace.cc')
+    Source('system.cc')
+    Source('tlb.cc')
+    Source('tru64/process.cc')
+    Source('tru64/system.cc')
+    Source('tru64/tru64.cc')
+    Source('utility.cc')
+    Source('vtophys.cc')
 
-# Import build environment variable from SConstruct.
-Import('env')
+    SimObject('AlphaInterrupts.py')
+    SimObject('AlphaISA.py')
+    SimObject('AlphaSystem.py')
+    SimObject('AlphaTLB.py')
 
-###################################################
-#
-# Define needed sources.
-#
-###################################################
-
-# Base sources used by all configurations.
-base_sources = Split('''
-       faults.cc
-       isa_traits.cc
-       ''')
-
-# Full-system sources
-full_system_sources = Split('''
-       tlb.cc
-       arguments.cc
-       ev5.cc
-       ipr.cc
-       osfpal.cc
-       stacktrace.cc
-       vtophys.cc
-       system.cc
-       freebsd/system.cc
-       linux/system.cc
-       tru64/system.cc
-       ''')
-
-
-# Syscall emulation (non-full-system) sources
-syscall_emulation_sources = Split('''
-        linux/linux.cc
-       linux/process.cc
-        tru64/tru64.cc
-       tru64/process.cc
-       process.cc
-       ''')
-
-# Set up complete list of sources based on configuration.
-sources = base_sources
-
-if env['FULL_SYSTEM']:
-    sources += full_system_sources
-else:
-    sources += syscall_emulation_sources
-
-# Convert file names to SCons File objects.  This takes care of the
-# path relative to the top of the directory tree.
-sources = [File(s) for s in sources]
-
-# Add in files generated by the ISA description.
-isa_desc_files = env.ISADesc('isa/main.isa')
-# Only non-header files need to be compiled.
-isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
-sources += isa_desc_sources
-
-Return('sources')
+    # Add in files generated by the ISA description.
+    env.ISADesc('isa/main.isa')