SConscript revision 10130:476aeb6b51b0
112027Sjungma@eit.uni-kl.de# -*- mode:python -*- 212027Sjungma@eit.uni-kl.de 312027Sjungma@eit.uni-kl.de# Copyright (c) 2013 ARM Limited 412027Sjungma@eit.uni-kl.de# All rights reserved. 512027Sjungma@eit.uni-kl.de# 612027Sjungma@eit.uni-kl.de# The license below extends only to copyright in the software and shall 712027Sjungma@eit.uni-kl.de# not be construed as granting a license to any other intellectual 812027Sjungma@eit.uni-kl.de# property including but not limited to intellectual property relating 912027Sjungma@eit.uni-kl.de# to a hardware implementation of the functionality of the software 1012027Sjungma@eit.uni-kl.de# licensed hereunder. You may use the software subject to the license 1112027Sjungma@eit.uni-kl.de# terms below provided that you ensure that this notice is replicated 1212027Sjungma@eit.uni-kl.de# unmodified and in its entirety in all distributions of the software, 1312027Sjungma@eit.uni-kl.de# modified or unmodified, in source code or in binary form. 1412027Sjungma@eit.uni-kl.de# 1512027Sjungma@eit.uni-kl.de# Redistribution and use in source and binary forms, with or without 1612027Sjungma@eit.uni-kl.de# modification, are permitted provided that the following conditions are 1712027Sjungma@eit.uni-kl.de# met: redistributions of source code must retain the above copyright 1812027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer; 1912027Sjungma@eit.uni-kl.de# redistributions in binary form must reproduce the above copyright 2012027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer in the 2112027Sjungma@eit.uni-kl.de# documentation and/or other materials provided with the distribution; 2212027Sjungma@eit.uni-kl.de# neither the name of the copyright holders nor the names of its 2312027Sjungma@eit.uni-kl.de# contributors may be used to endorse or promote products derived from 2412027Sjungma@eit.uni-kl.de# this software without specific prior written permission. 2512027Sjungma@eit.uni-kl.de# 2612027Sjungma@eit.uni-kl.de# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2712027Sjungma@eit.uni-kl.de# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2812027Sjungma@eit.uni-kl.de# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2912027Sjungma@eit.uni-kl.de# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3012027Sjungma@eit.uni-kl.de# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3112027Sjungma@eit.uni-kl.de# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3212027Sjungma@eit.uni-kl.de# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3312027Sjungma@eit.uni-kl.de# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3412027Sjungma@eit.uni-kl.de# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3512027Sjungma@eit.uni-kl.de# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3612027Sjungma@eit.uni-kl.de# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3712027Sjungma@eit.uni-kl.de# 3812027Sjungma@eit.uni-kl.de# Authors: Andreas Hansson 3912027Sjungma@eit.uni-kl.de 4012027Sjungma@eit.uni-kl.deimport os 4112027Sjungma@eit.uni-kl.de 4212027Sjungma@eit.uni-kl.deImport('main') 4312027Sjungma@eit.uni-kl.de 4412027Sjungma@eit.uni-kl.de# See if we got a cloned DRAMSim2 repo as a subdirectory and set the 4512027Sjungma@eit.uni-kl.de# HAVE_DRAMSIM flag accordingly 4612027Sjungma@eit.uni-kl.deif not os.path.exists(Dir('.').srcnode().abspath + '/DRAMSim2'): 4712027Sjungma@eit.uni-kl.de main['HAVE_DRAMSIM'] = False 4812027Sjungma@eit.uni-kl.de Return() 4912027Sjungma@eit.uni-kl.de 5012027Sjungma@eit.uni-kl.de# We have got the folder, so add the library and build the wrappers 5112027Sjungma@eit.uni-kl.demain['HAVE_DRAMSIM'] = True 5212027Sjungma@eit.uni-kl.de 5312027Sjungma@eit.uni-kl.de# Add the appropriate files. We leave out the trace driven simulator 5412027Sjungma@eit.uni-kl.dedram_files = [] 5512027Sjungma@eit.uni-kl.de 5612027Sjungma@eit.uni-kl.dedef DRAMFile(filename): 5712027Sjungma@eit.uni-kl.de dram_files.append(File('DRAMSim2/' + filename)) 5812027Sjungma@eit.uni-kl.de 5912027Sjungma@eit.uni-kl.deDRAMFile('AddressMapping.cpp') 6012027Sjungma@eit.uni-kl.deDRAMFile('Bank.cpp') 6112027Sjungma@eit.uni-kl.deDRAMFile('BankState.cpp') 6212027Sjungma@eit.uni-kl.deDRAMFile('BusPacket.cpp') 6312027Sjungma@eit.uni-kl.deDRAMFile('ClockDomain.cpp') 6412027Sjungma@eit.uni-kl.deDRAMFile('CommandQueue.cpp') 6512027Sjungma@eit.uni-kl.deDRAMFile('IniReader.cpp') 6612027Sjungma@eit.uni-kl.deDRAMFile('MemoryController.cpp') 6712027Sjungma@eit.uni-kl.deDRAMFile('MemorySystem.cpp') 6812027Sjungma@eit.uni-kl.deDRAMFile('MultiChannelMemorySystem.cpp') 6912027Sjungma@eit.uni-kl.deDRAMFile('Rank.cpp') 7012027Sjungma@eit.uni-kl.deDRAMFile('SimulatorObject.cpp') 7112027Sjungma@eit.uni-kl.deDRAMFile('Transaction.cpp') 7212027Sjungma@eit.uni-kl.de 7312027Sjungma@eit.uni-kl.de# DRAMSim2 violates some of the warning flags used by gem5, so 7412027Sjungma@eit.uni-kl.de# we explicitly disable them here 7512027Sjungma@eit.uni-kl.dedramenv = main.Clone() 7612027Sjungma@eit.uni-kl.dedramenv.Append(CCFLAGS=['-Wno-unused-value']) 7712027Sjungma@eit.uni-kl.de 7812027Sjungma@eit.uni-kl.de# If we are using clang, there are more flags to disable 7912027Sjungma@eit.uni-kl.deif main['CLANG']: 8012027Sjungma@eit.uni-kl.de dramenv.Append(CCFLAGS=['-Wno-unused-private-field']) 8112027Sjungma@eit.uni-kl.de 8212027Sjungma@eit.uni-kl.de# Tell DRAMSim2 to not store any data as this is already covered by 8312027Sjungma@eit.uni-kl.de# the wrapper 8412027Sjungma@eit.uni-kl.dedramenv.Append(CCFLAGS=['-DNO_STORAGE']) 8512027Sjungma@eit.uni-kl.de 8612027Sjungma@eit.uni-kl.dedramenv.Library('dramsim2', [dramenv.SharedObject(f) for f in dram_files]) 8712027Sjungma@eit.uni-kl.de 8812027Sjungma@eit.uni-kl.demain.Prepend(CPPPATH=Dir('.')) 8912027Sjungma@eit.uni-kl.demain.Append(LIBS=['dramsim2']) 9012027Sjungma@eit.uni-kl.demain.Prepend(LIBPATH=[Dir('.')]) 9112027Sjungma@eit.uni-kl.de