SConscript revision 8300
12139SN/A# -*- mode:python -*-
22139SN/A
312109SRekai.GonzalezAlberquilla@arm.com# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
412109SRekai.GonzalezAlberquilla@arm.com# All rights reserved.
512109SRekai.GonzalezAlberquilla@arm.com#
612109SRekai.GonzalezAlberquilla@arm.com# The license below extends only to copyright in the software and shall
712109SRekai.GonzalezAlberquilla@arm.com# not be construed as granting a license to any other intellectual
812109SRekai.GonzalezAlberquilla@arm.com# property including but not limited to intellectual property relating
912109SRekai.GonzalezAlberquilla@arm.com# to a hardware implementation of the functionality of the software
1012109SRekai.GonzalezAlberquilla@arm.com# licensed hereunder.  You may use the software subject to the license
1112109SRekai.GonzalezAlberquilla@arm.com# terms below provided that you ensure that this notice is replicated
1212109SRekai.GonzalezAlberquilla@arm.com# unmodified and in its entirety in all distributions of the software,
1312109SRekai.GonzalezAlberquilla@arm.com# modified or unmodified, in source code or in binary form.
1412109SRekai.GonzalezAlberquilla@arm.com#
152139SN/A# Copyright (c) 2005-2006 The Regents of The University of Michigan
162139SN/A# All rights reserved.
172139SN/A#
182139SN/A# Redistribution and use in source and binary forms, with or without
192139SN/A# modification, are permitted provided that the following conditions are
202139SN/A# met: redistributions of source code must retain the above copyright
212139SN/A# notice, this list of conditions and the following disclaimer;
222139SN/A# redistributions in binary form must reproduce the above copyright
232139SN/A# notice, this list of conditions and the following disclaimer in the
242139SN/A# documentation and/or other materials provided with the distribution;
252139SN/A# neither the name of the copyright holders nor the names of its
262139SN/A# contributors may be used to endorse or promote products derived from
272139SN/A# this software without specific prior written permission.
282139SN/A#
292139SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
302139SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
312139SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
322139SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
332139SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
342139SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
352139SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
362139SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
372139SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
382139SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
392139SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
402665Ssaidi@eecs.umich.edu#
412665Ssaidi@eecs.umich.edu# Authors: Gabe Black
422139SN/A
434202Sbinkertn@umich.eduImport('*')
448961Sgblack@eecs.umich.edu
4510196SCurtis.Dunham@arm.comif env['TARGET_ISA'] == 'x86':
462139SN/A    Source('cpuid.cc')
4712246Sgabeblack@google.com    Source('emulenv.cc')
4812246Sgabeblack@google.com    Source('faults.cc')
494202Sbinkertn@umich.edu    Source('insts/badmicroop.cc')
502152SN/A    Source('insts/microfpop.cc')
512152SN/A    Source('insts/microldstop.cc')
522139SN/A    Source('insts/micromediaop.cc')
532139SN/A    Source('insts/microop.cc')
542139SN/A    Source('insts/microregop.cc')
552139SN/A    Source('insts/static_inst.cc')
562139SN/A    Source('isa.cc')
572152SN/A    Source('nativetrace.cc')
582152SN/A    Source('pagetable.cc')
592139SN/A    Source('predecoder.cc')
6012015Sgabeblack@google.com    Source('predecoder_tables.cc')
6112015Sgabeblack@google.com    Source('remote_gdb.cc')
629020Sgblack@eecs.umich.edu    Source('tlb.cc')
634781Snate@binkert.org    Source('types.cc')
647799Sgblack@eecs.umich.edu    Source('utility.cc')
654781Snate@binkert.org
664781Snate@binkert.org    SimObject('X86NativeTrace.py')
673170Sstever@eecs.umich.edu
685664Sgblack@eecs.umich.edu    SimObject('X86TLB.py')
698105Sgblack@eecs.umich.edu    TraceFlag('Predecoder', "Predecoder debug output")
706179Sksewell@umich.edu    TraceFlag('X86', "Generic X86 ISA debugging")
714781Snate@binkert.org
7210553Salexandru.dutu@amd.com    if env['FULL_SYSTEM']:
736329Sgblack@eecs.umich.edu        TraceFlag('LocalApic', "Local APIC debugging")
744781Snate@binkert.org        TraceFlag('PageTableWalker', \
754781Snate@binkert.org                  "Page table walker state machine debugging")
764781Snate@binkert.org        TraceFlag('Faults', "Trace all faults/exceptions/traps")
774781Snate@binkert.org
784781Snate@binkert.org        SimObject('X86LocalApic.py')
7912015Sgabeblack@google.com        SimObject('X86System.py')
8012015Sgabeblack@google.com
812152SN/A        # Full-system sources
8211308Santhony.gutierrez@amd.com        Source('interrupts.cc')
8312016Sgabeblack@google.com        Source('linux/system.cc')
8412016Sgabeblack@google.com        Source('pagetable_walker.cc')
8511308Santhony.gutierrez@amd.com        Source('system.cc')
8611696Santhony.gutierrez@amd.com        Source('stacktrace.cc')
8711308Santhony.gutierrez@amd.com        Source('vtophys.cc')
8812016Sgabeblack@google.com    else:
8912016Sgabeblack@google.com        Source('process.cc')
9011308Santhony.gutierrez@amd.com
912152SN/A        Source('linux/linux.cc')
922152SN/A        Source('linux/process.cc')
932152SN/A        Source('linux/syscalls.cc')
942152SN/A
952152SN/A    python_files = (
962152SN/A        '__init__.py',
972152SN/A        'general_purpose/__init__.py',
982152SN/A        'general_purpose/arithmetic/__init__.py',
992152SN/A        'general_purpose/arithmetic/add_and_subtract.py',
1002152SN/A        'general_purpose/arithmetic/increment_and_decrement.py',
10112222Sgabeblack@google.com        'general_purpose/arithmetic/multiply_and_divide.py',
1022152SN/A        'general_purpose/cache_and_memory_management.py',
10312222Sgabeblack@google.com        'general_purpose/compare_and_test/__init__.py',
10412222Sgabeblack@google.com        'general_purpose/compare_and_test/bit_scan.py',
10512222Sgabeblack@google.com        'general_purpose/compare_and_test/bit_test.py',
10612222Sgabeblack@google.com        'general_purpose/compare_and_test/bounds.py',
1072152SN/A        'general_purpose/compare_and_test/compare.py',
10812222Sgabeblack@google.com        'general_purpose/compare_and_test/set_byte_on_condition.py',
10912222Sgabeblack@google.com        'general_purpose/compare_and_test/test.py',
11012222Sgabeblack@google.com        'general_purpose/control_transfer/__init__.py',
11112222Sgabeblack@google.com        'general_purpose/control_transfer/call.py',
1122152SN/A        'general_purpose/control_transfer/conditional_jump.py',
1132152SN/A        'general_purpose/control_transfer/interrupts_and_exceptions.py',
1142152SN/A        'general_purpose/control_transfer/jump.py',
1152152SN/A        'general_purpose/control_transfer/loop.py',
1162152SN/A        'general_purpose/control_transfer/xreturn.py',
1172152SN/A        'general_purpose/data_conversion/__init__.py',
11812222Sgabeblack@google.com        'general_purpose/data_conversion/ascii_adjust.py',
11912222Sgabeblack@google.com        'general_purpose/data_conversion/bcd_adjust.py',
1206993Snate@binkert.org        'general_purpose/data_conversion/endian_conversion.py',
1216998Snate@binkert.org        'general_purpose/data_conversion/extract_sign_mask.py',
1226998Snate@binkert.org        'general_purpose/data_conversion/sign_extension.py',
1236998Snate@binkert.org        'general_purpose/data_conversion/translate.py',
12412222Sgabeblack@google.com        'general_purpose/data_transfer/__init__.py',
12512222Sgabeblack@google.com        'general_purpose/data_transfer/conditional_move.py',
12612222Sgabeblack@google.com        'general_purpose/data_transfer/move.py',
1276993Snate@binkert.org        'general_purpose/data_transfer/stack_operations.py',
1286993Snate@binkert.org        'general_purpose/data_transfer/xchg.py',
12910319SAndreas.Sandberg@ARM.com        'general_purpose/flags/__init__.py',
1306993Snate@binkert.org        'general_purpose/flags/load_and_store.py',
1312152SN/A        'general_purpose/flags/push_and_pop.py',
13212222Sgabeblack@google.com        'general_purpose/flags/set_and_clear.py',
1332152SN/A        'general_purpose/input_output/__init__.py',
13412222Sgabeblack@google.com        'general_purpose/input_output/general_io.py',
1355944Sgblack@eecs.umich.edu        'general_purpose/input_output/string_io.py',
13610196SCurtis.Dunham@arm.com        'general_purpose/load_effective_address.py',
13712222Sgabeblack@google.com        'general_purpose/load_segment_registers.py',
13812222Sgabeblack@google.com        'general_purpose/logical.py',
13912222Sgabeblack@google.com        'general_purpose/no_operation.py',
14012222Sgabeblack@google.com        'general_purpose/rotate_and_shift/__init__.py',
14110196SCurtis.Dunham@arm.com        'general_purpose/rotate_and_shift/rotate.py',
14212222Sgabeblack@google.com        'general_purpose/rotate_and_shift/shift.py',
14312222Sgabeblack@google.com        'general_purpose/semaphores.py',
14412222Sgabeblack@google.com        'general_purpose/string/__init__.py',
14512222Sgabeblack@google.com        'general_purpose/string/compare_strings.py',
14610196SCurtis.Dunham@arm.com        'general_purpose/string/load_string.py',
14712222Sgabeblack@google.com        'general_purpose/string/move_string.py',
14812222Sgabeblack@google.com        'general_purpose/string/scan_string.py',
14912222Sgabeblack@google.com        'general_purpose/string/store_string.py',
15012222Sgabeblack@google.com        'general_purpose/system_calls.py',
15112222Sgabeblack@google.com        'romutil.py',
15212222Sgabeblack@google.com        'system/__init__.py',
15310196SCurtis.Dunham@arm.com        'system/control_registers.py',
15412222Sgabeblack@google.com        'system/halt.py',
15512222Sgabeblack@google.com        'system/invlpg.py',
15612222Sgabeblack@google.com        'system/undefined_operation.py',
15712222Sgabeblack@google.com        'system/msrs.py',
15812222Sgabeblack@google.com        'system/segmentation.py',
15912222Sgabeblack@google.com        'simd128/__init__.py',
16012222Sgabeblack@google.com        'simd128/integer/__init__.py',
16110196SCurtis.Dunham@arm.com        'simd128/integer/data_transfer/__init__.py',
16212222Sgabeblack@google.com        'simd128/integer/data_transfer/move.py',
16312222Sgabeblack@google.com        'simd128/integer/data_transfer/move_non_temporal.py',
16412222Sgabeblack@google.com        'simd128/integer/data_transfer/move_mask.py',
16512222Sgabeblack@google.com        'simd128/integer/data_conversion/__init__.py',
16612222Sgabeblack@google.com        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
16712222Sgabeblack@google.com        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
16810196SCurtis.Dunham@arm.com        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
16912222Sgabeblack@google.com        'simd128/integer/data_reordering/__init__.py',
17012222Sgabeblack@google.com        'simd128/integer/data_reordering/unpack_and_interleave.py',
17112222Sgabeblack@google.com        'simd128/integer/data_reordering/pack_with_saturation.py',
17212222Sgabeblack@google.com        'simd128/integer/data_reordering/extract_and_insert.py',
17312222Sgabeblack@google.com        'simd128/integer/data_reordering/shuffle.py',
17412222Sgabeblack@google.com        'simd128/integer/arithmetic/__init__.py',
17512222Sgabeblack@google.com        'simd128/integer/arithmetic/subtraction.py',
17612222Sgabeblack@google.com        'simd128/integer/arithmetic/addition.py',
17712222Sgabeblack@google.com        'simd128/integer/arithmetic/multiplication.py',
17812222Sgabeblack@google.com        'simd128/integer/arithmetic/multiply_add.py',
17912222Sgabeblack@google.com        'simd128/integer/arithmetic/average.py',
18010196SCurtis.Dunham@arm.com        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
18112222Sgabeblack@google.com        'simd128/integer/shift/__init__.py',
18212222Sgabeblack@google.com        'simd128/integer/shift/right_arithmetic_shift.py',
18312222Sgabeblack@google.com        'simd128/integer/shift/left_logical_shift.py',
18412222Sgabeblack@google.com        'simd128/integer/shift/right_logical_shift.py',
18512222Sgabeblack@google.com        'simd128/integer/compare/__init__.py',
18612222Sgabeblack@google.com        'simd128/integer/compare/compare_and_write_mask.py',
18712222Sgabeblack@google.com        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
18812222Sgabeblack@google.com        'simd128/integer/logical/__init__.py',
18912222Sgabeblack@google.com        'simd128/integer/logical/pand.py',
19012222Sgabeblack@google.com        'simd128/integer/logical/por.py',
19112222Sgabeblack@google.com        'simd128/integer/logical/exclusive_or.py',
19212222Sgabeblack@google.com        'simd128/integer/save_and_restore_state/__init__.py',
19312222Sgabeblack@google.com        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
19412222Sgabeblack@google.com        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
19512222Sgabeblack@google.com        'simd128/floating_point/__init__.py',
19612222Sgabeblack@google.com        'simd128/floating_point/data_transfer/__init__.py',
19712222Sgabeblack@google.com        'simd128/floating_point/data_transfer/move_mask.py',
19812222Sgabeblack@google.com        'simd128/floating_point/data_transfer/move.py',
19912222Sgabeblack@google.com        'simd128/floating_point/data_transfer/move_with_duplication.py',
20012222Sgabeblack@google.com        'simd128/floating_point/data_transfer/move_non_temporal.py',
20112222Sgabeblack@google.com        'simd128/floating_point/data_conversion/__init__.py',
20212222Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
20312222Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
20412222Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
20512222Sgabeblack@google.com        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
20612222Sgabeblack@google.com        'simd128/floating_point/data_reordering/__init__.py',
20712222Sgabeblack@google.com        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
20812222Sgabeblack@google.com        'simd128/floating_point/data_reordering/shuffle.py',
20912222Sgabeblack@google.com        'simd128/floating_point/arithmetic/__init__.py',
21012222Sgabeblack@google.com        'simd128/floating_point/arithmetic/subtraction.py',
21112222Sgabeblack@google.com        'simd128/floating_point/arithmetic/addition.py',
21212222Sgabeblack@google.com        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
21312222Sgabeblack@google.com        'simd128/floating_point/arithmetic/horizontal_addition.py',
21412222Sgabeblack@google.com        'simd128/floating_point/arithmetic/square_root.py',
21512222Sgabeblack@google.com        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
21612222Sgabeblack@google.com        'simd128/floating_point/arithmetic/multiplication.py',
21712222Sgabeblack@google.com        'simd128/floating_point/arithmetic/division.py',
21812222Sgabeblack@google.com        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
21912222Sgabeblack@google.com        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
22012222Sgabeblack@google.com        'simd128/floating_point/compare/__init__.py',
22112222Sgabeblack@google.com        'simd128/floating_point/compare/compare_and_write_mask.py',
22212222Sgabeblack@google.com        'simd128/floating_point/compare/compare_and_write_rflags.py',
22312222Sgabeblack@google.com        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
22412222Sgabeblack@google.com        'simd128/floating_point/logical/__init__.py',
22510196SCurtis.Dunham@arm.com        'simd128/floating_point/logical/andp.py',
2268335Snate@binkert.org        'simd128/floating_point/logical/orp.py',
2278335Snate@binkert.org        'simd128/floating_point/logical/exclusive_or.py',
22812109SRekai.GonzalezAlberquilla@arm.com        'simd64/__init__.py',
2299920Syasuko.eckert@amd.com        'simd64/integer/__init__.py',
2308335Snate@binkert.org        'simd64/integer/data_transfer/__init__.py',
23110935Snilay@cs.wisc.edu        'simd64/integer/data_transfer/move_mask.py',
232        'simd64/integer/data_transfer/move.py',
233        'simd64/integer/data_transfer/move_non_temporal.py',
234        'simd64/integer/exit_media_state.py',
235        'simd64/integer/data_reordering/__init__.py',
236        'simd64/integer/data_reordering/unpack_and_interleave.py',
237        'simd64/integer/data_reordering/pack_with_saturation.py',
238        'simd64/integer/data_reordering/extract_and_insert.py',
239        'simd64/integer/data_reordering/shuffle_and_swap.py',
240        'simd64/integer/data_conversion.py',
241        'simd64/integer/arithmetic/__init__.py',
242        'simd64/integer/arithmetic/subtraction.py',
243        'simd64/integer/arithmetic/addition.py',
244        'simd64/integer/arithmetic/multiplication.py',
245        'simd64/integer/arithmetic/multiply_add.py',
246        'simd64/integer/arithmetic/average.py',
247        'simd64/integer/arithmetic/sum_of_absolute_differences.py',
248        'simd64/integer/shift/__init__.py',
249        'simd64/integer/shift/right_arithmetic_shift.py',
250        'simd64/integer/shift/left_logical_shift.py',
251        'simd64/integer/shift/right_logical_shift.py',
252        'simd64/integer/compare/__init__.py',
253        'simd64/integer/compare/compare_and_write_mask.py',
254        'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
255        'simd64/integer/logical/__init__.py',
256        'simd64/integer/logical/pand.py',
257        'simd64/integer/logical/por.py',
258        'simd64/integer/logical/exclusive_or.py',
259        'simd64/integer/save_and_restore_state.py',
260        'simd64/floating_point/__init__.py',
261        'simd64/floating_point/arithmetic/__init__.py',
262        'simd64/floating_point/arithmetic/subtraction.py',
263        'simd64/floating_point/arithmetic/addition.py',
264        'simd64/floating_point/arithmetic/reciprocal_estimation.py',
265        'simd64/floating_point/arithmetic/multiplication.py',
266        'simd64/floating_point/arithmetic/accumulation.py',
267        'simd64/floating_point/arithmetic/reciprocal_square_root.py',
268        'simd64/floating_point/data_conversion.py',
269        'simd64/floating_point/compare/__init__.py',
270        'simd64/floating_point/compare/compare_and_write_mask.py',
271        'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
272        'x87/__init__.py',
273        'x87/data_transfer_and_conversion/__init__.py',
274        'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
275        'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
276        'x87/data_transfer_and_conversion/exchange.py',
277        'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
278        'x87/data_transfer_and_conversion/conditional_move.py',
279        'x87/data_transfer_and_conversion/extract.py',
280        'x87/load_constants/__init__.py',
281        'x87/load_constants/load_0_1_or_pi.py',
282        'x87/load_constants/load_logarithm.py',
283        'x87/arithmetic/__init__.py',
284        'x87/arithmetic/subtraction.py',
285        'x87/arithmetic/addition.py',
286        'x87/arithmetic/partial_remainder.py',
287        'x87/arithmetic/multiplication.py',
288        'x87/arithmetic/division.py',
289        'x87/arithmetic/change_sign.py',
290        'x87/arithmetic/round.py',
291        'x87/arithmetic/square_root.py',
292        'x87/transcendental_functions/__init__.py',
293        'x87/transcendental_functions/trigonometric_functions.py',
294        'x87/transcendental_functions/logarithmic_functions.py',
295        'x87/compare_and_test/__init__.py',
296        'x87/compare_and_test/classify.py',
297        'x87/compare_and_test/test.py',
298        'x87/compare_and_test/floating_point_ordered_compare.py',
299        'x87/compare_and_test/floating_point_unordered_compare.py',
300        'x87/compare_and_test/integer_compare.py',
301        'x87/stack_management/__init__.py',
302        'x87/stack_management/stack_control.py',
303        'x87/stack_management/clear_state.py',
304        'x87/control/__init__.py',
305        'x87/control/clear_exceptions.py',
306        'x87/control/initialize.py',
307        'x87/control/wait_for_exceptions.py',
308        'x87/control/save_x87_status_word.py',
309        'x87/control/save_and_restore_x87_control_word.py',
310        'x87/control/save_and_restore_x87_environment.py',
311        'x87/no_operation.py'
312        )
313
314
315    # Add in files generated by the ISA description.
316    isa_desc_files = env.ISADesc('isa/main.isa')
317    for f in isa_desc_files:
318        # Add in python file dependencies that won't be caught otherwise
319        for pyfile in python_files:
320            env.Depends(f, "isa/insts/%s" % pyfile)
321        # Only non-header files need to be compiled.
322        if not f.path.endswith('.hh'):
323            Source(f)
324