SConscript revision 5765
12155SN/A# -*- mode:python -*- 22155SN/A 32155SN/A# Copyright (c) 2005-2006 The Regents of The University of Michigan 42155SN/A# All rights reserved. 52155SN/A# 62155SN/A# Redistribution and use in source and binary forms, with or without 72155SN/A# modification, are permitted provided that the following conditions are 82155SN/A# met: redistributions of source code must retain the above copyright 92155SN/A# notice, this list of conditions and the following disclaimer; 102155SN/A# redistributions in binary form must reproduce the above copyright 112155SN/A# notice, this list of conditions and the following disclaimer in the 122155SN/A# documentation and/or other materials provided with the distribution; 132155SN/A# neither the name of the copyright holders nor the names of its 142155SN/A# contributors may be used to endorse or promote products derived from 152155SN/A# this software without specific prior written permission. 162155SN/A# 172155SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 182155SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 192155SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 202155SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 212155SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 222155SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 232155SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 242155SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 252155SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 262155SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272155SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282665Ssaidi@eecs.umich.edu# 292665Ssaidi@eecs.umich.edu# Authors: Gabe Black 302155SN/A 312155SN/A# Copyright (c) 2007-2008 The Hewlett-Packard Development Company 322155SN/A# All rights reserved. 332155SN/A# 342155SN/A# Redistribution and use of this software in source and binary forms, 352155SN/A# with or without modification, are permitted provided that the 362155SN/A# following conditions are met: 372178SN/A# 382178SN/A# The software must be used only for Non-Commercial Use which means any 392178SN/A# use which is NOT directed to receiving any direct monetary 402178SN/A# compensation for, or commercial advantage from such use. Illustrative 412178SN/A# examples of non-commercial use are academic research, personal study, 422178SN/A# teaching, education and corporate research & development. 432178SN/A# Illustrative examples of commercial use are distributing products for 442178SN/A# commercial advantage and providing services using the software for 452178SN/A# commercial advantage. 462178SN/A# 472178SN/A# If you wish to use this software or functionality therein that may be 482178SN/A# covered by patents for commercial use, please contact: 492155SN/A# Director of Intellectual Property Licensing 502178SN/A# Office of Strategy and Technology 512155SN/A# Hewlett-Packard Company 522155SN/A# 1501 Page Mill Road 532178SN/A# Palo Alto, California 94304 542155SN/A# 552155SN/A# Redistributions of source code must retain the above copyright notice, 562623SN/A# this list of conditions and the following disclaimer. Redistributions 572623SN/A# in binary form must reproduce the above copyright notice, this list of 582623SN/A# conditions and the following disclaimer in the documentation and/or 592623SN/A# other materials provided with the distribution. Neither the name of 602623SN/A# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 612155SN/A# contributors may be used to endorse or promote products derived from 622155SN/A# this software without specific prior written permission. No right of 632292SN/A# sublicense is granted herewith. Derivatives of the software and 642292SN/A# output created using the software may be prepared, but only for 652292SN/A# Non-Commercial Uses. Derivatives of the software may be shared with 662292SN/A# others provided: (i) the others agree to abide by the list of 672292SN/A# conditions herein which includes the Non-Commercial Use restrictions; 682292SN/A# and (ii) such Derivatives of the software include the above copyright 692292SN/A# notice to acknowledge the contribution from this software where 702292SN/A# applicable, this list of conditions and the disclaimer below. 712766Sktlim@umich.edu# 722766Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 732766Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 742921Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 752921Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 762766Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 772766Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 782766Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 792178SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 802155SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 812155SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 822155SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 832155SN/A# 842155SN/A# Authors: Gabe Black 852155SN/A 862766Sktlim@umich.eduImport('*') 872155SN/A 882623SN/Aif env['TARGET_ISA'] == 'x86': 892155SN/A Source('cpuid.cc') 902155SN/A Source('emulenv.cc') 912155SN/A Source('floatregfile.cc') 922155SN/A Source('faults.cc') 932178SN/A Source('insts/microfpop.cc') 942178SN/A Source('insts/microldstop.cc') 952178SN/A Source('insts/microop.cc') 962766Sktlim@umich.edu Source('insts/microregop.cc') 972178SN/A Source('insts/static_inst.cc') 982178SN/A Source('intregfile.cc') 992178SN/A Source('miscregfile.cc') 1002178SN/A Source('pagetable.cc') 1012766Sktlim@umich.edu Source('predecoder.cc') 1022766Sktlim@umich.edu Source('predecoder_tables.cc') 1032766Sktlim@umich.edu Source('regfile.cc') 1042788Sktlim@umich.edu Source('remote_gdb.cc') 1052178SN/A Source('tlb.cc') 1062733Sktlim@umich.edu Source('utility.cc') 1072733Sktlim@umich.edu 1082817Sksewell@umich.edu SimObject('X86TLB.py') 1092733Sktlim@umich.edu TraceFlag('Predecoder') 1102178SN/A TraceFlag('X86') 1112178SN/A 1122178SN/A if env['FULL_SYSTEM']: 1132178SN/A TraceFlag('LocalApic') 1142178SN/A 1152178SN/A SimObject('X86LocalApic.py') 1162155SN/A SimObject('X86System.py') 1172929Sktlim@umich.edu 1182929Sktlim@umich.edu # Full-system sources 1192929Sktlim@umich.edu Source('interrupts.cc') 1202155SN/A Source('linux/system.cc') 1212155SN/A Source('pagetable_walker.cc') 1222623SN/A Source('system.cc') 1232623SN/A Source('stacktrace.cc') 1242623SN/A Source('vtophys.cc') 1252623SN/A else: 1262623SN/A Source('process.cc') 1272623SN/A 1282623SN/A Source('linux/linux.cc') 1292623SN/A Source('linux/process.cc') 1302623SN/A Source('linux/syscalls.cc') 1312623SN/A 1322623SN/A python_files = ( 1332155SN/A '__init__.py', 1342155SN/A 'general_purpose/__init__.py', 1352155SN/A 'general_purpose/arithmetic/__init__.py', 1362155SN/A 'general_purpose/arithmetic/add_and_subtract.py', 1372821Sktlim@umich.edu 'general_purpose/arithmetic/increment_and_decrement.py', 1382817Sksewell@umich.edu 'general_purpose/arithmetic/multiply_and_divide.py', 1392821Sktlim@umich.edu 'general_purpose/cache_and_memory_management.py', 1402817Sksewell@umich.edu 'general_purpose/compare_and_test/__init__.py', 1412155SN/A 'general_purpose/compare_and_test/bit_scan.py', 1422765Sktlim@umich.edu 'general_purpose/compare_and_test/bit_test.py', 1432155SN/A 'general_purpose/compare_and_test/bounds.py', 1442155SN/A 'general_purpose/compare_and_test/compare.py', 1452155SN/A 'general_purpose/compare_and_test/set_byte_on_condition.py', 1462155SN/A 'general_purpose/compare_and_test/test.py', 1472155SN/A 'general_purpose/control_transfer/__init__.py', 1482292SN/A 'general_purpose/control_transfer/call.py', 1492155SN/A 'general_purpose/control_transfer/conditional_jump.py', 1502155SN/A 'general_purpose/control_transfer/interrupts_and_exceptions.py', 1512155SN/A 'general_purpose/control_transfer/jump.py', 1522292SN/A 'general_purpose/control_transfer/loop.py', 1532292SN/A 'general_purpose/control_transfer/xreturn.py', 1542155SN/A 'general_purpose/data_conversion/__init__.py', 1552155SN/A 'general_purpose/data_conversion/ascii_adjust.py', 1562155SN/A 'general_purpose/data_conversion/bcd_adjust.py', 1572155SN/A 'general_purpose/data_conversion/endian_conversion.py', 1582292SN/A 'general_purpose/data_conversion/extract_sign_mask.py', 1592155SN/A 'general_purpose/data_conversion/sign_extension.py', 1602155SN/A 'general_purpose/data_conversion/translate.py', 1612766Sktlim@umich.edu 'general_purpose/data_transfer/__init__.py', 1622765Sktlim@umich.edu 'general_purpose/data_transfer/conditional_move.py', 1632932Sktlim@umich.edu 'general_purpose/data_transfer/move.py', 1642932Sktlim@umich.edu 'general_purpose/data_transfer/stack_operations.py', 1652155SN/A 'general_purpose/data_transfer/xchg.py', 1662792Sktlim@umich.edu 'general_purpose/flags/__init__.py', 1672821Sktlim@umich.edu 'general_purpose/flags/load_and_store.py', 1682292SN/A 'general_purpose/flags/push_and_pop.py', 1692792Sktlim@umich.edu 'general_purpose/flags/set_and_clear.py', 1702792Sktlim@umich.edu 'general_purpose/input_output/__init__.py', 1712292SN/A 'general_purpose/input_output/general_io.py', 1722292SN/A 'general_purpose/input_output/string_io.py', 1732292SN/A 'general_purpose/load_effective_address.py', 1742292SN/A 'general_purpose/load_segment_registers.py', 1752297SN/A 'general_purpose/logical.py', 1762297SN/A 'general_purpose/no_operation.py', 1772792Sktlim@umich.edu 'general_purpose/rotate_and_shift/__init__.py', 1782292SN/A 'general_purpose/rotate_and_shift/rotate.py', 1792766Sktlim@umich.edu 'general_purpose/rotate_and_shift/shift.py', 1802765Sktlim@umich.edu 'general_purpose/semaphores.py', 1812292SN/A 'general_purpose/string/__init__.py', 1822821Sktlim@umich.edu 'general_purpose/string/compare_strings.py', 1832821Sktlim@umich.edu 'general_purpose/string/load_string.py', 1842821Sktlim@umich.edu 'general_purpose/string/move_string.py', 1852821Sktlim@umich.edu 'general_purpose/string/scan_string.py', 1862821Sktlim@umich.edu 'general_purpose/string/store_string.py', 1872821Sktlim@umich.edu 'general_purpose/system_calls.py', 1882821Sktlim@umich.edu 'romutil.py', 1892821Sktlim@umich.edu 'system/__init__.py', 1902766Sktlim@umich.edu 'system/halt.py', 1912789Sktlim@umich.edu 'system/invlpg.py', 1922733Sktlim@umich.edu 'system/undefined_operation.py', 1932733Sktlim@umich.edu 'system/msrs.py', 1942733Sktlim@umich.edu 'system/segmentation.py', 1952733Sktlim@umich.edu 'simd128/__init__.py', 1962733Sktlim@umich.edu 'simd128/integer/__init__.py', 1972874Sktlim@umich.edu 'simd128/integer/data_transfer/__init__.py', 1982874Sktlim@umich.edu 'simd128/integer/data_transfer/move.py', 1992874Sktlim@umich.edu 'simd128/integer/data_transfer/move_non_temporal.py', 2002874Sktlim@umich.edu 'simd128/integer/data_transfer/move_mask.py', 2012733Sktlim@umich.edu 'simd128/integer/data_conversion/__init__.py', 2022733Sktlim@umich.edu 'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py', 2032315SN/A 'simd128/integer/data_conversion/convert_integer_to_floating_point.py', 2042761Sstever@eecs.umich.edu 'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py', 2052155SN/A 'simd128/integer/data_reordering/__init__.py', 2062155SN/A 'simd128/integer/data_reordering/unpack_and_interleave.py', 2072155SN/A 'simd128/integer/data_reordering/pack_with_saturation.py', 2082155SN/A 'simd128/integer/data_reordering/extract_and_insert.py', 2092155SN/A 'simd128/integer/data_reordering/shuffle.py', 2102155SN/A 'simd128/integer/arithmetic/__init__.py', 2112155SN/A 'simd128/integer/arithmetic/subtraction.py', 2122155SN/A 'simd128/integer/arithmetic/addition.py', 213 'simd128/integer/arithmetic/multiplication.py', 214 'simd128/integer/arithmetic/multiply_add.py', 215 'simd128/integer/arithmetic/average.py', 216 'simd128/integer/arithmetic/sum_of_absolute_differences.py', 217 'simd128/integer/shift/__init__.py', 218 'simd128/integer/shift/right_arithmetic_shift.py', 219 'simd128/integer/shift/left_logical_shift.py', 220 'simd128/integer/shift/right_logical_shift.py', 221 'simd128/integer/compare/__init__.py', 222 'simd128/integer/compare/compare_and_write_mask.py', 223 'simd128/integer/compare/compare_and_write_minimum_or_maximum.py', 224 'simd128/integer/logical/__init__.py', 225 'simd128/integer/logical/pand.py', 226 'simd128/integer/logical/por.py', 227 'simd128/integer/logical/exclusive_or.py', 228 'simd128/integer/save_and_restore_state/__init__.py', 229 'simd128/integer/save_and_restore_state/save_and_restore_state.py', 230 'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py', 231 'simd128/floating_point/__init__.py', 232 'simd128/floating_point/data_transfer/__init__.py', 233 'simd128/floating_point/data_transfer/move_mask.py', 234 'simd128/floating_point/data_transfer/move.py', 235 'simd128/floating_point/data_transfer/move_with_duplication.py', 236 'simd128/floating_point/data_transfer/move_non_temporal.py', 237 'simd128/floating_point/data_conversion/__init__.py', 238 'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py', 239 'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py', 240 'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py', 241 'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py', 242 'simd128/floating_point/data_reordering/__init__.py', 243 'simd128/floating_point/data_reordering/unpack_and_interleave.py', 244 'simd128/floating_point/data_reordering/shuffle.py', 245 'simd128/floating_point/arithmetic/__init__.py', 246 'simd128/floating_point/arithmetic/subtraction.py', 247 'simd128/floating_point/arithmetic/addition.py', 248 'simd128/floating_point/arithmetic/horizontal_subtraction.py', 249 'simd128/floating_point/arithmetic/horizontal_addition.py', 250 'simd128/floating_point/arithmetic/square_root.py', 251 'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py', 252 'simd128/floating_point/arithmetic/multiplication.py', 253 'simd128/floating_point/arithmetic/division.py', 254 'simd128/floating_point/arithmetic/reciprocal_square_root.py', 255 'simd128/floating_point/arithmetic/reciprocal_estimation.py', 256 'simd128/floating_point/compare/__init__.py', 257 'simd128/floating_point/compare/compare_and_write_mask.py', 258 'simd128/floating_point/compare/compare_and_write_rflags.py', 259 'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py', 260 'simd128/floating_point/logical/__init__.py', 261 'simd128/floating_point/logical/andp.py', 262 'simd128/floating_point/logical/orp.py', 263 'simd128/floating_point/logical/exclusive_or.py', 264 'simd64/__init__.py', 265 'simd64/integer/__init__.py', 266 'simd64/integer/data_transfer/__init__.py', 267 'simd64/integer/data_transfer/move_mask.py', 268 'simd64/integer/data_transfer/move.py', 269 'simd64/integer/data_transfer/move_non_temporal.py', 270 'simd64/integer/exit_media_state.py', 271 'simd64/integer/data_reordering/__init__.py', 272 'simd64/integer/data_reordering/unpack_and_interleave.py', 273 'simd64/integer/data_reordering/pack_with_saturation.py', 274 'simd64/integer/data_reordering/extract_and_insert.py', 275 'simd64/integer/data_reordering/shuffle_and_swap.py', 276 'simd64/integer/data_conversion.py', 277 'simd64/integer/arithmetic/__init__.py', 278 'simd64/integer/arithmetic/subtraction.py', 279 'simd64/integer/arithmetic/addition.py', 280 'simd64/integer/arithmetic/multiplication.py', 281 'simd64/integer/arithmetic/multiply_add.py', 282 'simd64/integer/arithmetic/average.py', 283 'simd64/integer/arithmetic/sum_of_absolute_differences.py', 284 'simd64/integer/shift/__init__.py', 285 'simd64/integer/shift/right_arithmetic_shift.py', 286 'simd64/integer/shift/left_logical_shift.py', 287 'simd64/integer/shift/right_logical_shift.py', 288 'simd64/integer/compare/__init__.py', 289 'simd64/integer/compare/compare_and_write_mask.py', 290 'simd64/integer/compare/compare_and_write_minimum_or_maximum.py', 291 'simd64/integer/logical/__init__.py', 292 'simd64/integer/logical/pand.py', 293 'simd64/integer/logical/por.py', 294 'simd64/integer/logical/exclusive_or.py', 295 'simd64/integer/save_and_restore_state.py', 296 'simd64/floating_point/__init__.py', 297 'simd64/floating_point/arithmetic/__init__.py', 298 'simd64/floating_point/arithmetic/subtraction.py', 299 'simd64/floating_point/arithmetic/addition.py', 300 'simd64/floating_point/arithmetic/reciprocal_estimation.py', 301 'simd64/floating_point/arithmetic/multiplication.py', 302 'simd64/floating_point/arithmetic/accumulation.py', 303 'simd64/floating_point/arithmetic/reciprocal_square_root.py', 304 'simd64/floating_point/data_conversion.py', 305 'simd64/floating_point/compare/__init__.py', 306 'simd64/floating_point/compare/compare_and_write_mask.py', 307 'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py', 308 'x87/__init__.py', 309 'x87/data_transfer_and_conversion/__init__.py', 310 'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py', 311 'x87/data_transfer_and_conversion/load_or_store_floating_point.py', 312 'x87/data_transfer_and_conversion/exchange.py', 313 'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py', 314 'x87/data_transfer_and_conversion/conditional_move.py', 315 'x87/data_transfer_and_conversion/extract.py', 316 'x87/load_constants/__init__.py', 317 'x87/load_constants/load_0_1_or_pi.py', 318 'x87/load_constants/load_logarithm.py', 319 'x87/arithmetic/__init__.py', 320 'x87/arithmetic/subtraction.py', 321 'x87/arithmetic/addition.py', 322 'x87/arithmetic/partial_remainder.py', 323 'x87/arithmetic/multiplication.py', 324 'x87/arithmetic/division.py', 325 'x87/arithmetic/change_sign.py', 326 'x87/arithmetic/round.py', 327 'x87/arithmetic/square_root.py', 328 'x87/transcendental_functions/__init__.py', 329 'x87/transcendental_functions/trigonometric_functions.py', 330 'x87/transcendental_functions/logarithmic_functions.py', 331 'x87/compare_and_test/__init__.py', 332 'x87/compare_and_test/classify.py', 333 'x87/compare_and_test/test.py', 334 'x87/compare_and_test/floating_point_ordered_compare.py', 335 'x87/compare_and_test/floating_point_unordered_compare.py', 336 'x87/compare_and_test/integer_compare.py', 337 'x87/stack_management/__init__.py', 338 'x87/stack_management/stack_control.py', 339 'x87/stack_management/clear_state.py', 340 'x87/control/__init__.py', 341 'x87/control/clear_exceptions.py', 342 'x87/control/initialize.py', 343 'x87/control/wait_for_exceptions.py', 344 'x87/control/save_x87_status_word.py', 345 'x87/control/save_and_restore_x87_control_word.py', 346 'x87/control/save_and_restore_x87_environment.py', 347 'x87/no_operation.py' 348 ) 349 350 351 # Add in files generated by the ISA description. 352 isa_desc_files = env.ISADesc('isa/main.isa') 353 for f in isa_desc_files: 354 # Add in python file dependencies that won't be caught otherwise 355 for pyfile in python_files: 356 env.Depends(f, "isa/insts/%s" % pyfile) 357 # Only non-header files need to be compiled. 358 if not f.path.endswith('.hh'): 359 Source(f) 360 361 # Workaround for bug in SCons version > 0.97d20071212 362 # Scons bug id: 2006 M5 Bug id: 308 363 from os.path import dirname, join as joinpath 364 365 Dir('isa') 366 Dir('isa/microops') 367 Dir('isa/decoder') 368 Dir('isa/formats') 369 Dir('isa/insts') 370 isa_dirs = set(map(lambda x:dirname(x), python_files)) 371 for d in isa_dirs: 372 Dir(joinpath('isa/insts', d)) 373 374