SConscript revision 5173
14776Sgblack@eecs.umich.edu# -*- mode:python -*-
26365Sgblack@eecs.umich.edu
34776Sgblack@eecs.umich.edu# Copyright (c) 2005-2006 The Regents of The University of Michigan
44776Sgblack@eecs.umich.edu# All rights reserved.
54776Sgblack@eecs.umich.edu#
64776Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
74776Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
84776Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright
94776Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
104776Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
114776Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
124776Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution;
134776Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its
144776Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
154776Sgblack@eecs.umich.edu# this software without specific prior written permission.
164776Sgblack@eecs.umich.edu#
174776Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
184776Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
194776Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
204776Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
214776Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
224776Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
234776Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
244776Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
254776Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
264776Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
274776Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286365Sgblack@eecs.umich.edu#
294776Sgblack@eecs.umich.edu# Authors: Gabe Black
304776Sgblack@eecs.umich.edu
316216Snate@binkert.org# Copyright (c) 2007 The Hewlett-Packard Development Company
326216Snate@binkert.org# All rights reserved.
334776Sgblack@eecs.umich.edu#
346365Sgblack@eecs.umich.edu# Redistribution and use of this software in source and binary forms,
356365Sgblack@eecs.umich.edu# with or without modification, are permitted provided that the
368229Snate@binkert.org# following conditions are met:
378229Snate@binkert.org#
386365Sgblack@eecs.umich.edu# The software must be used only for Non-Commercial Use which means any
394776Sgblack@eecs.umich.edu# use which is NOT directed to receiving any direct monetary
406216Snate@binkert.org# compensation for, or commercial advantage from such use.  Illustrative
416409Sgblack@eecs.umich.edu# examples of non-commercial use are academic research, personal study,
424776Sgblack@eecs.umich.edu# teaching, education and corporate research & development.
434776Sgblack@eecs.umich.edu# Illustrative examples of commercial use are distributing products for
444776Sgblack@eecs.umich.edu# commercial advantage and providing services using the software for
454776Sgblack@eecs.umich.edu# commercial advantage.
464776Sgblack@eecs.umich.edu#
474776Sgblack@eecs.umich.edu# If you wish to use this software or functionality therein that may be
484776Sgblack@eecs.umich.edu# covered by patents for commercial use, please contact:
494776Sgblack@eecs.umich.edu#     Director of Intellectual Property Licensing
506409Sgblack@eecs.umich.edu#     Office of Strategy and Technology
514776Sgblack@eecs.umich.edu#     Hewlett-Packard Company
524776Sgblack@eecs.umich.edu#     1501 Page Mill Road
534776Sgblack@eecs.umich.edu#     Palo Alto, California  94304
544776Sgblack@eecs.umich.edu#
554776Sgblack@eecs.umich.edu# Redistributions of source code must retain the above copyright notice,
564776Sgblack@eecs.umich.edu# this list of conditions and the following disclaimer.  Redistributions
574776Sgblack@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of
587720Sgblack@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or
597720Sgblack@eecs.umich.edu# other materials provided with the distribution.  Neither the name of
606409Sgblack@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
617720Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
625784Sgblack@eecs.umich.edu# this software without specific prior written permission.  No right of
634776Sgblack@eecs.umich.edu# sublicense is granted herewith.  Derivatives of the software and
644776Sgblack@eecs.umich.edu# output created using the software may be prepared, but only for
654776Sgblack@eecs.umich.edu# Non-Commercial Uses.  Derivatives of the software may be shared with
664776Sgblack@eecs.umich.edu# others provided: (i) the others agree to abide by the list of
674776Sgblack@eecs.umich.edu# conditions herein which includes the Non-Commercial Use restrictions;
684776Sgblack@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright
696409Sgblack@eecs.umich.edu# notice to acknowledge the contribution from this software where
704776Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below.
714776Sgblack@eecs.umich.edu#
724776Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
734776Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
744776Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
754776Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
766365Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
774830Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
786365Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
796365Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
804830Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
816365Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
826365Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
837720Sgblack@eecs.umich.edu#
847720Sgblack@eecs.umich.edu# Authors: Gabe Black
856365Sgblack@eecs.umich.edu
866365Sgblack@eecs.umich.eduImport('*')
876365Sgblack@eecs.umich.edu
884830Sgblack@eecs.umich.eduif env['TARGET_ISA'] == 'x86':
896365Sgblack@eecs.umich.edu    Source('emulenv.cc')
907720Sgblack@eecs.umich.edu    Source('floatregfile.cc')
916365Sgblack@eecs.umich.edu    Source('faults.cc')
924776Sgblack@eecs.umich.edu    Source('insts/microfpop.cc')
934830Sgblack@eecs.umich.edu    Source('insts/microldstop.cc')
944830Sgblack@eecs.umich.edu    Source('insts/microop.cc')
954830Sgblack@eecs.umich.edu    Source('insts/microregop.cc')
964830Sgblack@eecs.umich.edu    Source('insts/static_inst.cc')
974830Sgblack@eecs.umich.edu    Source('intregfile.cc')
984830Sgblack@eecs.umich.edu    Source('miscregfile.cc')
994830Sgblack@eecs.umich.edu    Source('pagetable.cc')
1004830Sgblack@eecs.umich.edu    Source('predecoder.cc')
1014830Sgblack@eecs.umich.edu    Source('predecoder_tables.cc')
1024830Sgblack@eecs.umich.edu    Source('regfile.cc')
1034830Sgblack@eecs.umich.edu    Source('remote_gdb.cc')
1044830Sgblack@eecs.umich.edu    Source('tlb.cc')
1054830Sgblack@eecs.umich.edu    Source('utility.cc')
1066365Sgblack@eecs.umich.edu
1076365Sgblack@eecs.umich.edu    SimObject('X86TLB.py')
1084776Sgblack@eecs.umich.edu
1096365Sgblack@eecs.umich.edu    if env['FULL_SYSTEM']:
1106365Sgblack@eecs.umich.edu        SimObject('X86System.py')
1116365Sgblack@eecs.umich.edu
1126365Sgblack@eecs.umich.edu        # Full-system sources
1136365Sgblack@eecs.umich.edu        Source('system.cc')
1146365Sgblack@eecs.umich.edu        Source('stacktrace.cc')
1156365Sgblack@eecs.umich.edu        Source('vtophys.cc')
1166365Sgblack@eecs.umich.edu    else:
1174776Sgblack@eecs.umich.edu        Source('process.cc')
1184776Sgblack@eecs.umich.edu
1196365Sgblack@eecs.umich.edu        Source('linux/linux.cc')
1206365Sgblack@eecs.umich.edu        Source('linux/process.cc')
1214776Sgblack@eecs.umich.edu        Source('linux/syscalls.cc')
1224776Sgblack@eecs.umich.edu
1237811Ssteve.reinhardt@amd.com    python_files = (
1244776Sgblack@eecs.umich.edu        '__init__.py',
1256216Snate@binkert.org        'general_purpose/__init__.py',
126        'general_purpose/arithmetic/__init__.py',
127        'general_purpose/arithmetic/add_and_subtract.py',
128        'general_purpose/arithmetic/increment_and_decrement.py',
129        'general_purpose/arithmetic/multiply_and_divide.py',
130        'general_purpose/cache_and_memory_management.py',
131        'general_purpose/compare_and_test/__init__.py',
132        'general_purpose/compare_and_test/bit_scan.py',
133        'general_purpose/compare_and_test/bit_test.py',
134        'general_purpose/compare_and_test/bounds.py',
135        'general_purpose/compare_and_test/compare.py',
136        'general_purpose/compare_and_test/set_byte_on_condition.py',
137        'general_purpose/compare_and_test/test.py',
138        'general_purpose/control_transfer/__init__.py',
139        'general_purpose/control_transfer/call.py',
140        'general_purpose/control_transfer/conditional_jump.py',
141        'general_purpose/control_transfer/interrupts_and_exceptions.py',
142        'general_purpose/control_transfer/jump.py',
143        'general_purpose/control_transfer/loop.py',
144        'general_purpose/control_transfer/xreturn.py',
145        'general_purpose/data_conversion/__init__.py',
146        'general_purpose/data_conversion/ascii_adjust.py',
147        'general_purpose/data_conversion/bcd_adjust.py',
148        'general_purpose/data_conversion/endian_conversion.py',
149        'general_purpose/data_conversion/extract_sign_mask.py',
150        'general_purpose/data_conversion/sign_extension.py',
151        'general_purpose/data_conversion/translate.py',
152        'general_purpose/data_transfer/__init__.py',
153        'general_purpose/data_transfer/conditional_move.py',
154        'general_purpose/data_transfer/move.py',
155        'general_purpose/data_transfer/stack_operations.py',
156        'general_purpose/data_transfer/xchg.py',
157        'general_purpose/flags/__init__.py',
158        'general_purpose/flags/load_and_store.py',
159        'general_purpose/flags/push_and_pop.py',
160        'general_purpose/flags/set_and_clear.py',
161        'general_purpose/input_output/__init__.py',
162        'general_purpose/input_output/general_io.py',
163        'general_purpose/input_output/string_io.py',
164        'general_purpose/load_effective_address.py',
165        'general_purpose/load_segment_registers.py',
166        'general_purpose/logical.py',
167        'general_purpose/no_operation.py',
168        'general_purpose/processor_information.py',
169        'general_purpose/rotate_and_shift/__init__.py',
170        'general_purpose/rotate_and_shift/rotate.py',
171        'general_purpose/rotate_and_shift/shift.py',
172        'general_purpose/semaphores.py',
173        'general_purpose/string/__init__.py',
174        'general_purpose/string/compare_strings.py',
175        'general_purpose/string/load_string.py',
176        'general_purpose/string/move_string.py',
177        'general_purpose/string/scan_string.py',
178        'general_purpose/string/store_string.py',
179        'general_purpose/system_calls.py',
180        'system/__init__.py',
181        'system/halt.py',
182        'system/undefined_operation.py',
183        'system/msrs.py',
184        'simd128/__init__.py',
185        'simd128/integer/__init__.py',
186        'simd128/integer/data_transfer/__init__.py',
187        'simd128/integer/data_transfer/move.py',
188        'simd128/integer/data_transfer/move_non_temporal.py',
189        'simd128/integer/data_transfer/move_mask.py',
190        'simd128/integer/data_conversion/__init__.py',
191        'simd128/integer/data_conversion/convert_mmx_integer_to_floating_point.py',
192        'simd128/integer/data_conversion/convert_integer_to_floating_point.py',
193        'simd128/integer/data_conversion/convert_gpr_integer_to_floating_point.py',
194        'simd128/integer/data_reordering/__init__.py',
195        'simd128/integer/data_reordering/unpack_and_interleave.py',
196        'simd128/integer/data_reordering/pack_with_saturation.py',
197        'simd128/integer/data_reordering/extract_and_insert.py',
198        'simd128/integer/data_reordering/shuffle.py',
199        'simd128/integer/arithmetic/__init__.py',
200        'simd128/integer/arithmetic/subtraction.py',
201        'simd128/integer/arithmetic/addition.py',
202        'simd128/integer/arithmetic/multiplication.py',
203        'simd128/integer/arithmetic/multiply_add.py',
204        'simd128/integer/arithmetic/average.py',
205        'simd128/integer/arithmetic/sum_of_absolute_differences.py',
206        'simd128/integer/shift/__init__.py',
207        'simd128/integer/shift/right_arithmetic_shift.py',
208        'simd128/integer/shift/left_logical_shift.py',
209        'simd128/integer/shift/right_logical_shift.py',
210        'simd128/integer/compare/__init__.py',
211        'simd128/integer/compare/compare_and_write_mask.py',
212        'simd128/integer/compare/compare_and_write_minimum_or_maximum.py',
213        'simd128/integer/logical/__init__.py',
214        'simd128/integer/logical/pand.py',
215        'simd128/integer/logical/por.py',
216        'simd128/integer/logical/exclusive_or.py',
217        'simd128/integer/save_and_restore_state/__init__.py',
218        'simd128/integer/save_and_restore_state/save_and_restore_state.py',
219        'simd128/integer/save_and_restore_state/save_and_restore_control_and_status.py',
220        'simd128/floating_point/__init__.py',
221        'simd128/floating_point/data_transfer/__init__.py',
222        'simd128/floating_point/data_transfer/move_mask.py',
223        'simd128/floating_point/data_transfer/move.py',
224        'simd128/floating_point/data_transfer/move_with_duplication.py',
225        'simd128/floating_point/data_transfer/move_non_temporal.py',
226        'simd128/floating_point/data_conversion/__init__.py',
227        'simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py',
228        'simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py',
229        'simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py',
230        'simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py',
231        'simd128/floating_point/data_reordering/__init__.py',
232        'simd128/floating_point/data_reordering/unpack_and_interleave.py',
233        'simd128/floating_point/data_reordering/shuffle.py',
234        'simd128/floating_point/arithmetic/__init__.py',
235        'simd128/floating_point/arithmetic/subtraction.py',
236        'simd128/floating_point/arithmetic/addition.py',
237        'simd128/floating_point/arithmetic/horizontal_subtraction.py',
238        'simd128/floating_point/arithmetic/horizontal_addition.py',
239        'simd128/floating_point/arithmetic/square_root.py',
240        'simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py',
241        'simd128/floating_point/arithmetic/multiplication.py',
242        'simd128/floating_point/arithmetic/division.py',
243        'simd128/floating_point/arithmetic/reciprocal_square_root.py',
244        'simd128/floating_point/arithmetic/reciprocal_estimation.py',
245        'simd128/floating_point/compare/__init__.py',
246        'simd128/floating_point/compare/compare_and_write_mask.py',
247        'simd128/floating_point/compare/compare_and_write_rflags.py',
248        'simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py',
249        'simd128/floating_point/logical/__init__.py',
250        'simd128/floating_point/logical/andp.py',
251        'simd128/floating_point/logical/orp.py',
252        'simd128/floating_point/logical/exclusive_or.py',
253        'simd64/__init__.py',
254        'simd64/integer/__init__.py',
255        'simd64/integer/data_transfer/__init__.py',
256        'simd64/integer/data_transfer/move_mask.py',
257        'simd64/integer/data_transfer/move.py',
258        'simd64/integer/data_transfer/move_non_temporal.py',
259        'simd64/integer/exit_media_state.py',
260        'simd64/integer/data_reordering/__init__.py',
261        'simd64/integer/data_reordering/unpack_and_interleave.py',
262        'simd64/integer/data_reordering/pack_with_saturation.py',
263        'simd64/integer/data_reordering/extract_and_insert.py',
264        'simd64/integer/data_reordering/shuffle_and_swap.py',
265        'simd64/integer/data_conversion.py',
266        'simd64/integer/arithmetic/__init__.py',
267        'simd64/integer/arithmetic/subtraction.py',
268        'simd64/integer/arithmetic/addition.py',
269        'simd64/integer/arithmetic/multiplication.py',
270        'simd64/integer/arithmetic/multiply_add.py',
271        'simd64/integer/arithmetic/average.py',
272        'simd64/integer/arithmetic/sum_of_absolute_differences.py',
273        'simd64/integer/shift/__init__.py',
274        'simd64/integer/shift/right_arithmetic_shift.py',
275        'simd64/integer/shift/left_logical_shift.py',
276        'simd64/integer/shift/right_logical_shift.py',
277        'simd64/integer/compare/__init__.py',
278        'simd64/integer/compare/compare_and_write_mask.py',
279        'simd64/integer/compare/compare_and_write_minimum_or_maximum.py',
280        'simd64/integer/logical/__init__.py',
281        'simd64/integer/logical/pand.py',
282        'simd64/integer/logical/por.py',
283        'simd64/integer/logical/exclusive_or.py',
284        'simd64/integer/save_and_restore_state.py',
285        'simd64/floating_point/__init__.py',
286        'simd64/floating_point/arithmetic/__init__.py',
287        'simd64/floating_point/arithmetic/subtraction.py',
288        'simd64/floating_point/arithmetic/addition.py',
289        'simd64/floating_point/arithmetic/reciprocal_estimation.py',
290        'simd64/floating_point/arithmetic/multiplication.py',
291        'simd64/floating_point/arithmetic/accumulation.py',
292        'simd64/floating_point/arithmetic/reciprocal_square_root.py',
293        'simd64/floating_point/data_conversion.py',
294        'simd64/floating_point/compare/__init__.py',
295        'simd64/floating_point/compare/compare_and_write_mask.py',
296        'simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py',
297        'x87/__init__.py',
298        'x87/data_transfer_and_conversion/__init__.py',
299        'x87/data_transfer_and_conversion/convert_and_load_or_store_integer.py',
300        'x87/data_transfer_and_conversion/load_or_store_floating_point.py',
301        'x87/data_transfer_and_conversion/exchange.py',
302        'x87/data_transfer_and_conversion/convert_and_load_or_store_bcd.py',
303        'x87/data_transfer_and_conversion/conditional_move.py',
304        'x87/data_transfer_and_conversion/extract.py',
305        'x87/load_constants/__init__.py',
306        'x87/load_constants/load_0_1_or_pi.py',
307        'x87/load_constants/load_logarithm.py',
308        'x87/arithmetic/__init__.py',
309        'x87/arithmetic/subtraction.py',
310        'x87/arithmetic/addition.py',
311        'x87/arithmetic/partial_remainder.py',
312        'x87/arithmetic/multiplication.py',
313        'x87/arithmetic/division.py',
314        'x87/arithmetic/change_sign.py',
315        'x87/arithmetic/round.py',
316        'x87/arithmetic/square_root.py',
317        'x87/transcendental_functions/__init__.py',
318        'x87/transcendental_functions/trigonometric_functions.py',
319        'x87/transcendental_functions/logarithmic_functions.py',
320        'x87/compare_and_test/__init__.py',
321        'x87/compare_and_test/classify.py',
322        'x87/compare_and_test/test.py',
323        'x87/compare_and_test/floating_point_ordered_compare.py',
324        'x87/compare_and_test/floating_point_unordered_compare.py',
325        'x87/compare_and_test/integer_compare.py',
326        'x87/stack_management/__init__.py',
327        'x87/stack_management/stack_control.py',
328        'x87/stack_management/clear_state.py',
329        'x87/control/__init__.py',
330        'x87/control/clear_exceptions.py',
331        'x87/control/initialize.py',
332        'x87/control/wait_for_exceptions.py',
333        'x87/control/save_x87_status_word.py',
334        'x87/control/save_and_restore_x87_control_word.py',
335        'x87/control/save_and_restore_x87_environment.py',
336        'x87/no_operation.py'
337        )
338
339
340    # Add in files generated by the ISA description.
341    isa_desc_files = env.ISADesc('isa/main.isa')
342    for f in isa_desc_files:
343        # Add in python file dependencies that won't be caught otherwise
344        for pyfile in python_files:
345            env.Depends(f, "isa/insts/%s" % pyfile)
346        # Only non-header files need to be compiled.
347        if not f.path.endswith('.hh'):
348            Source(f)
349