SConscript revision 1078
14120Sgblack@eecs.umich.edu# -*- mode:python -*-
24120Sgblack@eecs.umich.edu
37087Snate@binkert.org# Copyright (c) 2004 The Regents of The University of Michigan
47087Snate@binkert.org# All rights reserved.
57087Snate@binkert.org#
67087Snate@binkert.org# Redistribution and use in source and binary forms, with or without
77087Snate@binkert.org# modification, are permitted provided that the following conditions are
87087Snate@binkert.org# met: redistributions of source code must retain the above copyright
97087Snate@binkert.org# notice, this list of conditions and the following disclaimer;
107087Snate@binkert.org# redistributions in binary form must reproduce the above copyright
117087Snate@binkert.org# notice, this list of conditions and the following disclaimer in the
127087Snate@binkert.org# documentation and/or other materials provided with the distribution;
137087Snate@binkert.org# neither the name of the copyright holders nor the names of its
147087Snate@binkert.org# contributors may be used to endorse or promote products derived from
154120Sgblack@eecs.umich.edu# this software without specific prior written permission.
164120Sgblack@eecs.umich.edu#
174120Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
184120Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
194120Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
204120Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
214120Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
224120Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
234120Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
244120Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
254120Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
264120Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
274120Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
284120Sgblack@eecs.umich.edu
294120Sgblack@eecs.umich.eduimport os
304120Sgblack@eecs.umich.eduimport sys
314120Sgblack@eecs.umich.edu
324120Sgblack@eecs.umich.edu# This file defines how to build a particular configuration of M5
334120Sgblack@eecs.umich.edu# based on variable settings in the 'env' build environment.
344120Sgblack@eecs.umich.edu
354120Sgblack@eecs.umich.edu# Import build environment variable from SConstruct.
364120Sgblack@eecs.umich.eduImport('env')
374120Sgblack@eecs.umich.edu
384120Sgblack@eecs.umich.edu###################################################
394120Sgblack@eecs.umich.edu#
404120Sgblack@eecs.umich.edu# Define needed sources.
414120Sgblack@eecs.umich.edu#
424120Sgblack@eecs.umich.edu###################################################
434202Sbinkertn@umich.edu
445069Sgblack@eecs.umich.edu# Base sources used by all configurations.
454202Sbinkertn@umich.edubase_sources = Split('''
465659Sgblack@eecs.umich.edu	arch/alpha/decoder.cc
474601Sgblack@eecs.umich.edu	arch/alpha/fast_cpu_exec.cc
485124Sgblack@eecs.umich.edu	arch/alpha/simple_cpu_exec.cc
497966Sgblack@eecs.umich.edu	arch/alpha/full_cpu_exec.cc
505083Sgblack@eecs.umich.edu	arch/alpha/faults.cc
514679Sgblack@eecs.umich.edu	arch/alpha/isa_traits.cc
526515Sgblack@eecs.umich.edu
535083Sgblack@eecs.umich.edu	base/circlebuf.cc
544679Sgblack@eecs.umich.edu	base/copyright.cc
554679Sgblack@eecs.umich.edu	base/cprintf.cc
566313Sgblack@eecs.umich.edu	base/fast_alloc.cc
576365Sgblack@eecs.umich.edu	base/fifo_buffer.cc
585124Sgblack@eecs.umich.edu	base/hostinfo.cc
594249Sgblack@eecs.umich.edu	base/hybrid_pred.cc
604240Sgblack@eecs.umich.edu	base/inifile.cc
614202Sbinkertn@umich.edu	base/intmath.cc
624997Sgblack@eecs.umich.edu	base/match.cc
637624Sgblack@eecs.umich.edu	base/misc.cc
645135Sgblack@eecs.umich.edu	base/pollevent.cc
654997Sgblack@eecs.umich.edu	base/python.cc
666365Sgblack@eecs.umich.edu	base/range.cc
678740Sgblack@eecs.umich.edu	base/sat_counter.cc
686365Sgblack@eecs.umich.edu	base/socket.cc
698740Sgblack@eecs.umich.edu	base/statistics.cc
708335Snate@binkert.org	base/str.cc
718335Snate@binkert.org	base/time.cc
724120Sgblack@eecs.umich.edu	base/trace.cc
734202Sbinkertn@umich.edu	base/traceflags.cc
748335Snate@binkert.org	base/userinfo.cc
758335Snate@binkert.org	base/compression/lzss_compression.cc
765904Sgblack@eecs.umich.edu	base/loader/aout_object.cc
775649Sgblack@eecs.umich.edu	base/loader/ecoff_object.cc
785647Sgblack@eecs.umich.edu	base/loader/elf_object.cc
795132Sgblack@eecs.umich.edu	base/loader/object_file.cc
805132Sgblack@eecs.umich.edu	base/loader/symtab.cc
814202Sbinkertn@umich.edu	base/stats/events.cc
825647Sgblack@eecs.umich.edu	base/stats/python.cc
835299Sgblack@eecs.umich.edu	base/stats/statdb.cc
845245Sgblack@eecs.umich.edu	base/stats/visit.cc
855132Sgblack@eecs.umich.edu	base/stats/text.cc
865086Sgblack@eecs.umich.edu
875086Sgblack@eecs.umich.edu	cpu/base_cpu.cc
884202Sbinkertn@umich.edu	cpu/exec_context.cc
894202Sbinkertn@umich.edu	cpu/exetrace.cc
904120Sgblack@eecs.umich.edu	cpu/pc_event.cc
914202Sbinkertn@umich.edu	cpu/static_inst.cc
924202Sbinkertn@umich.edu	cpu/fast_cpu/fast_cpu.cc
934202Sbinkertn@umich.edu	cpu/full_cpu/bpred.cc
944120Sgblack@eecs.umich.edu	cpu/full_cpu/commit.cc
955069Sgblack@eecs.umich.edu	cpu/full_cpu/create_vector.cc
965081Sgblack@eecs.umich.edu	cpu/full_cpu/cv_spec_state.cc
975081Sgblack@eecs.umich.edu	cpu/full_cpu/dd_queue.cc
985081Sgblack@eecs.umich.edu	cpu/full_cpu/dep_link.cc
995081Sgblack@eecs.umich.edu	cpu/full_cpu/dispatch.cc
1005081Sgblack@eecs.umich.edu	cpu/full_cpu/dyn_inst.cc
1015081Sgblack@eecs.umich.edu	cpu/full_cpu/execute.cc
1025081Sgblack@eecs.umich.edu	cpu/full_cpu/fetch.cc
1035081Sgblack@eecs.umich.edu	cpu/full_cpu/floss_reasons.cc
1045081Sgblack@eecs.umich.edu	cpu/full_cpu/fu_pool.cc
1055081Sgblack@eecs.umich.edu	cpu/full_cpu/full_cpu.cc
1065081Sgblack@eecs.umich.edu	cpu/full_cpu/inst_fifo.cc
1075081Sgblack@eecs.umich.edu	cpu/full_cpu/instpipe.cc
1085081Sgblack@eecs.umich.edu	cpu/full_cpu/issue.cc
1095081Sgblack@eecs.umich.edu	cpu/full_cpu/ls_queue.cc
1105081Sgblack@eecs.umich.edu	cpu/full_cpu/machine_queue.cc
1115081Sgblack@eecs.umich.edu	cpu/full_cpu/pipetrace.cc
1125081Sgblack@eecs.umich.edu	cpu/full_cpu/readyq.cc
1135081Sgblack@eecs.umich.edu	cpu/full_cpu/reg_info.cc
1145081Sgblack@eecs.umich.edu	cpu/full_cpu/rob_station.cc
1155081Sgblack@eecs.umich.edu	cpu/full_cpu/spec_memory.cc
1165081Sgblack@eecs.umich.edu	cpu/full_cpu/spec_state.cc
1175081Sgblack@eecs.umich.edu	cpu/full_cpu/storebuffer.cc
1185081Sgblack@eecs.umich.edu	cpu/full_cpu/writeback.cc
1195081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/iq_station.cc
1205081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/iqueue.cc
1215081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/segmented/chain_info.cc
1225081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/segmented/chain_wire.cc
1235081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/segmented/iq_seg.cc
1245081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/segmented/iq_segmented.cc
1255081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/segmented/seg_chain.cc
1265081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/seznec/iq_seznec.cc
1275081Sgblack@eecs.umich.edu	cpu/full_cpu/iq/standard/iq_standard.cc
1285081Sgblack@eecs.umich.edu	cpu/sampling_cpu/sampling_cpu.cc
1295081Sgblack@eecs.umich.edu	cpu/simple_cpu/simple_cpu.cc
1305081Sgblack@eecs.umich.edu	cpu/trace/reader/mem_trace_reader.cc
1315081Sgblack@eecs.umich.edu	cpu/trace/reader/ibm_reader.cc
1325081Sgblack@eecs.umich.edu	cpu/trace/reader/itx_reader.cc
1335081Sgblack@eecs.umich.edu	cpu/trace/reader/m5_reader.cc
1345081Sgblack@eecs.umich.edu
1355081Sgblack@eecs.umich.edu	mem/base_hier.cc
1365081Sgblack@eecs.umich.edu	mem/base_mem.cc
1375081Sgblack@eecs.umich.edu	mem/hier_params.cc
1385081Sgblack@eecs.umich.edu	mem/mem_cmd.cc
1395081Sgblack@eecs.umich.edu	mem/mem_debug.cc
1405081Sgblack@eecs.umich.edu	mem/mem_req.cc
1415081Sgblack@eecs.umich.edu	mem/memory_interface.cc
1425081Sgblack@eecs.umich.edu	mem/bus/base_interface.cc
1435081Sgblack@eecs.umich.edu	mem/bus/bus.cc
1445081Sgblack@eecs.umich.edu	mem/bus/bus_bridge.cc
1455081Sgblack@eecs.umich.edu	mem/bus/bus_bridge_master.cc
1465081Sgblack@eecs.umich.edu	mem/bus/bus_bridge_slave.cc
1475081Sgblack@eecs.umich.edu	mem/bus/bus_interface.cc
1485081Sgblack@eecs.umich.edu	mem/bus/dma_bus_interface.cc
1495081Sgblack@eecs.umich.edu	mem/bus/dma_interface.cc
1505081Sgblack@eecs.umich.edu	mem/bus/master_interface.cc
1515680Sgblack@eecs.umich.edu	mem/bus/slave_interface.cc
1525081Sgblack@eecs.umich.edu	mem/cache/base_cache.cc
1535933Sgblack@eecs.umich.edu	mem/cache/cache.cc
1545173Sgblack@eecs.umich.edu	mem/cache/cache_builder.cc
1555359Sgblack@eecs.umich.edu	mem/cache/coherence/coherence_protocol.cc
1565081Sgblack@eecs.umich.edu	mem/cache/coherence/uni_coherence.cc
1575149Sgblack@eecs.umich.edu	mem/cache/miss/blocking_buffer.cc
1585298Sgblack@eecs.umich.edu	mem/cache/miss/miss_queue.cc
1595081Sgblack@eecs.umich.edu	mem/cache/miss/mshr.cc
1605081Sgblack@eecs.umich.edu	mem/cache/miss/mshr_queue.cc
1615081Sgblack@eecs.umich.edu	mem/cache/tags/base_tags.cc
1625081Sgblack@eecs.umich.edu	mem/cache/tags/cache_tags.cc
1635081Sgblack@eecs.umich.edu	mem/cache/tags/fa_lru.cc
1645081Sgblack@eecs.umich.edu	mem/cache/tags/iic.cc
1655081Sgblack@eecs.umich.edu	mem/cache/tags/lru.cc
1665081Sgblack@eecs.umich.edu	mem/cache/tags/split.cc
1675081Sgblack@eecs.umich.edu	mem/cache/tags/split_lifo.cc
1685081Sgblack@eecs.umich.edu	mem/cache/tags/split_lru.cc
1695081Sgblack@eecs.umich.edu	mem/cache/tags/repl/gen.cc
1705081Sgblack@eecs.umich.edu	mem/cache/tags/repl/repl.cc
1715081Sgblack@eecs.umich.edu	mem/functional_mem/functional_memory.cc
1725081Sgblack@eecs.umich.edu	mem/functional_mem/main_memory.cc
1735081Sgblack@eecs.umich.edu	mem/timing_mem/base_memory.cc
1745081Sgblack@eecs.umich.edu	mem/timing_mem/memory_builder.cc
1755081Sgblack@eecs.umich.edu	mem/timing_mem/simple_mem_bank.cc
1765081Sgblack@eecs.umich.edu        mem/trace/itx_writer.cc
1775081Sgblack@eecs.umich.edu	mem/trace/mem_trace_writer.cc
1785081Sgblack@eecs.umich.edu	mem/trace/m5_writer.cc
1795081Sgblack@eecs.umich.edu
1805081Sgblack@eecs.umich.edu	sim/builder.cc
1815081Sgblack@eecs.umich.edu	sim/configfile.cc
1825081Sgblack@eecs.umich.edu	sim/debug.cc
1835081Sgblack@eecs.umich.edu	sim/eventq.cc
1845081Sgblack@eecs.umich.edu	sim/main.cc
1855081Sgblack@eecs.umich.edu	sim/param.cc
1865081Sgblack@eecs.umich.edu	sim/profile.cc
1875081Sgblack@eecs.umich.edu	sim/serialize.cc
1885081Sgblack@eecs.umich.edu	sim/sim_events.cc
1895081Sgblack@eecs.umich.edu	sim/sim_exit.cc
1905081Sgblack@eecs.umich.edu	sim/sim_init.cc
1915081Sgblack@eecs.umich.edu	sim/sim_object.cc
1925081Sgblack@eecs.umich.edu	sim/stat_context.cc
1935081Sgblack@eecs.umich.edu	sim/stat_control.cc
1945081Sgblack@eecs.umich.edu	sim/trace_context.cc
1955081Sgblack@eecs.umich.edu	sim/universe.cc
1965081Sgblack@eecs.umich.edu        sim/pyconfig/pyconfig.cc
1975081Sgblack@eecs.umich.edu        sim/pyconfig/code.cc
1985081Sgblack@eecs.umich.edu        ''')
1995081Sgblack@eecs.umich.edu
2005081Sgblack@eecs.umich.edubase_obj_desc_files = Split('''
2015081Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/SegmentedIQ.od
2025081Sgblack@eecs.umich.edu        cpu/full_cpu/iq/seznec/SeznecIQ.od
2035081Sgblack@eecs.umich.edu        cpu/full_cpu/iq/standard/StandardIQ.od
2045081Sgblack@eecs.umich.edu        cpu/full_cpu/iq/BaseIQ.od
2055081Sgblack@eecs.umich.edu        cpu/full_cpu/BranchPred.od
2065081Sgblack@eecs.umich.edu        cpu/full_cpu/FUDesc.od
2075081Sgblack@eecs.umich.edu        cpu/full_cpu/FullCPU.od
2085081Sgblack@eecs.umich.edu        cpu/full_cpu/FuncUnitPool.od
2095081Sgblack@eecs.umich.edu        cpu/full_cpu/OpDesc.od
2105081Sgblack@eecs.umich.edu        cpu/full_cpu/PipeTrace.od
2115081Sgblack@eecs.umich.edu        cpu/sampling_cpu/SamplingCPU.od
2125081Sgblack@eecs.umich.edu        cpu/simple_cpu/SimpleCPU.od
2135081Sgblack@eecs.umich.edu        cpu/BaseCPU.od
2145081Sgblack@eecs.umich.edu        cpu/IntrControl.od
2155081Sgblack@eecs.umich.edu        mem/bus/Bus.od
2165081Sgblack@eecs.umich.edu        mem/bus/BusBridge.od
2175081Sgblack@eecs.umich.edu        mem/cache/coherence/CoherenceProtocol.od
2185081Sgblack@eecs.umich.edu        mem/cache/tags/repl/GenRepl.od
2195081Sgblack@eecs.umich.edu        mem/cache/tags/repl/Repl.od
2205081Sgblack@eecs.umich.edu        mem/cache/BaseCache.od
2215081Sgblack@eecs.umich.edu        mem/functional_mem/FunctionalMemory.od
2225081Sgblack@eecs.umich.edu        mem/functional_mem/MainMemory.od
2235081Sgblack@eecs.umich.edu        mem/functional_mem/MemoryController.od
2245081Sgblack@eecs.umich.edu        mem/functional_mem/PhysicalMemory.od
2255081Sgblack@eecs.umich.edu        mem/timing_mem/BaseMemory.od
2265081Sgblack@eecs.umich.edu        mem/BaseHier.od
2275081Sgblack@eecs.umich.edu        mem/BaseMem.od
2285081Sgblack@eecs.umich.edu        mem/HierParams.od
2295081Sgblack@eecs.umich.edu        ''')
2305081Sgblack@eecs.umich.edu
2315081Sgblack@eecs.umich.edu
2325081Sgblack@eecs.umich.edu# MySql sources
2335081Sgblack@eecs.umich.edumysql_sources = Split('''
2345081Sgblack@eecs.umich.edu	base/mysql.cc
2355081Sgblack@eecs.umich.edu	base/stats/mysql.cc
2365081Sgblack@eecs.umich.edu        ''')
2375081Sgblack@eecs.umich.edu
2385081Sgblack@eecs.umich.edu# Full-system sources
2395081Sgblack@eecs.umich.edufull_system_sources = Split('''
2405081Sgblack@eecs.umich.edu	arch/alpha/alpha_memory.cc
2415081Sgblack@eecs.umich.edu	arch/alpha/arguments.cc
2425081Sgblack@eecs.umich.edu	arch/alpha/ev5.cc
2435081Sgblack@eecs.umich.edu	arch/alpha/osfpal.cc
2445081Sgblack@eecs.umich.edu	arch/alpha/pseudo_inst.cc
2455081Sgblack@eecs.umich.edu	arch/alpha/vtophys.cc
2465081Sgblack@eecs.umich.edu
2475081Sgblack@eecs.umich.edu	base/crc.cc
2485081Sgblack@eecs.umich.edu	base/inet.cc
2495081Sgblack@eecs.umich.edu	base/remote_gdb.cc
2505081Sgblack@eecs.umich.edu
2515081Sgblack@eecs.umich.edu	cpu/intr_control.cc
2525081Sgblack@eecs.umich.edu
2535081Sgblack@eecs.umich.edu	dev/alpha_console.cc
2545081Sgblack@eecs.umich.edu	dev/baddev.cc
2555081Sgblack@eecs.umich.edu        dev/simconsole.cc
2565081Sgblack@eecs.umich.edu	dev/disk_image.cc
2575081Sgblack@eecs.umich.edu	dev/dma.cc
2585081Sgblack@eecs.umich.edu	dev/etherbus.cc
2595081Sgblack@eecs.umich.edu	dev/etherdump.cc
2605081Sgblack@eecs.umich.edu	dev/etherint.cc
2615081Sgblack@eecs.umich.edu	dev/etherlink.cc
2625081Sgblack@eecs.umich.edu	dev/etherpkt.cc
2635081Sgblack@eecs.umich.edu	dev/ethertap.cc
2645081Sgblack@eecs.umich.edu	dev/ide_ctrl.cc
2655081Sgblack@eecs.umich.edu	dev/ide_disk.cc
2665081Sgblack@eecs.umich.edu	dev/io_device.cc
2675081Sgblack@eecs.umich.edu	dev/ns_gige.cc
2685081Sgblack@eecs.umich.edu	dev/etherdev.cc
2695081Sgblack@eecs.umich.edu	dev/pciconfigall.cc
2705081Sgblack@eecs.umich.edu	dev/pcidev.cc
2715081Sgblack@eecs.umich.edu	dev/scsi.cc
2725081Sgblack@eecs.umich.edu	dev/scsi_ctrl.cc
2735081Sgblack@eecs.umich.edu	dev/scsi_disk.cc
2745081Sgblack@eecs.umich.edu	dev/scsi_none.cc
2755081Sgblack@eecs.umich.edu	dev/simple_disk.cc
2765081Sgblack@eecs.umich.edu	dev/tlaser_clock.cc
2775081Sgblack@eecs.umich.edu	dev/tlaser_ipi.cc
2785081Sgblack@eecs.umich.edu	dev/tlaser_mbox.cc
2795081Sgblack@eecs.umich.edu	dev/tlaser_mc146818.cc
2805081Sgblack@eecs.umich.edu	dev/tlaser_node.cc
2815081Sgblack@eecs.umich.edu	dev/tlaser_pcia.cc
2825081Sgblack@eecs.umich.edu	dev/tlaser_pcidev.cc
2835081Sgblack@eecs.umich.edu	dev/tlaser_serial.cc
2845081Sgblack@eecs.umich.edu	dev/turbolaser.cc
2855081Sgblack@eecs.umich.edu	dev/tsunami.cc
2865081Sgblack@eecs.umich.edu	dev/tsunami_cchip.cc
2875081Sgblack@eecs.umich.edu	dev/tsunami_fake.cc
2885081Sgblack@eecs.umich.edu	dev/tsunami_io.cc
2895081Sgblack@eecs.umich.edu	dev/tsunami_pchip.cc
2905081Sgblack@eecs.umich.edu	dev/uart.cc
2915081Sgblack@eecs.umich.edu
2925081Sgblack@eecs.umich.edu	kern/kernel_binning.cc
2935081Sgblack@eecs.umich.edu	kern/kernel_stats.cc
2945081Sgblack@eecs.umich.edu	kern/system_events.cc
2955081Sgblack@eecs.umich.edu	kern/linux/linux_events.cc
2965081Sgblack@eecs.umich.edu	kern/linux/linux_syscalls.cc
2975081Sgblack@eecs.umich.edu	kern/linux/linux_system.cc
2985081Sgblack@eecs.umich.edu	kern/linux/printk.cc
2995081Sgblack@eecs.umich.edu	kern/tru64/dump_mbuf.cc
3005081Sgblack@eecs.umich.edu	kern/tru64/printf.cc
3015081Sgblack@eecs.umich.edu	kern/tru64/tru64_events.cc
3025081Sgblack@eecs.umich.edu	kern/tru64/tru64_syscalls.cc
3035081Sgblack@eecs.umich.edu	kern/tru64/tru64_system.cc
3045081Sgblack@eecs.umich.edu
3055081Sgblack@eecs.umich.edu	mem/functional_mem/memory_control.cc
3065081Sgblack@eecs.umich.edu	mem/functional_mem/physical_memory.cc
3075081Sgblack@eecs.umich.edu        dev/platform.cc
3085081Sgblack@eecs.umich.edu
3095081Sgblack@eecs.umich.edu	sim/system.cc
3105081Sgblack@eecs.umich.edu        ''')
3115081Sgblack@eecs.umich.edu
3125081Sgblack@eecs.umich.edufull_system_obj_desc_files = Split('''
3135081Sgblack@eecs.umich.edu        arch/alpha/AlphaDTB.od
3145069Sgblack@eecs.umich.edu        arch/alpha/AlphaITB.od
3154202Sbinkertn@umich.edu        arch/alpha/AlphaTLB.od
3164202Sbinkertn@umich.edu        dev/AlphaConsole.od
3174202Sbinkertn@umich.edu        dev/ConsoleListener.od
3185069Sgblack@eecs.umich.edu        dev/CowDiskImage.od
3195069Sgblack@eecs.umich.edu        dev/DiskImage.od
3205069Sgblack@eecs.umich.edu        dev/DmaDevice.od
3215069Sgblack@eecs.umich.edu        dev/DmaEngine.od
3224202Sbinkertn@umich.edu        dev/EtherBus.od
3234202Sbinkertn@umich.edu        dev/EtherDev.od
324        dev/EtherDevInt.od
325        dev/EtherDump.od
326        dev/EtherInt.od
327        dev/EtherLink.od
328        dev/EtherTap.od
329        dev/PioDevice.od
330        dev/RawDiskImage.od
331        dev/ScsiController.od
332        dev/ScsiDevice.od
333        dev/ScsiDisk.od
334        dev/SimConsole.od
335        dev/SimpleDisk.od
336        dev/TlaserClock.od
337        dev/TlaserIpi.od
338        dev/TlaserMBox.od
339        dev/TlaserMC146818.od
340        dev/TlaserNode.od
341        dev/TlaserPciDev.od
342        dev/TlaserPcia.od
343        dev/TlaserSerial.od
344        dev/TlaserUart.od
345        dev/Turbolaser.od
346        kern/tru64/Tru64System.od
347        sim/System.od
348	''')
349
350# Syscall emulation (non-full-system) sources
351syscall_emulation_sources = Split('''
352	arch/alpha/alpha_common_syscall_emul.cc
353	arch/alpha/alpha_linux_process.cc
354	arch/alpha/alpha_tru64_process.cc
355	cpu/memtest/memtest.cc
356	cpu/trace/trace_cpu.cc
357	eio/eio.cc
358	eio/exolex.cc
359	eio/libexo.cc
360	sim/process.cc
361	sim/syscall_emul.cc
362        ''')
363
364syscall_emulation_obj_desc_files = Split('''
365        cpu/memtest/MemTest.od
366        eio/EioProcess.od
367        sim/LiveProcess.od
368        sim/Process.od
369	''')
370
371# Set up complete list of sources based on configuration.
372sources = base_sources
373obj_desc_files = base_obj_desc_files
374
375if env['FULL_SYSTEM']:
376    sources += full_system_sources
377    obj_desc_files += full_system_obj_desc_files
378else:
379    sources += syscall_emulation_sources
380    obj_desc_files += syscall_emulation_obj_desc_files
381
382extra_libraries = []
383if env['USE_MYSQL']:
384    sources += mysql_sources
385    env.Append(CPPDEFINES = 'USE_MYSQL')
386    env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql'])
387    env.Append(LIBS=['z'])
388    if sys.platform.lower().startswith('linux'):
389        extra_libraries.append('/usr/lib/mysql/libmysqlclient.a')
390    else:
391        env.Append(LIBS=['mysql'])
392        env.Append(LIBPATH=['/usr/local/lib/mysql/'])
393
394###################################################
395#
396# Special build rules.
397#
398###################################################
399
400# base/traceflags.{cc,hh} are generated from base/traceflags.py.
401# $TARGET.base will expand to "<build-dir>/base/traceflags".
402env.Command(Split('base/traceflags.hh base/traceflags.cc'),
403            'base/traceflags.py',
404            'python $SOURCE $TARGET.base')
405
406# several files are generated from arch/$TARGET_ISA/isa_desc.
407env.Command(Split('''arch/alpha/decoder.cc
408		     arch/alpha/decoder.hh
409		     arch/alpha/fast_cpu_exec.cc
410                     arch/alpha/simple_cpu_exec.cc
411                     arch/alpha/full_cpu_exec.cc'''),
412            Split('''arch/alpha/isa_desc
413		     arch/isa_parser.py'''),
414            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
415
416
417# 'targetarch' is a symlink to arch/$TARGET_ISA.
418def link_targetarch(target, source, env):
419    link_target = str(target[0])
420    link_source = env.subst('$SRCDIR/arch/$TARGET_ISA')
421    if not os.path.isdir(link_target):
422        print "symlinking", link_source, "to", link_target
423        try:
424            os.symlink(link_source, link_target)
425        except OSError, desc:
426            print "Error creating symlink %s: %s" % (link_target, desc)
427            sys.exit(-1)
428
429# Tell SCons to use the link_targetarch function to make 'targetarch'
430env.Command('targetarch', None, link_targetarch)
431
432
433# libelf build is described in its own SConscript file.
434# SConscript-local is the per-config build, which just copies some
435# header files into a place where they can be found.
436SConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
437
438SConscript('sim/pyconfig/SConscript', exports = ['env', 'obj_desc_files'],
439           duplicate=0)
440
441
442# This function adds the specified sources to the given build
443# environment, and returns a list of all the corresponding SCons
444# Object nodes (including an extra one for date.cc).  We explicitly
445# add the Object nodes so we can set up special dependencies for
446# targetarch and date.cc.
447def make_objs(sources, env):
448    objs = [env.Object(s) for s in sources]
449    # make all objects depend on the targetarch link so it gets made first.
450    env.Depends(objs, 'targetarch')
451    # make date.cc depend on all other objects so it always gets
452    # recompiled whenever anything else does
453    date_obj = env.Object('base/date.cc')
454    env.Depends(date_obj, objs)
455    objs.append(date_obj)
456    objs.extend(extra_libraries)
457    return objs
458
459###################################################
460#
461# Define binaries.  Each different build type (debug, opt, etc.) gets
462# a slightly different build environment.
463#
464###################################################
465
466# Include file paths are rooted in this directory.  SCons will
467# automatically expand '.' to refer to both the source directory and
468# the corresponding build directory to pick up generated include
469# files.
470env.Append(CPPPATH='.')
471
472# Debug binary
473debug = env.Copy(OBJSUFFIX='.do')
474debug.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
475debug.Append(CPPDEFINES='DEBUG')
476debug.Program(target = 'm5.debug', source = make_objs(sources, debug))
477
478# Optimized binary
479opt = env.Copy()
480opt.Append(CCFLAGS=Split('-g -O5'))
481opt.Program(target = 'm5.opt', source = make_objs(sources, opt))
482
483# "Fast" binary
484fast = env.Copy(OBJSUFFIX='.fo')
485fast.Append(CCFLAGS=Split('-O5'))
486fast.Append(CPPDEFINES='NDEBUG')
487fast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast))
488fast.Command(target = 'm5.fast', source = 'm5.fast.unstripped',
489             action = 'strip $SOURCE -o $TARGET')
490
491# Profiled binary
492prof = env.Copy(OBJSUFFIX='.po')
493prof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
494prof.Program(target = 'm5.prof', source = make_objs(sources, prof))
495