SConscript revision 4120
16019Shines@cs.fsu.edu# -*- mode:python -*- 26019Shines@cs.fsu.edu 36019Shines@cs.fsu.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 46757SAli.Saidi@ARM.com# All rights reserved. 56019Shines@cs.fsu.edu# 66019Shines@cs.fsu.edu# Redistribution and use in source and binary forms, with or without 76019Shines@cs.fsu.edu# modification, are permitted provided that the following conditions are 86019Shines@cs.fsu.edu# met: redistributions of source code must retain the above copyright 96019Shines@cs.fsu.edu# notice, this list of conditions and the following disclaimer; 106019Shines@cs.fsu.edu# redistributions in binary form must reproduce the above copyright 116019Shines@cs.fsu.edu# notice, this list of conditions and the following disclaimer in the 126019Shines@cs.fsu.edu# documentation and/or other materials provided with the distribution; 136019Shines@cs.fsu.edu# neither the name of the copyright holders nor the names of its 146019Shines@cs.fsu.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# Steve Reinhardt 316757SAli.Saidi@ARM.com 326019Shines@cs.fsu.eduimport os 336019Shines@cs.fsu.eduimport sys 346019Shines@cs.fsu.edufrom os.path import isdir 356019Shines@cs.fsu.edu 366019Shines@cs.fsu.edu# This file defines how to build a particular configuration of M5 376019Shines@cs.fsu.edu# based on variable settings in the 'env' build environment. 386019Shines@cs.fsu.edu 396019Shines@cs.fsu.edu# Import build environment variable from SConstruct. 406253Sgblack@eecs.umich.eduImport('env') 416253Sgblack@eecs.umich.edu 426253Sgblack@eecs.umich.edu################################################### 436253Sgblack@eecs.umich.edu# 446397Sgblack@eecs.umich.edu# Define needed sources. 456019Shines@cs.fsu.edu# 466019Shines@cs.fsu.edu################################################### 476019Shines@cs.fsu.edu 486757SAli.Saidi@ARM.com# Base sources used by all configurations. 496019Shines@cs.fsu.edubase_sources = Split(''' 506397Sgblack@eecs.umich.edu faults.cc 516019Shines@cs.fsu.edu floatregfile.cc 526397Sgblack@eecs.umich.edu intregfile.cc 536019Shines@cs.fsu.edu miscregfile.cc 546735Sgblack@eecs.umich.edu regfile.cc 556019Shines@cs.fsu.edu remote_gdb.cc 566757SAli.Saidi@ARM.com ''') 576757SAli.Saidi@ARM.com 586757SAli.Saidi@ARM.com# Full-system sources 596757SAli.Saidi@ARM.comfull_system_sources = Split(''' 606757SAli.Saidi@ARM.com arguments.cc 616757SAli.Saidi@ARM.com ev5.cc 626019Shines@cs.fsu.edu freebsd/system.cc 636019Shines@cs.fsu.edu idle_event.cc 646019Shines@cs.fsu.edu ipr.cc 656019Shines@cs.fsu.edu kernel_stats.cc 666019Shines@cs.fsu.edu linux/system.cc 676019Shines@cs.fsu.edu osfpal.cc 686019Shines@cs.fsu.edu pagetable.cc 696019Shines@cs.fsu.edu stacktrace.cc 706019Shines@cs.fsu.edu system.cc 716019Shines@cs.fsu.edu tlb.cc 726019Shines@cs.fsu.edu tru64/system.cc 736019Shines@cs.fsu.edu vtophys.cc 74 ''') 75 76 77# Syscall emulation (non-full-system) sources 78syscall_emulation_sources = Split(''' 79 linux/linux.cc 80 linux/process.cc 81 tru64/tru64.cc 82 tru64/process.cc 83 process.cc 84 ''') 85 86# Set up complete list of sources based on configuration. 87sources = base_sources 88 89if env['FULL_SYSTEM']: 90 sources += full_system_sources 91else: 92 sources += syscall_emulation_sources 93 94# Convert file names to SCons File objects. This takes care of the 95# path relative to the top of the directory tree. 96sources = [File(s) for s in sources] 97 98# Add in files generated by the ISA description. 99isa_desc_files = env.ISADesc('isa/main.isa') 100# Only non-header files need to be compiled. 101isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 102sources += isa_desc_sources 103 104Return('sources') 105