SConscript revision 5525
16145Snate@binkert.org# -*- mode:python -*- 26145Snate@binkert.org 36145Snate@binkert.org# Copyright (c) 2005-2006 The Regents of The University of Michigan 46145Snate@binkert.org# All rights reserved. 56145Snate@binkert.org# 66145Snate@binkert.org# Redistribution and use in source and binary forms, with or without 76145Snate@binkert.org# modification, are permitted provided that the following conditions are 86145Snate@binkert.org# met: redistributions of source code must retain the above copyright 96145Snate@binkert.org# notice, this list of conditions and the following disclaimer; 106145Snate@binkert.org# redistributions in binary form must reproduce the above copyright 116145Snate@binkert.org# notice, this list of conditions and the following disclaimer in the 126145Snate@binkert.org# documentation and/or other materials provided with the distribution; 136145Snate@binkert.org# neither the name of the copyright holders nor the names of its 146145Snate@binkert.org# contributors may be used to endorse or promote products derived from 156145Snate@binkert.org# this software without specific prior written permission. 166145Snate@binkert.org# 176145Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 186145Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 196145Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 206145Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 216145Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 226145Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 236145Snate@binkert.org# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 246145Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 256145Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 266145Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 276145Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 286145Snate@binkert.org# 296145Snate@binkert.org# Authors: Gabe Black 307054Snate@binkert.org 317054Snate@binkert.org# Copyright (c) 2007-2008 The Hewlett-Packard Development Company 327054Snate@binkert.org# All rights reserved. 337054Snate@binkert.org# 347054Snate@binkert.org# Redistribution and use of this software in source and binary forms, 357054Snate@binkert.org# with or without modification, are permitted provided that the 366145Snate@binkert.org# following conditions are met: 376145Snate@binkert.org# 387054Snate@binkert.org# The software must be used only for Non-Commercial Use which means any 397054Snate@binkert.org# use which is NOT directed to receiving any direct monetary 406145Snate@binkert.org# compensation for, or commercial advantage from such use. Illustrative 416154Snate@binkert.org# examples of non-commercial use are academic research, personal study, 426154Snate@binkert.org# teaching, education and corporate research & development. 437054Snate@binkert.org# Illustrative examples of commercial use are distributing products for 447054Snate@binkert.org# commercial advantage and providing services using the software for 456154Snate@binkert.org# commercial advantage. 466285Snate@binkert.org# 476145Snate@binkert.org# If you wish to use this software or functionality therein that may be 486145Snate@binkert.org# covered by patents for commercial use, please contact: 496145Snate@binkert.org# Director of Intellectual Property Licensing 507054Snate@binkert.org# Office of Strategy and Technology 517054Snate@binkert.org# Hewlett-Packard Company 527054Snate@binkert.org# 1501 Page Mill Road 537054Snate@binkert.org# Palo Alto, California 94304 547054Snate@binkert.org# 557054Snate@binkert.org# Redistributions of source code must retain the above copyright notice, 567054Snate@binkert.org# this list of conditions and the following disclaimer. Redistributions 576145Snate@binkert.org# in binary form must reproduce the above copyright notice, this list of 587054Snate@binkert.org# conditions and the following disclaimer in the documentation and/or 597054Snate@binkert.org# other materials provided with the distribution. Neither the name of 607054Snate@binkert.org# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 616145Snate@binkert.org# contributors may be used to endorse or promote products derived from 627054Snate@binkert.org# this software without specific prior written permission. No right of 637054Snate@binkert.org# sublicense is granted herewith. Derivatives of the software and 647054Snate@binkert.org# output created using the software may be prepared, but only for 657054Snate@binkert.org# Non-Commercial Uses. Derivatives of the software may be shared with 667054Snate@binkert.org# others provided: (i) the others agree to abide by the list of 677054Snate@binkert.org# conditions herein which includes the Non-Commercial Use restrictions; 687054Snate@binkert.org# and (ii) such Derivatives of the software include the above copyright 697054Snate@binkert.org# notice to acknowledge the contribution from this software where 707054Snate@binkert.org# applicable, this list of conditions and the disclaimer below. 717054Snate@binkert.org# 727054Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 737054Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 746145Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 757054Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 767054Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 777054Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 787054Snate@binkert.org# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 797054Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 806145Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 817054Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 826145Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 837054Snate@binkert.org# 846145Snate@binkert.org# Authors: Gabe Black 857054Snate@binkert.org 867054Snate@binkert.orgImport('*') 877054Snate@binkert.org 887054Snate@binkert.orgif env['TARGET_ISA'] == 'x86': 896145Snate@binkert.org Source('emulenv.cc') 907054Snate@binkert.org Source('floatregfile.cc') 917054Snate@binkert.org Source('faults.cc') 927054Snate@binkert.org Source('insts/microfpop.cc') 936145Snate@binkert.org Source('insts/microldstop.cc') 947054Snate@binkert.org Source('insts/microop.cc') 957054Snate@binkert.org Source('insts/microregop.cc') 967054Snate@binkert.org Source('insts/static_inst.cc') 977054Snate@binkert.org Source('intregfile.cc') 987054Snate@binkert.org Source('miscregfile.cc') 997054Snate@binkert.org Source('pagetable.cc') 1007054Snate@binkert.org Source('predecoder.cc') 1017054Snate@binkert.org Source('predecoder_tables.cc') 1027054Snate@binkert.org Source('regfile.cc') 1037054Snate@binkert.org Source('remote_gdb.cc') 1046145Snate@binkert.org Source('tlb.cc') 1057054Snate@binkert.org Source('utility.cc') 1067054Snate@binkert.org 1077054Snate@binkert.org SimObject('X86TLB.py') 1086145Snate@binkert.org TraceFlag('Predecoder') 1096145Snate@binkert.org TraceFlag('X86') 1107054Snate@binkert.org 1117054Snate@binkert.org if env['FULL_SYSTEM']: 1126145Snate@binkert.org SimObject('X86System.py') 1137054Snate@binkert.org SimObject('bios/E820.py') 1147054Snate@binkert.org 1157054Snate@binkert.org # Full-system sources 1166145Snate@binkert.org Source('bios/e820.cc') 1176145Snate@binkert.org Source('linux/system.cc') 1187054Snate@binkert.org Source('pagetable_walker.cc') 119 Source('smbios.cc') 120 Source('system.cc') 121 Source('stacktrace.cc') 122 Source('vtophys.cc') 123 else: 124 Source('process.cc') 125 126 Source('linux/linux.cc') 127 Source('linux/process.cc') 128 Source('linux/syscalls.cc') 129 130 python_files = ( 131 '__init__.py', 132 'general_purpose/__init__.py', 133 'general_purpose/arithmetic/__init__.py', 134 'general_purpose/arithmetic/add_and_subtract.py', 135 'general_purpose/arithmetic/increment_and_decrement.py', 136 'general_purpose/arithmetic/multiply_and_divide.py', 137 'general_purpose/cache_and_memory_management.py', 138 'general_purpose/compare_and_test/__init__.py', 139 'general_purpose/compare_and_test/bit_scan.py', 140 'general_purpose/compare_and_test/bit_test.py', 141 'general_purpose/compare_and_test/bounds.py', 142 'general_purpose/compare_and_test/compare.py', 143 'general_purpose/compare_and_test/set_byte_on_condition.py', 144 'general_purpose/compare_and_test/test.py', 145 'general_purpose/control_transfer/__init__.py', 146 'general_purpose/control_transfer/call.py', 147 'general_purpose/control_transfer/conditional_jump.py', 148 'general_purpose/control_transfer/interrupts_and_exceptions.py', 149 'general_purpose/control_transfer/jump.py', 150 'general_purpose/control_transfer/loop.py', 151 'general_purpose/control_transfer/xreturn.py', 152 'general_purpose/data_conversion/__init__.py', 153 'general_purpose/data_conversion/ascii_adjust.py', 154 'general_purpose/data_conversion/bcd_adjust.py', 155 'general_purpose/data_conversion/endian_conversion.py', 156 'general_purpose/data_conversion/extract_sign_mask.py', 157 'general_purpose/data_conversion/sign_extension.py', 158 'general_purpose/data_conversion/translate.py', 159 'general_purpose/data_transfer/__init__.py', 160 'general_purpose/data_transfer/conditional_move.py', 161 'general_purpose/data_transfer/move.py', 162 'general_purpose/data_transfer/stack_operations.py', 163 'general_purpose/data_transfer/xchg.py', 164 'general_purpose/flags/__init__.py', 165 'general_purpose/flags/load_and_store.py', 166 'general_purpose/flags/push_and_pop.py', 167 'general_purpose/flags/set_and_clear.py', 168 'general_purpose/input_output/__init__.py', 169 'general_purpose/input_output/general_io.py', 170 'general_purpose/input_output/string_io.py', 171 'general_purpose/load_effective_address.py', 172 'general_purpose/load_segment_registers.py', 173 'general_purpose/logical.py', 174 'general_purpose/no_operation.py', 175 'general_purpose/processor_information.py', 176 'general_purpose/rotate_and_shift/__init__.py', 177 'general_purpose/rotate_and_shift/rotate.py', 178 'general_purpose/rotate_and_shift/shift.py', 179 'general_purpose/semaphores.py', 180 'general_purpose/string/__init__.py', 181 'general_purpose/string/compare_strings.py', 182 'general_purpose/string/load_string.py', 183 'general_purpose/string/move_string.py', 184 'general_purpose/string/scan_string.py', 185 'general_purpose/string/store_string.py', 186 'general_purpose/system_calls.py', 187 'system/__init__.py', 188 'system/halt.py', 189 'system/invlpg.py', 190 'system/undefined_operation.py', 191 'system/msrs.py', 192 'system/segmentation.py', 193 'simd128/__init__.py', 194 'simd128/integer/__init__.py', 195 'simd128/integer/data_transfer/__init__.py', 196 'simd128/integer/data_transfer/move.py', 197 'simd128/integer/data_transfer/move_non_temporal.py', 198 'simd128/integer/data_transfer/move_mask.py', 199 'simd128/integer/data_conversion/__init__.py', 200 'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py', 201 'simd128/integer/data_conversion/convert_integer_to_floating_point.py', 202 'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py', 203 'simd128/integer/data_reordering/__init__.py', 204 'simd128/integer/data_reordering/unpack_and_interleave.py', 205 'simd128/integer/data_reordering/pack_with_saturation.py', 206 'simd128/integer/data_reordering/extract_and_insert.py', 207 'simd128/integer/data_reordering/shuffle.py', 208 'simd128/integer/arithmetic/__init__.py', 209 'simd128/integer/arithmetic/subtraction.py', 210 'simd128/integer/arithmetic/addition.py', 211 'simd128/integer/arithmetic/multiplication.py', 212 'simd128/integer/arithmetic/multiply_add.py', 213 'simd128/integer/arithmetic/average.py', 214 'simd128/integer/arithmetic/sum_of_absolute_differences.py', 215 'simd128/integer/shift/__init__.py', 216 'simd128/integer/shift/right_arithmetic_shift.py', 217 'simd128/integer/shift/left_logical_shift.py', 218 'simd128/integer/shift/right_logical_shift.py', 219 'simd128/integer/compare/__init__.py', 220 'simd128/integer/compare/compare_and_write_mask.py', 221 'simd128/integer/compare/compare_and_write_minimum_or_maximum.py', 222 'simd128/integer/logical/__init__.py', 223 'simd128/integer/logical/pand.py', 224 'simd128/integer/logical/por.py', 225 'simd128/integer/logical/exclusive_or.py', 226 'simd128/integer/save_and_restore_state/__init__.py', 227 'simd128/integer/save_and_restore_state/save_and_restore_state.py', 228 'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py', 229 'simd128/floating_point/__init__.py', 230 'simd128/floating_point/data_transfer/__init__.py', 231 'simd128/floating_point/data_transfer/move_mask.py', 232 'simd128/floating_point/data_transfer/move.py', 233 'simd128/floating_point/data_transfer/move_with_duplication.py', 234 'simd128/floating_point/data_transfer/move_non_temporal.py', 235 'simd128/floating_point/data_conversion/__init__.py', 236 'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py', 237 'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py', 238 'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py', 239 'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py', 240 'simd128/floating_point/data_reordering/__init__.py', 241 'simd128/floating_point/data_reordering/unpack_and_interleave.py', 242 'simd128/floating_point/data_reordering/shuffle.py', 243 'simd128/floating_point/arithmetic/__init__.py', 244 'simd128/floating_point/arithmetic/subtraction.py', 245 'simd128/floating_point/arithmetic/addition.py', 246 'simd128/floating_point/arithmetic/horizontal_subtraction.py', 247 'simd128/floating_point/arithmetic/horizontal_addition.py', 248 'simd128/floating_point/arithmetic/square_root.py', 249 'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py', 250 'simd128/floating_point/arithmetic/multiplication.py', 251 'simd128/floating_point/arithmetic/division.py', 252 'simd128/floating_point/arithmetic/reciprocal_square_root.py', 253 'simd128/floating_point/arithmetic/reciprocal_estimation.py', 254 'simd128/floating_point/compare/__init__.py', 255 'simd128/floating_point/compare/compare_and_write_mask.py', 256 'simd128/floating_point/compare/compare_and_write_rflags.py', 257 'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py', 258 'simd128/floating_point/logical/__init__.py', 259 'simd128/floating_point/logical/andp.py', 260 'simd128/floating_point/logical/orp.py', 261 'simd128/floating_point/logical/exclusive_or.py', 262 'simd64/__init__.py', 263 'simd64/integer/__init__.py', 264 'simd64/integer/data_transfer/__init__.py', 265 'simd64/integer/data_transfer/move_mask.py', 266 'simd64/integer/data_transfer/move.py', 267 'simd64/integer/data_transfer/move_non_temporal.py', 268 'simd64/integer/exit_media_state.py', 269 'simd64/integer/data_reordering/__init__.py', 270 'simd64/integer/data_reordering/unpack_and_interleave.py', 271 'simd64/integer/data_reordering/pack_with_saturation.py', 272 'simd64/integer/data_reordering/extract_and_insert.py', 273 'simd64/integer/data_reordering/shuffle_and_swap.py', 274 'simd64/integer/data_conversion.py', 275 'simd64/integer/arithmetic/__init__.py', 276 'simd64/integer/arithmetic/subtraction.py', 277 'simd64/integer/arithmetic/addition.py', 278 'simd64/integer/arithmetic/multiplication.py', 279 'simd64/integer/arithmetic/multiply_add.py', 280 'simd64/integer/arithmetic/average.py', 281 'simd64/integer/arithmetic/sum_of_absolute_differences.py', 282 'simd64/integer/shift/__init__.py', 283 'simd64/integer/shift/right_arithmetic_shift.py', 284 'simd64/integer/shift/left_logical_shift.py', 285 'simd64/integer/shift/right_logical_shift.py', 286 'simd64/integer/compare/__init__.py', 287 'simd64/integer/compare/compare_and_write_mask.py', 288 'simd64/integer/compare/compare_and_write_minimum_or_maximum.py', 289 'simd64/integer/logical/__init__.py', 290 'simd64/integer/logical/pand.py', 291 'simd64/integer/logical/por.py', 292 'simd64/integer/logical/exclusive_or.py', 293 'simd64/integer/save_and_restore_state.py', 294 'simd64/floating_point/__init__.py', 295 'simd64/floating_point/arithmetic/__init__.py', 296 'simd64/floating_point/arithmetic/subtraction.py', 297 'simd64/floating_point/arithmetic/addition.py', 298 'simd64/floating_point/arithmetic/reciprocal_estimation.py', 299 'simd64/floating_point/arithmetic/multiplication.py', 300 'simd64/floating_point/arithmetic/accumulation.py', 301 'simd64/floating_point/arithmetic/reciprocal_square_root.py', 302 'simd64/floating_point/data_conversion.py', 303 'simd64/floating_point/compare/__init__.py', 304 'simd64/floating_point/compare/compare_and_write_mask.py', 305 'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py', 306 'x87/__init__.py', 307 'x87/data_transfer_and_conversion/__init__.py', 308 'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py', 309 'x87/data_transfer_and_conversion/load_or_store_floating_point.py', 310 'x87/data_transfer_and_conversion/exchange.py', 311 'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py', 312 'x87/data_transfer_and_conversion/conditional_move.py', 313 'x87/data_transfer_and_conversion/extract.py', 314 'x87/load_constants/__init__.py', 315 'x87/load_constants/load_0_1_or_pi.py', 316 'x87/load_constants/load_logarithm.py', 317 'x87/arithmetic/__init__.py', 318 'x87/arithmetic/subtraction.py', 319 'x87/arithmetic/addition.py', 320 'x87/arithmetic/partial_remainder.py', 321 'x87/arithmetic/multiplication.py', 322 'x87/arithmetic/division.py', 323 'x87/arithmetic/change_sign.py', 324 'x87/arithmetic/round.py', 325 'x87/arithmetic/square_root.py', 326 'x87/transcendental_functions/__init__.py', 327 'x87/transcendental_functions/trigonometric_functions.py', 328 'x87/transcendental_functions/logarithmic_functions.py', 329 'x87/compare_and_test/__init__.py', 330 'x87/compare_and_test/classify.py', 331 'x87/compare_and_test/test.py', 332 'x87/compare_and_test/floating_point_ordered_compare.py', 333 'x87/compare_and_test/floating_point_unordered_compare.py', 334 'x87/compare_and_test/integer_compare.py', 335 'x87/stack_management/__init__.py', 336 'x87/stack_management/stack_control.py', 337 'x87/stack_management/clear_state.py', 338 'x87/control/__init__.py', 339 'x87/control/clear_exceptions.py', 340 'x87/control/initialize.py', 341 'x87/control/wait_for_exceptions.py', 342 'x87/control/save_x87_status_word.py', 343 'x87/control/save_and_restore_x87_control_word.py', 344 'x87/control/save_and_restore_x87_environment.py', 345 'x87/no_operation.py' 346 ) 347 348 349 # Add in files generated by the ISA description. 350 isa_desc_files = env.ISADesc('isa/main.isa') 351 for f in isa_desc_files: 352 # Add in python file dependencies that won't be caught otherwise 353 for pyfile in python_files: 354 env.Depends(f, "isa/insts/%s" % pyfile) 355 # Only non-header files need to be compiled. 356 if not f.path.endswith('.hh'): 357 Source(f) 358 359 # Workaround for bug in SCons version > 0.97d20071212 360 # Scons bug id: 2006 M5 Bug id: 308 361 from os.path import dirname, join as joinpath 362 363 Dir('isa') 364 Dir('isa/microops') 365 Dir('isa/decoder') 366 Dir('isa/formats') 367 Dir('isa/insts') 368 isa_dirs = set(map(lambda x:dirname(x), python_files)) 369 for d in isa_dirs: 370 Dir(joinpath('isa/insts', d)) 371 372