SConscript (10196:be0e1724eb39) SConscript (10319:4207f9bfcceb)
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

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

90# output from the ISA description (*.isa) files.
91#
92
93isa_parser = File('isa_parser.py')
94
95# The emitter patches up the sources & targets to include the
96# autogenerated files as targets and isa parser itself as a source.
97def isa_desc_emitter(target, source, env):
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

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

90# output from the ISA description (*.isa) files.
91#
92
93isa_parser = File('isa_parser.py')
94
95# The emitter patches up the sources & targets to include the
96# autogenerated files as targets and isa parser itself as a source.
97def isa_desc_emitter(target, source, env):
98 cpu_models = list(env['CPU_MODELS'])
99 cpu_models.append('CheckerCPU')
100
101 # List the isa parser as a source.
98 # List the isa parser as a source.
102 source += [ isa_parser ]
103 # Add in the CPU models.
104 source += [ Value(m) for m in cpu_models ]
99 source += [
100 isa_parser,
101 Value("ExecContext"),
102 ]
105
106 # Specify different targets depending on if we're running the ISA
107 # parser for its dependency information, or for the generated files.
108 # (As an optimization, the ISA parser detects the useless second run
109 # and skips doing any work, if the first run was performed, since it
110 # always generates all its files). The way we track this in SCons is the
111 # <arch>_isa_outputs value in the environment (env). If it's unset, we
112 # don't know what the dependencies are so we ask for generated/inc.d to

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

132
133def isa_desc_action_func(target, source, env):
134 # Add the current directory to the system path so we can import files
135 sys.path[0:0] = [ ARCH_DIR.srcnode().abspath ]
136 import isa_parser
137
138 # Skip over the ISA description itself and the parser to the CPU models.
139 models = [ s.get_contents() for s in source[2:] ]
103
104 # Specify different targets depending on if we're running the ISA
105 # parser for its dependency information, or for the generated files.
106 # (As an optimization, the ISA parser detects the useless second run
107 # and skips doing any work, if the first run was performed, since it
108 # always generates all its files). The way we track this in SCons is the
109 # <arch>_isa_outputs value in the environment (env). If it's unset, we
110 # don't know what the dependencies are so we ask for generated/inc.d to

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

130
131def isa_desc_action_func(target, source, env):
132 # Add the current directory to the system path so we can import files
133 sys.path[0:0] = [ ARCH_DIR.srcnode().abspath ]
134 import isa_parser
135
136 # Skip over the ISA description itself and the parser to the CPU models.
137 models = [ s.get_contents() for s in source[2:] ]
140 cpu_models = [CpuModel.dict[cpu] for cpu in models]
141 parser = isa_parser.ISAParser(target[0].dir.abspath, cpu_models)
138 parser = isa_parser.ISAParser(target[0].dir.abspath)
142 parser.parse_isa_desc(source[0].abspath)
143isa_desc_action = MakeAction(isa_desc_action_func, Transform("ISA DESC", 1))
144
145# Also include the CheckerCPU as one of the models if it is being
146# enabled via command line.
147isa_desc_builder = Builder(action=isa_desc_action, emitter=isa_desc_emitter)
148
149env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })

--- 53 unchanged lines hidden ---
139 parser.parse_isa_desc(source[0].abspath)
140isa_desc_action = MakeAction(isa_desc_action_func, Transform("ISA DESC", 1))
141
142# Also include the CheckerCPU as one of the models if it is being
143# enabled via command line.
144isa_desc_builder = Builder(action=isa_desc_action, emitter=isa_desc_emitter)
145
146env.Append(BUILDERS = { 'ISADesc' : isa_desc_builder })

--- 53 unchanged lines hidden ---