Deleted Added
sdiff udiff text old ( 9920:028e4da64b42 ) new ( 10196:be0e1724eb39 )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2006 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29# Authors: Steve Reinhardt
30
31import sys
32import os
33
34Import('*')
35
36#################################################################
37#
38# ISA "switch header" generation.
39#
40# Auto-generate arch headers that include the right ISA-specific

--- 51 unchanged lines hidden (view full) ---

92isa_parser = File('isa_parser.py')
93
94# The emitter patches up the sources & targets to include the
95# autogenerated files as targets and isa parser itself as a source.
96def isa_desc_emitter(target, source, env):
97 cpu_models = list(env['CPU_MODELS'])
98 cpu_models.append('CheckerCPU')
99
100 # Several files are generated from the ISA description.
101 # We always get the basic decoder and header file.
102 target = [ 'decoder.cc', 'decoder.hh', 'max_inst_regs.hh' ]
103 # We also get an execute file for each selected CPU model.
104 target += [CpuModel.dict[cpu].filename for cpu in cpu_models]
105
106 # List the isa parser as a source.
107 source += [ isa_parser ]
108 # Add in the CPU models.
109 source += [ Value(m) for m in cpu_models ]
110
111 return [os.path.join("generated", t) for t in target], source
112
113ARCH_DIR = Dir('.')
114
115# import ply here because SCons screws with sys.path when performing actions.
116import ply
117
118def isa_desc_action_func(target, source, env):
119 # Add the current directory to the system path so we can import files
120 sys.path[0:0] = [ ARCH_DIR.srcnode().abspath ]

--- 7 unchanged lines hidden (view full) ---

128isa_desc_action = MakeAction(isa_desc_action_func, Transform("ISA DESC", 1))
129
130# Also include the CheckerCPU as one of the models if it is being
131# enabled via command line.
132isa_desc_builder = Builder(action=isa_desc_action, emitter=isa_desc_emitter)
133
134env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })
135
136DebugFlag('IntRegs')
137DebugFlag('FloatRegs')
138DebugFlag('CCRegs')
139DebugFlag('MiscRegs')
140CompoundFlag('Registers', [ 'IntRegs', 'FloatRegs', 'CCRegs', 'MiscRegs' ])