SConscript revision 9983
12929Sktlim@umich.edu# -*- mode:python -*-
22929Sktlim@umich.edu
32932Sktlim@umich.edu# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
42929Sktlim@umich.edu# All rights reserved.
52929Sktlim@umich.edu#
62929Sktlim@umich.edu# The license below extends only to copyright in the software and shall
72929Sktlim@umich.edu# not be construed as granting a license to any other intellectual
82929Sktlim@umich.edu# property including but not limited to intellectual property relating
92929Sktlim@umich.edu# to a hardware implementation of the functionality of the software
102929Sktlim@umich.edu# licensed hereunder.  You may use the software subject to the license
112929Sktlim@umich.edu# terms below provided that you ensure that this notice is replicated
122929Sktlim@umich.edu# unmodified and in its entirety in all distributions of the software,
132929Sktlim@umich.edu# modified or unmodified, in source code or in binary form.
142929Sktlim@umich.edu#
152929Sktlim@umich.edu# Copyright (c) 2005-2006 The Regents of The University of Michigan
162929Sktlim@umich.edu# All rights reserved.
172929Sktlim@umich.edu#
182929Sktlim@umich.edu# Redistribution and use in source and binary forms, with or without
192929Sktlim@umich.edu# modification, are permitted provided that the following conditions are
202929Sktlim@umich.edu# met: redistributions of source code must retain the above copyright
212929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer;
222929Sktlim@umich.edu# redistributions in binary form must reproduce the above copyright
232929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer in the
242929Sktlim@umich.edu# documentation and/or other materials provided with the distribution;
252929Sktlim@umich.edu# neither the name of the copyright holders nor the names of its
262929Sktlim@umich.edu# contributors may be used to endorse or promote products derived from
272929Sktlim@umich.edu# this software without specific prior written permission.
282932Sktlim@umich.edu#
292932Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
302932Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
312929Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
322929Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
332929Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
342929Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
352929Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
362929Sktlim@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
372929Sktlim@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
382929Sktlim@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
392929Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
402929Sktlim@umich.edu#
412929Sktlim@umich.edu# Authors: Gabe Black
422929Sktlim@umich.edu
432929Sktlim@umich.eduImport('*')
442929Sktlim@umich.edu
452929Sktlim@umich.eduif env['TARGET_ISA'] == 'x86':
462929Sktlim@umich.edu    Source('cpuid.cc')
472929Sktlim@umich.edu    Source('decoder.cc')
482929Sktlim@umich.edu    Source('decoder_tables.cc')
492929Sktlim@umich.edu    Source('emulenv.cc')
502929Sktlim@umich.edu    Source('faults.cc')
512929Sktlim@umich.edu    Source('insts/badmicroop.cc')
522929Sktlim@umich.edu    Source('insts/microfpop.cc')
532929Sktlim@umich.edu    Source('insts/microldstop.cc')
542929Sktlim@umich.edu    Source('insts/micromediaop.cc')
552929Sktlim@umich.edu    Source('insts/microop.cc')
562929Sktlim@umich.edu    Source('insts/microregop.cc')
572929Sktlim@umich.edu    Source('insts/static_inst.cc')
582929Sktlim@umich.edu    Source('interrupts.cc')
592929Sktlim@umich.edu    Source('isa.cc')
602929Sktlim@umich.edu    Source('linux/linux.cc')
612929Sktlim@umich.edu    Source('linux/process.cc')
622929Sktlim@umich.edu    Source('linux/syscalls.cc')
632929Sktlim@umich.edu    Source('linux/system.cc')
643020Sstever@eecs.umich.edu    Source('nativetrace.cc')
653020Sstever@eecs.umich.edu    Source('pagetable.cc')
663020Sstever@eecs.umich.edu    Source('pagetable_walker.cc')
672929Sktlim@umich.edu    Source('process.cc')
682929Sktlim@umich.edu    Source('remote_gdb.cc')
693021Sstever@eecs.umich.edu    Source('stacktrace.cc')
702929Sktlim@umich.edu    Source('system.cc')
712929Sktlim@umich.edu    Source('tlb.cc')
722929Sktlim@umich.edu    Source('types.cc')
732929Sktlim@umich.edu    Source('utility.cc')
742929Sktlim@umich.edu    Source('vtophys.cc')
752929Sktlim@umich.edu
762929Sktlim@umich.edu    SimObject('X86ISA.py')
772929Sktlim@umich.edu    SimObject('X86LocalApic.py')
782929Sktlim@umich.edu    SimObject('X86NativeTrace.py')
792929Sktlim@umich.edu    SimObject('X86System.py')
802929Sktlim@umich.edu    SimObject('X86TLB.py')
812929Sktlim@umich.edu
822929Sktlim@umich.edu    DebugFlag('Faults', "Trace all faults/exceptions/traps")
832929Sktlim@umich.edu    DebugFlag('LocalApic', "Local APIC debugging")
842929Sktlim@umich.edu    DebugFlag('PageTableWalker', \
852929Sktlim@umich.edu              "Page table walker state machine debugging")
862929Sktlim@umich.edu    DebugFlag('Decoder', "Decoder debug output")
872929Sktlim@umich.edu    DebugFlag('X86', "Generic X86 ISA debugging")
882929Sktlim@umich.edu
892929Sktlim@umich.edu    python_files = (
902929Sktlim@umich.edu        '__init__.py',
912929Sktlim@umich.edu        'general_purpose/__init__.py',
922929Sktlim@umich.edu        'general_purpose/arithmetic/__init__.py',
932929Sktlim@umich.edu        'general_purpose/arithmetic/add_and_subtract.py',
942929Sktlim@umich.edu        'general_purpose/arithmetic/increment_and_decrement.py',
952929Sktlim@umich.edu        'general_purpose/arithmetic/multiply_and_divide.py',
962929Sktlim@umich.edu        'general_purpose/cache_and_memory_management.py',
972929Sktlim@umich.edu        'general_purpose/compare_and_test/__init__.py',
982929Sktlim@umich.edu        'general_purpose/compare_and_test/bit_scan.py',
992929Sktlim@umich.edu        'general_purpose/compare_and_test/bit_test.py',
1002929Sktlim@umich.edu        'general_purpose/compare_and_test/bounds.py',
1012929Sktlim@umich.edu        'general_purpose/compare_and_test/compare.py',
1022929Sktlim@umich.edu        'general_purpose/compare_and_test/set_byte_on_condition.py',
1032929Sktlim@umich.edu        'general_purpose/compare_and_test/test.py',
1042929Sktlim@umich.edu        'general_purpose/control_transfer/__init__.py',
1052929Sktlim@umich.edu        'general_purpose/control_transfer/call.py',
1062929Sktlim@umich.edu        'general_purpose/control_transfer/conditional_jump.py',
1072929Sktlim@umich.edu        'general_purpose/control_transfer/interrupts_and_exceptions.py',
1082929Sktlim@umich.edu        'general_purpose/control_transfer/jump.py',
1092929Sktlim@umich.edu        'general_purpose/control_transfer/loop.py',
1102929Sktlim@umich.edu        'general_purpose/control_transfer/xreturn.py',
1112929Sktlim@umich.edu        'general_purpose/data_conversion/__init__.py',
1122929Sktlim@umich.edu        'general_purpose/data_conversion/ascii_adjust.py',
1132929Sktlim@umich.edu        'general_purpose/data_conversion/bcd_adjust.py',
1142929Sktlim@umich.edu        'general_purpose/data_conversion/endian_conversion.py',
1152929Sktlim@umich.edu        'general_purpose/data_conversion/extract_sign_mask.py',
1162929Sktlim@umich.edu        'general_purpose/data_conversion/sign_extension.py',
1173701Sstever@eecs.umich.edu        'general_purpose/data_conversion/translate.py',
1182929Sktlim@umich.edu        'general_purpose/data_transfer/__init__.py',
1192929Sktlim@umich.edu        'general_purpose/data_transfer/conditional_move.py',
1202929Sktlim@umich.edu        'general_purpose/data_transfer/move.py',
1212929Sktlim@umich.edu        'general_purpose/data_transfer/stack_operations.py',
1222929Sktlim@umich.edu        'general_purpose/data_transfer/xchg.py',
1232929Sktlim@umich.edu        'general_purpose/flags/__init__.py',
1242929Sktlim@umich.edu        'general_purpose/flags/load_and_store.py',
1252929Sktlim@umich.edu        'general_purpose/flags/push_and_pop.py',
1262929Sktlim@umich.edu        'general_purpose/flags/set_and_clear.py',
1272929Sktlim@umich.edu        'general_purpose/input_output/__init__.py',
1282929Sktlim@umich.edu        'general_purpose/input_output/general_io.py',
1292929Sktlim@umich.edu        'general_purpose/input_output/string_io.py',
1302929Sktlim@umich.edu        'general_purpose/load_effective_address.py',
1312929Sktlim@umich.edu        'general_purpose/load_segment_registers.py',
1322929Sktlim@umich.edu        'general_purpose/logical.py',
1332929Sktlim@umich.edu        'general_purpose/no_operation.py',
1342929Sktlim@umich.edu        'general_purpose/rotate_and_shift/__init__.py',
1352929Sktlim@umich.edu        'general_purpose/rotate_and_shift/rotate.py',
1362929Sktlim@umich.edu        'general_purpose/rotate_and_shift/shift.py',
1372929Sktlim@umich.edu        'general_purpose/semaphores.py',
1382929Sktlim@umich.edu        'general_purpose/string/__init__.py',
1392929Sktlim@umich.edu        'general_purpose/string/compare_strings.py',
1402997Sstever@eecs.umich.edu        'general_purpose/string/load_string.py',
1412997Sstever@eecs.umich.edu        'general_purpose/string/move_string.py',
1422929Sktlim@umich.edu        'general_purpose/string/scan_string.py',
1432997Sstever@eecs.umich.edu        'general_purpose/string/store_string.py',
1442997Sstever@eecs.umich.edu        'general_purpose/system_calls.py',
1452929Sktlim@umich.edu        'romutil.py',
1462997Sstever@eecs.umich.edu        'system/__init__.py',
1472997Sstever@eecs.umich.edu        'system/control_registers.py',
1482997Sstever@eecs.umich.edu        'system/halt.py',
1492929Sktlim@umich.edu        'system/invlpg.py',
1502997Sstever@eecs.umich.edu        'system/undefined_operation.py',
1512997Sstever@eecs.umich.edu        'system/msrs.py',
1522997Sstever@eecs.umich.edu        'system/segmentation.py',
1532997Sstever@eecs.umich.edu        'simd128/__init__.py',
1542997Sstever@eecs.umich.edu        'simd128/integer/__init__.py',
1552997Sstever@eecs.umich.edu        'simd128/integer/data_transfer/__init__.py',
1562997Sstever@eecs.umich.edu        'simd128/integer/data_transfer/move.py',
1572997Sstever@eecs.umich.edu        'simd128/integer/data_transfer/move_non_temporal.py',
1582997Sstever@eecs.umich.edu        'simd128/integer/data_transfer/move_mask.py',
1592997Sstever@eecs.umich.edu        'simd128/integer/data_conversion/__init__.py',
1602997Sstever@eecs.umich.edu        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
1612997Sstever@eecs.umich.edu        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
1622997Sstever@eecs.umich.edu        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
1632997Sstever@eecs.umich.edu        'simd128/integer/data_reordering/__init__.py',
1642997Sstever@eecs.umich.edu        'simd128/integer/data_reordering/unpack_and_interleave.py',
1652997Sstever@eecs.umich.edu        'simd128/integer/data_reordering/pack_with_saturation.py',
1662997Sstever@eecs.umich.edu        'simd128/integer/data_reordering/extract_and_insert.py',
1672997Sstever@eecs.umich.edu        'simd128/integer/data_reordering/shuffle.py',
1682997Sstever@eecs.umich.edu        'simd128/integer/arithmetic/__init__.py',
1692997Sstever@eecs.umich.edu        'simd128/integer/arithmetic/subtraction.py',
1703045Sstever@eecs.umich.edu        'simd128/integer/arithmetic/addition.py',
1712997Sstever@eecs.umich.edu        'simd128/integer/arithmetic/multiplication.py',
1722997Sstever@eecs.umich.edu        'simd128/integer/arithmetic/multiply_add.py',
1732997Sstever@eecs.umich.edu        'simd128/integer/arithmetic/average.py',
1742953Sktlim@umich.edu        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
1752997Sstever@eecs.umich.edu        'simd128/integer/shift/__init__.py',
1764781Snate@binkert.org        'simd128/integer/shift/right_arithmetic_shift.py',
1772997Sstever@eecs.umich.edu        'simd128/integer/shift/left_logical_shift.py',
1782997Sstever@eecs.umich.edu        'simd128/integer/shift/right_logical_shift.py',
1792929Sktlim@umich.edu        'simd128/integer/compare/__init__.py',
1802997Sstever@eecs.umich.edu        'simd128/integer/compare/compare_and_write_mask.py',
1812997Sstever@eecs.umich.edu        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
1822997Sstever@eecs.umich.edu        'simd128/integer/logical/__init__.py',
1832997Sstever@eecs.umich.edu        'simd128/integer/logical/pand.py',
1842929Sktlim@umich.edu        'simd128/integer/logical/por.py',
1852997Sstever@eecs.umich.edu        'simd128/integer/logical/exclusive_or.py',
1862997Sstever@eecs.umich.edu        'simd128/integer/save_and_restore_state/__init__.py',
1872997Sstever@eecs.umich.edu        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
1882997Sstever@eecs.umich.edu        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
1892997Sstever@eecs.umich.edu        'simd128/floating_point/__init__.py',
1902997Sstever@eecs.umich.edu        'simd128/floating_point/data_transfer/__init__.py',
1912997Sstever@eecs.umich.edu        'simd128/floating_point/data_transfer/move_mask.py',
1922929Sktlim@umich.edu        'simd128/floating_point/data_transfer/move.py',
1932997Sstever@eecs.umich.edu        'simd128/floating_point/data_transfer/move_with_duplication.py',
1942929Sktlim@umich.edu        'simd128/floating_point/data_transfer/move_non_temporal.py',
1952929Sktlim@umich.edu        'simd128/floating_point/data_conversion/__init__.py',
1963005Sstever@eecs.umich.edu        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
1973005Sstever@eecs.umich.edu        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
1983005Sstever@eecs.umich.edu        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
1993005Sstever@eecs.umich.edu        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
2003005Sstever@eecs.umich.edu        'simd128/floating_point/data_reordering/__init__.py',
2013005Sstever@eecs.umich.edu        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
2023005Sstever@eecs.umich.edu        'simd128/floating_point/data_reordering/shuffle.py',
2033005Sstever@eecs.umich.edu        'simd128/floating_point/arithmetic/__init__.py',
2043691Shsul@eecs.umich.edu        'simd128/floating_point/arithmetic/subtraction.py',
2054781Snate@binkert.org        'simd128/floating_point/arithmetic/addition.py',
2064130Ssaidi@eecs.umich.edu        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
2074130Ssaidi@eecs.umich.edu        'simd128/floating_point/arithmetic/horizontal_addition.py',
2084130Ssaidi@eecs.umich.edu        'simd128/floating_point/arithmetic/square_root.py',
2093691Shsul@eecs.umich.edu        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
2103005Sstever@eecs.umich.edu        'simd128/floating_point/arithmetic/multiplication.py',
2114019Sstever@eecs.umich.edu        'simd128/floating_point/arithmetic/division.py',
2123005Sstever@eecs.umich.edu        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
2132929Sktlim@umich.edu        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
2142929Sktlim@umich.edu        'simd128/floating_point/compare/__init__.py',
2153005Sstever@eecs.umich.edu        'simd128/floating_point/compare/compare_and_write_mask.py',
2162997Sstever@eecs.umich.edu        'simd128/floating_point/compare/compare_and_write_rflags.py',
2172997Sstever@eecs.umich.edu        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
2182997Sstever@eecs.umich.edu        'simd128/floating_point/logical/__init__.py',
2192929Sktlim@umich.edu        'simd128/floating_point/logical/andp.py',
220        'simd128/floating_point/logical/orp.py',
221        '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        # Only non-header files need to be compiled.
316        if not f.path.endswith('.hh'):
317            Source(f)
318