SConscript revision 11375
112855Sgabeblack@google.com# -*- mode:python -*-
212855Sgabeblack@google.com
312855Sgabeblack@google.com# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
412855Sgabeblack@google.com# All rights reserved.
512855Sgabeblack@google.com#
612855Sgabeblack@google.com# The license below extends only to copyright in the software and shall
712855Sgabeblack@google.com# not be construed as granting a license to any other intellectual
812855Sgabeblack@google.com# property including but not limited to intellectual property relating
912855Sgabeblack@google.com# to a hardware implementation of the functionality of the software
1012855Sgabeblack@google.com# licensed hereunder.  You may use the software subject to the license
1112855Sgabeblack@google.com# terms below provided that you ensure that this notice is replicated
1212855Sgabeblack@google.com# unmodified and in its entirety in all distributions of the software,
1312855Sgabeblack@google.com# modified or unmodified, in source code or in binary form.
1412855Sgabeblack@google.com#
1512855Sgabeblack@google.com# Copyright (c) 2005-2006 The Regents of The University of Michigan
1612855Sgabeblack@google.com# All rights reserved.
1712855Sgabeblack@google.com#
1812855Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
1912855Sgabeblack@google.com# modification, are permitted provided that the following conditions are
2012855Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
2112855Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
2212855Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
2312855Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
2412855Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
2512855Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
2612855Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
2712855Sgabeblack@google.com# this software without specific prior written permission.
2812855Sgabeblack@google.com#
2912855Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3012855Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3112855Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3212855Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3312855Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3412855Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3512855Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3612855Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3712855Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3812855Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3912855Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4012855Sgabeblack@google.com#
4112855Sgabeblack@google.com# Authors: Gabe Black
4212855Sgabeblack@google.com
4312855Sgabeblack@google.comImport('*')
4412855Sgabeblack@google.com
4512855Sgabeblack@google.comif env['TARGET_ISA'] == 'x86':
4612855Sgabeblack@google.com    Source('cpuid.cc')
4712855Sgabeblack@google.com    Source('decoder.cc')
4812855Sgabeblack@google.com    Source('decoder_tables.cc')
4912855Sgabeblack@google.com    Source('emulenv.cc')
5012855Sgabeblack@google.com    Source('faults.cc')
5112855Sgabeblack@google.com    Source('insts/badmicroop.cc')
5212855Sgabeblack@google.com    Source('insts/microfpop.cc')
5312855Sgabeblack@google.com    Source('insts/microldstop.cc')
5412855Sgabeblack@google.com    Source('insts/micromediaop.cc')
5512855Sgabeblack@google.com    Source('insts/microop.cc')
5612855Sgabeblack@google.com    Source('insts/microregop.cc')
5712855Sgabeblack@google.com    Source('insts/static_inst.cc')
5812855Sgabeblack@google.com    Source('interrupts.cc')
5912855Sgabeblack@google.com    Source('isa.cc')
6012855Sgabeblack@google.com    Source('linux/linux.cc')
6112855Sgabeblack@google.com    Source('linux/process.cc')
6212855Sgabeblack@google.com    Source('linux/system.cc')
6312855Sgabeblack@google.com    Source('nativetrace.cc')
6412855Sgabeblack@google.com    Source('pagetable.cc')
6512855Sgabeblack@google.com    Source('pagetable_walker.cc')
6612855Sgabeblack@google.com    Source('process.cc')
6712855Sgabeblack@google.com    Source('pseudo_inst.cc')
6812855Sgabeblack@google.com    Source('remote_gdb.cc')
6912855Sgabeblack@google.com    Source('stacktrace.cc')
7012855Sgabeblack@google.com    Source('system.cc')
7112855Sgabeblack@google.com    Source('tlb.cc')
7212855Sgabeblack@google.com    Source('types.cc')
7312855Sgabeblack@google.com    Source('utility.cc')
7412855Sgabeblack@google.com    Source('vtophys.cc')
7512855Sgabeblack@google.com
7612855Sgabeblack@google.com    SimObject('X86ISA.py')
7712855Sgabeblack@google.com    SimObject('X86LocalApic.py')
7812855Sgabeblack@google.com    SimObject('X86NativeTrace.py')
7912855Sgabeblack@google.com    SimObject('X86System.py')
8012855Sgabeblack@google.com    SimObject('X86TLB.py')
8112855Sgabeblack@google.com
8212855Sgabeblack@google.com    DebugFlag('Faults', "Trace all faults/exceptions/traps")
8312855Sgabeblack@google.com    DebugFlag('LocalApic', "Local APIC debugging")
8412855Sgabeblack@google.com    DebugFlag('PageTableWalker', \
8512855Sgabeblack@google.com              "Page table walker state machine debugging")
8612855Sgabeblack@google.com    DebugFlag('Decoder', "Decoder debug output")
8712855Sgabeblack@google.com    DebugFlag('X86', "Generic X86 ISA debugging")
8812855Sgabeblack@google.com
8912855Sgabeblack@google.com    python_files = (
9012855Sgabeblack@google.com        '__init__.py',
9112855Sgabeblack@google.com        'general_purpose/__init__.py',
9212855Sgabeblack@google.com        'general_purpose/arithmetic/__init__.py',
9312855Sgabeblack@google.com        'general_purpose/arithmetic/add_and_subtract.py',
9412855Sgabeblack@google.com        'general_purpose/arithmetic/increment_and_decrement.py',
9512855Sgabeblack@google.com        'general_purpose/arithmetic/multiply_and_divide.py',
9612855Sgabeblack@google.com        'general_purpose/cache_and_memory_management.py',
9712855Sgabeblack@google.com        'general_purpose/compare_and_test/__init__.py',
9812855Sgabeblack@google.com        'general_purpose/compare_and_test/bit_scan.py',
9912855Sgabeblack@google.com        'general_purpose/compare_and_test/bit_test.py',
10012855Sgabeblack@google.com        'general_purpose/compare_and_test/bounds.py',
10112855Sgabeblack@google.com        'general_purpose/compare_and_test/compare.py',
10212855Sgabeblack@google.com        'general_purpose/compare_and_test/set_byte_on_condition.py',
10312855Sgabeblack@google.com        'general_purpose/compare_and_test/test.py',
10412855Sgabeblack@google.com        'general_purpose/control_transfer/__init__.py',
10512855Sgabeblack@google.com        'general_purpose/control_transfer/call.py',
10612855Sgabeblack@google.com        'general_purpose/control_transfer/conditional_jump.py',
10712855Sgabeblack@google.com        'general_purpose/control_transfer/interrupts_and_exceptions.py',
10812855Sgabeblack@google.com        'general_purpose/control_transfer/jump.py',
10912855Sgabeblack@google.com        'general_purpose/control_transfer/loop.py',
11012855Sgabeblack@google.com        'general_purpose/control_transfer/xreturn.py',
11112855Sgabeblack@google.com        'general_purpose/data_conversion/__init__.py',
11212855Sgabeblack@google.com        'general_purpose/data_conversion/ascii_adjust.py',
11312855Sgabeblack@google.com        'general_purpose/data_conversion/bcd_adjust.py',
11412855Sgabeblack@google.com        'general_purpose/data_conversion/endian_conversion.py',
11512855Sgabeblack@google.com        'general_purpose/data_conversion/extract_sign_mask.py',
11612855Sgabeblack@google.com        'general_purpose/data_conversion/sign_extension.py',
11712855Sgabeblack@google.com        'general_purpose/data_conversion/translate.py',
11812855Sgabeblack@google.com        'general_purpose/data_transfer/__init__.py',
11912855Sgabeblack@google.com        'general_purpose/data_transfer/conditional_move.py',
12012855Sgabeblack@google.com        'general_purpose/data_transfer/move.py',
12112855Sgabeblack@google.com        'general_purpose/data_transfer/stack_operations.py',
12212855Sgabeblack@google.com        'general_purpose/data_transfer/xchg.py',
12312855Sgabeblack@google.com        'general_purpose/flags/__init__.py',
12412855Sgabeblack@google.com        'general_purpose/flags/load_and_store.py',
12512855Sgabeblack@google.com        'general_purpose/flags/push_and_pop.py',
12612855Sgabeblack@google.com        'general_purpose/flags/set_and_clear.py',
12712855Sgabeblack@google.com        'general_purpose/input_output/__init__.py',
12812855Sgabeblack@google.com        'general_purpose/input_output/general_io.py',
12912855Sgabeblack@google.com        'general_purpose/input_output/string_io.py',
13012855Sgabeblack@google.com        'general_purpose/load_effective_address.py',
13112855Sgabeblack@google.com        'general_purpose/load_segment_registers.py',
13212855Sgabeblack@google.com        'general_purpose/logical.py',
13312855Sgabeblack@google.com        'general_purpose/no_operation.py',
13412855Sgabeblack@google.com        'general_purpose/rotate_and_shift/__init__.py',
13512855Sgabeblack@google.com        'general_purpose/rotate_and_shift/rotate.py',
13612855Sgabeblack@google.com        'general_purpose/rotate_and_shift/shift.py',
13712855Sgabeblack@google.com        'general_purpose/semaphores.py',
13812855Sgabeblack@google.com        'general_purpose/string/__init__.py',
13912855Sgabeblack@google.com        'general_purpose/string/compare_strings.py',
14012855Sgabeblack@google.com        'general_purpose/string/load_string.py',
14112855Sgabeblack@google.com        'general_purpose/string/move_string.py',
14212855Sgabeblack@google.com        'general_purpose/string/scan_string.py',
14312855Sgabeblack@google.com        'general_purpose/string/store_string.py',
14412855Sgabeblack@google.com        'general_purpose/system_calls.py',
14512855Sgabeblack@google.com        'romutil.py',
14612855Sgabeblack@google.com        'system/__init__.py',
14712855Sgabeblack@google.com        'system/control_registers.py',
14812855Sgabeblack@google.com        'system/halt.py',
14912855Sgabeblack@google.com        'system/invlpg.py',
15012855Sgabeblack@google.com        'system/undefined_operation.py',
15112855Sgabeblack@google.com        'system/msrs.py',
15212855Sgabeblack@google.com        'system/segmentation.py',
15312855Sgabeblack@google.com        'simd128/__init__.py',
15412855Sgabeblack@google.com        'simd128/integer/__init__.py',
15512855Sgabeblack@google.com        'simd128/integer/data_transfer/__init__.py',
15612855Sgabeblack@google.com        'simd128/integer/data_transfer/move.py',
15712855Sgabeblack@google.com        'simd128/integer/data_transfer/move_non_temporal.py',
15812855Sgabeblack@google.com        'simd128/integer/data_transfer/move_mask.py',
15912855Sgabeblack@google.com        'simd128/integer/data_conversion/__init__.py',
16012855Sgabeblack@google.com        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
16112855Sgabeblack@google.com        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
16212855Sgabeblack@google.com        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
16312855Sgabeblack@google.com        'simd128/integer/data_reordering/__init__.py',
16412855Sgabeblack@google.com        'simd128/integer/data_reordering/unpack_and_interleave.py',
16512855Sgabeblack@google.com        'simd128/integer/data_reordering/pack_with_saturation.py',
16612855Sgabeblack@google.com        'simd128/integer/data_reordering/extract_and_insert.py',
16712855Sgabeblack@google.com        'simd128/integer/data_reordering/shuffle.py',
16812855Sgabeblack@google.com        'simd128/integer/arithmetic/__init__.py',
16912855Sgabeblack@google.com        'simd128/integer/arithmetic/subtraction.py',
17012855Sgabeblack@google.com        'simd128/integer/arithmetic/addition.py',
17112855Sgabeblack@google.com        'simd128/integer/arithmetic/multiplication.py',
17212855Sgabeblack@google.com        'simd128/integer/arithmetic/multiply_add.py',
17312855Sgabeblack@google.com        'simd128/integer/arithmetic/average.py',
17412855Sgabeblack@google.com        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
17512855Sgabeblack@google.com        'simd128/integer/shift/__init__.py',
17612855Sgabeblack@google.com        'simd128/integer/shift/right_arithmetic_shift.py',
17712855Sgabeblack@google.com        'simd128/integer/shift/left_logical_shift.py',
17812855Sgabeblack@google.com        'simd128/integer/shift/right_logical_shift.py',
17912855Sgabeblack@google.com        'simd128/integer/compare/__init__.py',
18012855Sgabeblack@google.com        'simd128/integer/compare/compare_and_write_mask.py',
18112855Sgabeblack@google.com        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
18212855Sgabeblack@google.com        'simd128/integer/logical/__init__.py',
18312855Sgabeblack@google.com        'simd128/integer/logical/pand.py',
18412855Sgabeblack@google.com        'simd128/integer/logical/por.py',
18512855Sgabeblack@google.com        'simd128/integer/logical/exclusive_or.py',
18612855Sgabeblack@google.com        'simd128/integer/save_and_restore_state/__init__.py',
18712855Sgabeblack@google.com        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
18812855Sgabeblack@google.com        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
18912855Sgabeblack@google.com        'simd128/floating_point/__init__.py',
19012855Sgabeblack@google.com        'simd128/floating_point/data_transfer/__init__.py',
19112855Sgabeblack@google.com        'simd128/floating_point/data_transfer/move_mask.py',
19212855Sgabeblack@google.com        'simd128/floating_point/data_transfer/move.py',
19312855Sgabeblack@google.com        'simd128/floating_point/data_transfer/move_with_duplication.py',
19412855Sgabeblack@google.com        'simd128/floating_point/data_transfer/move_non_temporal.py',
19512855Sgabeblack@google.com        'simd128/floating_point/data_conversion/__init__.py',
19612855Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
19712855Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
19812855Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
19912855Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
20012855Sgabeblack@google.com        'simd128/floating_point/data_reordering/__init__.py',
20112855Sgabeblack@google.com        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
20212855Sgabeblack@google.com        'simd128/floating_point/data_reordering/shuffle.py',
20312855Sgabeblack@google.com        'simd128/floating_point/arithmetic/__init__.py',
20412855Sgabeblack@google.com        'simd128/floating_point/arithmetic/subtraction.py',
20512855Sgabeblack@google.com        'simd128/floating_point/arithmetic/addition.py',
20612855Sgabeblack@google.com        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
20712855Sgabeblack@google.com        'simd128/floating_point/arithmetic/horizontal_addition.py',
20812855Sgabeblack@google.com        'simd128/floating_point/arithmetic/square_root.py',
20912855Sgabeblack@google.com        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
21012855Sgabeblack@google.com        'simd128/floating_point/arithmetic/multiplication.py',
21112855Sgabeblack@google.com        'simd128/floating_point/arithmetic/division.py',
21212855Sgabeblack@google.com        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
21312855Sgabeblack@google.com        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
21412855Sgabeblack@google.com        'simd128/floating_point/compare/__init__.py',
21512876Sgabeblack@google.com        'simd128/floating_point/compare/compare_and_write_mask.py',
21612855Sgabeblack@google.com        'simd128/floating_point/compare/compare_and_write_rflags.py',
21712855Sgabeblack@google.com        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
21812855Sgabeblack@google.com        'simd128/floating_point/logical/__init__.py',
21912855Sgabeblack@google.com        'simd128/floating_point/logical/andp.py',
22012855Sgabeblack@google.com        'simd128/floating_point/logical/orp.py',
22112855Sgabeblack@google.com        'simd128/floating_point/logical/exclusive_or.py',
222        'simd64/__init__.py',
223        'simd64/integer/__init__.py',
224        'simd64/integer/data_transfer/__init__.py',
225        'simd64/integer/data_transfer/move_mask.py',
226        'simd64/integer/data_transfer/move.py',
227        'simd64/integer/data_transfer/move_non_temporal.py',
228        'simd64/integer/exit_media_state.py',
229        'simd64/integer/data_reordering/__init__.py',
230        'simd64/integer/data_reordering/unpack_and_interleave.py',
231        'simd64/integer/data_reordering/pack_with_saturation.py',
232        'simd64/integer/data_reordering/extract_and_insert.py',
233        'simd64/integer/data_reordering/shuffle_and_swap.py',
234        'simd64/integer/data_conversion.py',
235        'simd64/integer/arithmetic/__init__.py',
236        'simd64/integer/arithmetic/subtraction.py',
237        'simd64/integer/arithmetic/addition.py',
238        'simd64/integer/arithmetic/multiplication.py',
239        'simd64/integer/arithmetic/multiply_add.py',
240        'simd64/integer/arithmetic/average.py',
241        'simd64/integer/arithmetic/sum_of_absolute_differences.py',
242        'simd64/integer/shift/__init__.py',
243        'simd64/integer/shift/right_arithmetic_shift.py',
244        'simd64/integer/shift/left_logical_shift.py',
245        'simd64/integer/shift/right_logical_shift.py',
246        'simd64/integer/compare/__init__.py',
247        'simd64/integer/compare/compare_and_write_mask.py',
248        'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
249        'simd64/integer/logical/__init__.py',
250        'simd64/integer/logical/pand.py',
251        'simd64/integer/logical/por.py',
252        'simd64/integer/logical/exclusive_or.py',
253        'simd64/integer/save_and_restore_state.py',
254        'simd64/floating_point/__init__.py',
255        'simd64/floating_point/arithmetic/__init__.py',
256        'simd64/floating_point/arithmetic/subtraction.py',
257        'simd64/floating_point/arithmetic/addition.py',
258        'simd64/floating_point/arithmetic/reciprocal_estimation.py',
259        'simd64/floating_point/arithmetic/multiplication.py',
260        'simd64/floating_point/arithmetic/accumulation.py',
261        'simd64/floating_point/arithmetic/reciprocal_square_root.py',
262        'simd64/floating_point/data_conversion.py',
263        'simd64/floating_point/compare/__init__.py',
264        'simd64/floating_point/compare/compare_and_write_mask.py',
265        'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
266        'x87/__init__.py',
267        'x87/data_transfer_and_conversion/__init__.py',
268        'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
269        'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
270        'x87/data_transfer_and_conversion/exchange.py',
271        'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
272        'x87/data_transfer_and_conversion/conditional_move.py',
273        'x87/data_transfer_and_conversion/extract.py',
274        'x87/load_constants/__init__.py',
275        'x87/load_constants/load_0_1_or_pi.py',
276        'x87/load_constants/load_logarithm.py',
277        'x87/arithmetic/__init__.py',
278        'x87/arithmetic/subtraction.py',
279        'x87/arithmetic/addition.py',
280        'x87/arithmetic/partial_remainder.py',
281        'x87/arithmetic/multiplication.py',
282        'x87/arithmetic/division.py',
283        'x87/arithmetic/change_sign.py',
284        'x87/arithmetic/round.py',
285        'x87/arithmetic/square_root.py',
286        'x87/transcendental_functions/__init__.py',
287        'x87/transcendental_functions/trigonometric_functions.py',
288        'x87/transcendental_functions/logarithmic_functions.py',
289        'x87/compare_and_test/__init__.py',
290        'x87/compare_and_test/classify.py',
291        'x87/compare_and_test/test.py',
292        'x87/compare_and_test/floating_point_ordered_compare.py',
293        'x87/compare_and_test/floating_point_unordered_compare.py',
294        'x87/compare_and_test/integer_compare.py',
295        'x87/stack_management/__init__.py',
296        'x87/stack_management/stack_control.py',
297        'x87/stack_management/clear_state.py',
298        'x87/control/__init__.py',
299        'x87/control/clear_exceptions.py',
300        'x87/control/initialize.py',
301        'x87/control/wait_for_exceptions.py',
302        'x87/control/save_x87_status_word.py',
303        'x87/control/save_and_restore_x87_control_word.py',
304        'x87/control/save_and_restore_x87_environment.py',
305        'x87/no_operation.py'
306        )
307
308
309    # Add in files generated by the ISA description.
310    isa_desc_files = env.ISADesc('isa/main.isa')
311    for f in isa_desc_files:
312        # Add in python file dependencies that won't be caught otherwise
313        for pyfile in python_files:
314            env.Depends(f, "isa/insts/%s" % pyfile)
315