tsunami-simple-atomic.py
来自「M5,一个功能强大的多处理器系统模拟器.很多针对处理器架构,性能的研究都使用它作」· Python 代码 · 共 69 行
PY
69 行
import m5from m5.objects import *m5.AddToPath('../configs/common')import FSConfig# --------------------# Base L1 Cache# ====================class L1(BaseCache): latency = '1ns' block_size = 64 mshrs = 4 tgts_per_mshr = 8# ----------------------# Base L2 Cache# ----------------------class L2(BaseCache): block_size = 64 latency = '10ns' mshrs = 92 tgts_per_mshr = 16 write_buffers = 8# ---------------------# I/O Cache# ---------------------class IOCache(BaseCache): assoc = 8 block_size = 64 latency = '50ns' mshrs = 20 size = '1kB' tgts_per_mshr = 12 mem_side_filter_ranges=[AddrRange(0, Addr.max)] cpu_side_filter_ranges=[AddrRange(0x8000000000, Addr.max)]#cpucpu = AtomicSimpleCPU(cpu_id=0)#the systemsystem = FSConfig.makeLinuxAlphaSystem('atomic')system.bridge.filter_ranges_a=[AddrRange(0, Addr.max)]system.bridge.filter_ranges_b=[AddrRange(0, size='8GB')]system.iocache = IOCache()system.iocache.cpu_side = system.iobus.portsystem.iocache.mem_side = system.membus.portsystem.cpu = cpu#create the l1/l2 bussystem.toL2Bus = Bus()#connect up the l2 cachesystem.l2c = L2(size='4MB', assoc=8)system.l2c.cpu_side = system.toL2Bus.portsystem.l2c.mem_side = system.membus.port#connect up the cpu and l1scpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1), L1(size = '32kB', assoc = 4))# connect cpu level-1 caches to shared level-2 cachecpu.connectMemPorts(system.toL2Bus)cpu.clock = '2GHz'root = Root(system=system)m5.ticks.setGlobalFrequency('1THz')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?