SConscript revision 5069
16145SN/A# -*- mode:python -*-
28683SN/A
310973Sdavid.hashe@amd.com# Copyright (c) 2005-2006 The Regents of The University of Michigan
46145SN/A# All rights reserved.
56145SN/A#
66145SN/A# Redistribution and use in source and binary forms, with or without
76145SN/A# modification, are permitted provided that the following conditions are
86145SN/A# met: redistributions of source code must retain the above copyright
96145SN/A# notice, this list of conditions and the following disclaimer;
106145SN/A# redistributions in binary form must reproduce the above copyright
116145SN/A# notice, this list of conditions and the following disclaimer in the
126145SN/A# documentation and/or other materials provided with the distribution;
136145SN/A# neither the name of the copyright holders nor the names of its
146145SN/A# contributors may be used to endorse or promote products derived from
156145SN/A# this software without specific prior written permission.
166145SN/A#
176145SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186145SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196145SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206145SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216145SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226145SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236145SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246145SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256145SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266145SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276145SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286145SN/A#
296145SN/A# Authors: Gabe Black
3010441Snilay@cs.wisc.edu
3110441Snilay@cs.wisc.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
326145SN/A# All rights reserved.
337055SN/A#
346145SN/A# Redistribution and use of this software in source and binary forms,
356145SN/A# with or without modification, are permitted provided that the
367039SN/A# following conditions are met:
379104SN/A#
3810301Snilay@cs.wisc.edu# The software must be used only for Non-Commercial Use which means any
399105SN/A# use which is NOT directed to receiving any direct monetary
408174SN/A# compensation for, or commercial advantage from such use.  Illustrative
417039SN/A# examples of non-commercial use are academic research, personal study,
427039SN/A# teaching, education and corporate research & development.
437039SN/A# Illustrative examples of commercial use are distributing products for
4410970Sdavid.hashe@amd.com# commercial advantage and providing services using the software for
4510301Snilay@cs.wisc.edu# commercial advantage.
4610301Snilay@cs.wisc.edu#
477039SN/A# If you wish to use this software or functionality therein that may be
487039SN/A# covered by patents for commercial use, please contact:
496145SN/A#     Director of Intellectual Property Licensing
507039SN/A#     Office of Strategy and Technology
517039SN/A#     Hewlett-Packard Company
527039SN/A#     1501 Page Mill Road
536876SN/A#     Palo Alto, California  94304
547039SN/A#
557039SN/A# Redistributions of source code must retain the above copyright notice,
566145SN/A# this list of conditions and the following disclaimer.  Redistributions
577039SN/A# in binary form must reproduce the above copyright notice, this list of
586145SN/A# conditions and the following disclaimer in the documentation and/or
597039SN/A# other materials provided with the distribution.  Neither the name of
607039SN/A# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
618165SN/A# contributors may be used to endorse or promote products derived from
627039SN/A# this software without specific prior written permission.  No right of
636145SN/A# sublicense is granted herewith.  Derivatives of the software and
647039SN/A# output created using the software may be prepared, but only for
658165SN/A# Non-Commercial Uses.  Derivatives of the software may be shared with
667039SN/A# others provided: (i) the others agree to abide by the list of
676145SN/A# conditions herein which includes the Non-Commercial Use restrictions;
687039SN/A# and (ii) such Derivatives of the software include the above copyright
697039SN/A# notice to acknowledge the contribution from this software where
706145SN/A# applicable, this list of conditions and the disclaimer below.
717039SN/A#
727039SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
737039SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
747039SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
756145SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
767039SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7710974Sdavid.hashe@amd.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7810974Sdavid.hashe@amd.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7910974Sdavid.hashe@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8010974Sdavid.hashe@amd.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8110974Sdavid.hashe@amd.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8210974Sdavid.hashe@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8310974Sdavid.hashe@amd.com#
848193SN/A# Authors: Gabe Black
858193SN/A
8610974Sdavid.hashe@amd.comImport('*')
878193SN/A
886145SN/Aif env['TARGET_ISA'] == 'x86':
897039SN/A    Source('emulenv.cc')
907039SN/A    Source('floatregfile.cc')
916145SN/A    Source('insts/microldstop.cc')
927039SN/A    Source('insts/microregop.cc')
937039SN/A    Source('insts/static_inst.cc')
946145SN/A    Source('intregfile.cc')
957039SN/A    Source('miscregfile.cc')
967839SN/A    Source('predecoder.cc')
977839SN/A    Source('predecoder_tables.cc')
986145SN/A    Source('regfile.cc')
999499SN/A    Source('remote_gdb.cc')
10010969Sdavid.hashe@amd.com    Source('tlb.cc')
10110969Sdavid.hashe@amd.com
10210969Sdavid.hashe@amd.com    SimObject('X86TLB.py')
1036285SN/A
1047039SN/A    if env['FULL_SYSTEM']:
1058683SN/A        # Full-system sources
1066145SN/A        pass
1077039SN/A    else:
1087039SN/A        Source('process.cc')
1096145SN/A
1107039SN/A        Source('linux/linux.cc')
1117039SN/A        Source('linux/process.cc')
1127039SN/A        Source('linux/syscalls.cc')
1139692SN/A
1147039SN/A    python_files = (
1157055SN/A            '__init__.py',
1167055SN/A            'arithmetic/__init__.py',
1176145SN/A            'arithmetic/add_and_subtract.py',
1189692SN/A            'arithmetic/increment_and_decrement.py',
1199692SN/A            'arithmetic/multiply_and_divide.py',
1209692SN/A            'cache_and_memory_management.py',
1216374SN/A            'compare_and_test/__init__.py',
1229692SN/A            'compare_and_test/bit_scan.py',
1239692SN/A            'compare_and_test/bit_test.py',
1249692SN/A            'compare_and_test/bounds.py',
1259692SN/A            'compare_and_test/compare.py',
1269692SN/A            'compare_and_test/set_byte_on_condition.py',
1279692SN/A            'compare_and_test/test.py',
1289692SN/A            'control_transfer/__init__.py',
1299692SN/A            'control_transfer/call.py',
1309692SN/A            'control_transfer/conditional_jump.py',
1319692SN/A            'control_transfer/interrupts_and_exceptions.py',
1329104SN/A            'control_transfer/jump.py',
1339104SN/A            'control_transfer/loop.py',
1349104SN/A            'control_transfer/xreturn.py',
1359104SN/A            'data_conversion/__init__.py',
1369104SN/A            'data_conversion/ascii_adjust.py',
1379104SN/A            'data_conversion/bcd_adjust.py',
1389105SN/A            'data_conversion/endian_conversion.py',
1399105SN/A            'data_conversion/extract_sign_mask.py',
1409692SN/A            'data_conversion/sign_extension.py',
14110973Sdavid.hashe@amd.com            'data_conversion/translate.py',
14210973Sdavid.hashe@amd.com            'data_transfer/__init__.py',
14310973Sdavid.hashe@amd.com            'data_transfer/conditional_move.py',
14410973Sdavid.hashe@amd.com            'data_transfer/move.py',
1457039SN/A            'data_transfer/stack_operations.py',
1467039SN/A            'data_transfer/xchg.py',
14710314Snilay@cs.wisc.edu            'flags/__init__.py',
1486145SN/A            'flags/load_and_store.py',
1497039SN/A            'flags/push_and_pop.py',
1507039SN/A            'flags/set_and_clear.py',
15110314Snilay@cs.wisc.edu            'input_output/__init__.py',
15210314Snilay@cs.wisc.edu            'input_output/general_io.py',
1537039SN/A            'input_output/string_io.py',
1546145SN/A            'load_effective_address.py',
1557039SN/A            'load_segment_registers.py',
1567039SN/A            'logical.py',
1577039SN/A            'no_operation.py',
1586145SN/A            'processor_information.py',
1597039SN/A            'rotate_and_shift/__init__.py',
1609499SN/A            'rotate_and_shift/rotate.py',
1616145SN/A            'rotate_and_shift/shift.py',
1627039SN/A            'semaphores.py',
1637039SN/A            'string/__init__.py',
1646285SN/A            'string/compare_strings.py',
1657039SN/A            'string/load_string.py',
1667039SN/A            'string/move_string.py',
1677039SN/A            'string/scan_string.py',
1687454SN/A            'string/store_string.py',
1696145SN/A            'system/__init__.py',
1707039SN/A            'system/undefined_operation.py',
1716145SN/A            'system_calls.py',
1729105SN/A            'sse/__init__.py',
1739105SN/A            'sse/move.py',
1749105SN/A            'sse/convert.py',
1757039SN/A            'sse/add_and_subtract.py',
1767039SN/A            'sse/multiply_and_divide.py',
1777039SN/A            'sse/logical.py',
1787039SN/A            'sse/compare.py',
1797564SN/A            'sse/square_root.py'
1809105SN/A            )
1816145SN/A
1826145SN/A    # Add in files generated by the ISA description.
1839554SN/A    isa_desc_files = env.ISADesc('isa/main.isa')
1849554SN/A    for f in isa_desc_files:
18510441Snilay@cs.wisc.edu        # Add in python file dependencies that won't be caught otherwise
186        for pyfile in python_files:
187            env.Depends(f, "isa/insts/%s" % pyfile)
188        # Only non-header files need to be compiled.
189        if not f.path.endswith('.hh'):
190            Source(f)
191