SConscript revision 8752
110994Sandreas.sandberg@arm.com# -*- mode:python -*-
210994Sandreas.sandberg@arm.com
310994Sandreas.sandberg@arm.com# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
410994Sandreas.sandberg@arm.com# All rights reserved.
510994Sandreas.sandberg@arm.com#
610994Sandreas.sandberg@arm.com# The license below extends only to copyright in the software and shall
710994Sandreas.sandberg@arm.com# not be construed as granting a license to any other intellectual
810994Sandreas.sandberg@arm.com# property including but not limited to intellectual property relating
910994Sandreas.sandberg@arm.com# to a hardware implementation of the functionality of the software
1010994Sandreas.sandberg@arm.com# licensed hereunder.  You may use the software subject to the license
1110994Sandreas.sandberg@arm.com# terms below provided that you ensure that this notice is replicated
1210994Sandreas.sandberg@arm.com# unmodified and in its entirety in all distributions of the software,
1310994Sandreas.sandberg@arm.com# modified or unmodified, in source code or in binary form.
1410994Sandreas.sandberg@arm.com#
1510994Sandreas.sandberg@arm.com# Copyright (c) 2005-2006 The Regents of The University of Michigan
1610994Sandreas.sandberg@arm.com# All rights reserved.
1710994Sandreas.sandberg@arm.com#
1810994Sandreas.sandberg@arm.com# Redistribution and use in source and binary forms, with or without
1910994Sandreas.sandberg@arm.com# modification, are permitted provided that the following conditions are
2010994Sandreas.sandberg@arm.com# met: redistributions of source code must retain the above copyright
2110994Sandreas.sandberg@arm.com# notice, this list of conditions and the following disclaimer;
2210994Sandreas.sandberg@arm.com# redistributions in binary form must reproduce the above copyright
2310994Sandreas.sandberg@arm.com# notice, this list of conditions and the following disclaimer in the
2410994Sandreas.sandberg@arm.com# documentation and/or other materials provided with the distribution;
2510994Sandreas.sandberg@arm.com# neither the name of the copyright holders nor the names of its
2610994Sandreas.sandberg@arm.com# contributors may be used to endorse or promote products derived from
2710994Sandreas.sandberg@arm.com# this software without specific prior written permission.
2810994Sandreas.sandberg@arm.com#
2910994Sandreas.sandberg@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3010994Sandreas.sandberg@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3110994Sandreas.sandberg@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3210994Sandreas.sandberg@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3310994Sandreas.sandberg@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3410994Sandreas.sandberg@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3510994Sandreas.sandberg@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3610994Sandreas.sandberg@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3710994Sandreas.sandberg@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3810994Sandreas.sandberg@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3910994Sandreas.sandberg@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4010994Sandreas.sandberg@arm.com#
4110994Sandreas.sandberg@arm.com# Authors: Gabe Black
4210994Sandreas.sandberg@arm.com
4310994Sandreas.sandberg@arm.comImport('*')
4410994Sandreas.sandberg@arm.com
4510994Sandreas.sandberg@arm.comif env['TARGET_ISA'] == 'x86':
4610994Sandreas.sandberg@arm.com    Source('cpuid.cc')
4710994Sandreas.sandberg@arm.com    Source('emulenv.cc')
4810994Sandreas.sandberg@arm.com    Source('faults.cc')
4910994Sandreas.sandberg@arm.com    Source('insts/badmicroop.cc')
5011139Sandreas.hansson@arm.com    Source('insts/microfpop.cc')
5111139Sandreas.hansson@arm.com    Source('insts/microldstop.cc')
5211139Sandreas.hansson@arm.com    Source('insts/micromediaop.cc')
5311139Sandreas.hansson@arm.com    Source('insts/microop.cc')
5411139Sandreas.hansson@arm.com    Source('insts/microregop.cc')
5511139Sandreas.hansson@arm.com    Source('insts/static_inst.cc')
5611139Sandreas.hansson@arm.com    Source('interrupts.cc')
5711139Sandreas.hansson@arm.com    Source('isa.cc')
5811139Sandreas.hansson@arm.com    Source('nativetrace.cc')
5911437Svictor.garcia@arm.com    Source('pagetable.cc')
6012188Sgabeblack@google.com    Source('pagetable_walker.cc')
6111139Sandreas.hansson@arm.com    Source('predecoder.cc')
6211139Sandreas.hansson@arm.com    Source('predecoder_tables.cc')
6311139Sandreas.hansson@arm.com    Source('remote_gdb.cc')
6411139Sandreas.hansson@arm.com    Source('tlb.cc')
6511139Sandreas.hansson@arm.com    Source('types.cc')
6611437Svictor.garcia@arm.com    Source('utility.cc')
6712188Sgabeblack@google.com
6812188Sgabeblack@google.com    SimObject('X86LocalApic.py')
6911139Sandreas.hansson@arm.com    SimObject('X86NativeTrace.py')
7011139Sandreas.hansson@arm.com    SimObject('X86TLB.py')
7111139Sandreas.hansson@arm.com
7210994Sandreas.sandberg@arm.com    DebugFlag('Faults', "Trace all faults/exceptions/traps")
7310994Sandreas.sandberg@arm.com    DebugFlag('LocalApic', "Local APIC debugging")
7410994Sandreas.sandberg@arm.com    DebugFlag('PageTableWalker', \
7510994Sandreas.sandberg@arm.com              "Page table walker state machine debugging")
7610994Sandreas.sandberg@arm.com    DebugFlag('Predecoder', "Predecoder debug output")
7710994Sandreas.sandberg@arm.com    DebugFlag('X86', "Generic X86 ISA debugging")
7810994Sandreas.sandberg@arm.com
7910994Sandreas.sandberg@arm.com    if env['FULL_SYSTEM']:
8010994Sandreas.sandberg@arm.com
8110994Sandreas.sandberg@arm.com        SimObject('X86System.py')
8210994Sandreas.sandberg@arm.com
8310994Sandreas.sandberg@arm.com        # Full-system sources
8410994Sandreas.sandberg@arm.com        Source('linux/system.cc')
8510994Sandreas.sandberg@arm.com        Source('system.cc')
8610994Sandreas.sandberg@arm.com        Source('stacktrace.cc')
8710994Sandreas.sandberg@arm.com        Source('vtophys.cc')
8810994Sandreas.sandberg@arm.com    else:
8910994Sandreas.sandberg@arm.com        Source('process.cc')
9010994Sandreas.sandberg@arm.com
9110994Sandreas.sandberg@arm.com        Source('linux/linux.cc')
9210994Sandreas.sandberg@arm.com        Source('linux/process.cc')
9310994Sandreas.sandberg@arm.com        Source('linux/syscalls.cc')
9410994Sandreas.sandberg@arm.com
9510994Sandreas.sandberg@arm.com    python_files = (
9610994Sandreas.sandberg@arm.com        '__init__.py',
9710994Sandreas.sandberg@arm.com        'general_purpose/__init__.py',
9810994Sandreas.sandberg@arm.com        'general_purpose/arithmetic/__init__.py',
9910994Sandreas.sandberg@arm.com        'general_purpose/arithmetic/add_and_subtract.py',
10010994Sandreas.sandberg@arm.com        'general_purpose/arithmetic/increment_and_decrement.py',
10110994Sandreas.sandberg@arm.com        'general_purpose/arithmetic/multiply_and_divide.py',
10210994Sandreas.sandberg@arm.com        'general_purpose/cache_and_memory_management.py',
10310994Sandreas.sandberg@arm.com        'general_purpose/compare_and_test/__init__.py',
10411139Sandreas.hansson@arm.com        'general_purpose/compare_and_test/bit_scan.py',
10510994Sandreas.sandberg@arm.com        'general_purpose/compare_and_test/bit_test.py',
10610994Sandreas.sandberg@arm.com        'general_purpose/compare_and_test/bounds.py',
10710994Sandreas.sandberg@arm.com        'general_purpose/compare_and_test/compare.py',
10810994Sandreas.sandberg@arm.com        'general_purpose/compare_and_test/set_byte_on_condition.py',
10910994Sandreas.sandberg@arm.com        'general_purpose/compare_and_test/test.py',
110        'general_purpose/control_transfer/__init__.py',
111        'general_purpose/control_transfer/call.py',
112        'general_purpose/control_transfer/conditional_jump.py',
113        'general_purpose/control_transfer/interrupts_and_exceptions.py',
114        'general_purpose/control_transfer/jump.py',
115        'general_purpose/control_transfer/loop.py',
116        'general_purpose/control_transfer/xreturn.py',
117        'general_purpose/data_conversion/__init__.py',
118        'general_purpose/data_conversion/ascii_adjust.py',
119        'general_purpose/data_conversion/bcd_adjust.py',
120        'general_purpose/data_conversion/endian_conversion.py',
121        'general_purpose/data_conversion/extract_sign_mask.py',
122        'general_purpose/data_conversion/sign_extension.py',
123        'general_purpose/data_conversion/translate.py',
124        'general_purpose/data_transfer/__init__.py',
125        'general_purpose/data_transfer/conditional_move.py',
126        'general_purpose/data_transfer/move.py',
127        'general_purpose/data_transfer/stack_operations.py',
128        'general_purpose/data_transfer/xchg.py',
129        'general_purpose/flags/__init__.py',
130        'general_purpose/flags/load_and_store.py',
131        'general_purpose/flags/push_and_pop.py',
132        'general_purpose/flags/set_and_clear.py',
133        'general_purpose/input_output/__init__.py',
134        'general_purpose/input_output/general_io.py',
135        'general_purpose/input_output/string_io.py',
136        'general_purpose/load_effective_address.py',
137        'general_purpose/load_segment_registers.py',
138        'general_purpose/logical.py',
139        'general_purpose/no_operation.py',
140        'general_purpose/rotate_and_shift/__init__.py',
141        'general_purpose/rotate_and_shift/rotate.py',
142        'general_purpose/rotate_and_shift/shift.py',
143        'general_purpose/semaphores.py',
144        'general_purpose/string/__init__.py',
145        'general_purpose/string/compare_strings.py',
146        'general_purpose/string/load_string.py',
147        'general_purpose/string/move_string.py',
148        'general_purpose/string/scan_string.py',
149        'general_purpose/string/store_string.py',
150        'general_purpose/system_calls.py',
151        'romutil.py',
152        'system/__init__.py',
153        'system/control_registers.py',
154        'system/halt.py',
155        'system/invlpg.py',
156        'system/undefined_operation.py',
157        'system/msrs.py',
158        'system/segmentation.py',
159        'simd128/__init__.py',
160        'simd128/integer/__init__.py',
161        'simd128/integer/data_transfer/__init__.py',
162        'simd128/integer/data_transfer/move.py',
163        'simd128/integer/data_transfer/move_non_temporal.py',
164        'simd128/integer/data_transfer/move_mask.py',
165        'simd128/integer/data_conversion/__init__.py',
166        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
167        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
168        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
169        'simd128/integer/data_reordering/__init__.py',
170        'simd128/integer/data_reordering/unpack_and_interleave.py',
171        'simd128/integer/data_reordering/pack_with_saturation.py',
172        'simd128/integer/data_reordering/extract_and_insert.py',
173        'simd128/integer/data_reordering/shuffle.py',
174        'simd128/integer/arithmetic/__init__.py',
175        'simd128/integer/arithmetic/subtraction.py',
176        'simd128/integer/arithmetic/addition.py',
177        'simd128/integer/arithmetic/multiplication.py',
178        'simd128/integer/arithmetic/multiply_add.py',
179        'simd128/integer/arithmetic/average.py',
180        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
181        'simd128/integer/shift/__init__.py',
182        'simd128/integer/shift/right_arithmetic_shift.py',
183        'simd128/integer/shift/left_logical_shift.py',
184        'simd128/integer/shift/right_logical_shift.py',
185        'simd128/integer/compare/__init__.py',
186        'simd128/integer/compare/compare_and_write_mask.py',
187        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
188        'simd128/integer/logical/__init__.py',
189        'simd128/integer/logical/pand.py',
190        'simd128/integer/logical/por.py',
191        'simd128/integer/logical/exclusive_or.py',
192        'simd128/integer/save_and_restore_state/__init__.py',
193        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
194        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
195        'simd128/floating_point/__init__.py',
196        'simd128/floating_point/data_transfer/__init__.py',
197        'simd128/floating_point/data_transfer/move_mask.py',
198        'simd128/floating_point/data_transfer/move.py',
199        'simd128/floating_point/data_transfer/move_with_duplication.py',
200        'simd128/floating_point/data_transfer/move_non_temporal.py',
201        'simd128/floating_point/data_conversion/__init__.py',
202        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
203        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
204        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
205        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
206        'simd128/floating_point/data_reordering/__init__.py',
207        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
208        'simd128/floating_point/data_reordering/shuffle.py',
209        'simd128/floating_point/arithmetic/__init__.py',
210        'simd128/floating_point/arithmetic/subtraction.py',
211        'simd128/floating_point/arithmetic/addition.py',
212        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
213        'simd128/floating_point/arithmetic/horizontal_addition.py',
214        'simd128/floating_point/arithmetic/square_root.py',
215        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
216        'simd128/floating_point/arithmetic/multiplication.py',
217        'simd128/floating_point/arithmetic/division.py',
218        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
219        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
220        'simd128/floating_point/compare/__init__.py',
221        'simd128/floating_point/compare/compare_and_write_mask.py',
222        'simd128/floating_point/compare/compare_and_write_rflags.py',
223        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
224        'simd128/floating_point/logical/__init__.py',
225        'simd128/floating_point/logical/andp.py',
226        'simd128/floating_point/logical/orp.py',
227        'simd128/floating_point/logical/exclusive_or.py',
228        'simd64/__init__.py',
229        'simd64/integer/__init__.py',
230        'simd64/integer/data_transfer/__init__.py',
231        '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