SConscript revision 10066:06a33d872798
1955SN/A# -*- mode:python -*- 2955SN/A 31762SN/A# Copyright (c) 2013 ARM Limited 4955SN/A# All rights reserved. 5955SN/A# 6955SN/A# The license below extends only to copyright in the software and shall 7955SN/A# not be construed as granting a license to any other intellectual 8955SN/A# property including but not limited to intellectual property relating 9955SN/A# to a hardware implementation of the functionality of the software 10955SN/A# licensed hereunder. You may use the software subject to the license 11955SN/A# terms below provided that you ensure that this notice is replicated 12955SN/A# unmodified and in its entirety in all distributions of the software, 13955SN/A# modified or unmodified, in source code or in binary form. 14955SN/A# 15955SN/A# Redistribution and use in source and binary forms, with or without 16955SN/A# modification, are permitted provided that the following conditions are 17955SN/A# met: redistributions of source code must retain the above copyright 18955SN/A# notice, this list of conditions and the following disclaimer; 19955SN/A# redistributions in binary form must reproduce the above copyright 20955SN/A# notice, this list of conditions and the following disclaimer in the 21955SN/A# documentation and/or other materials provided with the distribution; 22955SN/A# neither the name of the copyright holders nor the names of its 23955SN/A# contributors may be used to endorse or promote products derived from 24955SN/A# this software without specific prior written permission. 25955SN/A# 26955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 282665Ssaidi@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 292665Ssaidi@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 352632Sstever@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 362632Sstever@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 372632Sstever@eecs.umich.edu# 382632Sstever@eecs.umich.edu# Authors: Andreas Hansson 39955SN/A 402632Sstever@eecs.umich.eduimport os 412632Sstever@eecs.umich.edu 422761Sstever@eecs.umich.eduImport('main') 432632Sstever@eecs.umich.edu 442632Sstever@eecs.umich.edu# See if we got a cloned DRAMSim2 repo as a subdirectory and set the 452632Sstever@eecs.umich.edu# HAVE_DRAMSIM flag accordingly 462761Sstever@eecs.umich.eduif not os.path.exists(Dir('.').srcnode().abspath + '/DRAMSim2'): 472761Sstever@eecs.umich.edu main['HAVE_DRAMSIM'] = False 482761Sstever@eecs.umich.edu Return() 492632Sstever@eecs.umich.edu 502632Sstever@eecs.umich.edu# We have got the folder, so add the library and build the wrappers 512761Sstever@eecs.umich.edumain['HAVE_DRAMSIM'] = True 522761Sstever@eecs.umich.edu 532761Sstever@eecs.umich.edu# Add the appropriate files. We leave out the trace driven simulator 542761Sstever@eecs.umich.edudram_files = [] 552761Sstever@eecs.umich.edu 562632Sstever@eecs.umich.edudef DRAMFile(filename): 572632Sstever@eecs.umich.edu dram_files.append(File('DRAMSim2/' + filename)) 582632Sstever@eecs.umich.edu 592632Sstever@eecs.umich.eduDRAMFile('AddressMapping.cpp') 602632Sstever@eecs.umich.eduDRAMFile('Bank.cpp') 612632Sstever@eecs.umich.eduDRAMFile('BankState.cpp') 622632Sstever@eecs.umich.eduDRAMFile('BusPacket.cpp') 63955SN/ADRAMFile('ClockDomain.cpp') 64955SN/ADRAMFile('CommandQueue.cpp') 65955SN/ADRAMFile('IniReader.cpp') 66955SN/ADRAMFile('MemoryController.cpp') 67955SN/ADRAMFile('MemorySystem.cpp') 68955SN/ADRAMFile('MultiChannelMemorySystem.cpp') 69955SN/ADRAMFile('Rank.cpp') 702656Sstever@eecs.umich.eduDRAMFile('SimulatorObject.cpp') 712656Sstever@eecs.umich.eduDRAMFile('Transaction.cpp') 722656Sstever@eecs.umich.edu 732656Sstever@eecs.umich.edu# DRAMSim2 violates some of the warning flags used by gem5, so 742656Sstever@eecs.umich.edu# we explicitly disable them here 752656Sstever@eecs.umich.edudramenv = main.Clone() 762656Sstever@eecs.umich.edudramenv.Append(CCFLAGS=['-Wno-unused-value']) 772653Sstever@eecs.umich.edu 782653Sstever@eecs.umich.edu# Tell DRAMSim2 to not store any data as this is already covered by 792653Sstever@eecs.umich.edu# the wrapper 802653Sstever@eecs.umich.edudramenv.Append(CCFLAGS=['-DNO_STORAGE']) 812653Sstever@eecs.umich.edu 822653Sstever@eecs.umich.edudramenv.Library('dramsim2', [main.SharedObject(f) for f in dram_files]) 832653Sstever@eecs.umich.edu 842653Sstever@eecs.umich.edumain.Prepend(CPPPATH=Dir('.')) 852653Sstever@eecs.umich.edumain.Append(LIBS=['dramsim2']) 862653Sstever@eecs.umich.edumain.Prepend(LIBPATH=[Dir('.')]) 872653Sstever@eecs.umich.edu