SConscript revision 5389
16019Shines@cs.fsu.edu# -*- mode:python -*-
26019Shines@cs.fsu.edu
310037SARM gem5 Developers# Copyright (c) 2005-2006 The Regents of The University of Michigan
47100Sgblack@eecs.umich.edu# All rights reserved.
57100Sgblack@eecs.umich.edu#
67100Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
77100Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
87100Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright
97100Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
107100Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
117100Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
127100Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution;
137100Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its
147100Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
156019Shines@cs.fsu.edu# this software without specific prior written permission.
166019Shines@cs.fsu.edu#
176019Shines@cs.fsu.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186019Shines@cs.fsu.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196019Shines@cs.fsu.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206019Shines@cs.fsu.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216019Shines@cs.fsu.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226019Shines@cs.fsu.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236019Shines@cs.fsu.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246019Shines@cs.fsu.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256019Shines@cs.fsu.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266019Shines@cs.fsu.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276019Shines@cs.fsu.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286019Shines@cs.fsu.edu#
296019Shines@cs.fsu.edu# Authors: Gabe Black
306019Shines@cs.fsu.edu
316019Shines@cs.fsu.edu# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
326019Shines@cs.fsu.edu# All rights reserved.
336019Shines@cs.fsu.edu#
346019Shines@cs.fsu.edu# Redistribution and use of this software in source and binary forms,
356019Shines@cs.fsu.edu# with or without modification, are permitted provided that the
366019Shines@cs.fsu.edu# following conditions are met:
376019Shines@cs.fsu.edu#
386019Shines@cs.fsu.edu# The software must be used only for Non-Commercial Use which means any
396019Shines@cs.fsu.edu# use which is NOT directed to receiving any direct monetary
406019Shines@cs.fsu.edu# compensation for, or commercial advantage from such use.  Illustrative
416019Shines@cs.fsu.edu# examples of non-commercial use are academic research, personal study,
426757SAli.Saidi@ARM.com# teaching, education and corporate research & development.
436019Shines@cs.fsu.edu# Illustrative examples of commercial use are distributing products for
446019Shines@cs.fsu.edu# commercial advantage and providing services using the software for
456019Shines@cs.fsu.edu# commercial advantage.
466019Shines@cs.fsu.edu#
476019Shines@cs.fsu.edu# If you wish to use this software or functionality therein that may be
4811320Ssteve.reinhardt@amd.com# covered by patents for commercial use, please contact:
496019Shines@cs.fsu.edu#     Director of Intellectual Property Licensing
509022Sgblack@eecs.umich.edu#     Office of Strategy and Technology
516019Shines@cs.fsu.edu#     Hewlett-Packard Company
5212640Sgiacomo.travaglini@arm.com#     1501 Page Mill Road
5310037SARM gem5 Developers#     Palo Alto, California  94304
5410037SARM gem5 Developers#
557170Sgblack@eecs.umich.edu# Redistributions of source code must retain the above copyright notice,
566253Sgblack@eecs.umich.edu# this list of conditions and the following disclaimer.  Redistributions
5710037SARM gem5 Developers# in binary form must reproduce the above copyright notice, this list of
587202Sgblack@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or
5910037SARM gem5 Developers# other materials provided with the distribution.  Neither the name of
606253Sgblack@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
6110611SAndreas.Sandberg@ARM.com# contributors may be used to endorse or promote products derived from
626253Sgblack@eecs.umich.edu# this software without specific prior written permission.  No right of
637396Sgblack@eecs.umich.edu# sublicense is granted herewith.  Derivatives of the software and
6410037SARM gem5 Developers# output created using the software may be prepared, but only for
658745Sgblack@eecs.umich.edu# Non-Commercial Uses.  Derivatives of the software may be shared with
667405SAli.Saidi@ARM.com# others provided: (i) the others agree to abide by the list of
6710461SAndreas.Sandberg@ARM.com# conditions herein which includes the Non-Commercial Use restrictions;
688782Sgblack@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright
698782Sgblack@eecs.umich.edu# notice to acknowledge the contribution from this software where
708782Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below.
7110810Sbr@bsdpad.com#
7210810Sbr@bsdpad.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7310810Sbr@bsdpad.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
747259Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
758757Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7610461SAndreas.Sandberg@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
778782Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
788757Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7912531Sandreas.sandberg@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
808777Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
818782Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
828756Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8310037SARM gem5 Developers#
8410037SARM gem5 Developers# Authors: Gabe Black
856019Shines@cs.fsu.edu
8612605Sgiacomo.travaglini@arm.comImport('*')
876757SAli.Saidi@ARM.com
888757Sgblack@eecs.umich.eduif env['TARGET_ISA'] == 'x86':
896019Shines@cs.fsu.edu    Source('emulenv.cc')
908745Sgblack@eecs.umich.edu    Source('floatregfile.cc')
919384SAndreas.Sandberg@arm.com    Source('faults.cc')
926397Sgblack@eecs.umich.edu    Source('insts/microfpop.cc')
9312531Sandreas.sandberg@arm.com    Source('insts/microldstop.cc')
948782Sgblack@eecs.umich.edu    Source('insts/microop.cc')
956019Shines@cs.fsu.edu    Source('insts/microregop.cc')
9610461SAndreas.Sandberg@ARM.com    Source('insts/static_inst.cc')
976397Sgblack@eecs.umich.edu    Source('intregfile.cc')
988335Snate@binkert.org    Source('miscregfile.cc')
9912531Sandreas.sandberg@arm.com    Source('pagetable.cc')
1009023Sgblack@eecs.umich.edu    Source('predecoder.cc')
1019023Sgblack@eecs.umich.edu    Source('predecoder_tables.cc')
10210461SAndreas.Sandberg@ARM.com    Source('regfile.cc')
1038335Snate@binkert.org    Source('remote_gdb.cc')
1046019Shines@cs.fsu.edu    Source('tlb.cc')
10510196SCurtis.Dunham@arm.com    Source('utility.cc')
10612222Sgabeblack@google.com
107    SimObject('X86TLB.py')
108    TraceFlag('Predecoder')
109    TraceFlag('X86')
110
111    if env['FULL_SYSTEM']:
112        SimObject('X86System.py')
113
114        # Full-system sources
115        Source('linux/system.cc')
116        Source('pagetable_walker.cc')
117	Source('smbios.cc')
118        Source('system.cc')
119        Source('stacktrace.cc')
120        Source('vtophys.cc')
121    else:
122        Source('process.cc')
123
124        Source('linux/linux.cc')
125        Source('linux/process.cc')
126        Source('linux/syscalls.cc')
127
128    python_files = (
129        '__init__.py',
130        'general_purpose/__init__.py',
131        'general_purpose/arithmetic/__init__.py',
132        'general_purpose/arithmetic/add_and_subtract.py',
133        'general_purpose/arithmetic/increment_and_decrement.py',
134        'general_purpose/arithmetic/multiply_and_divide.py',
135        'general_purpose/cache_and_memory_management.py',
136        'general_purpose/compare_and_test/__init__.py',
137        'general_purpose/compare_and_test/bit_scan.py',
138        'general_purpose/compare_and_test/bit_test.py',
139        'general_purpose/compare_and_test/bounds.py',
140        'general_purpose/compare_and_test/compare.py',
141        'general_purpose/compare_and_test/set_byte_on_condition.py',
142        'general_purpose/compare_and_test/test.py',
143        'general_purpose/control_transfer/__init__.py',
144        'general_purpose/control_transfer/call.py',
145        'general_purpose/control_transfer/conditional_jump.py',
146        'general_purpose/control_transfer/interrupts_and_exceptions.py',
147        'general_purpose/control_transfer/jump.py',
148        'general_purpose/control_transfer/loop.py',
149        'general_purpose/control_transfer/xreturn.py',
150        'general_purpose/data_conversion/__init__.py',
151        'general_purpose/data_conversion/ascii_adjust.py',
152        'general_purpose/data_conversion/bcd_adjust.py',
153        'general_purpose/data_conversion/endian_conversion.py',
154        'general_purpose/data_conversion/extract_sign_mask.py',
155        'general_purpose/data_conversion/sign_extension.py',
156        'general_purpose/data_conversion/translate.py',
157        'general_purpose/data_transfer/__init__.py',
158        'general_purpose/data_transfer/conditional_move.py',
159        'general_purpose/data_transfer/move.py',
160        'general_purpose/data_transfer/stack_operations.py',
161        'general_purpose/data_transfer/xchg.py',
162        'general_purpose/flags/__init__.py',
163        'general_purpose/flags/load_and_store.py',
164        'general_purpose/flags/push_and_pop.py',
165        'general_purpose/flags/set_and_clear.py',
166        'general_purpose/input_output/__init__.py',
167        'general_purpose/input_output/general_io.py',
168        'general_purpose/input_output/string_io.py',
169        'general_purpose/load_effective_address.py',
170        'general_purpose/load_segment_registers.py',
171        'general_purpose/logical.py',
172        'general_purpose/no_operation.py',
173        'general_purpose/processor_information.py',
174        'general_purpose/rotate_and_shift/__init__.py',
175        'general_purpose/rotate_and_shift/rotate.py',
176        'general_purpose/rotate_and_shift/shift.py',
177        'general_purpose/semaphores.py',
178        'general_purpose/string/__init__.py',
179        'general_purpose/string/compare_strings.py',
180        'general_purpose/string/load_string.py',
181        'general_purpose/string/move_string.py',
182        'general_purpose/string/scan_string.py',
183        'general_purpose/string/store_string.py',
184        'general_purpose/system_calls.py',
185        'system/__init__.py',
186        'system/halt.py',
187        'system/invlpg.py',
188        'system/undefined_operation.py',
189        'system/msrs.py',
190        'system/segmentation.py',
191        'simd128/__init__.py',
192        'simd128/integer/__init__.py',
193        'simd128/integer/data_transfer/__init__.py',
194        'simd128/integer/data_transfer/move.py',
195        'simd128/integer/data_transfer/move_non_temporal.py',
196        'simd128/integer/data_transfer/move_mask.py',
197        'simd128/integer/data_conversion/__init__.py',
198        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
199        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
200        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
201        'simd128/integer/data_reordering/__init__.py',
202        'simd128/integer/data_reordering/unpack_and_interleave.py',
203        'simd128/integer/data_reordering/pack_with_saturation.py',
204        'simd128/integer/data_reordering/extract_and_insert.py',
205        'simd128/integer/data_reordering/shuffle.py',
206        'simd128/integer/arithmetic/__init__.py',
207        'simd128/integer/arithmetic/subtraction.py',
208        'simd128/integer/arithmetic/addition.py',
209        'simd128/integer/arithmetic/multiplication.py',
210        'simd128/integer/arithmetic/multiply_add.py',
211        'simd128/integer/arithmetic/average.py',
212        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
213        'simd128/integer/shift/__init__.py',
214        'simd128/integer/shift/right_arithmetic_shift.py',
215        'simd128/integer/shift/left_logical_shift.py',
216        'simd128/integer/shift/right_logical_shift.py',
217        'simd128/integer/compare/__init__.py',
218        'simd128/integer/compare/compare_and_write_mask.py',
219        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
220        'simd128/integer/logical/__init__.py',
221        'simd128/integer/logical/pand.py',
222        'simd128/integer/logical/por.py',
223        'simd128/integer/logical/exclusive_or.py',
224        'simd128/integer/save_and_restore_state/__init__.py',
225        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
226        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
227        'simd128/floating_point/__init__.py',
228        'simd128/floating_point/data_transfer/__init__.py',
229        'simd128/floating_point/data_transfer/move_mask.py',
230        'simd128/floating_point/data_transfer/move.py',
231        'simd128/floating_point/data_transfer/move_with_duplication.py',
232        'simd128/floating_point/data_transfer/move_non_temporal.py',
233        'simd128/floating_point/data_conversion/__init__.py',
234        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
235        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
236        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
237        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
238        'simd128/floating_point/data_reordering/__init__.py',
239        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
240        'simd128/floating_point/data_reordering/shuffle.py',
241        'simd128/floating_point/arithmetic/__init__.py',
242        'simd128/floating_point/arithmetic/subtraction.py',
243        'simd128/floating_point/arithmetic/addition.py',
244        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
245        'simd128/floating_point/arithmetic/horizontal_addition.py',
246        'simd128/floating_point/arithmetic/square_root.py',
247        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
248        'simd128/floating_point/arithmetic/multiplication.py',
249        'simd128/floating_point/arithmetic/division.py',
250        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
251        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
252        'simd128/floating_point/compare/__init__.py',
253        'simd128/floating_point/compare/compare_and_write_mask.py',
254        'simd128/floating_point/compare/compare_and_write_rflags.py',
255        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
256        'simd128/floating_point/logical/__init__.py',
257        'simd128/floating_point/logical/andp.py',
258        'simd128/floating_point/logical/orp.py',
259        'simd128/floating_point/logical/exclusive_or.py',
260        'simd64/__init__.py',
261        'simd64/integer/__init__.py',
262        'simd64/integer/data_transfer/__init__.py',
263        'simd64/integer/data_transfer/move_mask.py',
264        'simd64/integer/data_transfer/move.py',
265        'simd64/integer/data_transfer/move_non_temporal.py',
266        'simd64/integer/exit_media_state.py',
267        'simd64/integer/data_reordering/__init__.py',
268        'simd64/integer/data_reordering/unpack_and_interleave.py',
269        'simd64/integer/data_reordering/pack_with_saturation.py',
270        'simd64/integer/data_reordering/extract_and_insert.py',
271        'simd64/integer/data_reordering/shuffle_and_swap.py',
272        'simd64/integer/data_conversion.py',
273        'simd64/integer/arithmetic/__init__.py',
274        'simd64/integer/arithmetic/subtraction.py',
275        'simd64/integer/arithmetic/addition.py',
276        'simd64/integer/arithmetic/multiplication.py',
277        'simd64/integer/arithmetic/multiply_add.py',
278        'simd64/integer/arithmetic/average.py',
279        'simd64/integer/arithmetic/sum_of_absolute_differences.py',
280        'simd64/integer/shift/__init__.py',
281        'simd64/integer/shift/right_arithmetic_shift.py',
282        'simd64/integer/shift/left_logical_shift.py',
283        'simd64/integer/shift/right_logical_shift.py',
284        'simd64/integer/compare/__init__.py',
285        'simd64/integer/compare/compare_and_write_mask.py',
286        'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
287        'simd64/integer/logical/__init__.py',
288        'simd64/integer/logical/pand.py',
289        'simd64/integer/logical/por.py',
290        'simd64/integer/logical/exclusive_or.py',
291        'simd64/integer/save_and_restore_state.py',
292        'simd64/floating_point/__init__.py',
293        'simd64/floating_point/arithmetic/__init__.py',
294        'simd64/floating_point/arithmetic/subtraction.py',
295        'simd64/floating_point/arithmetic/addition.py',
296        'simd64/floating_point/arithmetic/reciprocal_estimation.py',
297        'simd64/floating_point/arithmetic/multiplication.py',
298        'simd64/floating_point/arithmetic/accumulation.py',
299        'simd64/floating_point/arithmetic/reciprocal_square_root.py',
300        'simd64/floating_point/data_conversion.py',
301        'simd64/floating_point/compare/__init__.py',
302        'simd64/floating_point/compare/compare_and_write_mask.py',
303        'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
304        'x87/__init__.py',
305        'x87/data_transfer_and_conversion/__init__.py',
306        'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
307        'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
308        'x87/data_transfer_and_conversion/exchange.py',
309        'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
310        'x87/data_transfer_and_conversion/conditional_move.py',
311        'x87/data_transfer_and_conversion/extract.py',
312        'x87/load_constants/__init__.py',
313        'x87/load_constants/load_0_1_or_pi.py',
314        'x87/load_constants/load_logarithm.py',
315        'x87/arithmetic/__init__.py',
316        'x87/arithmetic/subtraction.py',
317        'x87/arithmetic/addition.py',
318        'x87/arithmetic/partial_remainder.py',
319        'x87/arithmetic/multiplication.py',
320        'x87/arithmetic/division.py',
321        'x87/arithmetic/change_sign.py',
322        'x87/arithmetic/round.py',
323        'x87/arithmetic/square_root.py',
324        'x87/transcendental_functions/__init__.py',
325        'x87/transcendental_functions/trigonometric_functions.py',
326        'x87/transcendental_functions/logarithmic_functions.py',
327        'x87/compare_and_test/__init__.py',
328        'x87/compare_and_test/classify.py',
329        'x87/compare_and_test/test.py',
330        'x87/compare_and_test/floating_point_ordered_compare.py',
331        'x87/compare_and_test/floating_point_unordered_compare.py',
332        'x87/compare_and_test/integer_compare.py',
333        'x87/stack_management/__init__.py',
334        'x87/stack_management/stack_control.py',
335        'x87/stack_management/clear_state.py',
336        'x87/control/__init__.py',
337        'x87/control/clear_exceptions.py',
338        'x87/control/initialize.py',
339        'x87/control/wait_for_exceptions.py',
340        'x87/control/save_x87_status_word.py',
341        'x87/control/save_and_restore_x87_control_word.py',
342        'x87/control/save_and_restore_x87_environment.py',
343        'x87/no_operation.py'
344        )
345
346
347    # Add in files generated by the ISA description.
348    isa_desc_files = env.ISADesc('isa/main.isa')
349    for f in isa_desc_files:
350        # Add in python file dependencies that won't be caught otherwise
351        for pyfile in python_files:
352            env.Depends(f, "isa/insts/%s" % pyfile)
353        # Only non-header files need to be compiled.
354        if not f.path.endswith('.hh'):
355            Source(f)
356