本文整理汇总了Python中MemConfig类的典型用法代码示例。如果您正苦于以下问题:Python MemConfig类的具体用法?Python MemConfig怎么用?Python MemConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MemConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_memory_controllers
def setup_memory_controllers(system, ruby, dir_cntrls, options):
ruby.block_size_bytes = options.cacheline_size
ruby.memory_size_bits = 48
block_size_bits = int(math.log(options.cacheline_size, 2))
if options.numa_high_bit:
numa_bit = options.numa_high_bit
else:
# if the numa_bit is not specified, set the directory bits as the
# lowest bits above the block offset bits, and the numa_bit as the
# highest of those directory bits
dir_bits = int(math.log(options.num_dirs, 2))
numa_bit = block_size_bits + dir_bits - 1
index = 0
mem_ctrls = []
crossbars = []
# Sets bits to be used for interleaving. Creates memory controllers
# attached to a directory controller. A separate controller is created
# for each address range as the abstract memory can handle only one
# contiguous address range as of now.
for dir_cntrl in dir_cntrls:
dir_cntrl.directory.numa_high_bit = numa_bit
crossbar = None
if len(system.mem_ranges) > 1:
crossbar = NoncoherentXBar()
crossbars.append(crossbar)
dir_cntrl.memory = crossbar.slave
for r in system.mem_ranges:
mem_ctrl = MemConfig.create_mem_ctrl(
MemConfig.get(options.mem_type), r, index, options.num_dirs,
int(math.log(options.num_dirs, 2)), options.cacheline_size)
mem_ctrls.append(mem_ctrl)
if crossbar != None:
mem_ctrl.port = crossbar.master
else:
mem_ctrl.port = dir_cntrl.memory
index += 1
system.mem_ctrls = mem_ctrls
if len(crossbars) > 0:
ruby.crossbars = crossbars
示例2: addTHNVMOptions
def addTHNVMOptions(parser):
parser.add_option("--dram-type", type="choice", default="DDR3_1600_x64",
choices=MemConfig.mem_names(),
help = "type of DRAM to use")
parser.add_option("--nvm-type", type="choice", default="DDR3_1600_x64_PCM",
choices=MemConfig.mem_names(),
help = "type of NVM to use")
parser.add_option("--block-bits", type="int", default=6,
help="number of bits of a block in the block remapping scheme")
parser.add_option("--page-bits", type="int", default=12,
help="number of bits of a page in the page writeback scheme")
parser.add_option("--btt-length", type="int", default=0,
help="number of BTT entries")
parser.add_option("--ptt-length", type="int", default=0,
help="number of PTT entries")
示例3: config_hybrid_mem
def config_hybrid_mem(options, system):
"""
Assign proper address ranges for DRAM and NVM controllers.
Create memory controllers and add their shared bus to the system.
"""
system.thnvm_bus = VirtualXBar()
mem_ctrls = []
# The default behaviour is to interleave memory channels on 128
# byte granularity, or cache line granularity if larger than 128
# byte. This value is based on the locality seen across a large
# range of workloads.
intlv_size = max(128, system.cache_line_size.value)
total_size = Addr(options.mem_size)
dram_size = pow(2, options.page_bits) * options.ptt_length
if dram_size < total_size.value:
nvm_cls = MemConfig.get(options.nvm_type)
nvm_range = AddrRange(0, total_size - dram_size - 1)
nvm_ctrl = MemConfig.create_mem_ctrl(nvm_cls, nvm_range,
0, 1, 0, intlv_size)
# Set the number of ranks based on the command-line
# options if it was explicitly set
if issubclass(nvm_cls, DRAMCtrl) and options.mem_ranks:
nvm_ctrl.ranks_per_channel = options.mem_ranks
mem_ctrls.append(nvm_ctrl)
if dram_size > 0:
dram_cls = MemConfig.get(options.dram_type)
dram_range = AddrRange(total_size - dram_size, total_size - 1)
dram_ctrl = MemConfig.create_mem_ctrl(dram_cls, dram_range,
0, 1, 0, intlv_size)
# Set the number of ranks based on the command-line
# options if it was explicitly set
if issubclass(dram_cls, DRAMCtrl) and options.mem_ranks:
dram_ctrl.ranks_per_channel = options.mem_ranks
mem_ctrls.append(dram_ctrl)
system.mem_ctrls = mem_ctrls
# Connect the controllers to the THNVM bus
for i in xrange(len(system.mem_ctrls)):
system.mem_ctrls[i].port = system.thnvm_bus.master
system.thnvm_bus.slave = system.membus.master
示例4: setMemClass
def setMemClass(options):
"""Returns a memory controller class."""
return MemConfig.get(options.mem_type)
示例5: xrange
for i in xrange(np):
ruby_port = system.ruby._cpu_ports[i]
# Create the interrupt controller and connect its ports to Ruby
# Note that the interrupt controller is always present but only
# in x86 does it have message ports that need to be connected
system.cpu[i].createInterruptController()
# Connect the cpu's cache ports to Ruby
system.cpu[i].icache_port = ruby_port.slave
system.cpu[i].dcache_port = ruby_port.slave
if buildEnv['TARGET_ISA'] == 'x86':
system.cpu[i].interrupts.pio = ruby_port.master
system.cpu[i].interrupts.int_master = ruby_port.slave
system.cpu[i].interrupts.int_slave = ruby_port.master
system.cpu[i].itb.walker.port = ruby_port.slave
system.cpu[i].dtb.walker.port = ruby_port.slave
else: ### THIS IS WHERE WE END UP ###
MemClass = Simulation.setMemClass(options)
system.membus = CoherentXBar()
system.system_port = system.membus.slave
CacheConfig.config_cache(options, system)
MemConfig.config_mem(options, system)
root = Root(full_system = False, system = system)
Simulation.run(options, root, system, FutureClass)
示例6: addToPath
from m5.internal.stats import periodicStatDump
addToPath('../common')
import MemConfig
# this script is helpful to sweep the efficiency of a specific memory
# controller configuration, by varying the number of banks accessed,
# and the sequential stride size (how many bytes per activate), and
# observe what bus utilisation (bandwidth) is achieved
parser = optparse.OptionParser()
# Use a single-channel DDR3-1600 x64 by default
parser.add_option("--mem-type", type="choice", default="ddr3_1600_x64",
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"],
help = "DRAM: Random traffic; \
DRAM_ROTATE: Traffic rotating across banks and ranks")
parser.add_option("--addr_map", type="int", default=1,
help = "0: RoCoRaBaCh; 1: RoRaBaCoCh/RoRaBaChCo")
示例7: build_test_system
#.........这里部分代码省略.........
if options.virtualisation:
test_sys.have_virtualization = True
test_sys.init_param = options.init_param
# For now, assign all the CPUs to the same clock domain
test_sys.cpu = [TestCPUClass(clk_domain=test_sys.cpu_clk_domain, cpu_id=i,
function_trace=options.enable_trace)
for i in xrange(np)]
if is_kvm_cpu(TestCPUClass) or is_kvm_cpu(FutureClass):
test_sys.vm = KvmVM()
if options.ruby:
# Check for timing mode because ruby does not support atomic accesses
if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
print >> sys.stderr, "Ruby requires TimingSimpleCPU or O3CPU!!"
sys.exit(1)
Ruby.create_system(options, True, test_sys, test_sys.iobus,
test_sys._dma_ports)
# Create a seperate clock domain for Ruby
test_sys.ruby.clk_domain = SrcClockDomain(clock = options.ruby_clock,
voltage_domain = test_sys.voltage_domain)
# Connect the ruby io port to the PIO bus,
# assuming that there is just one such port.
test_sys.iobus.master = test_sys.ruby._io_port.slave
for (i, cpu) in enumerate(test_sys.cpu):
#
# Tie the cpu ports to the correct ruby system ports
#
cpu.clk_domain = test_sys.cpu_clk_domain
cpu.createThreads()
cpu.createInterruptController()
cpu.icache_port = test_sys.ruby._cpu_ports[i].slave
cpu.dcache_port = test_sys.ruby._cpu_ports[i].slave
if buildEnv['TARGET_ISA'] == "x86":
cpu.itb.walker.port = test_sys.ruby._cpu_ports[i].slave
cpu.dtb.walker.port = test_sys.ruby._cpu_ports[i].slave
cpu.interrupts[0].pio = test_sys.ruby._cpu_ports[i].master
cpu.interrupts[0].int_master = test_sys.ruby._cpu_ports[i].slave
cpu.interrupts[0].int_slave = test_sys.ruby._cpu_ports[i].master
else:
if options.caches or options.l2cache:
# By default the IOCache runs at the system clock
test_sys.iocache = IOCache(addr_ranges = test_sys.mem_ranges)
test_sys.iocache.cpu_side = test_sys.iobus.master
test_sys.iocache.mem_side = test_sys.membus.slave
elif not options.external_memory_system:
test_sys.iobridge = Bridge(delay='50ns', ranges = test_sys.mem_ranges)
test_sys.iobridge.slave = test_sys.iobus.master
test_sys.iobridge.master = test_sys.membus.slave
# Sanity check
if options.fastmem:
if TestCPUClass != AtomicSimpleCPU:
fatal("Fastmem can only be used with atomic CPU!")
if (options.caches or options.l2cache):
fatal("You cannot use fastmem in combination with caches!")
if options.simpoint_profile:
if not options.fastmem:
# Atomic CPU checked with fastmem option already
fatal("SimPoint generation should be done with atomic cpu and fastmem")
if np > 1:
fatal("SimPoint generation not supported with more than one CPUs")
for i in xrange(np):
if options.fastmem:
test_sys.cpu[i].fastmem = True
if options.simpoint_profile:
test_sys.cpu[i].addSimPointProbe(options.simpoint_interval)
if options.checker:
test_sys.cpu[i].addCheckerCpu()
test_sys.cpu[i].createThreads()
# If elastic tracing is enabled when not restoring from checkpoint and
# when not fast forwarding using the atomic cpu, then check that the
# TestCPUClass is DerivO3CPU or inherits from DerivO3CPU. If the check
# passes then attach the elastic trace probe.
# If restoring from checkpoint or fast forwarding, the code that does this for
# FutureCPUClass is in the Simulation module. If the check passes then the
# elastic trace probe is attached to the switch CPUs.
if options.elastic_trace_en and options.checkpoint_restore == None and \
not options.fast_forward:
CpuConfig.config_etrace(TestCPUClass, test_sys.cpu, options)
CacheConfig.config_cache(options, test_sys)
MemConfig.config_mem(options, test_sys)
return test_sys
示例8: build_test_system
#.........这里部分代码省略.........
test_sys.clk_domain = SrcClockDomain(clock = options.sys_clock,
voltage_domain = test_sys.voltage_domain)
# Create a CPU voltage domain
test_sys.cpu_voltage_domain = VoltageDomain()
# Create a source clock for the CPUs and set the clock period
test_sys.cpu_clk_domain = SrcClockDomain(clock = options.cpu_clock,
voltage_domain =
test_sys.cpu_voltage_domain)
if options.kernel is not None:
test_sys.kernel = binary(options.kernel)
if options.script is not None:
test_sys.readfile = options.script
if options.lpae:
test_sys.have_lpae = True
if options.virtualisation:
test_sys.have_virtualization = True
test_sys.init_param = options.init_param
# For now, assign all the CPUs to the same clock domain
test_sys.cpu = [TestCPUClass(clk_domain=test_sys.cpu_clk_domain, cpu_id=i)
for i in xrange(np)]
if is_kvm_cpu(TestCPUClass) or is_kvm_cpu(FutureClass):
test_sys.vm = KvmVM()
if options.ruby:
# Check for timing mode because ruby does not support atomic accesses
if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
print >> sys.stderr, "Ruby requires TimingSimpleCPU or O3CPU!!"
sys.exit(1)
Ruby.create_system(options, test_sys, test_sys.iobus, test_sys._dma_ports)
# Create a seperate clock domain for Ruby
test_sys.ruby.clk_domain = SrcClockDomain(clock = options.ruby_clock,
voltage_domain = test_sys.voltage_domain)
for (i, cpu) in enumerate(test_sys.cpu):
#
# Tie the cpu ports to the correct ruby system ports
#
cpu.clk_domain = test_sys.cpu_clk_domain
cpu.createThreads()
cpu.createInterruptController()
cpu.icache_port = test_sys.ruby._cpu_ports[i].slave
cpu.dcache_port = test_sys.ruby._cpu_ports[i].slave
if buildEnv['TARGET_ISA'] == "x86":
cpu.itb.walker.port = test_sys.ruby._cpu_ports[i].slave
cpu.dtb.walker.port = test_sys.ruby._cpu_ports[i].slave
cpu.interrupts.pio = test_sys.ruby._cpu_ports[i].master
cpu.interrupts.int_master = test_sys.ruby._cpu_ports[i].slave
cpu.interrupts.int_slave = test_sys.ruby._cpu_ports[i].master
test_sys.ruby._cpu_ports[i].access_phys_mem = True
# Create the appropriate memory controllers
# and connect them to the IO bus
test_sys.mem_ctrls = [TestMemClass(range = r) for r in test_sys.mem_ranges]
for i in xrange(len(test_sys.mem_ctrls)):
test_sys.mem_ctrls[i].port = test_sys.iobus.master
else:
if options.caches or options.l2cache:
# By default the IOCache runs at the system clock
test_sys.iocache = IOCache(addr_ranges = test_sys.mem_ranges)
test_sys.iocache.cpu_side = test_sys.iobus.master
test_sys.iocache.mem_side = test_sys.membus.slave
else:
test_sys.iobridge = Bridge(delay='50ns', ranges = test_sys.mem_ranges)
test_sys.iobridge.slave = test_sys.iobus.master
test_sys.iobridge.master = test_sys.membus.slave
# Sanity check
if options.fastmem:
if TestCPUClass != AtomicSimpleCPU:
fatal("Fastmem can only be used with atomic CPU!")
if (options.caches or options.l2cache):
fatal("You cannot use fastmem in combination with caches!")
for i in xrange(np):
if options.fastmem:
test_sys.cpu[i].fastmem = True
if options.checker:
test_sys.cpu[i].addCheckerCpu()
test_sys.cpu[i].createThreads()
BaseCacheConfig.config_cache(options, test_sys)
MemConfig.config_mem(options, test_sys)
return test_sys
示例9: fatal
# Sanity check
if options.fastmem:
if TestCPUClass != AtomicSimpleCPU:
fatal("Fastmem can only be used with atomic CPU!")
if (options.caches or options.l2cache):
fatal("You cannot use fastmem in combination with caches!")
for i in xrange(np):
if options.fastmem:
test_sys.cpu[i].fastmem = True
if options.checker:
test_sys.cpu[i].addCheckerCpu()
test_sys.cpu[i].createThreads()
CacheConfig.config_cache(options, test_sys)
MemConfig.config_mem(options, test_sys)
if len(bm) == 2:
if buildEnv['TARGET_ISA'] == 'alpha':
drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
elif buildEnv['TARGET_ISA'] == 'mips':
drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1])
elif buildEnv['TARGET_ISA'] == 'sparc':
drive_sys = makeSparcSystem(drive_mem_mode, bm[1])
elif buildEnv['TARGET_ISA'] == 'x86':
drive_sys = makeX86System(drive_mem_mode, np, bm[1])
elif buildEnv['TARGET_ISA'] == 'arm':
drive_sys = makeArmSystem(drive_mem_mode, options.machine_type, bm[1])
# Create a top-level voltage domain
drive_sys.voltage_domain = VoltageDomain(voltage = options.sys_voltage)
示例10: addToPath
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")
parser.add_argument("--mem-ranks", "-r", type=int, default=1,
help = "Number of ranks to iterate across")
parser.add_argument("--page-policy", "-p",
choices=["close_adaptive", "open_adaptive"],
default="close_adaptive", help="controller page policy")
parser.add_argument("--itt-list", "-t", default="1 20 100",
help="a list of multipliers for the max value of itt, " \
"e.g. \"1 20 100\"")
parser.add_argument("--rd-perc", type=int, default=100,
help = "Percentage of read commands")
示例11: create_system
#.........这里部分代码省略.........
dir_version = i + num_cpu_dirs
dir_size = MemorySize('0B')
dir_size.value = mem_module_size
pf = ProbeFilter(size = pf_size, assoc = 4,
start_index_bit = pf_start_bit)
dev_dir_cntrl = Directory_Controller(version = dir_version,
directory = \
RubyDirectoryMemory( \
version = dir_version,
size = dir_size,
numa_high_bit = \
options.numa_high_bit,
device_directory = True),
probeFilter = pf,
probe_filter_enabled = options.pf_on,
full_bit_dir_enabled = options.dir_on,
ruby_system = ruby_system)
if options.recycle_latency:
dev_dir_cntrl.recycle_latency = options.recycle_latency
exec("ruby_system.dev_dir_cntrl%d = dev_dir_cntrl" % i)
dev_dir_cntrls.append(dev_dir_cntrl)
# Connect the directory controller to the network
dev_dir_cntrl.forwardFromDir = ruby_system.network.slave
dev_dir_cntrl.responseFromDir = ruby_system.network.slave
dev_dir_cntrl.dmaResponseFromDir = ruby_system.network.slave
dev_dir_cntrl.unblockToDir = ruby_system.network.master
dev_dir_cntrl.responseToDir = ruby_system.network.master
dev_dir_cntrl.requestToDir = ruby_system.network.master
dev_dir_cntrl.dmaRequestToDir = ruby_system.network.master
dev_mem_ctrl = MemConfig.create_mem_ctrl(
MemConfig.get(options.mem_type), system.gpu.gpu_memory_range,
i, options.num_dev_dirs, int(math.log(options.num_dev_dirs, 2)),
options.cacheline_size)
dev_mem_ctrl.port = dev_dir_cntrl.memory
dev_mem_ctrls.append(dev_mem_ctrl)
system.dev_mem_ctrls = dev_mem_ctrls
else:
# Since there are no device directories, use CPU directories
# Fix up the memory sizes of the CPU directories
num_dirs = len(dir_cntrls)
add_gpu_mem = gpu_phys_mem_size / num_dirs
for cntrl in dir_cntrls:
new_size = cntrl.directory.size.value + add_gpu_mem
cntrl.directory.size.value = new_size
#
# Create controller for the copy engine to connect to in GPU cluster
# Cache is unused by controller
#
cache = L1Cache(size = "4096B", assoc = 2)
gpu_ce_seq = RubySequencer(version = options.num_cpus + options.num_sc + 1,
icache = cache,
dcache = cache,
max_outstanding_requests = 64,
support_inst_reqs = False,
ruby_system = ruby_system,
connect_to_io = False)
gpu_ce_cntrl = GPUCopyDMA_Controller(version = 1,
sequencer = gpu_ce_seq,
number_of_TBEs = 256,
ruby_system = ruby_system)
ruby_system.l1_cntrl_ce = gpu_ce_cntrl
all_sequencers.append(cpu_ce_seq)
all_sequencers.append(gpu_ce_seq)
gpu_ce_cntrl.responseFromDir = ruby_system.network.master
gpu_ce_cntrl.reqToDirectory = ruby_system.network.slave
complete_cluster = Cluster(intBW = 32, extBW = 32)
complete_cluster.add(cpu_ce_cntrl)
complete_cluster.add(gpu_ce_cntrl)
complete_cluster.add(cpu_cluster)
complete_cluster.add(gpu_cluster)
for cntrl in dir_cntrls:
complete_cluster.add(cntrl)
for cntrl in dev_dir_cntrls:
complete_cluster.add(cntrl)
for cntrl in dma_cntrls:
complete_cluster.add(cntrl)
for cluster in l2_clusters:
complete_cluster.add(cluster)
return (all_sequencers, dir_cntrls, complete_cluster)
示例12: checks
parser.add_option("-l", "--checks", metavar="N", default=100,
help="Stop after N checks (loads)")
parser.add_option("-f", "--wakeup_freq", metavar="N", default=10,
help="Wakeup every N cycles")
#
# Add the ruby specific and protocol specific options
#
Ruby.define_options(parser)
#execfile(os.path.join(config_root, "common", "Options.py"))
(options, args) = parser.parse_args()
gpgpusimconfig = MemConfig.parseGpgpusimConfig(options)
#
# Set the default cache size and associativity to be very small to encourage
# races between requests and writebacks.
#
options.l1d_size="256B"
options.l1i_size="256B"
options.l2_size="512B"
options.l3_size="1kB"
options.l1d_assoc=2
options.l1i_assoc=2
options.l2_assoc=2
options.l3_assoc=2
if args:
示例13: addCommonOptions
def addCommonOptions(parser):
# system options
parser.add_option("--list-cpu-types",
action="callback", callback=_listCpuTypes,
help="List available CPU types")
parser.add_option("--cpu-type", type="choice", default="atomic",
choices=CpuConfig.cpu_names(),
help = "type of cpu to run with")
parser.add_option("--checker", action="store_true");
parser.add_option("-n", "--num-cpus", type="int", default=1)
parser.add_option("--sys-voltage", action="store", type="string",
default='1.0V',
help = """Top-level voltage for blocks running at system
power supply""")
parser.add_option("--sys-clock", action="store", type="string",
default='1GHz',
help = """Top-level clock for blocks running at system
speed""")
parser.add_option("--cpu-clock", action="store", type="string",
default='1GHz',
help="Clock for blocks running at CPU speed")
parser.add_option("--smt", action="store_true", default=False,
help = """
Only used if multiple programs are specified. If true,
then the number of threads per cpu is same as the
number of programs.""")
# Memory Options
parser.add_option("--list-mem-types",
action="callback", callback=_listMemTypes,
help="List available memory types")
parser.add_option("--mem-type", type="choice", default="simple_mem",
choices=MemConfig.mem_names(),
help = "type of memory to use")
parser.add_option("--mem-channels", type="int", default=1,
help = "number of memory channels")
parser.add_option("--mem-size", action="store", type="string",
default="4GB",
help="Specify the physical memory size (single memory)")
# Cache Options
parser.add_option("--caches", action="store_true")
parser.add_option("--l2cache", action="store_true")
#PRODROMOU
parser.add_option("--l3cache",
action = "store_true",
help = "Enable L3 cache (Implies L2)")
parser.add_option("-b", "--benchmark", default="",
help="The benchmark to be loaded.")
parser.add_option("--bench-size", default="ref",
help="The size of the benchmark <train/ref>")
parser.add_option("--total-insts", type="int",
default = 0, # by default "if options.total_insts" fails
help="If defined, the simulation is going to keep running until the total number of instructions has been executed accross all threads")
parser.add_option("--mempolicy", default = "frfcfs",
help="The memory controller scheduling policy to be used")
parser.add_option("--ckpt-nickname", default=None, type="string",
help="If defined, the simulator will use it as part of the checkpoint's name. Example (nickname set as memIntense): cpt.memIntense.20140693 instead of cpt.None.20140693")
parser.add_option("--mutlu", action="store_true",
help="Creates the mem hierarchy used in Mutlu's Par-BS paper")
parser.add_option("-d", "--dump-interval", default=0, type="int",
help="Dumps statistics every defined interval")
parser.add_option("--per-access-slowdown", default="0ns", type="string",
help="Sets the MC's static delay per access. Only used custom_tcl MC class")
parser.add_option("--slowdown-accesses", default=False, action="store_true",
help="Enables per access slowdown. Amount of delay passed with --per-access-slowdown")
#PRODROMOU
parser.add_option("--fastmem", action="store_true")
parser.add_option("--num-dirs", type="int", default=1)
parser.add_option("--num-l2caches", type="int", default=1)
parser.add_option("--num-l3caches", type="int", default=1)
parser.add_option("--l1d_size", type="string", default="32kB")
parser.add_option("--l1i_size", type="string", default="32kB")
parser.add_option("--l2_size", type="string", default="512kB")
parser.add_option("--l3_size", type="string", default="16MB")
parser.add_option("--l1d_assoc", type="int", default=2)
parser.add_option("--l1i_assoc", type="int", default=2)
parser.add_option("--l2_assoc", type="int", default=8)
parser.add_option("--l3_assoc", type="int", default=16)
parser.add_option("--cacheline_size", type="int", default=64)
# Enable Ruby
parser.add_option("--ruby", action="store_true")
# Run duration options
parser.add_option("-m", "--abs-max-tick", type="int", default=None,
metavar="TICKS", help="Run to absolute simulated tick " \
"specified including ticks from a restored checkpoint")
parser.add_option("--rel-max-tick", type="int", default=None,
metavar="TICKS", help="Simulate for specified number of" \
" ticks relative to the simulation start tick (e.g. if " \
"restoring a checkpoint)")
parser.add_option("--maxtime", type="float", default=None,
help="Run to the specified absolute simulated time in " \
"seconds")
parser.add_option("-I", "--maxinsts", action="store", type="int",
default=None, help="""Total number of instructions to
simulate (default: run forever)""")
#.........这里部分代码省略.........
示例14: create_system
def create_system(options, full_system, system, dma_ports, ruby_system):
if not buildEnv['GPGPU_SIM']:
m5.util.panic("This script requires GPGPU-Sim integration to be built.")
options.access_backing_store = True
# Run the original protocol script
buildEnv['PROTOCOL'] = buildEnv['PROTOCOL'].replace('split', 'fusion')
protocol = buildEnv['PROTOCOL']
exec "import %s" % protocol
try:
(cpu_sequencers, dir_cntrl_nodes, topology) = \
eval("%s.create_system(options, full_system, system, dma_ports, ruby_system)" % protocol)
except:
print "Error: could not create system for ruby protocol inside fusion system %s" % protocol
raise
# Faking things to build the rest of the system
print "Warning!"
print "Warning: Faking split MOESI_hammer protocol; collecting checkpoints?"
print "Warning!"
if options.num_dev_dirs > 0:
block_size_bits = int(math.log(options.cacheline_size, 2))
gpu_phys_mem_size = system.gpu.gpu_memory_range.size()
mem_module_size = gpu_phys_mem_size / options.num_dev_dirs
#
# determine size and index bits for probe filter
# By default, the probe filter size is configured to be twice the
# size of the L2 cache.
#
pf_size = MemorySize(options.sc_l2_size)
pf_size.value = pf_size.value * 2
dir_bits = int(math.log(options.num_dev_dirs, 2))
pf_bits = int(math.log(pf_size.value, 2))
if options.numa_high_bit:
if options.pf_on or options.dir_on:
# if numa high bit explicitly set, make sure it does not overlap
# with the probe filter index
assert(options.numa_high_bit - dir_bits > pf_bits)
# set the probe filter start bit to just above the block offset
pf_start_bit = block_size_bits
else:
if dir_bits > 0:
pf_start_bit = dir_bits + block_size_bits - 1
else:
pf_start_bit = block_size_bits
dev_dir_cntrls = []
dev_mem_ctrls = []
num_cpu_dirs = len(dir_cntrl_nodes)
for i in xrange(options.num_dev_dirs):
#
# Create the Ruby objects associated with the directory controller
#
dir_version = i + num_cpu_dirs
dir_size = MemorySize('0B')
dir_size.value = mem_module_size
pf = ProbeFilter(size = pf_size, assoc = 4,
start_index_bit = pf_start_bit)
dev_dir_cntrl = Directory_Controller(version = dir_version,
directory = \
RubyDirectoryMemory( \
version = dir_version,
size = dir_size,
numa_high_bit = \
options.numa_high_bit,
device_directory = True),
probeFilter = pf,
probe_filter_enabled = options.pf_on,
full_bit_dir_enabled = options.dir_on,
ruby_system = ruby_system)
if options.recycle_latency:
dev_dir_cntrl.recycle_latency = options.recycle_latency
exec("ruby_system.dev_dir_cntrl%d = dev_dir_cntrl" % i)
dev_dir_cntrls.append(dev_dir_cntrl)
# Connect the directory controller to the network
dev_dir_cntrl.forwardFromDir = ruby_system.network.slave
dev_dir_cntrl.responseFromDir = ruby_system.network.slave
dev_dir_cntrl.dmaResponseFromDir = ruby_system.network.slave
dev_dir_cntrl.unblockToDir = ruby_system.network.master
dev_dir_cntrl.responseToDir = ruby_system.network.master
dev_dir_cntrl.requestToDir = ruby_system.network.master
dev_dir_cntrl.dmaRequestToDir = ruby_system.network.master
dev_mem_ctrl = MemConfig.create_mem_ctrl(
MemConfig.get(options.mem_type), system.gpu.gpu_memory_range,
i, options.num_dev_dirs, int(math.log(options.num_dev_dirs, 2)),
options.cacheline_size)
#.........这里部分代码省略.........
示例15: _listMemTypes
def _listMemTypes(option, opt, value, parser):
MemConfig.print_mem_list()
sys.exit(0)