SConscript revision 5069
1# -*- mode:python -*-
2
3# Copyright (c) 2005-2006 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer;
10# redistributions in binary form must reproduce the above copyright
11# notice, this list of conditions and the following disclaimer in the
12# documentation and/or other materials provided with the distribution;
13# neither the name of the copyright holders nor the names of its
14# contributors may be used to endorse or promote products derived from
15# this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29# Authors: Gabe Black
30
31# Copyright (c) 2007 The Hewlett-Packard Development Company
32# All rights reserved.
33#
34# Redistribution and use of this software in source and binary forms,
35# with or without modification, are permitted provided that the
36# following conditions are met:
37#
38# The software must be used only for Non-Commercial Use which means any
39# use which is NOT directed to receiving any direct monetary
40# compensation for, or commercial advantage from such use.  Illustrative
41# examples of non-commercial use are academic research, personal study,
42# teaching, education and corporate research & development.
43# Illustrative examples of commercial use are distributing products for
44# commercial advantage and providing services using the software for
45# commercial advantage.
46#
47# If you wish to use this software or functionality therein that may be
48# covered by patents for commercial use, please contact:
49#     Director of Intellectual Property Licensing
50#     Office of Strategy and Technology
51#     Hewlett-Packard Company
52#     1501 Page Mill Road
53#     Palo Alto, California  94304
54#
55# Redistributions of source code must retain the above copyright notice,
56# this list of conditions and the following disclaimer.  Redistributions
57# in binary form must reproduce the above copyright notice, this list of
58# conditions and the following disclaimer in the documentation and/or
59# other materials provided with the distribution.  Neither the name of
60# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
61# contributors may be used to endorse or promote products derived from
62# this software without specific prior written permission.  No right of
63# sublicense is granted herewith.  Derivatives of the software and
64# output created using the software may be prepared, but only for
65# Non-Commercial Uses.  Derivatives of the software may be shared with
66# others provided: (i) the others agree to abide by the list of
67# conditions herein which includes the Non-Commercial Use restrictions;
68# and (ii) such Derivatives of the software include the above copyright
69# notice to acknowledge the contribution from this software where
70# applicable, this list of conditions and the disclaimer below.
71#
72# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
73# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
74# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
75# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
76# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
77# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
78# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
79# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
80# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
81# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
82# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
83#
84# Authors: Gabe Black
85
86Import('*')
87
88if env['TARGET_ISA'] == 'x86':
89    Source('emulenv.cc')
90    Source('floatregfile.cc')
91    Source('insts/microldstop.cc')
92    Source('insts/microregop.cc')
93    Source('insts/static_inst.cc')
94    Source('intregfile.cc')
95    Source('miscregfile.cc')
96    Source('predecoder.cc')
97    Source('predecoder_tables.cc')
98    Source('regfile.cc')
99    Source('remote_gdb.cc')
100    Source('tlb.cc')
101
102    SimObject('X86TLB.py')
103
104    if env['FULL_SYSTEM']:
105        # Full-system sources
106        pass
107    else:
108        Source('process.cc')
109
110        Source('linux/linux.cc')
111        Source('linux/process.cc')
112        Source('linux/syscalls.cc')
113
114    python_files = (
115            '__init__.py',
116            'arithmetic/__init__.py',
117            'arithmetic/add_and_subtract.py',
118            'arithmetic/increment_and_decrement.py',
119            'arithmetic/multiply_and_divide.py',
120            'cache_and_memory_management.py',
121            'compare_and_test/__init__.py',
122            'compare_and_test/bit_scan.py',
123            'compare_and_test/bit_test.py',
124            'compare_and_test/bounds.py',
125            'compare_and_test/compare.py',
126            'compare_and_test/set_byte_on_condition.py',
127            'compare_and_test/test.py',
128            'control_transfer/__init__.py',
129            'control_transfer/call.py',
130            'control_transfer/conditional_jump.py',
131            'control_transfer/interrupts_and_exceptions.py',
132            'control_transfer/jump.py',
133            'control_transfer/loop.py',
134            'control_transfer/xreturn.py',
135            'data_conversion/__init__.py',
136            'data_conversion/ascii_adjust.py',
137            'data_conversion/bcd_adjust.py',
138            'data_conversion/endian_conversion.py',
139            'data_conversion/extract_sign_mask.py',
140            'data_conversion/sign_extension.py',
141            'data_conversion/translate.py',
142            'data_transfer/__init__.py',
143            'data_transfer/conditional_move.py',
144            'data_transfer/move.py',
145            'data_transfer/stack_operations.py',
146            'data_transfer/xchg.py',
147            'flags/__init__.py',
148            'flags/load_and_store.py',
149            'flags/push_and_pop.py',
150            'flags/set_and_clear.py',
151            'input_output/__init__.py',
152            'input_output/general_io.py',
153            'input_output/string_io.py',
154            'load_effective_address.py',
155            'load_segment_registers.py',
156            'logical.py',
157            'no_operation.py',
158            'processor_information.py',
159            'rotate_and_shift/__init__.py',
160            'rotate_and_shift/rotate.py',
161            'rotate_and_shift/shift.py',
162            'semaphores.py',
163            'string/__init__.py',
164            'string/compare_strings.py',
165            'string/load_string.py',
166            'string/move_string.py',
167            'string/scan_string.py',
168            'string/store_string.py',
169            'system/__init__.py',
170            'system/undefined_operation.py',
171            'system_calls.py',
172            'sse/__init__.py',
173            'sse/move.py',
174            'sse/convert.py',
175            'sse/add_and_subtract.py',
176            'sse/multiply_and_divide.py',
177            'sse/logical.py',
178            'sse/compare.py',
179            'sse/square_root.py'
180            )
181
182    # Add in files generated by the ISA description.
183    isa_desc_files = env.ISADesc('isa/main.isa')
184    for f in isa_desc_files:
185        # 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