SConscript revision 5083
14202Sbinkertn@umich.edu# -*- mode:python -*-
212966SMatteo.Andreozzi@arm.com
312966SMatteo.Andreozzi@arm.com# Copyright (c) 2005-2006 The Regents of The University of Michigan
412966SMatteo.Andreozzi@arm.com# All rights reserved.
512966SMatteo.Andreozzi@arm.com#
612966SMatteo.Andreozzi@arm.com# Redistribution and use in source and binary forms, with or without
712966SMatteo.Andreozzi@arm.com# modification, are permitted provided that the following conditions are
812966SMatteo.Andreozzi@arm.com# met: redistributions of source code must retain the above copyright
912966SMatteo.Andreozzi@arm.com# notice, this list of conditions and the following disclaimer;
1012966SMatteo.Andreozzi@arm.com# redistributions in binary form must reproduce the above copyright
1112966SMatteo.Andreozzi@arm.com# notice, this list of conditions and the following disclaimer in the
1212966SMatteo.Andreozzi@arm.com# documentation and/or other materials provided with the distribution;
1312966SMatteo.Andreozzi@arm.com# neither the name of the copyright holders nor the names of its
1412966SMatteo.Andreozzi@arm.com# contributors may be used to endorse or promote products derived from
154202Sbinkertn@umich.edu# this software without specific prior written permission.
164202Sbinkertn@umich.edu#
174202Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
184202Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
194202Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
204202Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
214202Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
224202Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
234202Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
244202Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
254202Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
264202Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
274202Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
284202Sbinkertn@umich.edu#
294202Sbinkertn@umich.edu# Authors: Gabe Black
304202Sbinkertn@umich.edu
314202Sbinkertn@umich.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
324202Sbinkertn@umich.edu# All rights reserved.
334202Sbinkertn@umich.edu#
344202Sbinkertn@umich.edu# Redistribution and use of this software in source and binary forms,
354202Sbinkertn@umich.edu# with or without modification, are permitted provided that the
364202Sbinkertn@umich.edu# following conditions are met:
374202Sbinkertn@umich.edu#
384202Sbinkertn@umich.edu# The software must be used only for Non-Commercial Use which means any
394202Sbinkertn@umich.edu# use which is NOT directed to receiving any direct monetary
404202Sbinkertn@umich.edu# compensation for, or commercial advantage from such use.  Illustrative
414202Sbinkertn@umich.edu# examples of non-commercial use are academic research, personal study,
424202Sbinkertn@umich.edu# teaching, education and corporate research & development.
434202Sbinkertn@umich.edu# Illustrative examples of commercial use are distributing products for
444202Sbinkertn@umich.edu# commercial advantage and providing services using the software for
4510996Sandreas.sandberg@arm.com# commercial advantage.
4610996Sandreas.sandberg@arm.com#
479398Sandreas.hansson@arm.com# If you wish to use this software or functionality therein that may be
489850Sandreas.hansson@arm.com# covered by patents for commercial use, please contact:
499259SAli.Saidi@ARM.com#     Director of Intellectual Property Licensing
504486Sbinkertn@umich.edu#     Office of Strategy and Technology
5110146Sandreas.hansson@arm.com#     Hewlett-Packard Company
5210478SAndrew.Bardsley@arm.com#     1501 Page Mill Road
5310478SAndrew.Bardsley@arm.com#     Palo Alto, California  94304
546165Ssanchezd@stanford.edu#
559850Sandreas.hansson@arm.com# Redistributions of source code must retain the above copyright notice,
5610405Sandreas.hansson@arm.com# this list of conditions and the following disclaimer.  Redistributions
5711184Serfan.azarkhish@unibo.it# in binary form must reproduce the above copyright notice, this list of
5811185Serfan.azarkhish@unibo.it# conditions and the following disclaimer in the documentation and/or
5912802Sandreas.sandberg@arm.com# other materials provided with the distribution.  Neither the name of
606168Snate@binkert.org# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
619850Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from
629259SAli.Saidi@ARM.com# this software without specific prior written permission.  No right of
634202Sbinkertn@umich.edu# sublicense is granted herewith.  Derivatives of the software and
6410405Sandreas.hansson@arm.com# output created using the software may be prepared, but only for
6510431SOmar.Naji@arm.com# Non-Commercial Uses.  Derivatives of the software may be shared with
6610146Sandreas.hansson@arm.com# others provided: (i) the others agree to abide by the list of
6710478SAndrew.Bardsley@arm.com# conditions herein which includes the Non-Commercial Use restrictions;
6810478SAndrew.Bardsley@arm.com# and (ii) such Derivatives of the software include the above copyright
694202Sbinkertn@umich.edu# notice to acknowledge the contribution from this software where
708761Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below.
7110405Sandreas.hansson@arm.com#
724202Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
734202Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
748914Sandreas.hansson@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7510405Sandreas.hansson@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7610405Sandreas.hansson@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7714007Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7810405Sandreas.hansson@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7910405Sandreas.hansson@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8010614Skanishk.sugand@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
814202Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8210405Sandreas.hansson@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8311184Serfan.azarkhish@unibo.it#
8411185Serfan.azarkhish@unibo.it# Authors: Gabe Black
8512802Sandreas.sandberg@arm.com
866168Snate@binkert.orgImport('*')
879850Sandreas.hansson@arm.com
889850Sandreas.hansson@arm.comif env['TARGET_ISA'] == 'x86':
899850Sandreas.hansson@arm.com    Source('emulenv.cc')
908763Sgblack@eecs.umich.edu    Source('floatregfile.cc')
917768SAli.Saidi@ARM.com    Source('insts/microfpop.cc')
9210131Sandreas.hansson@arm.com    Source('insts/microldstop.cc')
9310131Sandreas.hansson@arm.com    Source('insts/microop.cc')
9410131Sandreas.hansson@arm.com    Source('insts/microregop.cc')
9510131Sandreas.hansson@arm.com    Source('insts/static_inst.cc')
9610066Sandreas.hansson@arm.com    Source('intregfile.cc')
9710612SMarco.Elver@ARM.com    Source('miscregfile.cc')
9810612SMarco.Elver@ARM.com    Source('predecoder.cc')
9910612SMarco.Elver@ARM.com    Source('predecoder_tables.cc')
10010612SMarco.Elver@ARM.com    Source('regfile.cc')
10110405Sandreas.hansson@arm.com    Source('remote_gdb.cc')
10210405Sandreas.hansson@arm.com    Source('tlb.cc')
10310405Sandreas.hansson@arm.com
10410405Sandreas.hansson@arm.com    SimObject('X86TLB.py')
10510399Sstephan.diestelhorst@arm.com
10610405Sandreas.hansson@arm.com    if env['FULL_SYSTEM']:
10710405Sandreas.hansson@arm.com        # Full-system sources
1089036Sandreas.hansson@arm.com        pass
1099164Sandreas.hansson@arm.com    else:
1108981Sandreas.hansson@arm.com        Source('process.cc')
1119243Sandreas.hansson@arm.com
11210247Sandreas.hansson@arm.com        Source('linux/linux.cc')
11310208Sandreas.hansson@arm.com        Source('linux/process.cc')
11410478SAndrew.Bardsley@arm.com        Source('linux/syscalls.cc')
1158335Snate@binkert.org
1168335Snate@binkert.org    python_files = (
1178335Snate@binkert.org        '__init__.py',
1188914Sandreas.hansson@arm.com        'general_purpose/__init__.py',
11910614Skanishk.sugand@arm.com        'general_purpose/arithmetic/__init__.py',
12010066Sandreas.hansson@arm.com        'general_purpose/arithmetic/add_and_subtract.py',
12111184Serfan.azarkhish@unibo.it        'general_purpose/arithmetic/increment_and_decrement.py',
12211185Serfan.azarkhish@unibo.it        'general_purpose/arithmetic/multiply_and_divide.py',
12310612SMarco.Elver@ARM.com        'general_purpose/cache_and_memory_management.py',
12410612SMarco.Elver@ARM.com        'general_purpose/compare_and_test/__init__.py',
12510612SMarco.Elver@ARM.com        'general_purpose/compare_and_test/bit_scan.py',
12612966SMatteo.Andreozzi@arm.com        'general_purpose/compare_and_test/bit_test.py',
127        'general_purpose/compare_and_test/bounds.py',
128        'general_purpose/compare_and_test/compare.py',
129        'general_purpose/compare_and_test/set_byte_on_condition.py',
130        'general_purpose/compare_and_test/test.py',
131        'general_purpose/control_transfer/__init__.py',
132        'general_purpose/control_transfer/call.py',
133        'general_purpose/control_transfer/conditional_jump.py',
134        'general_purpose/control_transfer/interrupts_and_exceptions.py',
135        'general_purpose/control_transfer/jump.py',
136        'general_purpose/control_transfer/loop.py',
137        'general_purpose/control_transfer/xreturn.py',
138        'general_purpose/data_conversion/__init__.py',
139        'general_purpose/data_conversion/ascii_adjust.py',
140        'general_purpose/data_conversion/bcd_adjust.py',
141        'general_purpose/data_conversion/endian_conversion.py',
142        'general_purpose/data_conversion/extract_sign_mask.py',
143        'general_purpose/data_conversion/sign_extension.py',
144        'general_purpose/data_conversion/translate.py',
145        'general_purpose/data_transfer/__init__.py',
146        'general_purpose/data_transfer/conditional_move.py',
147        'general_purpose/data_transfer/move.py',
148        'general_purpose/data_transfer/stack_operations.py',
149        'general_purpose/data_transfer/xchg.py',
150        'general_purpose/flags/__init__.py',
151        'general_purpose/flags/load_and_store.py',
152        'general_purpose/flags/push_and_pop.py',
153        'general_purpose/flags/set_and_clear.py',
154        'general_purpose/input_output/__init__.py',
155        'general_purpose/input_output/general_io.py',
156        'general_purpose/input_output/string_io.py',
157        'general_purpose/load_effective_address.py',
158        'general_purpose/load_segment_registers.py',
159        'general_purpose/logical.py',
160        'general_purpose/no_operation.py',
161        'general_purpose/processor_information.py',
162        'general_purpose/rotate_and_shift/__init__.py',
163        'general_purpose/rotate_and_shift/rotate.py',
164        'general_purpose/rotate_and_shift/shift.py',
165        'general_purpose/semaphores.py',
166        'general_purpose/string/__init__.py',
167        'general_purpose/string/compare_strings.py',
168        'general_purpose/string/load_string.py',
169        'general_purpose/string/move_string.py',
170        'general_purpose/string/scan_string.py',
171        'general_purpose/string/store_string.py',
172        'general_purpose/system_calls.py',
173        'system/__init__.py',
174        'system/undefined_operation.py',
175        'simd128/__init__.py',
176        'simd128/integer/__init__.py',
177        'simd128/integer/data_transfer/__init__.py',
178        'simd128/integer/data_transfer/move.py',
179        'simd128/integer/data_transfer/move_non_temporal.py',
180        'simd128/integer/data_transfer/move_mask.py',
181        'simd128/integer/data_conversion/__init__.py',
182        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
183        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
184        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
185        'simd128/integer/data_reordering/__init__.py',
186        'simd128/integer/data_reordering/unpack_and_interleave.py',
187        'simd128/integer/data_reordering/pack_with_saturation.py',
188        'simd128/integer/data_reordering/extract_and_insert.py',
189        'simd128/integer/data_reordering/shuffle.py',
190        'simd128/integer/arithmetic/__init__.py',
191        'simd128/integer/arithmetic/subtraction.py',
192        'simd128/integer/arithmetic/addition.py',
193        'simd128/integer/arithmetic/multiplication.py',
194        'simd128/integer/arithmetic/multiply_add.py',
195        'simd128/integer/arithmetic/average.py',
196        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
197        'simd128/integer/shift/__init__.py',
198        'simd128/integer/shift/right_arithmetic_shift.py',
199        'simd128/integer/shift/left_logical_shift.py',
200        'simd128/integer/shift/right_logical_shift.py',
201        'simd128/integer/compare/__init__.py',
202        'simd128/integer/compare/compare_and_write_mask.py',
203        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
204        'simd128/integer/logical/__init__.py',
205        'simd128/integer/logical/pand.py',
206        'simd128/integer/logical/por.py',
207        'simd128/integer/logical/exclusive_or.py',
208        'simd128/integer/save_and_restore_state/__init__.py',
209        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
210        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
211        'simd128/floating_point/__init__.py',
212        'simd128/floating_point/data_transfer/__init__.py',
213        'simd128/floating_point/data_transfer/move_mask.py',
214        'simd128/floating_point/data_transfer/move.py',
215        'simd128/floating_point/data_transfer/move_with_duplication.py',
216        'simd128/floating_point/data_transfer/move_non_temporal.py',
217        'simd128/floating_point/data_conversion/__init__.py',
218        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
219        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
220        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
221        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
222        'simd128/floating_point/data_reordering/__init__.py',
223        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
224        'simd128/floating_point/data_reordering/shuffle.py',
225        'simd128/floating_point/arithmetic/__init__.py',
226        'simd128/floating_point/arithmetic/subtraction.py',
227        'simd128/floating_point/arithmetic/addition.py',
228        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
229        'simd128/floating_point/arithmetic/horizontal_addition.py',
230        'simd128/floating_point/arithmetic/square_root.py',
231        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
232        'simd128/floating_point/arithmetic/multiplication.py',
233        'simd128/floating_point/arithmetic/division.py',
234        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
235        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
236        'simd128/floating_point/compare/__init__.py',
237        'simd128/floating_point/compare/compare_and_write_mask.py',
238        'simd128/floating_point/compare/compare_and_write_rflags.py',
239        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
240        'simd128/floating_point/logical/__init__.py',
241        'simd128/floating_point/logical/andp.py',
242        'simd128/floating_point/logical/orp.py',
243        'simd128/floating_point/logical/exclusive_or.py',
244        'simd64/__init__.py',
245        'simd64/integer/__init__.py',
246        'simd64/integer/data_transfer/__init__.py',
247        'simd64/integer/data_transfer/move_mask.py',
248        'simd64/integer/data_transfer/move.py',
249        'simd64/integer/data_transfer/move_non_temporal.py',
250        'simd64/integer/exit_media_state.py',
251        'simd64/integer/data_reordering/__init__.py',
252        'simd64/integer/data_reordering/unpack_and_interleave.py',
253        'simd64/integer/data_reordering/pack_with_saturation.py',
254        'simd64/integer/data_reordering/extract_and_insert.py',
255        'simd64/integer/data_reordering/shuffle_and_swap.py',
256        'simd64/integer/data_conversion.py',
257        'simd64/integer/arithmetic/__init__.py',
258        'simd64/integer/arithmetic/subtraction.py',
259        'simd64/integer/arithmetic/addition.py',
260        'simd64/integer/arithmetic/multiplication.py',
261        'simd64/integer/arithmetic/multiply_add.py',
262        'simd64/integer/arithmetic/average.py',
263        'simd64/integer/arithmetic/sum_of_absolute_differences.py',
264        'simd64/integer/shift/__init__.py',
265        'simd64/integer/shift/right_arithmetic_shift.py',
266        'simd64/integer/shift/left_logical_shift.py',
267        'simd64/integer/shift/right_logical_shift.py',
268        'simd64/integer/compare/__init__.py',
269        'simd64/integer/compare/compare_and_write_mask.py',
270        'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
271        'simd64/integer/logical/__init__.py',
272        'simd64/integer/logical/pand.py',
273        'simd64/integer/logical/por.py',
274        'simd64/integer/logical/exclusive_or.py',
275        'simd64/integer/save_and_restore_state.py',
276        'simd64/floating_point/__init__.py',
277        'simd64/floating_point/arithmetic/__init__.py',
278        'simd64/floating_point/arithmetic/subtraction.py',
279        'simd64/floating_point/arithmetic/addition.py',
280        'simd64/floating_point/arithmetic/reciprocal_estimation.py',
281        'simd64/floating_point/arithmetic/multiplication.py',
282        'simd64/floating_point/arithmetic/accumulation.py',
283        'simd64/floating_point/arithmetic/reciprocal_square_root.py',
284        'simd64/floating_point/data_conversion.py',
285        'simd64/floating_point/compare/__init__.py',
286        'simd64/floating_point/compare/compare_and_write_mask.py',
287        'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
288        'x87/__init__.py',
289        'x87/data_transfer_and_conversion/__init__.py',
290        'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
291        'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
292        'x87/data_transfer_and_conversion/exchange.py',
293        'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
294        'x87/data_transfer_and_conversion/conditional_move.py',
295        'x87/data_transfer_and_conversion/extract.py',
296        'x87/load_constants/__init__.py',
297        'x87/load_constants/load_0_1_or_pi.py',
298        'x87/load_constants/load_logarithm.py',
299        'x87/arithmetic/__init__.py',
300        'x87/arithmetic/subtraction.py',
301        'x87/arithmetic/addition.py',
302        'x87/arithmetic/partial_remainder.py',
303        'x87/arithmetic/multiplication.py',
304        'x87/arithmetic/division.py',
305        'x87/arithmetic/change_sign.py',
306        'x87/arithmetic/round.py',
307        'x87/arithmetic/square_root.py',
308        'x87/transcendental_functions/__init__.py',
309        'x87/transcendental_functions/trigonometric_functions.py',
310        'x87/transcendental_functions/logarithmic_functions.py',
311        'x87/compare_and_test/__init__.py',
312        'x87/compare_and_test/classify.py',
313        'x87/compare_and_test/test.py',
314        'x87/compare_and_test/floating_point_ordered_compare.py',
315        'x87/compare_and_test/floating_point_unordered_compare.py',
316        'x87/compare_and_test/integer_compare.py',
317        'x87/stack_management/__init__.py',
318        'x87/stack_management/stack_control.py',
319        'x87/stack_management/clear_state.py',
320        'x87/control/__init__.py',
321        'x87/control/clear_exceptions.py',
322        'x87/control/initialize.py',
323        'x87/control/wait_for_exceptions.py',
324        'x87/control/save_x87_status_word.py',
325        'x87/control/save_and_restore_x87_control_word.py',
326        'x87/control/save_and_restore_x87_environment.py',
327        'x87/no_operation.py'
328        )
329
330
331    # Add in files generated by the ISA description.
332    isa_desc_files = env.ISADesc('isa/main.isa')
333    for f in isa_desc_files:
334        # Add in python file dependencies that won't be caught otherwise
335        for pyfile in python_files:
336            env.Depends(f, "isa/insts/%s" % pyfile)
337        # Only non-header files need to be compiled.
338        if not f.path.endswith('.hh'):
339            Source(f)
340