SConscript revision 2155
12155SN/A# -*- mode:python -*- 22155SN/A 32155SN/A# Copyright (c) 2006 The Regents of The University of Michigan 42155SN/A# All rights reserved. 52155SN/A# 62155SN/A# Redistribution and use in source and binary forms, with or without 72155SN/A# modification, are permitted provided that the following conditions are 82155SN/A# met: redistributions of source code must retain the above copyright 92155SN/A# notice, this list of conditions and the following disclaimer; 102155SN/A# redistributions in binary form must reproduce the above copyright 112155SN/A# notice, this list of conditions and the following disclaimer in the 122155SN/A# documentation and/or other materials provided with the distribution; 132155SN/A# neither the name of the copyright holders nor the names of its 142155SN/A# contributors may be used to endorse or promote products derived from 152155SN/A# this software without specific prior written permission. 162155SN/A# 172155SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 182155SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 192155SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 202155SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 212155SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 222155SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 232155SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 242155SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 252155SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 262155SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272155SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282665Ssaidi@eecs.umich.edu 292665Ssaidi@eecs.umich.eduimport os 302155SN/Aimport os.path 312155SN/A 322155SN/A# Import build environment variable from SConstruct. 332155SN/AImport('env') 342155SN/A 352155SN/Amodels_db = File('cpu_models.py') 362155SN/Aexecfile(models_db.srcnode().abspath) 372178SN/A 382178SN/Aexec_sig_template = ''' 392178SN/Avirtual Fault execute(%s *xc, Trace::InstRecord *traceData) const = 0; 402178SN/A''' 412178SN/A 422178SN/Adef gen_cpu_exec_signatures(target, source, env): 432178SN/A f = open(str(target[0]), 'w') 442178SN/A print >> f, ''' 452178SN/A#ifndef __CPU_STATIC_INST_EXEC_SIGS_HH__ 462178SN/A#define __CPU_STATIC_INST_EXEC_SIGS_HH__ 472178SN/A''' 482178SN/A for cpu in env['CPU_MODELS']: 492155SN/A xc_type = CpuModel.dict[cpu].strings['CPU_exec_context'] 502178SN/A print >> f, exec_sig_template % xc_type 512155SN/A print >> f, ''' 522155SN/A#endif // __CPU_STATIC_INST_EXEC_SIGS_HH__ 532178SN/A''' 542155SN/A 552155SN/Aenv.Command('static_inst_exec_sigs.hh', models_db, gen_cpu_exec_signatures) 562623SN/A 572623SN/Asources = [] 582623SN/A 592623SN/Aif 'SimpleCPU' in env['CPU_MODELS']: 602623SN/A sources += Split('simple/cpu.cc') 612155SN/A 622155SN/Aif 'FastCPU' in env['CPU_MODELS']: 632292SN/A sources += Split('fast/cpu.cc') 642292SN/A 652292SN/Aif 'AlphaFullCPU' in env['CPU_MODELS']: 662292SN/A sources += Split(''' 672292SN/A o3/2bit_local_pred.cc 682292SN/A o3/alpha_dyn_inst.cc 692292SN/A o3/alpha_cpu.cc 702292SN/A o3/alpha_cpu_builder.cc 712766Sktlim@umich.edu o3/bpred_unit.cc 722766Sktlim@umich.edu o3/btb.cc 732766Sktlim@umich.edu o3/commit.cc 742766Sktlim@umich.edu o3/decode.cc 752766Sktlim@umich.edu o3/fetch.cc 762766Sktlim@umich.edu o3/free_list.cc 772766Sktlim@umich.edu o3/cpu.cc 782178SN/A o3/iew.cc 792155SN/A o3/inst_queue.cc 802155SN/A o3/ldstq.cc 812155SN/A o3/mem_dep_unit.cc 822155SN/A o3/ras.cc 832155SN/A o3/rename.cc 842155SN/A o3/rename_map.cc 852766Sktlim@umich.edu o3/rob.cc 862155SN/A o3/sat_counter.cc 872623SN/A o3/store_set.cc 882155SN/A o3/tournament_pred.cc 892155SN/A ''') 902155SN/A 912155SN/A# FullCPU sources are included from m5/SConscript since they're not 922178SN/A# below this point in the file hierarchy. 932178SN/A 942178SN/A# Convert file names to SCons File objects. This takes care of the 952766Sktlim@umich.edu# path relative to the top of the directory tree. 962178SN/Asources = [File(s) for s in sources] 972178SN/A 982178SN/AReturn('sources') 992178SN/A 1002766Sktlim@umich.edu