summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/SConscript13
-rw-r--r--src/arch/arm/isa/includes.isa1
-rwxr-xr-xsrc/arch/isa_parser.py22
3 files changed, 22 insertions, 14 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))
diff --git a/src/arch/arm/isa/includes.isa b/src/arch/arm/isa/includes.isa
index a2ce84345..7328e5307 100644
--- a/src/arch/arm/isa/includes.isa
+++ b/src/arch/arm/isa/includes.isa
@@ -90,6 +90,7 @@ output exec {{
#include "arch/arm/utility.hh"
#include "arch/generic/memhelpers.hh"
#include "base/condcodes.hh"
+#include "cpu/base.hh"
#include "sim/pseudo_inst.hh"
#if defined(linux)
#include <fenv.h>
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py
index 6aa553588..adadbe14d 100755
--- a/src/arch/isa_parser.py
+++ b/src/arch/isa_parser.py
@@ -1178,13 +1178,25 @@ class Stack(list):
#
class ISAParser(Grammar):
- def __init__(self, output_dir, cpu_models):
+ class CpuModel(object):
+ def __init__(self, name, filename, includes, strings):
+ self.name = name
+ self.filename = filename
+ self.includes = includes
+ self.strings = strings
+
+ def __init__(self, output_dir):
super(ISAParser, self).__init__()
self.output_dir = output_dir
self.filename = None # for output file watermarking/scaremongering
- self.cpuModels = cpu_models
+ self.cpuModels = [
+ ISAParser.CpuModel('ExecContext',
+ 'generic_cpu_exec.cc',
+ '#include "cpu/exec_context.hh"',
+ { "CPU_exec_context" : "ExecContext" }),
+ ]
# variable to hold templates
self.templateMap = {}
@@ -2376,8 +2388,6 @@ StaticInstPtr
e.exit(self.fileNameStack)
# Called as script: get args from command line.
-# Args are: <path to cpu_models.py> <isa desc file> <output dir> <cpu models>
+# Args are: <isa desc file> <output dir>
if __name__ == '__main__':
- execfile(sys.argv[1]) # read in CpuModel definitions
- cpu_models = [CpuModel.dict[cpu] for cpu in sys.argv[4:]]
- ISAParser(sys.argv[3], cpu_models).parse_isa_desc(sys.argv[2])
+ ISAParser(sys.argv[2]).parse_isa_desc(sys.argv[1])