summaryrefslogtreecommitdiff
path: root/src/arch/SConscript
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-09-03 07:42:22 -0400
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-09-03 07:42:22 -0400
commit326662b01b0fbb7fe4e38cec7a96222d2891808b (patch)
tree35bbca1174a6262d3f69dcf729682e1183f8dede /src/arch/SConscript
parente1ac9629398027186ef4c2a66772aeff2b4c6792 (diff)
downloadgem5-326662b01b0fbb7fe4e38cec7a96222d2891808b.tar.xz
arch, cpu: Factor out the ExecContext into a proper base class
We currently generate and compile one version of the ISA code per CPU model. This is obviously wasting a lot of resources at compile time. This changeset factors out the interface into a separate ExecContext class, which also serves as documentation for the interface between CPUs and the ISA code. While doing so, this changeset also fixes up interface inconsistencies between the different CPU models. The main argument for using one set of ISA code per CPU model has always been performance as this avoid indirect branches in the generated code. However, this argument does not hold water. Booting Linux on a simulated ARM system running in atomic mode (opt/10.linux-boot/realview-simple-atomic) is actually 2% faster (compiled using clang 3.4) after applying this patch. Additionally, compilation time is decreased by 35%.
Diffstat (limited to 'src/arch/SConscript')
-rw-r--r--src/arch/SConscript13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/arch/SConscript b/src/arch/SConscript
index e9b5c5365..31ea0b78f 100644
--- a/src/arch/SConscript
+++ b/src/arch/SConscript
@@ -95,13 +95,11 @@ isa_parser = File('isa_parser.py')
# 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):
- cpu_models = list(env['CPU_MODELS'])
- cpu_models.append('CheckerCPU')
-
# List the isa parser as a source.
- source += [ isa_parser ]
- # Add in the CPU models.
- source += [ Value(m) for m in cpu_models ]
+ source += [
+ isa_parser,
+ Value("ExecContext"),
+ ]
# Specify different targets depending on if we're running the ISA
# parser for its dependency information, or for the generated files.
@@ -137,8 +135,7 @@ def isa_desc_action_func(target, source, env):
# Skip over the ISA description itself and the parser to the CPU models.
models = [ s.get_contents() for s in source[2:] ]
- cpu_models = [CpuModel.dict[cpu] for cpu in models]
- parser = isa_parser.ISAParser(target[0].dir.abspath, cpu_models)
+ parser = isa_parser.ISAParser(target[0].dir.abspath)
parser.parse_isa_desc(source[0].abspath)
isa_desc_action = MakeAction(isa_desc_action_func, Transform("ISA DESC", 1))