SConscript revision 6735
16757SAli.Saidi@ARM.com# -*- mode:python -*-
26757SAli.Saidi@ARM.com
310037SARM gem5 Developers# Copyright (c) 2005-2006 The Regents of The University of Michigan
46757SAli.Saidi@ARM.com# All rights reserved.
56757SAli.Saidi@ARM.com#
67090SAli.Saidi@ARM.com# Redistribution and use in source and binary forms, with or without
77090SAli.Saidi@ARM.com# modification, are permitted provided that the following conditions are
87090SAli.Saidi@ARM.com# met: redistributions of source code must retain the above copyright
97090SAli.Saidi@ARM.com# notice, this list of conditions and the following disclaimer;
107090SAli.Saidi@ARM.com# redistributions in binary form must reproduce the above copyright
117090SAli.Saidi@ARM.com# notice, this list of conditions and the following disclaimer in the
127090SAli.Saidi@ARM.com# documentation and/or other materials provided with the distribution;
137090SAli.Saidi@ARM.com# neither the name of the copyright holders nor the names of its
147090SAli.Saidi@ARM.com# contributors may be used to endorse or promote products derived from
156757SAli.Saidi@ARM.com# this software without specific prior written permission.
166757SAli.Saidi@ARM.com#
176757SAli.Saidi@ARM.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186757SAli.Saidi@ARM.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196757SAli.Saidi@ARM.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206757SAli.Saidi@ARM.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216757SAli.Saidi@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226757SAli.Saidi@ARM.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236757SAli.Saidi@ARM.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246757SAli.Saidi@ARM.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256757SAli.Saidi@ARM.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266757SAli.Saidi@ARM.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276757SAli.Saidi@ARM.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286757SAli.Saidi@ARM.com#
296757SAli.Saidi@ARM.com# Authors: Gabe Black
306757SAli.Saidi@ARM.com
316757SAli.Saidi@ARM.com# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
326757SAli.Saidi@ARM.com# All rights reserved.
336757SAli.Saidi@ARM.com#
346757SAli.Saidi@ARM.com# Redistribution and use of this software in source and binary forms,
356757SAli.Saidi@ARM.com# with or without modification, are permitted provided that the
366757SAli.Saidi@ARM.com# following conditions are met:
376757SAli.Saidi@ARM.com#
386757SAli.Saidi@ARM.com# The software must be used only for Non-Commercial Use which means any
396757SAli.Saidi@ARM.com# use which is NOT directed to receiving any direct monetary
406757SAli.Saidi@ARM.com# compensation for, or commercial advantage from such use.  Illustrative
416757SAli.Saidi@ARM.com# examples of non-commercial use are academic research, personal study,
428739Sgblack@eecs.umich.edu# teaching, education and corporate research & development.
4310801Srene.dejong@arm.com# Illustrative examples of commercial use are distributing products for
4410801Srene.dejong@arm.com# commercial advantage and providing services using the software for
459525SAndreas.Sandberg@ARM.com# commercial advantage.
467584SAli.Saidi@arm.com#
4710802Srene.dejong@arm.com# If you wish to use this software or functionality therein that may be
4810396Sakash.bagdia@arm.com# covered by patents for commercial use, please contact:
4910916Sandreas.sandberg@arm.com#     Director of Intellectual Property Licensing
5012740Sandreas.sandberg@arm.com#     Office of Strategy and Technology
516757SAli.Saidi@ARM.com#     Hewlett-Packard Company
528282SAli.Saidi@ARM.com#     1501 Page Mill Road
537584SAli.Saidi@arm.com#     Palo Alto, California  94304
547584SAli.Saidi@arm.com#
559525SAndreas.Sandberg@ARM.com# Redistributions of source code must retain the above copyright notice,
5610801Srene.dejong@arm.com# this list of conditions and the following disclaimer.  Redistributions
5710037SARM gem5 Developers# in binary form must reproduce the above copyright notice, this list of
589525SAndreas.Sandberg@ARM.com# conditions and the following disclaimer in the documentation and/or
5910749Smatt.evans@arm.com# other materials provided with the distribution.  Neither the name of
607584SAli.Saidi@arm.com# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
617753SWilliam.Wang@arm.com# contributors may be used to endorse or promote products derived from
629646SChris.Emmons@arm.com# this software without specific prior written permission.  No right of
637754SWilliam.Wang@arm.com# sublicense is granted herewith.  Derivatives of the software and
647584SAli.Saidi@arm.com# output created using the software may be prepared, but only for
6510916Sandreas.sandberg@arm.com# Non-Commercial Uses.  Derivatives of the software may be shared with
6611296Sandreas.sandberg@arm.com# others provided: (i) the others agree to abide by the list of
677584SAli.Saidi@arm.com# conditions herein which includes the Non-Commercial Use restrictions;
687584SAli.Saidi@arm.com# and (ii) such Derivatives of the software include the above copyright
698869SAli.Saidi@ARM.com# notice to acknowledge the contribution from this software where
708512Sgeoffrey.blake@arm.com# applicable, this list of conditions and the disclaimer below.
7112077Sgedare@rtems.org#
7210037SARM gem5 Developers# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7312740Sandreas.sandberg@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7410802Srene.dejong@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7510396Sakash.bagdia@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
767584SAli.Saidi@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
778335Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7810801Srene.dejong@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
799646SChris.Emmons@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
808335Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8110749Smatt.evans@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
828335Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
838335Snate@binkert.org#
849958Smatt.evans@arm.com# Authors: Gabe Black
8510396Sakash.bagdia@arm.com
8610802Srene.dejong@arm.comImport('*')
8710037SARM gem5 Developers
8810916Sandreas.sandberg@arm.comif env['TARGET_ISA'] == 'x86':
89    Source('cpuid.cc')
90    Source('emulenv.cc')
91    Source('faults.cc')
92    Source('insts/microfpop.cc')
93    Source('insts/microldstop.cc')
94    Source('insts/micromediaop.cc')
95    Source('insts/microop.cc')
96    Source('insts/microregop.cc')
97    Source('insts/static_inst.cc')
98    Source('isa.cc')
99    Source('nativetrace.cc')
100    Source('pagetable.cc')
101    Source('predecoder.cc')
102    Source('predecoder_tables.cc')
103    Source('remote_gdb.cc')
104    Source('tlb.cc')
105    Source('utility.cc')
106
107    SimObject('X86NativeTrace.py')
108
109    SimObject('X86TLB.py')
110    TraceFlag('Predecoder', "Predecoder debug output")
111    TraceFlag('X86', "Generic X86 ISA debugging")
112
113    if env['FULL_SYSTEM']:
114        TraceFlag('LocalApic', "Local APIC debugging")
115        TraceFlag('PageTableWalker', \
116                  "Page table walker state machine debugging")
117        TraceFlag('Faults', "Trace all faults/exceptions/traps")
118
119        SimObject('X86LocalApic.py')
120        SimObject('X86System.py')
121
122        # Full-system sources
123        Source('interrupts.cc')
124        Source('linux/system.cc')
125        Source('pagetable_walker.cc')
126        Source('system.cc')
127        Source('stacktrace.cc')
128        Source('vtophys.cc')
129    else:
130        Source('process.cc')
131
132        Source('linux/linux.cc')
133        Source('linux/process.cc')
134        Source('linux/syscalls.cc')
135
136    python_files = (
137        '__init__.py',
138        'general_purpose/__init__.py',
139        'general_purpose/arithmetic/__init__.py',
140        'general_purpose/arithmetic/add_and_subtract.py',
141        'general_purpose/arithmetic/increment_and_decrement.py',
142        'general_purpose/arithmetic/multiply_and_divide.py',
143        'general_purpose/cache_and_memory_management.py',
144        'general_purpose/compare_and_test/__init__.py',
145        'general_purpose/compare_and_test/bit_scan.py',
146        'general_purpose/compare_and_test/bit_test.py',
147        'general_purpose/compare_and_test/bounds.py',
148        'general_purpose/compare_and_test/compare.py',
149        'general_purpose/compare_and_test/set_byte_on_condition.py',
150        'general_purpose/compare_and_test/test.py',
151        'general_purpose/control_transfer/__init__.py',
152        'general_purpose/control_transfer/call.py',
153        'general_purpose/control_transfer/conditional_jump.py',
154        'general_purpose/control_transfer/interrupts_and_exceptions.py',
155        'general_purpose/control_transfer/jump.py',
156        'general_purpose/control_transfer/loop.py',
157        'general_purpose/control_transfer/xreturn.py',
158        'general_purpose/data_conversion/__init__.py',
159        'general_purpose/data_conversion/ascii_adjust.py',
160        'general_purpose/data_conversion/bcd_adjust.py',
161        'general_purpose/data_conversion/endian_conversion.py',
162        'general_purpose/data_conversion/extract_sign_mask.py',
163        'general_purpose/data_conversion/sign_extension.py',
164        'general_purpose/data_conversion/translate.py',
165        'general_purpose/data_transfer/__init__.py',
166        'general_purpose/data_transfer/conditional_move.py',
167        'general_purpose/data_transfer/move.py',
168        'general_purpose/data_transfer/stack_operations.py',
169        'general_purpose/data_transfer/xchg.py',
170        'general_purpose/flags/__init__.py',
171        'general_purpose/flags/load_and_store.py',
172        'general_purpose/flags/push_and_pop.py',
173        'general_purpose/flags/set_and_clear.py',
174        'general_purpose/input_output/__init__.py',
175        'general_purpose/input_output/general_io.py',
176        'general_purpose/input_output/string_io.py',
177        'general_purpose/load_effective_address.py',
178        'general_purpose/load_segment_registers.py',
179        'general_purpose/logical.py',
180        'general_purpose/no_operation.py',
181        'general_purpose/rotate_and_shift/__init__.py',
182        'general_purpose/rotate_and_shift/rotate.py',
183        'general_purpose/rotate_and_shift/shift.py',
184        'general_purpose/semaphores.py',
185        'general_purpose/string/__init__.py',
186        'general_purpose/string/compare_strings.py',
187        'general_purpose/string/load_string.py',
188        'general_purpose/string/move_string.py',
189        'general_purpose/string/scan_string.py',
190        'general_purpose/string/store_string.py',
191        'general_purpose/system_calls.py',
192        'romutil.py',
193        'system/__init__.py',
194        'system/control_registers.py',
195        'system/halt.py',
196        'system/invlpg.py',
197        'system/undefined_operation.py',
198        'system/msrs.py',
199        'system/segmentation.py',
200        'simd128/__init__.py',
201        'simd128/integer/__init__.py',
202        'simd128/integer/data_transfer/__init__.py',
203        'simd128/integer/data_transfer/move.py',
204        'simd128/integer/data_transfer/move_non_temporal.py',
205        'simd128/integer/data_transfer/move_mask.py',
206        'simd128/integer/data_conversion/__init__.py',
207        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
208        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
209        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
210        'simd128/integer/data_reordering/__init__.py',
211        'simd128/integer/data_reordering/unpack_and_interleave.py',
212        'simd128/integer/data_reordering/pack_with_saturation.py',
213        'simd128/integer/data_reordering/extract_and_insert.py',
214        'simd128/integer/data_reordering/shuffle.py',
215        'simd128/integer/arithmetic/__init__.py',
216        'simd128/integer/arithmetic/subtraction.py',
217        'simd128/integer/arithmetic/addition.py',
218        'simd128/integer/arithmetic/multiplication.py',
219        'simd128/integer/arithmetic/multiply_add.py',
220        'simd128/integer/arithmetic/average.py',
221        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
222        'simd128/integer/shift/__init__.py',
223        'simd128/integer/shift/right_arithmetic_shift.py',
224        'simd128/integer/shift/left_logical_shift.py',
225        'simd128/integer/shift/right_logical_shift.py',
226        'simd128/integer/compare/__init__.py',
227        'simd128/integer/compare/compare_and_write_mask.py',
228        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
229        'simd128/integer/logical/__init__.py',
230        'simd128/integer/logical/pand.py',
231        'simd128/integer/logical/por.py',
232        'simd128/integer/logical/exclusive_or.py',
233        'simd128/integer/save_and_restore_state/__init__.py',
234        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
235        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
236        'simd128/floating_point/__init__.py',
237        'simd128/floating_point/data_transfer/__init__.py',
238        'simd128/floating_point/data_transfer/move_mask.py',
239        'simd128/floating_point/data_transfer/move.py',
240        'simd128/floating_point/data_transfer/move_with_duplication.py',
241        'simd128/floating_point/data_transfer/move_non_temporal.py',
242        'simd128/floating_point/data_conversion/__init__.py',
243        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
244        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
245        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
246        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
247        'simd128/floating_point/data_reordering/__init__.py',
248        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
249        'simd128/floating_point/data_reordering/shuffle.py',
250        'simd128/floating_point/arithmetic/__init__.py',
251        'simd128/floating_point/arithmetic/subtraction.py',
252        'simd128/floating_point/arithmetic/addition.py',
253        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
254        'simd128/floating_point/arithmetic/horizontal_addition.py',
255        'simd128/floating_point/arithmetic/square_root.py',
256        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
257        'simd128/floating_point/arithmetic/multiplication.py',
258        'simd128/floating_point/arithmetic/division.py',
259        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
260        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
261        'simd128/floating_point/compare/__init__.py',
262        'simd128/floating_point/compare/compare_and_write_mask.py',
263        'simd128/floating_point/compare/compare_and_write_rflags.py',
264        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
265        'simd128/floating_point/logical/__init__.py',
266        'simd128/floating_point/logical/andp.py',
267        'simd128/floating_point/logical/orp.py',
268        'simd128/floating_point/logical/exclusive_or.py',
269        'simd64/__init__.py',
270        'simd64/integer/__init__.py',
271        'simd64/integer/data_transfer/__init__.py',
272        'simd64/integer/data_transfer/move_mask.py',
273        'simd64/integer/data_transfer/move.py',
274        'simd64/integer/data_transfer/move_non_temporal.py',
275        'simd64/integer/exit_media_state.py',
276        'simd64/integer/data_reordering/__init__.py',
277        'simd64/integer/data_reordering/unpack_and_interleave.py',
278        'simd64/integer/data_reordering/pack_with_saturation.py',
279        'simd64/integer/data_reordering/extract_and_insert.py',
280        'simd64/integer/data_reordering/shuffle_and_swap.py',
281        'simd64/integer/data_conversion.py',
282        'simd64/integer/arithmetic/__init__.py',
283        'simd64/integer/arithmetic/subtraction.py',
284        'simd64/integer/arithmetic/addition.py',
285        'simd64/integer/arithmetic/multiplication.py',
286        'simd64/integer/arithmetic/multiply_add.py',
287        'simd64/integer/arithmetic/average.py',
288        'simd64/integer/arithmetic/sum_of_absolute_differences.py',
289        'simd64/integer/shift/__init__.py',
290        'simd64/integer/shift/right_arithmetic_shift.py',
291        'simd64/integer/shift/left_logical_shift.py',
292        'simd64/integer/shift/right_logical_shift.py',
293        'simd64/integer/compare/__init__.py',
294        'simd64/integer/compare/compare_and_write_mask.py',
295        'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
296        'simd64/integer/logical/__init__.py',
297        'simd64/integer/logical/pand.py',
298        'simd64/integer/logical/por.py',
299        'simd64/integer/logical/exclusive_or.py',
300        'simd64/integer/save_and_restore_state.py',
301        'simd64/floating_point/__init__.py',
302        'simd64/floating_point/arithmetic/__init__.py',
303        'simd64/floating_point/arithmetic/subtraction.py',
304        'simd64/floating_point/arithmetic/addition.py',
305        'simd64/floating_point/arithmetic/reciprocal_estimation.py',
306        'simd64/floating_point/arithmetic/multiplication.py',
307        'simd64/floating_point/arithmetic/accumulation.py',
308        'simd64/floating_point/arithmetic/reciprocal_square_root.py',
309        'simd64/floating_point/data_conversion.py',
310        'simd64/floating_point/compare/__init__.py',
311        'simd64/floating_point/compare/compare_and_write_mask.py',
312        'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
313        'x87/__init__.py',
314        'x87/data_transfer_and_conversion/__init__.py',
315        'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
316        'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
317        'x87/data_transfer_and_conversion/exchange.py',
318        'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
319        'x87/data_transfer_and_conversion/conditional_move.py',
320        'x87/data_transfer_and_conversion/extract.py',
321        'x87/load_constants/__init__.py',
322        'x87/load_constants/load_0_1_or_pi.py',
323        'x87/load_constants/load_logarithm.py',
324        'x87/arithmetic/__init__.py',
325        'x87/arithmetic/subtraction.py',
326        'x87/arithmetic/addition.py',
327        'x87/arithmetic/partial_remainder.py',
328        'x87/arithmetic/multiplication.py',
329        'x87/arithmetic/division.py',
330        'x87/arithmetic/change_sign.py',
331        'x87/arithmetic/round.py',
332        'x87/arithmetic/square_root.py',
333        'x87/transcendental_functions/__init__.py',
334        'x87/transcendental_functions/trigonometric_functions.py',
335        'x87/transcendental_functions/logarithmic_functions.py',
336        'x87/compare_and_test/__init__.py',
337        'x87/compare_and_test/classify.py',
338        'x87/compare_and_test/test.py',
339        'x87/compare_and_test/floating_point_ordered_compare.py',
340        'x87/compare_and_test/floating_point_unordered_compare.py',
341        'x87/compare_and_test/integer_compare.py',
342        'x87/stack_management/__init__.py',
343        'x87/stack_management/stack_control.py',
344        'x87/stack_management/clear_state.py',
345        'x87/control/__init__.py',
346        'x87/control/clear_exceptions.py',
347        'x87/control/initialize.py',
348        'x87/control/wait_for_exceptions.py',
349        'x87/control/save_x87_status_word.py',
350        'x87/control/save_and_restore_x87_control_word.py',
351        'x87/control/save_and_restore_x87_environment.py',
352        'x87/no_operation.py'
353        )
354
355
356    # Add in files generated by the ISA description.
357    isa_desc_files = env.ISADesc('isa/main.isa')
358    for f in isa_desc_files:
359        # Add in python file dependencies that won't be caught otherwise
360        for pyfile in python_files:
361            env.Depends(f, "isa/insts/%s" % pyfile)
362        # Only non-header files need to be compiled.
363        if not f.path.endswith('.hh'):
364            Source(f)
365