diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-02-28 06:13:35 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-02-28 06:13:35 -0500 |
commit | f7360d5bca61baf4539698faf08fc36113c4fb33 (patch) | |
tree | 1551252d2ea703d26c39eddcd21e752eb94a148c /cpu | |
parent | 299efffaf5eb5fb55b2109a643e1e0e985f89ce6 (diff) | |
parent | d207168eda13483a2990cdf060c1a7ead42cc9da (diff) | |
download | gem5-f7360d5bca61baf4539698faf08fc36113c4fb33.tar.xz |
Merge gblack@m5.eecs.umich.edu:/bk/multiarch
into ewok.(none):/home/gblack/m5/multiarch
--HG--
extra : convert_revision : 0b3ffc0605c9043d7f5bf6c15f4a3c68846a732a
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/SConscript | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/cpu/SConscript b/cpu/SConscript index dbe174660..af6bab4eb 100644 --- a/cpu/SConscript +++ b/cpu/SConscript @@ -32,13 +32,28 @@ import os.path # Import build environment variable from SConstruct. Import('env') +################################################################# +# +# Generate StaticInst execute() method signatures. +# +# There must be one signature for each CPU model compiled in. +# Since the set of compiled-in models is flexible, we generate a +# header containing the appropriate set of signatures on the fly. +# +################################################################# + +# CPU model-specific data is contained in cpu_models.py +# Convert to SCons File node to get path handling models_db = File('cpu_models.py') +# slurp in contents of file execfile(models_db.srcnode().abspath) +# Template for execute() signature. exec_sig_template = ''' virtual Fault execute(%s *xc, Trace::InstRecord *traceData) const = 0; ''' +# Generate header. def gen_cpu_exec_signatures(target, source, env): f = open(str(target[0]), 'w') print >> f, ''' @@ -52,7 +67,22 @@ def gen_cpu_exec_signatures(target, source, env): #endif // __CPU_STATIC_INST_EXEC_SIGS_HH__ ''' -env.Command('static_inst_exec_sigs.hh', models_db, gen_cpu_exec_signatures) +# Generate string that gets printed when header is rebuilt +def gen_sigs_string(target, source, env): + return "Generating static_inst_exec_sigs.hh: " \ + + ', '.join(env['CPU_MODELS']) + +# Add command to generate header to environment. +env.Command('static_inst_exec_sigs.hh', models_db, + Action(gen_cpu_exec_signatures, gen_sigs_string, + varlist = ['CPU_MODELS'])) + +################################################################# +# +# Include CPU-model-specific files based on set of models +# specified in CPU_MODELS build option. +# +################################################################# sources = [] |