Ejemplo n.º 1
0
# import the m5 (gem5) library created when gem5 is built
import m5
# import all of the SimObjects
from m5.objects import *
from m5.util import addToPath
from FaultParser import *
import argparse

import os

# Add configs/common to execution path in order to import Caches classes
addToPath(os.path.join('..', 'common'))
from Caches import *

#parse and save the arguments
parser = argparse.ArgumentParser(description='Gem5')

parser.add_argument('-fe',
                    '--fault-enabled',
                    dest='faultEnabled',
                    action='store_true',
                    help='It is true if the BPU is faulted')
parser.set_defaults(faultEnabled=False)

parser.add_argument('-b',
                    '--benchmark',
                    type=str,
                    dest='benchmark',
                    help='Benchmark set on which to run the simulation')

parser.add_argument('-l', '--label', type=str, dest='label', help='Fault name')
Ejemplo n.º 2
0
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Radhika Jagtap

# Basic elastic traces replay script that configures a Trace CPU

from __future__ import print_function

import optparse

from m5.util import addToPath, fatal

addToPath('../')

from common import Options
from common import Simulation
from common import CacheConfig
from common import MemConfig
from common.Caches import *

parser = optparse.OptionParser()
Options.addCommonOptions(parser)

if '--ruby' in sys.argv:
    print("This script does not support Ruby configuration, mainly"
    " because Trace CPU has been tested only with classic memory system")
    sys.exit(1)
Ejemplo n.º 3
0
# Copyright (c) 2014 ACS, ICT.
# All rights reserved.
#
# Author: Jiuyue Ma

import optparse
import sys

from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../../gem5-pard/configs/common')
addToPath('common')

import Simulation
import Options
import PARDg5Main
import PARDg5GM

# Control Panel Settings
class CPNetwork(NoncoherentBus):
    fake_responder = IsaFake(pio_addr=0, pio_size=Addr('16MB'))
    default = Self.fake_responder.pio

def connect_cp_bus(sys, gm):
    # CPN0 for cache/memory; CPN1 for IO.
    gm.cpn = [CPNetwork(), CPNetwork()]
    gm.cpa = [CPAdaptor(pci_bus=0, pci_dev=0x10, pci_func=0, InterruptLine = 10,
                        InterruptPin=1),
              CPAdaptor(pci_bus=0, pci_dev=0x11, pci_func=0, InterruptLine = 11,
                        InterruptPin=1)]
Ejemplo n.º 4
0
# Authors: Steve Reinhardt

# Simple test script
#
# "m5 test.py"

import os
import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('/usr/local/lib/gem5/configs/common')
addToPath('/usr/local/lib/gem5/configs/topologies')

import Options
import Simulation
import CacheConfig
from Caches import *
from cpu2000 import *

### Create the Options Parser
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addSEOptions(parser)

### Parse for command line options
(options, args) = parser.parse_args()
Ejemplo n.º 5
0
#
# Authors: Andreas Hansson

from __future__ import print_function
from __future__ import absolute_import

import gzip
import optparse
import os

import m5
from m5.objects import *
from m5.util import addToPath
from m5.stats import periodicStatDump

addToPath('../')
from common import MemConfig

addToPath('../../util')
import protolib

# this script is helpful to observe the memory latency for various
# levels in a cache hierarchy, and various cache and memory
# configurations, in essence replicating the lmbench lat_mem_rd thrash
# behaviour

# import the packet proto definitions, and if they are not found,
# attempt to generate them automatically
try:
    import packet_pb2
except:
Ejemplo n.º 6
0
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ron Dreslinski
#          Brad Beckmann

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys
addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')

import Options
import Ruby

# Get paths we might need.  It's expected this file is in m5/configs/example.
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)

parser = optparse.OptionParser()
Options.addCommonOptions(parser)

parser.add_option("-l",
Ejemplo n.º 7
0
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Jiuyue Ma

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('common')
addToPath('../../gem5-offical/configs/common')
addToPath('../../gem5-offical/configs/ruby')

from XFSConfig import *
from SysPaths import *
from Benchmarks import *
import XSimulation
import CacheConfig
import XMemConfig
from Caches import *
import Options

from PARDg5GM import *

def build_pardg5v_system(np):
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ron Dreslinski

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

# Get paths we might need
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)
addToPath(config_root + '/configs/common')
addToPath(config_root + '/configs/ruby')

import Options
import Ruby

parser = optparse.OptionParser()
Options.addCommonOptions(parser)

# Add the ruby specific and protocol specific options
Ruby.define_options(parser)

(options, args) = parser.parse_args()

#
# Set the default cache size and associativity to be very small to encourage
Ejemplo n.º 9
0
# Simple test script
#
# "m5 test.py"

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal
from m5.SimObject import SimObject
from m5.params import *
# from FuncUnit import *

addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')
addToPath('../build/X86/cpu/o3')

# from FUPool import *
import Options
import Ruby
import Simulation
import CacheConfig
from Caches import *
from cpu2000 import *


def get_processes(options):
    """Interprets provided options and returns a list of processes"""
Ejemplo n.º 10
0
#
# Authors: Radhika Jagtap
#          Andreas Hansson

from __future__ import print_function
from __future__ import absolute_import

import argparse

import m5
from m5.objects import *
from m5.util import addToPath
from m5.stats import periodicStatDump
from common import ObjectList

addToPath(os.getcwd() + '/configs/common')
import MemConfig

# This script aims at triggering low power state transitions in the DRAM
# controller. The traffic generator is used in DRAM mode and traffic
# states target a different levels of bank utilization and strides.
# At the end after sweeping through bank utilization and strides, we go
# through an idle state with no requests to enforce self-refresh.

parser = argparse.ArgumentParser(
    formatter_class=argparse.ArgumentDefaultsHelpFormatter)

# Use a single-channel DDR4-2400 in 16x4 configuration by default
parser.add_argument("--mem-type",
                    default="DDR4_2400_16x4",
                    choices=ObjectList.mem_list.get_names(),
Ejemplo n.º 11
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Andreas Hansson

import gzip
import optparse
import os

import m5
from m5.objects import *
from m5.util import addToPath
from m5.internal.stats import periodicStatDump

addToPath('../common')
import MemConfig

addToPath('../../util')
import protolib

# this script is helpful to observe the memory latency for various
# levels in a cache hierarchy, and various cache and memory
# configurations, in essence replicating the lmbench lat_mem_rd thrash
# behaviour

# import the packet proto definitions, and if they are not found,
# attempt to generate them automatically
try:
    import packet_pb2
except:
Ejemplo n.º 12
0
# Authors: Ron Dreslinski

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

if buildEnv["FULL_SYSTEM"]:
    panic("This script requires system-emulation mode (*_SE).")

# Get paths we might need
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)
addToPath(config_root + "/configs/common")
addToPath(config_root + "/configs/ruby")
addToPath(config_root + "/configs/ruby/protocols")
addToPath(config_root + "/configs/ruby/topologies")

import Ruby

parser = optparse.OptionParser()

#
# Set the default cache size and associativity to be very small to encourage
# races between requests and writebacks.
#
parser.add_option("--l1d_size", type="string", default="256B")
parser.add_option("--l1i_size", type="string", default="256B")
parser.add_option("--l2_size", type="string", default="512B")
Ejemplo n.º 13
0
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Radhika Jagtap
#          Andreas Hansson

from __future__ import print_function

import argparse

import m5
from m5.objects import *
from m5.util import addToPath
from m5.stats import periodicStatDump

addToPath(os.getcwd() + '/configs/common')
import MemConfig

# This script aims at triggering low power state transitions in the DRAM
# controller. The traffic generator is used in DRAM mode and traffic
# states target a different levels of bank utilization and strides.
# At the end after sweeping through bank utilization and strides, we go
# through an idle state with no requests to enforce self-refresh.

parser = argparse.ArgumentParser(
  formatter_class=argparse.ArgumentDefaultsHelpFormatter)

# Use a single-channel DDR4-2400 in 16x4 configuration by default
parser.add_argument("--mem-type", default="DDR4_2400_16x4",
                    choices=MemConfig.mem_names(),
                    help = "type of memory to use")
Ejemplo n.º 14
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Andreas Hansson

import gzip
import optparse
import os

import m5
from m5.objects import *
from m5.util import addToPath
from m5.internal.stats import periodicStatDump

addToPath('../common')
import MemConfig

addToPath('../../util')
import protolib

# this script is helpful to observe the memory latency for various
# levels in a cache hierarchy, and various cache and memory
# configurations, in essence replicating the lmbench lat_mem_rd thrash
# behaviour

# import the packet proto definitions, and if they are not found,
# attempt to generate them automatically
try:
    import packet_pb2
except:
Ejemplo n.º 15
0
# Authors: Ali Saidi
#          Brad Beckmann

from __future__ import print_function
from __future__ import absolute_import

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal, warn
from m5.util.fdthelper import *

addToPath('../gem5/configs/')

from ruby import Ruby

from common.FSConfig import *
from common.SysPaths import *
from common.Benchmarks import *
from common import Simulation
from common import CacheConfig
from common import CpuConfig
from common import MemConfig
from common import ObjectList
from common.Caches import *
from common import Options

Ejemplo n.º 16
0
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Brad Beckmann

import math
import m5
from m5.objects import *
from m5.defines import buildEnv
from Ruby import create_topology
from Ruby import send_evicts
from m5.util import addToPath, fatal

addToPath('../lcacc')
import Lcacc


#
# Note: the L1 Cache latency is only used by the sequencer on fast path hits
#
class L1Cache(RubyCache):
    latency = 3


#
# Note: the L2 Cache latency is not currently used
#
class L2Cache(RubyCache):
    latency = 15
Ejemplo n.º 17
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi

import optparse
import sys
from datetime import datetime

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../common')

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
from Caches import *
import Options

parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)

(options, args) = parser.parse_args()
Ejemplo n.º 18
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi
#          Brad Beckmann

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../common')
addToPath('../ruby_booksim2')

import Ruby

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options


# Check if KVM support has been enabled, we might need to do VM
Ejemplo n.º 19
0
import optparse
import sys
import os

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../')

from ruby import Ruby

from common import Options
from common import Simulation
from common import CacheConfig
from common import CpuConfig
from common import MemConfig
from common.Caches import *
from common.cpu2000 import *

parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addSEOptions(parser)

if '--ruby' in sys.argv:
    Ruby.define_options(parser)
else:
    fatal("This test is only for FPGA in Ruby. Please set --ruby.\n")

(options, args) = parser.parse_args()
# Simple test script
#
# "m5 test.py"

import optparse
import sys
import os

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

gem5_path = os.environ["GEM5"]

addToPath(gem5_path + '/configs')

from ruby import Ruby

from common import Options
from common import Simulation
from common import CacheConfig
from common import CpuConfig
from common import MemConfig
from common.Caches import *
from common.cpu2000 import *
import hw3opts

# Check if KVM support has been enabled, we might need to do VM
# configuration if that's the case.
have_kvm_support = 'BaseKvmCPU' in globals()
Ejemplo n.º 21
0
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('/home/hrniels/Applications/gem5-stable/configs/common')

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options

parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)

parser.add_option("--kernel-cmdline", action="store", type="string")
Ejemplo n.º 22
0
#
# Authors: Ali Saidi
#          Brad Beckmann

from __future__ import print_function

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal, warn
from m5.util.fdthelper import *

addToPath('/home/eli/gem5/configs')

from ruby import Ruby

from FSConfig_mod import *
from common.SysPaths import *
from common.Benchmarks import *
from common import Simulation
from common import CacheConfig
from common import MemConfig
from common import CpuConfig
from common import BPConfig
from common.Caches import *
from common import Options

Ejemplo n.º 23
0
#
# Authors: Karthik Sangaiah & Ankit More
#

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

addToPath("../common")
addToPath("../ruby")
addToPath("../topologies")

import Options
import Ruby

# Get relevant paths.
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)

# Add Gem5 Options
parser = optparse.OptionParser()
Options.addCommonOptions(parser)

# SynchroTrace Specific Options
parser.add_option("--num_cpus", type="int", default=4, help="Number of cpus")
parser.add_option("--num_threads", type="int", default=4, help="Number of threads")
parser.add_option(
    "--dir_shared_frac", type="int", default=2, help="Fraction of the directory used as shared memory (eg. 1/2->2)"
)
Ejemplo n.º 24
0
# This needs to point to an installation of gem5 to use configs/common files
GEM5_DIR = '/opt/gem5'

# Generic python libraries
import optparse
import os
import os.path
import sys

# Interface to m5 simulation, implementing in gem5/src
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath(os.path.join(GEM5_DIR, 'configs/common'))

# Utilities included with m5 for configuring common simulations
# from gem5/configs/common
import Options
import Simulation
from Caches import *
import MemConfig


def eprint(*args):
    sys.stderr.write("".join(args))
    sys.stderr.write("\n")


"""
Ejemplo n.º 25
0
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ron Dreslinski
#          Tushar Krishna

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys
addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')

import Options
import Ruby

# Get paths we might need.  It's expected this file is in m5/configs/example.
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)

parser = optparse.OptionParser()
Options.addCommonOptions(parser)

parser.add_option("--synthetic", type="int", default=0,
Ejemplo n.º 26
0
# Copyright (c) 2014 ACS, ICT.
# All rights reserved.
#
# Author: Jiuyue Ma

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('common')
addToPath('../../gem5-latest/configs/common')

from M5FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options

from PARDg5GM import *

# Add options
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)
Ejemplo n.º 27
0
#
# Authors: Ali Saidi

import optparse
import os
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

if not buildEnv['FULL_SYSTEM']:
    fatal("This script requires full-system mode (*_FS).")

addToPath('../common')

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
from Caches import *

# Get paths we might need.  It's expected this file is in m5/configs/example.
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)

parser = optparse.OptionParser()

# Simulation options
Ejemplo n.º 28
0
#!/usr/bin/python

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal
addToPath('../dramsim2')
import dramsim2_base
from dramsim2_base import *


###############################################################################
# System Configuration
###############################################################################

#All the functions called in this section are in dramsim2_base.py

#Incorporate all the options available do dramsim2_base.py
options = add_options()
#Use DRAMSim for the shared memory
DRAM = setup_dramsim(options)
#Setup benchmarks
multiprocesses = setup_workloads(options)
#Setup CPUs
(CPUClass,test_mem_mode,FutureClass) = setup_cpus(options)

# Use a bus that doesn't model interference
systembus = MagicBus()
Ejemplo n.º 29
0
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi
#          Brad Beckmann

import ConfigParser
import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../../gem5/configs/common')
addToPath('../../gem5/configs/ruby')
addToPath('../../gem5/configs/topologies')
addToPath('gpu_protocol')

import Ruby

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options
Ejemplo n.º 30
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi
#          Brad Beckmann

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../common')
addToPath('../ruby')
addToPath('../network')

import Ruby
import Network

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options
Ejemplo n.º 31
0
# change fully associative to direct mappend
# make sure it's not inclusive
# various performance by just using that as l3 / l4

import m5
import sys
import os
import subprocess
from m5.objects import *
from m5.util import addToPath
from optparse import OptionParser

#=================================================================
# SPEC BENCHMARKS

addToPath("/home/nanoproj/michael/gem5/src/DynamicCacheCtrl/")
addToPath("/home/nanoproj/michael/gem5/configs/common")

from getBenchmark import getBenchmark

process = None

parser = OptionParser()
parser.add_option("-b", "--benchmark", dest="benchmark", help="name of benchmark")
parser.add_option("-i", "--maxinst", dest="maxinst", help="max insts", default=3000000)

(options, _) = parser.parse_args()

if(options.benchmark == None):
    print("! benchmark is a required argument")
    sys.exit(1)
Ejemplo n.º 32
0
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi
#          Brad Beckmann
#          Pablo Prieto
#          Jose Angel Herrero

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../')
# addToPath('../example')
addToPath('../ruby')

import Ruby

from common.FSConfig import *
from common.SysPaths import *
from common import Simulation
from common import CacheConfig
from common import MemConfig
from common import Options
import ACOptions
# -- begin KVM/Timing
import ACSimulation
# -- end KVM/Timing
Ejemplo n.º 33
0
Archivo: o3.py Proyecto: hassahma/m5
import os
import optparse
import sys
from os.path import join as joinpath

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath("../common")
import Simulation
import CacheConfig
from Caches import *


config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)

parser = optparse.OptionParser()

execfile(os.path.join(config_root, "o3lite", "options.py"))

(options, args) = parser.parse_args()

execfile(os.path.join(config_root, "o3lite", "benchmarks.py"))

process = LiveProcess()
process.executable = options.cmd
process.cmd = [options.cmd] + options.options.split()
Ejemplo n.º 34
0
# Copyright (c) 2014 ACS, ICT.
# All rights reserved.
#
# Author: Jiuyue Ma

import optparse
import sys

from m5.objects import *
from m5.util import addToPath, fatal

addToPath("../../gem5-latest/configs/common")
addToPath("common")

import Simulation
import Options
import PARDg5Main

# Add options
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)
PARDg5Main.addPARDg5VOptions(parser)

parser.add_option(
    "--dumpreset-stats",
    action="store",
    type="string",
    help="<M,N> dump and reset stats at M ns and every N ns thereafter",
)
parser.add_option(
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ron Dreslinski

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

# Get paths we might need
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)
addToPath(config_root+'/configs/common')
addToPath(config_root+'/configs/ruby')
addToPath(config_root+'/configs/topologies')

import Ruby
import Options

parser = optparse.OptionParser()
Options.addCommonOptions(parser)

# Add the ruby specific and protocol specific options
Ruby.define_options(parser)

(options, args) = parser.parse_args()

#
Ejemplo n.º 36
0
from m5.util.convert import *
from m5.util import addToPath
# import m5.pystats.loader as loader
addToPath('system')
addToPath('../gem5/configs')

from TestBenchSystem import *
from TrafficGen import *

import argparse
import math

parser = argparse.ArgumentParser()

parser.add_argument('mem_type', type=str, help='''memory model to simulate''')

parser.add_argument('num_chnls',
                    type=int,
                    default=1,
                    help='number of channels in the memory system, \
                    could only be a power of 2, e.g. 1, 2, 4, 8, ..')

parser.add_argument('banks_per_channel',
                    type=int,
                    default=32,
                    help='number of banks per LLM channel')

parser.add_argument('unified_queue',
                    type=int,
                    default=False,
                    help='Unified queue at the MemScheduler')
Ejemplo n.º 37
0
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Matthias Jung

import m5
import optparse

from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../../configs/common/')

from Caches import *

# This configuration shows a simple setup of a Elastic Trace Player (eTraceCPU)
# and an external TLM port for SystemC co-simulation.
#
# We assume a DRAM size of 512MB and L1 cache sizes of 32KB.
#
# Base System Architecture:
#
#                  +-----------+       ^
# +-------------+  | eTraceCPU |       |
# | System Port |  +-----+-----+       |
# +------+------+  | $D1 | $I1 |       |
#        |         +--+--+--+--+       |
Ejemplo n.º 38
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Andreas Hansson

import gzip
import optparse
import os

import m5
from m5.objects import *
from m5.util import addToPath
from m5.stats import periodicStatDump

addToPath('../')
from common import MemConfig

addToPath('../../util')
import protolib

# this script is helpful to observe the memory latency for various
# levels in a cache hierarchy, and various cache and memory
# configurations, in essence replicating the lmbench lat_mem_rd thrash
# behaviour

# import the packet proto definitions, and if they are not found,
# attempt to generate them automatically
try:
    import packet_pb2
except:
Ejemplo n.º 39
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi
#          Brad Beckmann

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../common')
addToPath('../ruby')

import Ruby

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options

# Check if KVM support has been enabled, we might need to do VM
# configuration if that's the case.
#!/usr/bin/python3

import optparse
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../../gem5-20.1/configs/')

#addToPath('../../')
import json
import os

# from network import Network
from common import Options
from noc_network import NoCSystem
from noc_config import noc_config

#-------------------------------------------#
# Add Script arguments                      #
#-------------------------------------------#
parser = optparse.OptionParser()
# Options.addCommonOptions(parser)
# Options.addSEOptions(parser)
#Ruby.define_options(parser)
#Network.define_options(parser)

parser.add_option(
    "--noc-config",
    type="string",
Ejemplo n.º 41
0
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Jason Power, Joel Hestness

import optparse
import os
import sys
from os.path import join as joinpath

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../../gem5/configs/common')
addToPath('../../gem5/configs/ruby')
addToPath('../../gem5/configs/topologies')
addToPath('gpu_protocol')

import GPUConfig
import GPUMemConfig
import Options
import Ruby
import Simulation

parser = optparse.OptionParser()
GPUConfig.addGPUOptions(parser)
GPUMemConfig.addMemCtrlOptions(parser)
Options.addCommonOptions(parser)
Options.addSEOptions(parser)
Ejemplo n.º 42
0
import optparse
import sys
import subprocess

import m5
from m5.objects import *
from m5.util import addToPath

addToPath("../")

from common import MemConfig
from common import HMC

parser = optparse.OptionParser()

# Use a HMC_2500_x32 by default
parser.add_option(
    "--mem-type", type="choice", default="HMC_2500_x32", choices=MemConfig.mem_names(), help="type of memory to use"
)

parser.add_option("--ranks", "-r", type="int", default=1, help="Number of ranks to iterate across")

parser.add_option("--rd_perc", type="int", default=100, help="Percentage of read commands")

parser.add_option(
    "--mode",
    type="choice",
    default="DRAM",
    choices=["DRAM", "DRAM_ROTATE", "RANDOM"],
    help="DRAM: Random traffic; \
                          DRAM_ROTATE: Traffic rotating across banks and ranks",
Ejemplo n.º 43
0
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

# Get paths we might need.
gem5EnvironmentVariable = "GEM5_HOME"
try:
    environ[gem5EnvironmentVariable]
except KeyError:
    print ("Cannot find environment variable '" + gem5EnvironmentVariable + "' which is needed to simulate the program using gem5.")
    exit(0)
m5_root = environ[gem5EnvironmentVariable]
config_root = joinpath(m5_root, "configs")

addToPath(joinpath(config_root, "common"))
addToPath(joinpath(config_root, "ruby"))

#addToPath('../common')
#addToPath('../ruby')

import Options
import Ruby
import Simulation
import CacheConfig
from Caches import *
from cpu2000 import *

#disable the listening sockets to allow gem5 to run in parallel
m5.disableAllListeners()
Ejemplo n.º 44
0
# change fully associative to direct mappend
# make sure it's not inclusive
# various performance by just using that as l3 / l4

import m5
import sys
import os
import subprocess
from m5.objects import *
from m5.util import addToPath
from optparse import OptionParser

#=================================================================
# SPEC BENCHMARKS

addToPath("/home/nanoproj/michael/gem5/configs/dynamic-cache")
addToPath("/home/nanoproj/michael/gem5/configs/common")

from getBenchmark import getBenchmark

process = None

parser = OptionParser()
parser.add_option("-b",
                  "--benchmark",
                  dest="benchmark",
                  help="name of benchmark")
parser.add_option("-i",
                  "--maxinst",
                  dest="maxinst",
                  help="max insts",
Ejemplo n.º 45
0
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Brad Beckmann

import math
import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath, fatal

import MemConfig
addToPath('../topologies')

def define_options(parser):
    # By default, ruby uses the simple timing cpu
    parser.set_defaults(cpu_type="timing")

    parser.add_option("--ruby-clock", action="store", type="string",
                      default='2GHz',
                      help="Clock for blocks running at Ruby system's speed")

    parser.add_option("--access-backing-store", action="store_true", default=False,
                      help="Should ruby maintain a second copy of memory")

    # Options related to cache structure
    parser.add_option("--ports", action="store", type="int", default=4,
                      help="used of transitions per cycle which is a proxy \
Ejemplo n.º 46
0
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Brad Beckmann

import math
import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath, fatal

addToPath('../topologies')
import inspect
from textwrap import TextWrapper

RubyMemoryControl = None

_ruby_mem_aliases_all = [
    ("ruby", "RubyMemoryControl"),
    ("nvmain", "NVMMemoryControl"),
]

_ruby_mem_classes = {}
_ruby_mem_aliases = {}


def is_ruby_mem_class(cls):
Ejemplo n.º 47
0
Archivo: fs.py Proyecto: valkjsaaa/gem5
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Ali Saidi
#          Brad Beckmann

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath("../common")
addToPath("../ruby")

import Ruby

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Simulation
import CacheConfig
import MemConfig
from Caches import *
import Options


# Check if KVM support has been enabled, we might need to do VM
Ejemplo n.º 48
0
    if not isa:
        fatal('ISA not found in test: %s' % test_filename)

    file_chop_index = test_filename.find('%s/' % isa)
    if file_chop_index >= len(test_filename):
        fatal('test_filename lacks \'%s\/\' substring' % isa)
    test_filename = test_filename[:file_chop_index]

    test_filename = os.path.join(test_filename, 'test.py')
    if not os.path.exists(test_filename):
        fatal('Could not find test script: \'%s\'' % test_filename)
    return test_filename


addToPath('../configs/example')
addToPath('../configs/common')
addToPath('../configs/ruby')
addToPath('../configs/topologies')
addToPath('../../gem5-gpu/configs')
addToPath('../../gem5-gpu/configs/gpu_protocol')

import GPUConfig
import GPUMemConfig
import Options
import Ruby
import Simulation

from FSConfig import *
from SysPaths import *
from Benchmarks import *
# Authors: Steve Reinhardt

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

if buildEnv['FULL_SYSTEM']:
    panic("This script requires system-emulation mode (*_SE).")

# Get paths we might need
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)
addToPath(config_root+'/configs/common')
addToPath(config_root+'/configs/ruby')

import Ruby

parser = optparse.OptionParser()

#
# Add the ruby specific and protocol specific options
#
Ruby.define_options(parser)

execfile(os.path.join(config_root, "configs/common", "Options.py"))

(options, args) = parser.parse_args()
Ejemplo n.º 50
0
# Date: 04/22/2019
#
# All rights reserved.

import optparse
import sys
import os
from cpu2006 import CPU2006

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath

configs = os.path.expanduser("~/Research/ywang-gem5/configs")
addToPath(configs)

from common import Options
from common import Simulation
from common import CacheConfig
from common import CpuConfig
from common import MemConfig
from common.Caches import *


def get_processes(binary, np):
    """Interprets provided options and returns a list of processes"""
    multiprocesses = []

    for i in range(np):
        process = Process(pid=100 + i)
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Brad Beckmann

import math
import m5
from m5.objects import *
from m5.defines import buildEnv
from Ruby import create_topology
from Ruby import send_evicts
from m5.util import addToPath, fatal

addToPath('../lcacc')
import Lcacc

#
# Note: the L1 Cache latency is only used by the sequencer on fast path hits
#
class L1Cache(RubyCache):
    latency = 3

#
# Note: the L2 Cache latency is not currently used
#
class L2Cache(RubyCache):
    latency = 15

def define_options(parser):
Ejemplo n.º 52
0
import os
import os.path
import sys

if os.path.isdir('/afs/cs.cmu.edu/academic/class/18600-f17/gem5'):
    GEM5_DIR = '/afs/cs.cmu.edu/academic/class/18600-f17/gem5'
elif os.path.isdir('/usr/local/depot/gem5'):
    GEM5_DIR = '/usr/local/depot/gem5'

# Interface to m5 simulation, implementing in gem5/src
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath(os.path.join(GEM5_DIR, 'configs'))

# Utilities included with m5 for configuring common simulations
# from gem5/configs/common
from common import Options
from common import Simulation
from common.Caches import *
from common import MemConfig


def eprint(*args):
    sys.stderr.write("".join(args))
    sys.stderr.write("\n")


"""
Ejemplo n.º 53
0
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Steve Reinhardt

import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys

# Get paths we might need
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
addToPath(config_root+'/configs/common')
addToPath(config_root+'/configs/ruby')
addToPath(config_root+'/configs/topologies')

import Ruby
import Options

parser = optparse.OptionParser()
Options.addCommonOptions(parser)

# Add the ruby specific and protocol specific options
Ruby.define_options(parser)

(options, args) = parser.parse_args()

#
Ejemplo n.º 54
0
# -*- coding: utf-8 -*-

from __future__ import print_function

import m5
from m5.objects import *
from m5.util import addToPath

from argparse import ArgumentParser

addToPath("./systems/")
addToPath("./systems/cpus/")
addToPath("./systems/caches/")
#addToPath("./systems/bt/")

#from benchmarks     import PARSECBenchmarkManager
#from benchmarks     import MiBenchBenchmarkManager

from system_manager import SystemManager


# Beautiful COLors for formatting
class bcol:
    MAGENTA = '\033[95m'
    BLUE = '\033[94m'
    GREEN = '\033[92m'
    YELLOW = '\033[93m'
    RED = '\033[91m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'
    END = '\033[0m'
Ejemplo n.º 55
0
#
# Authors: Brad Beckmann

#
# Full system configuraiton for ruby
#

import optparse
import sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal

addToPath('../common')
addToPath('../ruby')

import Ruby

from FSConfig import *
from SysPaths import *
from Benchmarks import *
import Options
import Simulation

def addExternalDisk(cur_sys):
     cur_sys.cf1 = CowIdeDisk(driveID='master')
     cur_sys.cf1.childImage(disk("benchmarks.img"))
     # default to an IDE controller rather than a CF one
     # assuming we've got one
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Brad Beckmann

import math
import m5
from m5.objects import *
from m5.defines import buildEnv
from Ruby import create_topology
from Ruby import send_evicts
from m5.util import addToPath, fatal

addToPath("../lcacc")
import Lcacc

#
# Note: the L1 Cache latency is only used by the sequencer on fast path hits
#
class L1Cache(RubyCache):
    latency = 3


#
# Note: the L2 Cache latency is not currently used
#
class L2Cache(RubyCache):
    latency = 15