1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
|
# -*- mode:python -*-
# Copyright (c) 2005-2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer;
# redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution;
# neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Gabe Black
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the
# following conditions are met:
#
# The software must be used only for Non-Commercial Use which means any
# use which is NOT directed to receiving any direct monetary
# compensation for, or commercial advantage from such use. Illustrative
# examples of non-commercial use are academic research, personal study,
# teaching, education and corporate research & development.
# Illustrative examples of commercial use are distributing products for
# commercial advantage and providing services using the software for
# commercial advantage.
#
# If you wish to use this software or functionality therein that may be
# covered by patents for commercial use, please contact:
# Director of Intellectual Property Licensing
# Office of Strategy and Technology
# Hewlett-Packard Company
# 1501 Page Mill Road
# Palo Alto, California 94304
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer. Redistributions
# in binary form must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution. Neither the name of
# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission. No right of
# sublicense is granted herewith. Derivatives of the software and
# output created using the software may be prepared, but only for
# Non-Commercial Uses. Derivatives of the software may be shared with
# others provided: (i) the others agree to abide by the list of
# conditions herein which includes the Non-Commercial Use restrictions;
# and (ii) such Derivatives of the software include the above copyright
# notice to acknowledge the contribution from this software where
# applicable, this list of conditions and the disclaimer below.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Gabe Black
Import('*')
if env['TARGET_ISA'] == 'x86':
Source('emulenv.cc')
Source('floatregfile.cc')
Source('faults.cc')
Source('insts/microfpop.cc')
Source('insts/microldstop.cc')
Source('insts/microop.cc')
Source('insts/microregop.cc')
Source('insts/static_inst.cc')
Source('intregfile.cc')
Source('miscregfile.cc')
Source('pagetable.cc')
Source('predecoder.cc')
Source('predecoder_tables.cc')
Source('regfile.cc')
Source('remote_gdb.cc')
Source('tlb.cc')
Source('utility.cc')
SimObject('X86TLB.py')
TraceFlag('Predecoder')
TraceFlag('X86')
if env['FULL_SYSTEM']:
SimObject('X86LocalApic.py')
SimObject('X86System.py')
# Full-system sources
Source('interrupts.cc')
Source('linux/system.cc')
Source('pagetable_walker.cc')
Source('system.cc')
Source('stacktrace.cc')
Source('vtophys.cc')
else:
Source('process.cc')
Source('linux/linux.cc')
Source('linux/process.cc')
Source('linux/syscalls.cc')
python_files = (
'__init__.py',
'general_purpose/__init__.py',
'general_purpose/arithmetic/__init__.py',
'general_purpose/arithmetic/add_and_subtract.py',
'general_purpose/arithmetic/increment_and_decrement.py',
'general_purpose/arithmetic/multiply_and_divide.py',
'general_purpose/cache_and_memory_management.py',
'general_purpose/compare_and_test/__init__.py',
'general_purpose/compare_and_test/bit_scan.py',
'general_purpose/compare_and_test/bit_test.py',
'general_purpose/compare_and_test/bounds.py',
'general_purpose/compare_and_test/compare.py',
'general_purpose/compare_and_test/set_byte_on_condition.py',
'general_purpose/compare_and_test/test.py',
'general_purpose/control_transfer/__init__.py',
'general_purpose/control_transfer/call.py',
'general_purpose/control_transfer/conditional_jump.py',
'general_purpose/control_transfer/interrupts_and_exceptions.py',
'general_purpose/control_transfer/jump.py',
'general_purpose/control_transfer/loop.py',
'general_purpose/control_transfer/xreturn.py',
'general_purpose/data_conversion/__init__.py',
'general_purpose/data_conversion/ascii_adjust.py',
'general_purpose/data_conversion/bcd_adjust.py',
'general_purpose/data_conversion/endian_conversion.py',
'general_purpose/data_conversion/extract_sign_mask.py',
'general_purpose/data_conversion/sign_extension.py',
'general_purpose/data_conversion/translate.py',
'general_purpose/data_transfer/__init__.py',
'general_purpose/data_transfer/conditional_move.py',
'general_purpose/data_transfer/move.py',
'general_purpose/data_transfer/stack_operations.py',
'general_purpose/data_transfer/xchg.py',
'general_purpose/flags/__init__.py',
'general_purpose/flags/load_and_store.py',
'general_purpose/flags/push_and_pop.py',
'general_purpose/flags/set_and_clear.py',
'general_purpose/input_output/__init__.py',
'general_purpose/input_output/general_io.py',
'general_purpose/input_output/string_io.py',
'general_purpose/load_effective_address.py',
'general_purpose/load_segment_registers.py',
'general_purpose/logical.py',
'general_purpose/no_operation.py',
'general_purpose/processor_information.py',
'general_purpose/rotate_and_shift/__init__.py',
'general_purpose/rotate_and_shift/rotate.py',
'general_purpose/rotate_and_shift/shift.py',
'general_purpose/semaphores.py',
'general_purpose/string/__init__.py',
'general_purpose/string/compare_strings.py',
'general_purpose/string/load_string.py',
'general_purpose/string/move_string.py',
'general_purpose/string/scan_string.py',
'general_purpose/string/store_string.py',
'general_purpose/system_calls.py',
'system/__init__.py',
'system/halt.py',
'system/invlpg.py',
'system/undefined_operation.py',
'system/msrs.py',
'system/segmentation.py',
'simd128/__init__.py',
'simd128/integer/__init__.py',
'simd128/integer/data_transfer/__init__.py',
'simd128/integer/data_transfer/move.py',
'simd128/integer/data_transfer/move_non_temporal.py',
'simd128/integer/data_transfer/move_mask.py',
'simd128/integer/data_conversion/__init__.py',
'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
'simd128/integer/data_reordering/__init__.py',
'simd128/integer/data_reordering/unpack_and_interleave.py',
'simd128/integer/data_reordering/pack_with_saturation.py',
'simd128/integer/data_reordering/extract_and_insert.py',
'simd128/integer/data_reordering/shuffle.py',
'simd128/integer/arithmetic/__init__.py',
'simd128/integer/arithmetic/subtraction.py',
'simd128/integer/arithmetic/addition.py',
'simd128/integer/arithmetic/multiplication.py',
'simd128/integer/arithmetic/multiply_add.py',
'simd128/integer/arithmetic/average.py',
'simd128/integer/arithmetic/sum_of_absolute_differences.py',
'simd128/integer/shift/__init__.py',
'simd128/integer/shift/right_arithmetic_shift.py',
'simd128/integer/shift/left_logical_shift.py',
'simd128/integer/shift/right_logical_shift.py',
'simd128/integer/compare/__init__.py',
'simd128/integer/compare/compare_and_write_mask.py',
'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
'simd128/integer/logical/__init__.py',
'simd128/integer/logical/pand.py',
'simd128/integer/logical/por.py',
'simd128/integer/logical/exclusive_or.py',
'simd128/integer/save_and_restore_state/__init__.py',
'simd128/integer/save_and_restore_state/save_and_restore_state.py',
'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
'simd128/floating_point/__init__.py',
'simd128/floating_point/data_transfer/__init__.py',
'simd128/floating_point/data_transfer/move_mask.py',
'simd128/floating_point/data_transfer/move.py',
'simd128/floating_point/data_transfer/move_with_duplication.py',
'simd128/floating_point/data_transfer/move_non_temporal.py',
'simd128/floating_point/data_conversion/__init__.py',
'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
'simd128/floating_point/data_reordering/__init__.py',
'simd128/floating_point/data_reordering/unpack_and_interleave.py',
'simd128/floating_point/data_reordering/shuffle.py',
'simd128/floating_point/arithmetic/__init__.py',
'simd128/floating_point/arithmetic/subtraction.py',
'simd128/floating_point/arithmetic/addition.py',
'simd128/floating_point/arithmetic/horizontal_subtraction.py',
'simd128/floating_point/arithmetic/horizontal_addition.py',
'simd128/floating_point/arithmetic/square_root.py',
'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
'simd128/floating_point/arithmetic/multiplication.py',
'simd128/floating_point/arithmetic/division.py',
'simd128/floating_point/arithmetic/reciprocal_square_root.py',
'simd128/floating_point/arithmetic/reciprocal_estimation.py',
'simd128/floating_point/compare/__init__.py',
'simd128/floating_point/compare/compare_and_write_mask.py',
'simd128/floating_point/compare/compare_and_write_rflags.py',
'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
'simd128/floating_point/logical/__init__.py',
'simd128/floating_point/logical/andp.py',
'simd128/floating_point/logical/orp.py',
'simd128/floating_point/logical/exclusive_or.py',
'simd64/__init__.py',
'simd64/integer/__init__.py',
'simd64/integer/data_transfer/__init__.py',
'simd64/integer/data_transfer/move_mask.py',
'simd64/integer/data_transfer/move.py',
'simd64/integer/data_transfer/move_non_temporal.py',
'simd64/integer/exit_media_state.py',
'simd64/integer/data_reordering/__init__.py',
'simd64/integer/data_reordering/unpack_and_interleave.py',
'simd64/integer/data_reordering/pack_with_saturation.py',
'simd64/integer/data_reordering/extract_and_insert.py',
'simd64/integer/data_reordering/shuffle_and_swap.py',
'simd64/integer/data_conversion.py',
'simd64/integer/arithmetic/__init__.py',
'simd64/integer/arithmetic/subtraction.py',
'simd64/integer/arithmetic/addition.py',
'simd64/integer/arithmetic/multiplication.py',
'simd64/integer/arithmetic/multiply_add.py',
'simd64/integer/arithmetic/average.py',
'simd64/integer/arithmetic/sum_of_absolute_differences.py',
'simd64/integer/shift/__init__.py',
'simd64/integer/shift/right_arithmetic_shift.py',
'simd64/integer/shift/left_logical_shift.py',
'simd64/integer/shift/right_logical_shift.py',
'simd64/integer/compare/__init__.py',
'simd64/integer/compare/compare_and_write_mask.py',
'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
'simd64/integer/logical/__init__.py',
'simd64/integer/logical/pand.py',
'simd64/integer/logical/por.py',
'simd64/integer/logical/exclusive_or.py',
'simd64/integer/save_and_restore_state.py',
'simd64/floating_point/__init__.py',
'simd64/floating_point/arithmetic/__init__.py',
'simd64/floating_point/arithmetic/subtraction.py',
'simd64/floating_point/arithmetic/addition.py',
'simd64/floating_point/arithmetic/reciprocal_estimation.py',
'simd64/floating_point/arithmetic/multiplication.py',
'simd64/floating_point/arithmetic/accumulation.py',
'simd64/floating_point/arithmetic/reciprocal_square_root.py',
'simd64/floating_point/data_conversion.py',
'simd64/floating_point/compare/__init__.py',
'simd64/floating_point/compare/compare_and_write_mask.py',
'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
'x87/__init__.py',
'x87/data_transfer_and_conversion/__init__.py',
'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
'x87/data_transfer_and_conversion/exchange.py',
'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
'x87/data_transfer_and_conversion/conditional_move.py',
'x87/data_transfer_and_conversion/extract.py',
'x87/load_constants/__init__.py',
'x87/load_constants/load_0_1_or_pi.py',
'x87/load_constants/load_logarithm.py',
'x87/arithmetic/__init__.py',
'x87/arithmetic/subtraction.py',
'x87/arithmetic/addition.py',
'x87/arithmetic/partial_remainder.py',
'x87/arithmetic/multiplication.py',
'x87/arithmetic/division.py',
'x87/arithmetic/change_sign.py',
'x87/arithmetic/round.py',
'x87/arithmetic/square_root.py',
'x87/transcendental_functions/__init__.py',
'x87/transcendental_functions/trigonometric_functions.py',
'x87/transcendental_functions/logarithmic_functions.py',
'x87/compare_and_test/__init__.py',
'x87/compare_and_test/classify.py',
'x87/compare_and_test/test.py',
'x87/compare_and_test/floating_point_ordered_compare.py',
'x87/compare_and_test/floating_point_unordered_compare.py',
'x87/compare_and_test/integer_compare.py',
'x87/stack_management/__init__.py',
'x87/stack_management/stack_control.py',
'x87/stack_management/clear_state.py',
'x87/control/__init__.py',
'x87/control/clear_exceptions.py',
'x87/control/initialize.py',
'x87/control/wait_for_exceptions.py',
'x87/control/save_x87_status_word.py',
'x87/control/save_and_restore_x87_control_word.py',
'x87/control/save_and_restore_x87_environment.py',
'x87/no_operation.py'
)
# Add in files generated by the ISA description.
isa_desc_files = env.ISADesc('isa/main.isa')
for f in isa_desc_files:
# Add in python file dependencies that won't be caught otherwise
for pyfile in python_files:
env.Depends(f, "isa/insts/%s" % pyfile)
# Only non-header files need to be compiled.
if not f.path.endswith('.hh'):
Source(f)
# Workaround for bug in SCons version > 0.97d20071212
# Scons bug id: 2006 M5 Bug id: 308
from os.path import dirname, join as joinpath
Dir('isa')
Dir('isa/microops')
Dir('isa/decoder')
Dir('isa/formats')
Dir('isa/insts')
isa_dirs = set(map(lambda x:dirname(x), python_files))
for d in isa_dirs:
Dir(joinpath('isa/insts', d))
|