ZombieLoadについて説明するにあたり重要なCPU内ユニットとして、メモリオーダバッファ(Memory Order Buffer)がある。Intel CPUの場合、データロードを行うユニットは2つ、データストアを行うためのユニットが1つ搭載されている。メモリオーダバッファはロードバッファとストアバッファの内部を管理し、メモリの依存関係を解決してどのメモリアクセス命令を発行してよいのかを決定する。
まずConfig(new WithNBigCores(1) ++ new BaseConfig)のような記述を実現しているのは、Chiselで作られたConfigクラスの役割だ。これはChiselデフォルトの機能ではなく、freechipsの成果物であるのでソースコードを持ってきて自分のプロジェクトに配置する必要がある。
src/main/scala/subsystem/Configs.scala
/* Composable partial function Configs to set individual parameters */class WithNBigCores(n: Int) extends Config((site, here, up) => {
case RocketTilesKey => {
val big = RocketTileParams(
core = RocketCoreParams(mulDiv = Some(MulDivParams(
mulUnroll = 8,
...
./bin/llc -march=mips -mcpu=help
...
Available features for this target:
mips1 - Mips I ISA Support [highly experimental].
mips16 - Mips16 mode.
mips2 - Mips II ISA Support [highly experimental].
mips3 - MIPS III ISA Support [highly experimental].
mips32 - Mips32 ISA Support.
...
noabicalls - Disable SVR4-style position-independent code.
...
[runfarm]
runfarmtag=matrixmul-unifarm
f1_16xlarges=0
m4_16xlarges=0
f1_4xlarges=0
f1_2xlarges=1
runinstancemarket=ondemand
spotinterruptionbehavior=terminate
spotmaxprice=ondemand
[targetconfig]
topology=no_net_config
no_net_num_nodes=1
linklatency=6405
switchinglatency=10
netbandwidth=200
profileinterval=-1
# This references a section from config_hwconfigs.ini
# In homogeneous configurations, use this to set the hardware config deployed
# for all simulators
defaulthwconfig=firesim-singlecore-no-nic-matrixmul
[tracing]
enable=no
startcycle=0
endcycle=-1
[workload]
workloadname=matrixmul.json
terminateoncompletion=no
less /home/centos/firesim-msyksphinz/deploy/logs/[実行した日付]-launchrunfarm-B8G7C0DQNCNB0OF0.log
...
2019-05-11 02:45:59,050 [run_workload] [DEBUG] jobs complete dict {u'matrixmul.riscv': True}
2019-05-11 02:45:59,050 [run_workload] [DEBUG] global status: [True]
2019-05-11 02:45:59,050 [run_workload] [INFO ] FireSim Simulation Exited Successfully. See results in:
/home/centos/firesim-msyksphinz/deploy/results-workload/2019-05-11--02-44-10-matrixmul/
さらに、uartlogを確認してみる。
less /home/centos/firesim-msyksphinz/deploy/results-workload/2019-05-11--02-44-10-matrixmul/matrixmul.riscv/uartlog
Script started on Sat 11 May 2019 02:44:13 AM UTC
AFI PCI Vendor ID: 0x1d0f, Device ID 0xf000
Using xdma write queue: /dev/xdma0_h2c_0
Using xdma read queue: /dev/xdma0_c2h_0
UART0 is here (stdin/stdout).
command line for program 0. argc=19:
+permissive +mm_relaxFunctionalModel=0 +mm_writeMaxReqs=16 +mm_readMaxReqs=16 +mm_writeLatency=30 +mm_readLatency=30 +macaddr0=00:12:6D:00:00:02 +slotid=0 +niclog0=niclog +trace-start0=0 +trace-end0=-1 +linklatency0=6405 +netbw0=200 +profile-interval=-1 +zero-out-dram +shmemportname0=default +permissive-off matrixmul.riscv +blkdev0=dummy.ext2
random min: 0x0, random max: 0xffffffffffffffff
Zeroing out FPGA DRAM. This will take a few seconds...
Commencing simulation.
SW HW
----------------------------------
2 x 2 x 2 : 327 219
4 x 4 x 4 : 1024 488
8 x 8 x 8 : 7041 2527
16 x16 x16 : 54559 16118
18 x24 x28 : 154583 44362
*** PASSED *** after 3913301296 cycles
time elapsed: 25.0 s, simulation speed = 156.26 MHz
FPGA-Cycles-to-Model-Cycles Ratio (FMR): 1.00
Runs 3913301296 cycles
[PASS] FireSimNoNIC Test
SEED: 1557542653