SConscript revision 1070
1955SN/A# -*- mode:python -*-
2955SN/A
311408Sandreas.sandberg@arm.com# Copyright (c) 2004 The Regents of The University of Michigan
49812Sandreas.hansson@arm.com# All rights reserved.
59812Sandreas.hansson@arm.com#
69812Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without
79812Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are
89812Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright
99812Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer;
109812Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright
119812Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the
129812Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution;
139812Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its
149812Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from
157816Ssteve.reinhardt@amd.com# this software without specific prior written permission.
165871Snate@binkert.org#
171762SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28955SN/A
29955SN/Aimport os
30955SN/Aimport sys
31955SN/A
32955SN/A# This file defines how to build a particular configuration of M5
33955SN/A# based on variable settings in the 'env' build environment.
34955SN/A
35955SN/A# Import build environment variable from SConstruct.
36955SN/AImport('env')
37955SN/A
38955SN/A###################################################
39955SN/A#
40955SN/A# Define needed sources.
41955SN/A#
422665Ssaidi@eecs.umich.edu###################################################
432665Ssaidi@eecs.umich.edu
445863Snate@binkert.org# Base sources used by all configurations.
45955SN/Abase_sources = Split('''
46955SN/A	arch/alpha/decoder.cc
47955SN/A	arch/alpha/fast_cpu_exec.cc
48955SN/A	arch/alpha/simple_cpu_exec.cc
49955SN/A	arch/alpha/full_cpu_exec.cc
508878Ssteve.reinhardt@amd.com	arch/alpha/faults.cc
512632Sstever@eecs.umich.edu	arch/alpha/isa_traits.cc
528878Ssteve.reinhardt@amd.com
532632Sstever@eecs.umich.edu	base/circlebuf.cc
54955SN/A	base/copyright.cc
558878Ssteve.reinhardt@amd.com	base/cprintf.cc
562632Sstever@eecs.umich.edu	base/fast_alloc.cc
572761Sstever@eecs.umich.edu	base/fifo_buffer.cc
582632Sstever@eecs.umich.edu	base/hostinfo.cc
592632Sstever@eecs.umich.edu	base/hybrid_pred.cc
602632Sstever@eecs.umich.edu	base/inifile.cc
612761Sstever@eecs.umich.edu	base/intmath.cc
622761Sstever@eecs.umich.edu	base/match.cc
632761Sstever@eecs.umich.edu	base/misc.cc
648878Ssteve.reinhardt@amd.com	base/pollevent.cc
658878Ssteve.reinhardt@amd.com	base/python.cc
662761Sstever@eecs.umich.edu	base/range.cc
672761Sstever@eecs.umich.edu	base/sat_counter.cc
682761Sstever@eecs.umich.edu	base/socket.cc
692761Sstever@eecs.umich.edu	base/statistics.cc
702761Sstever@eecs.umich.edu	base/str.cc
718878Ssteve.reinhardt@amd.com	base/time.cc
728878Ssteve.reinhardt@amd.com	base/trace.cc
732632Sstever@eecs.umich.edu	base/traceflags.cc
742632Sstever@eecs.umich.edu	base/userinfo.cc
758878Ssteve.reinhardt@amd.com	base/compression/lzss_compression.cc
768878Ssteve.reinhardt@amd.com	base/loader/aout_object.cc
772632Sstever@eecs.umich.edu	base/loader/ecoff_object.cc
78955SN/A	base/loader/elf_object.cc
79955SN/A	base/loader/object_file.cc
80955SN/A	base/loader/symtab.cc
815863Snate@binkert.org	base/stats/events.cc
825863Snate@binkert.org	base/stats/python.cc
835863Snate@binkert.org	base/stats/statdb.cc
845863Snate@binkert.org	base/stats/visit.cc
855863Snate@binkert.org	base/stats/text.cc
865863Snate@binkert.org
875863Snate@binkert.org	cpu/base_cpu.cc
885863Snate@binkert.org	cpu/exec_context.cc
895863Snate@binkert.org	cpu/exetrace.cc
905863Snate@binkert.org	cpu/pc_event.cc
915863Snate@binkert.org	cpu/static_inst.cc
928878Ssteve.reinhardt@amd.com	cpu/fast_cpu/fast_cpu.cc
935863Snate@binkert.org	cpu/full_cpu/bpred.cc
945863Snate@binkert.org	cpu/full_cpu/commit.cc
955863Snate@binkert.org	cpu/full_cpu/create_vector.cc
969812Sandreas.hansson@arm.com	cpu/full_cpu/cv_spec_state.cc
979812Sandreas.hansson@arm.com	cpu/full_cpu/dd_queue.cc
985863Snate@binkert.org	cpu/full_cpu/dep_link.cc
999812Sandreas.hansson@arm.com	cpu/full_cpu/dispatch.cc
1005863Snate@binkert.org	cpu/full_cpu/dyn_inst.cc
1015863Snate@binkert.org	cpu/full_cpu/execute.cc
1025863Snate@binkert.org	cpu/full_cpu/fetch.cc
1039812Sandreas.hansson@arm.com	cpu/full_cpu/floss_reasons.cc
1049812Sandreas.hansson@arm.com	cpu/full_cpu/fu_pool.cc
1055863Snate@binkert.org	cpu/full_cpu/full_cpu.cc
1065863Snate@binkert.org	cpu/full_cpu/inst_fifo.cc
1078878Ssteve.reinhardt@amd.com	cpu/full_cpu/instpipe.cc
1085863Snate@binkert.org	cpu/full_cpu/issue.cc
1095863Snate@binkert.org	cpu/full_cpu/ls_queue.cc
1105863Snate@binkert.org	cpu/full_cpu/machine_queue.cc
1116654Snate@binkert.org	cpu/full_cpu/pipetrace.cc
11210196SCurtis.Dunham@arm.com	cpu/full_cpu/readyq.cc
113955SN/A	cpu/full_cpu/reg_info.cc
1145396Ssaidi@eecs.umich.edu	cpu/full_cpu/rob_station.cc
11511401Sandreas.sandberg@arm.com	cpu/full_cpu/spec_memory.cc
1165863Snate@binkert.org	cpu/full_cpu/spec_state.cc
1175863Snate@binkert.org	cpu/full_cpu/storebuffer.cc
1184202Sbinkertn@umich.edu	cpu/full_cpu/writeback.cc
1195863Snate@binkert.org	cpu/full_cpu/iq/iq_station.cc
1205863Snate@binkert.org	cpu/full_cpu/iq/iqueue.cc
1215863Snate@binkert.org	cpu/full_cpu/iq/segmented/chain_info.cc
1225863Snate@binkert.org	cpu/full_cpu/iq/segmented/chain_wire.cc
123955SN/A	cpu/full_cpu/iq/segmented/iq_seg.cc
1246654Snate@binkert.org	cpu/full_cpu/iq/segmented/iq_segmented.cc
1255273Sstever@gmail.com	cpu/full_cpu/iq/segmented/seg_chain.cc
1265871Snate@binkert.org	cpu/full_cpu/iq/seznec/iq_seznec.cc
1275273Sstever@gmail.com	cpu/full_cpu/iq/standard/iq_standard.cc
1286655Snate@binkert.org	cpu/sampling_cpu/sampling_cpu.cc
1298878Ssteve.reinhardt@amd.com	cpu/simple_cpu/simple_cpu.cc
1306655Snate@binkert.org	cpu/trace/reader/mem_trace_reader.cc
1316655Snate@binkert.org	cpu/trace/reader/ibm_reader.cc
1329219Spower.jg@gmail.com	cpu/trace/reader/itx_reader.cc
1336655Snate@binkert.org	cpu/trace/reader/m5_reader.cc
1345871Snate@binkert.org
1356654Snate@binkert.org	mem/base_hier.cc
1368947Sandreas.hansson@arm.com	mem/base_mem.cc
1375396Ssaidi@eecs.umich.edu	mem/hier_params.cc
1388120Sgblack@eecs.umich.edu	mem/mem_cmd.cc
1398120Sgblack@eecs.umich.edu	mem/mem_debug.cc
1408120Sgblack@eecs.umich.edu	mem/mem_req.cc
1418120Sgblack@eecs.umich.edu	mem/memory_interface.cc
1428120Sgblack@eecs.umich.edu	mem/bus/base_interface.cc
1438120Sgblack@eecs.umich.edu	mem/bus/bus.cc
1448120Sgblack@eecs.umich.edu	mem/bus/bus_bridge.cc
1458120Sgblack@eecs.umich.edu	mem/bus/bus_bridge_master.cc
1468879Ssteve.reinhardt@amd.com	mem/bus/bus_bridge_slave.cc
1478879Ssteve.reinhardt@amd.com	mem/bus/bus_interface.cc
1488879Ssteve.reinhardt@amd.com	mem/bus/dma_bus_interface.cc
1498879Ssteve.reinhardt@amd.com	mem/bus/dma_interface.cc
1508879Ssteve.reinhardt@amd.com	mem/bus/master_interface.cc
1518879Ssteve.reinhardt@amd.com	mem/bus/slave_interface.cc
1528879Ssteve.reinhardt@amd.com	mem/cache/base_cache.cc
1538879Ssteve.reinhardt@amd.com	mem/cache/cache.cc
1548879Ssteve.reinhardt@amd.com	mem/cache/cache_builder.cc
1558879Ssteve.reinhardt@amd.com	mem/cache/coherence/coherence_protocol.cc
1568879Ssteve.reinhardt@amd.com	mem/cache/coherence/uni_coherence.cc
1578879Ssteve.reinhardt@amd.com	mem/cache/miss/blocking_buffer.cc
1588879Ssteve.reinhardt@amd.com	mem/cache/miss/miss_queue.cc
1598120Sgblack@eecs.umich.edu	mem/cache/miss/mshr.cc
1608120Sgblack@eecs.umich.edu	mem/cache/miss/mshr_queue.cc
1618120Sgblack@eecs.umich.edu	mem/cache/tags/base_tags.cc
1628120Sgblack@eecs.umich.edu	mem/cache/tags/cache_tags.cc
1638120Sgblack@eecs.umich.edu	mem/cache/tags/fa_lru.cc
1648120Sgblack@eecs.umich.edu	mem/cache/tags/iic.cc
1658120Sgblack@eecs.umich.edu	mem/cache/tags/lru.cc
1668120Sgblack@eecs.umich.edu	mem/cache/tags/split.cc
1678120Sgblack@eecs.umich.edu	mem/cache/tags/split_lifo.cc
1688120Sgblack@eecs.umich.edu	mem/cache/tags/split_lru.cc
1698120Sgblack@eecs.umich.edu	mem/cache/tags/repl/gen.cc
1708120Sgblack@eecs.umich.edu	mem/cache/tags/repl/repl.cc
1718120Sgblack@eecs.umich.edu	mem/functional_mem/functional_memory.cc
1728120Sgblack@eecs.umich.edu	mem/functional_mem/main_memory.cc
1738879Ssteve.reinhardt@amd.com	mem/timing_mem/base_memory.cc
1748879Ssteve.reinhardt@amd.com	mem/timing_mem/memory_builder.cc
1758879Ssteve.reinhardt@amd.com	mem/timing_mem/simple_mem_bank.cc
1768879Ssteve.reinhardt@amd.com	mem/trace/mem_trace_writer.cc
17710458Sandreas.hansson@arm.com	mem/trace/m5_writer.cc
17810458Sandreas.hansson@arm.com
17910458Sandreas.hansson@arm.com	sim/builder.cc
1808879Ssteve.reinhardt@amd.com	sim/configfile.cc
1818879Ssteve.reinhardt@amd.com	sim/debug.cc
1828879Ssteve.reinhardt@amd.com	sim/eventq.cc
1838879Ssteve.reinhardt@amd.com	sim/main.cc
1849227Sandreas.hansson@arm.com	sim/param.cc
1859227Sandreas.hansson@arm.com	sim/profile.cc
1868879Ssteve.reinhardt@amd.com	sim/serialize.cc
1878879Ssteve.reinhardt@amd.com	sim/sim_events.cc
1888879Ssteve.reinhardt@amd.com	sim/sim_exit.cc
1898879Ssteve.reinhardt@amd.com	sim/sim_init.cc
19010453SAndrew.Bardsley@arm.com	sim/sim_object.cc
19110453SAndrew.Bardsley@arm.com	sim/stat_context.cc
19210453SAndrew.Bardsley@arm.com	sim/stat_control.cc
19310456SCurtis.Dunham@arm.com	sim/trace_context.cc
19410456SCurtis.Dunham@arm.com	sim/universe.cc
19510456SCurtis.Dunham@arm.com        sim/pyconfig/pyconfig.cc
19610457Sandreas.hansson@arm.com        sim/pyconfig/code.cc
19710457Sandreas.hansson@arm.com        ''')
19811342Sandreas.hansson@arm.com
19911342Sandreas.hansson@arm.combase_obj_desc_files = Split('''
2008120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/SegmentedIQ.od
2018947Sandreas.hansson@arm.com        cpu/full_cpu/iq/seznec/SeznecIQ.od
2027816Ssteve.reinhardt@amd.com        cpu/full_cpu/iq/standard/StandardIQ.od
2035871Snate@binkert.org        cpu/full_cpu/iq/BaseIQ.od
2045871Snate@binkert.org        cpu/full_cpu/BranchPred.od
2056121Snate@binkert.org        cpu/full_cpu/FUDesc.od
2065871Snate@binkert.org        cpu/full_cpu/FullCPU.od
2075871Snate@binkert.org        cpu/full_cpu/FuncUnitPool.od
2089926Sstan.czerniawski@arm.com        cpu/full_cpu/OpDesc.od
2099926Sstan.czerniawski@arm.com        cpu/full_cpu/PipeTrace.od
2109119Sandreas.hansson@arm.com        cpu/sampling_cpu/SamplingCPU.od
21110068Sandreas.hansson@arm.com        cpu/simple_cpu/SimpleCPU.od
21210068Sandreas.hansson@arm.com        cpu/BaseCPU.od
213955SN/A        cpu/IntrControl.od
2149416SAndreas.Sandberg@ARM.com        mem/bus/Bus.od
21511342Sandreas.hansson@arm.com        mem/bus/BusBridge.od
21611212Sjoseph.gross@amd.com        mem/cache/coherence/CoherenceProtocol.od
21711212Sjoseph.gross@amd.com        mem/cache/tags/repl/GenRepl.od
21811212Sjoseph.gross@amd.com        mem/cache/tags/repl/Repl.od
21911212Sjoseph.gross@amd.com        mem/cache/BaseCache.od
22011212Sjoseph.gross@amd.com        mem/functional_mem/FunctionalMemory.od
2219416SAndreas.Sandberg@ARM.com        mem/functional_mem/MainMemory.od
2229416SAndreas.Sandberg@ARM.com        mem/functional_mem/MemoryController.od
2235871Snate@binkert.org        mem/functional_mem/PhysicalMemory.od
22410584Sandreas.hansson@arm.com        mem/timing_mem/BaseMemory.od
2259416SAndreas.Sandberg@ARM.com        mem/BaseHier.od
2269416SAndreas.Sandberg@ARM.com        mem/BaseMem.od
2275871Snate@binkert.org        mem/HierParams.od
228955SN/A        ''')
22910671Sandreas.hansson@arm.com
23010671Sandreas.hansson@arm.com
23110671Sandreas.hansson@arm.com# MySql sources
23210671Sandreas.hansson@arm.commysql_sources = Split('''
2338881Smarc.orr@gmail.com	base/mysql.cc
2346121Snate@binkert.org	base/stats/mysql.cc
2356121Snate@binkert.org        ''')
2361533SN/A
2379239Sandreas.hansson@arm.com# Full-system sources
2389239Sandreas.hansson@arm.comfull_system_sources = Split('''
2399239Sandreas.hansson@arm.com	arch/alpha/alpha_memory.cc
2409239Sandreas.hansson@arm.com	arch/alpha/arguments.cc
2419239Sandreas.hansson@arm.com	arch/alpha/ev5.cc
2429239Sandreas.hansson@arm.com	arch/alpha/osfpal.cc
2439239Sandreas.hansson@arm.com	arch/alpha/pseudo_inst.cc
2449239Sandreas.hansson@arm.com	arch/alpha/vtophys.cc
2459239Sandreas.hansson@arm.com
2469239Sandreas.hansson@arm.com	base/inet.cc
2479239Sandreas.hansson@arm.com	base/remote_gdb.cc
2489239Sandreas.hansson@arm.com
2496655Snate@binkert.org	cpu/intr_control.cc
2506655Snate@binkert.org
2516655Snate@binkert.org	dev/alpha_console.cc
2526655Snate@binkert.org	dev/baddev.cc
2535871Snate@binkert.org        dev/simconsole.cc
2545871Snate@binkert.org	dev/disk_image.cc
2555863Snate@binkert.org	dev/dma.cc
2565871Snate@binkert.org	dev/etherbus.cc
2578878Ssteve.reinhardt@amd.com	dev/etherdump.cc
2585871Snate@binkert.org	dev/etherint.cc
2595871Snate@binkert.org	dev/etherlink.cc
2605871Snate@binkert.org	dev/etherpkt.cc
2615863Snate@binkert.org	dev/ethertap.cc
2626121Snate@binkert.org	dev/ide_ctrl.cc
2635863Snate@binkert.org	dev/ide_disk.cc
26411408Sandreas.sandberg@arm.com	dev/io_device.cc
26511408Sandreas.sandberg@arm.com	dev/ns_gige.cc
2668336Ssteve.reinhardt@amd.com	dev/etherdev.cc
26711469SCurtis.Dunham@arm.com	dev/pciconfigall.cc
26811469SCurtis.Dunham@arm.com	dev/pcidev.cc
2698336Ssteve.reinhardt@amd.com	dev/scsi.cc
2704678Snate@binkert.org	dev/scsi_ctrl.cc
27111887Sandreas.sandberg@arm.com	dev/scsi_disk.cc
27211887Sandreas.sandberg@arm.com	dev/scsi_none.cc
27311887Sandreas.sandberg@arm.com	dev/simple_disk.cc
27411887Sandreas.sandberg@arm.com	dev/tlaser_clock.cc
27511887Sandreas.sandberg@arm.com	dev/tlaser_ipi.cc
27611887Sandreas.sandberg@arm.com	dev/tlaser_mbox.cc
27711887Sandreas.sandberg@arm.com	dev/tlaser_mc146818.cc
27811887Sandreas.sandberg@arm.com	dev/tlaser_node.cc
27911887Sandreas.sandberg@arm.com	dev/tlaser_pcia.cc
28011887Sandreas.sandberg@arm.com	dev/tlaser_pcidev.cc
28111887Sandreas.sandberg@arm.com	dev/tlaser_serial.cc
28211408Sandreas.sandberg@arm.com	dev/turbolaser.cc
28311401Sandreas.sandberg@arm.com	dev/tsunami.cc
28411401Sandreas.sandberg@arm.com	dev/tsunami_cchip.cc
28511401Sandreas.sandberg@arm.com	dev/tsunami_fake.cc
28611401Sandreas.sandberg@arm.com	dev/tsunami_io.cc
28711401Sandreas.sandberg@arm.com	dev/tsunami_pchip.cc
28811401Sandreas.sandberg@arm.com	dev/uart.cc
2898336Ssteve.reinhardt@amd.com
2908336Ssteve.reinhardt@amd.com	kern/kernel_binning.cc
2918336Ssteve.reinhardt@amd.com	kern/kernel_stats.cc
2924678Snate@binkert.org	kern/system_events.cc
29311401Sandreas.sandberg@arm.com	kern/linux/linux_events.cc
2944678Snate@binkert.org	kern/linux/linux_syscalls.cc
2954678Snate@binkert.org	kern/linux/linux_system.cc
29611401Sandreas.sandberg@arm.com	kern/linux/printk.cc
29711401Sandreas.sandberg@arm.com	kern/tru64/dump_mbuf.cc
2988336Ssteve.reinhardt@amd.com	kern/tru64/printf.cc
2994678Snate@binkert.org	kern/tru64/tru64_events.cc
3008336Ssteve.reinhardt@amd.com	kern/tru64/tru64_syscalls.cc
3018336Ssteve.reinhardt@amd.com	kern/tru64/tru64_system.cc
3028336Ssteve.reinhardt@amd.com
3038336Ssteve.reinhardt@amd.com	mem/functional_mem/memory_control.cc
3048336Ssteve.reinhardt@amd.com	mem/functional_mem/physical_memory.cc
3058336Ssteve.reinhardt@amd.com        dev/platform.cc
3065871Snate@binkert.org
3075871Snate@binkert.org	sim/system.cc
3088336Ssteve.reinhardt@amd.com        ''')
30911408Sandreas.sandberg@arm.com
31011408Sandreas.sandberg@arm.comfull_system_obj_desc_files = Split('''
31111408Sandreas.sandberg@arm.com        arch/alpha/AlphaDTB.od
31211408Sandreas.sandberg@arm.com        arch/alpha/AlphaITB.od
31311408Sandreas.sandberg@arm.com        arch/alpha/AlphaTLB.od
31411408Sandreas.sandberg@arm.com        dev/AlphaConsole.od
31511408Sandreas.sandberg@arm.com        dev/ConsoleListener.od
3168336Ssteve.reinhardt@amd.com        dev/CowDiskImage.od
31711401Sandreas.sandberg@arm.com        dev/DiskImage.od
31811401Sandreas.sandberg@arm.com        dev/DmaDevice.od
31911401Sandreas.sandberg@arm.com        dev/DmaEngine.od
3205871Snate@binkert.org        dev/EtherBus.od
3218336Ssteve.reinhardt@amd.com        dev/EtherDev.od
3228336Ssteve.reinhardt@amd.com        dev/EtherDevInt.od
32311401Sandreas.sandberg@arm.com        dev/EtherDump.od
32411401Sandreas.sandberg@arm.com        dev/EtherInt.od
32511401Sandreas.sandberg@arm.com        dev/EtherLink.od
32611401Sandreas.sandberg@arm.com        dev/EtherTap.od
32711401Sandreas.sandberg@arm.com        dev/PioDevice.od
3284678Snate@binkert.org        dev/RawDiskImage.od
3295871Snate@binkert.org        dev/ScsiController.od
3304678Snate@binkert.org        dev/ScsiDevice.od
33111401Sandreas.sandberg@arm.com        dev/ScsiDisk.od
33211401Sandreas.sandberg@arm.com        dev/SimConsole.od
33311401Sandreas.sandberg@arm.com        dev/SimpleDisk.od
33411401Sandreas.sandberg@arm.com        dev/TlaserClock.od
33511401Sandreas.sandberg@arm.com        dev/TlaserIpi.od
33611401Sandreas.sandberg@arm.com        dev/TlaserMBox.od
33711401Sandreas.sandberg@arm.com        dev/TlaserMC146818.od
33811401Sandreas.sandberg@arm.com        dev/TlaserNode.od
33911401Sandreas.sandberg@arm.com        dev/TlaserPciDev.od
34011401Sandreas.sandberg@arm.com        dev/TlaserPcia.od
34111401Sandreas.sandberg@arm.com        dev/TlaserSerial.od
34211401Sandreas.sandberg@arm.com        dev/TlaserUart.od
34311450Sandreas.sandberg@arm.com        dev/Turbolaser.od
34411450Sandreas.sandberg@arm.com        kern/tru64/Tru64System.od
34511450Sandreas.sandberg@arm.com        sim/System.od
34611450Sandreas.sandberg@arm.com	''')
34711450Sandreas.sandberg@arm.com
34811450Sandreas.sandberg@arm.com# Syscall emulation (non-full-system) sources
34911450Sandreas.sandberg@arm.comsyscall_emulation_sources = Split('''
35011450Sandreas.sandberg@arm.com	arch/alpha/alpha_common_syscall_emul.cc
35111450Sandreas.sandberg@arm.com	arch/alpha/alpha_linux_process.cc
35211450Sandreas.sandberg@arm.com	arch/alpha/alpha_tru64_process.cc
35311450Sandreas.sandberg@arm.com	cpu/memtest/memtest.cc
35411401Sandreas.sandberg@arm.com	cpu/trace/trace_cpu.cc
35511450Sandreas.sandberg@arm.com	eio/eio.cc
35611450Sandreas.sandberg@arm.com	eio/exolex.cc
35711450Sandreas.sandberg@arm.com	eio/libexo.cc
35811401Sandreas.sandberg@arm.com	sim/process.cc
35911450Sandreas.sandberg@arm.com	sim/syscall_emul.cc
36011401Sandreas.sandberg@arm.com        ''')
3618336Ssteve.reinhardt@amd.com
3628336Ssteve.reinhardt@amd.comsyscall_emulation_obj_desc_files = Split('''
3638336Ssteve.reinhardt@amd.com        cpu/memtest/MemTest.od
3648336Ssteve.reinhardt@amd.com        eio/EioProcess.od
3658336Ssteve.reinhardt@amd.com        sim/LiveProcess.od
3668336Ssteve.reinhardt@amd.com        sim/Process.od
3678336Ssteve.reinhardt@amd.com	''')
3688336Ssteve.reinhardt@amd.com
3698336Ssteve.reinhardt@amd.com# Set up complete list of sources based on configuration.
3708336Ssteve.reinhardt@amd.comsources = base_sources
37111401Sandreas.sandberg@arm.comobj_desc_files = base_obj_desc_files
37211401Sandreas.sandberg@arm.com
3738336Ssteve.reinhardt@amd.comif env['FULL_SYSTEM']:
3748336Ssteve.reinhardt@amd.com    sources += full_system_sources
3758336Ssteve.reinhardt@amd.com    obj_desc_files += full_system_obj_desc_files
3765871Snate@binkert.orgelse:
37711476Sandreas.sandberg@arm.com    sources += syscall_emulation_sources
37811476Sandreas.sandberg@arm.com    obj_desc_files += syscall_emulation_obj_desc_files
37911476Sandreas.sandberg@arm.com
38011476Sandreas.sandberg@arm.comextra_libraries = []
38111476Sandreas.sandberg@arm.comif env['USE_MYSQL']:
38211476Sandreas.sandberg@arm.com    sources += mysql_sources
38311476Sandreas.sandberg@arm.com    env.Append(CPPDEFINES = 'USE_MYSQL')
38411476Sandreas.sandberg@arm.com    env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql'])
38511476Sandreas.sandberg@arm.com    env.Append(LIBS=['z'])
38611887Sandreas.sandberg@arm.com    if sys.platform.lower().startswith('linux'):
38711887Sandreas.sandberg@arm.com        extra_libraries.append('/usr/lib/mysql/libmysqlclient.a')
38811887Sandreas.sandberg@arm.com    else:
38911408Sandreas.sandberg@arm.com        env.Append(LIBS=['mysql'])
39011887Sandreas.sandberg@arm.com        env.Append(LIBPATH=['/usr/local/lib/mysql/'])
39111887Sandreas.sandberg@arm.com
39211887Sandreas.sandberg@arm.com###################################################
39311887Sandreas.sandberg@arm.com#
39411887Sandreas.sandberg@arm.com# Special build rules.
39511887Sandreas.sandberg@arm.com#
39611887Sandreas.sandberg@arm.com###################################################
39711887Sandreas.sandberg@arm.com
39811887Sandreas.sandberg@arm.com# base/traceflags.{cc,hh} are generated from base/traceflags.py.
39911887Sandreas.sandberg@arm.com# $TARGET.base will expand to "<build-dir>/base/traceflags".
40011887Sandreas.sandberg@arm.comenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
40111887Sandreas.sandberg@arm.com            'base/traceflags.py',
40211887Sandreas.sandberg@arm.com            'python $SOURCE $TARGET.base')
40311887Sandreas.sandberg@arm.com
40411887Sandreas.sandberg@arm.com# several files are generated from arch/$TARGET_ISA/isa_desc.
40511887Sandreas.sandberg@arm.comenv.Command(Split('''arch/alpha/decoder.cc
40611887Sandreas.sandberg@arm.com		     arch/alpha/decoder.hh
40711887Sandreas.sandberg@arm.com		     arch/alpha/fast_cpu_exec.cc
40811887Sandreas.sandberg@arm.com                     arch/alpha/simple_cpu_exec.cc
40911887Sandreas.sandberg@arm.com                     arch/alpha/full_cpu_exec.cc'''),
41011887Sandreas.sandberg@arm.com            Split('''arch/alpha/isa_desc
41111887Sandreas.sandberg@arm.com		     arch/isa_parser.py'''),
41211887Sandreas.sandberg@arm.com            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
41311887Sandreas.sandberg@arm.com
41411476Sandreas.sandberg@arm.com
41511476Sandreas.sandberg@arm.com# 'targetarch' is a symlink to arch/$TARGET_ISA.
41611408Sandreas.sandberg@arm.comdef link_targetarch(target, source, env):
41711408Sandreas.sandberg@arm.com    link_target = str(target[0])
41811408Sandreas.sandberg@arm.com    link_source = env.subst('$SRCDIR/arch/$TARGET_ISA')
41911408Sandreas.sandberg@arm.com    if not os.path.isdir(link_target):
42011408Sandreas.sandberg@arm.com        print "symlinking", link_source, "to", link_target
42111408Sandreas.sandberg@arm.com        try:
42211408Sandreas.sandberg@arm.com            os.symlink(link_source, link_target)
42311887Sandreas.sandberg@arm.com        except OSError, desc:
42411887Sandreas.sandberg@arm.com            print "Error creating symlink %s: %s" % (link_target, desc)
42511476Sandreas.sandberg@arm.com            sys.exit(-1)
42611887Sandreas.sandberg@arm.com
42711887Sandreas.sandberg@arm.com# Tell SCons to use the link_targetarch function to make 'targetarch'
42811476Sandreas.sandberg@arm.comenv.Command('targetarch', None, link_targetarch)
42911476Sandreas.sandberg@arm.com
43011476Sandreas.sandberg@arm.com
43111476Sandreas.sandberg@arm.com# libelf build is described in its own SConscript file.
4326121Snate@binkert.org# SConscript-local is the per-config build, which just copies some
433955SN/A# header files into a place where they can be found.
434955SN/ASConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
4352632Sstever@eecs.umich.edu
4362632Sstever@eecs.umich.eduSConscript('sim/pyconfig/SConscript', exports = ['env', 'obj_desc_files'],
437955SN/A           duplicate=0)
438955SN/A
439955SN/A
440955SN/A# This function adds the specified sources to the given build
4418878Ssteve.reinhardt@amd.com# environment, and returns a list of all the corresponding SCons
442955SN/A# Object nodes (including an extra one for date.cc).  We explicitly
4432632Sstever@eecs.umich.edu# add the Object nodes so we can set up special dependencies for
4442632Sstever@eecs.umich.edu# targetarch and date.cc.
4452632Sstever@eecs.umich.edudef make_objs(sources, env):
4462632Sstever@eecs.umich.edu    objs = [env.Object(s) for s in sources]
4472632Sstever@eecs.umich.edu    # make all objects depend on the targetarch link so it gets made first.
4482632Sstever@eecs.umich.edu    env.Depends(objs, 'targetarch')
4492632Sstever@eecs.umich.edu    # make date.cc depend on all other objects so it always gets
4508268Ssteve.reinhardt@amd.com    # recompiled whenever anything else does
4518268Ssteve.reinhardt@amd.com    date_obj = env.Object('base/date.cc')
4528268Ssteve.reinhardt@amd.com    env.Depends(date_obj, objs)
4538268Ssteve.reinhardt@amd.com    objs.append(date_obj)
4548268Ssteve.reinhardt@amd.com    objs.extend(extra_libraries)
4558268Ssteve.reinhardt@amd.com    return objs
4568268Ssteve.reinhardt@amd.com
4572632Sstever@eecs.umich.edu###################################################
4582632Sstever@eecs.umich.edu#
4592632Sstever@eecs.umich.edu# Define binaries.  Each different build type (debug, opt, etc.) gets
4602632Sstever@eecs.umich.edu# a slightly different build environment.
4618268Ssteve.reinhardt@amd.com#
4622632Sstever@eecs.umich.edu###################################################
4638268Ssteve.reinhardt@amd.com
4648268Ssteve.reinhardt@amd.com# Include file paths are rooted in this directory.  SCons will
4658268Ssteve.reinhardt@amd.com# automatically expand '.' to refer to both the source directory and
4668268Ssteve.reinhardt@amd.com# the corresponding build directory to pick up generated include
4673718Sstever@eecs.umich.edu# files.
4682634Sstever@eecs.umich.eduenv.Append(CPPPATH='.')
4692634Sstever@eecs.umich.edu
4705863Snate@binkert.org# Debug binary
4712638Sstever@eecs.umich.edudebug = env.Copy(OBJSUFFIX='.do')
4728268Ssteve.reinhardt@amd.comdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
4732632Sstever@eecs.umich.edudebug.Append(CPPDEFINES='DEBUG')
4742632Sstever@eecs.umich.edudebug.Program(target = 'm5.debug', source = make_objs(sources, debug))
4752632Sstever@eecs.umich.edu
4762632Sstever@eecs.umich.edu# Optimized binary
4772632Sstever@eecs.umich.eduopt = env.Copy()
4781858SN/Aopt.Append(CCFLAGS=Split('-g -O5'))
4793716Sstever@eecs.umich.eduopt.Program(target = 'm5.opt', source = make_objs(sources, opt))
4802638Sstever@eecs.umich.edu
4812638Sstever@eecs.umich.edu# "Fast" binary
4822638Sstever@eecs.umich.edufast = env.Copy(OBJSUFFIX='.fo')
4832638Sstever@eecs.umich.edufast.Append(CCFLAGS=Split('-O5'))
4842638Sstever@eecs.umich.edufast.Append(CPPDEFINES='NDEBUG')
4852638Sstever@eecs.umich.edufast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast))
4862638Sstever@eecs.umich.edufast.Command(target = 'm5.fast', source = 'm5.fast.unstripped',
4875863Snate@binkert.org             action = 'strip $SOURCE -o $TARGET')
4885863Snate@binkert.org
4895863Snate@binkert.org# Profiled binary
490955SN/Aprof = env.Copy(OBJSUFFIX='.po')
4915341Sstever@gmail.comprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
4925341Sstever@gmail.comprof.Program(target = 'm5.prof', source = make_objs(sources, prof))
4935863Snate@binkert.org