添加自己的benchmark
GemFI全系统模式的命令行为
# dmtcp_launch build/X86/gem5.opt configs/example/fs.py
其中fs.py下有:
# dmtcp_launch build/X86/gem5.opt configs/example/fs.py --help
Usage: fs.py [options]
Options:
-h, --help show this help message and exit
--list-cpu-types List available CPU types
--cpu-type=CPU_TYPE type of cpu to run with
--checker
-n NUM_CPUS, --num-cpus=NUM_CPUS
--sys-voltage=SYS_VOLTAGE
Top-level voltage for blocks running at system
power supply
--sys-clock=SYS_CLOCK
Top-level clock for blocks running at system
speed
--cpu-clock=CPU_CLOCK
Clock for blocks running at CPU speed
--smt Only used if multiple programs
are specified. If true, then the
number of threads per cpu is same as the
number of programs.
--list-mem-types List available memory types
--mem-type=MEM_TYPE type of memory to use
--mem-channels=MEM_CHANNELS
number of memory channels
--mem-size=MEM_SIZE Specify the physical memory size (single memory)
-l, --lpae
-V, --virtualisation
--caches
--l2cache
--fastmem
--num-dirs=NUM_DIRS
--num-l2caches=NUM_L2CACHES
--num-l3caches=NUM_L3CACHES
--l1d_size=L1D_SIZE
--l1i_size=L1I_SIZE
--l2_size=L2_SIZE
--l3_size=L3_SIZE
--l1d_assoc=L1D_ASSOC
--l1i_assoc=L1I_ASSOC
--l2_assoc=L2_ASSOC
--l3_assoc=L3_ASSOC
--cacheline_size=CACHELINE_SIZE
--ruby
-m TICKS, --abs-max-tick=TICKS
Run to absolute simulated tick specified including
ticks from a restored checkpoint
--rel-max-tick=TICKS Simulate for specified number of ticks relative to the
simulation start tick (e.g. if restoring a checkpoint)
--maxtime=MAXTIME Run to the specified absolute simulated time in
seconds
-I MAXINSTS, --maxinsts=MAXINSTS
Total number of instructions to
simulate (default: run forever)
--work-item-id=WORK_ITEM_ID
the specific work id for exit & checkpointing
--num-work-ids=NUM_WORK_IDS
Number of distinct work item types
--work-begin-cpu-id-exit=WORK_BEGIN_CPU_ID_EXIT
exit when work starts on the specified cpu
--work-end-exit-count=WORK_END_EXIT_COUNT
exit at specified work end count
--work-begin-exit-count=WORK_BEGIN_EXIT_COUNT
exit at specified work begin count
--init-param=INIT_PARAM
Parameter available in simulation with m5
initparam
--simpoint-profile Enable basic block profiling for SimPoints
--simpoint-interval=SIMPOINT_INTERVAL
SimPoint interval in num of instructions
--fi-in=FI_INPUT file to read input for fi_system
-M EXIT_ON_CHECKPOINT, --exit-on-first-checkpoint=EXIT_ON_CHECKPOINT
Exit simulation after first checkpoint
--switch-on-fault=SWITCH_ON_FAULT
Switch cpu from detailed to atomic after fault
Injection
--take-checkpoints=TAKE_CHECKPOINTS
<M,N> take checkpoints at tick M and every N ticks
thereafter
--max-checkpoints=MAX_CHECKPOINTS
the maximum number of checkpoints to drop
--checkpoint-dir=CHECKPOINT_DIR
Place all checkpoints in this absolute directory
-r CHECKPOINT_RESTORE, --checkpoint-restore=CHECKPOINT_RESTORE
restore from checkpoint <N>
--checkpoint-at-end take a checkpoint at end of run
--work-begin-checkpoint-count=WORK_BEGIN_CHECKPOINT_COUNT
checkpoint at specified work begin count
--work-end-checkpoint-count=WORK_END_CHECKPOINT_COUNT
checkpoint at specified work end count
--work-cpus-checkpoint-count=WORK_CPUS_CHECKPOINT_COUNT
checkpoint and exit when active cpu count is reached
--restore-with-cpu=RESTORE_WITH_CPU
cpu type for restoring from a checkpoint
--repeat-switch=REPEAT_SWITCH
switch back and forth between CPUs with period <N>
-s STANDARD_SWITCH, --standard-switch=STANDARD_SWITCH
switch from timing to Detailed CPU after warmup period
of <N>
-p PROG_INTERVAL, --prog-interval=PROG_INTERVAL
CPU Progress Interval
-W WARMUP_INSTS, --warmup-insts=WARMUP_INSTS
Warmup period in total instructions (requires
--standard-switch)
--bench=BENCH base names for --take-checkpoint and --checkpoint-
restore
-F FAST_FORWARD, --fast-forward=FAST_FORWARD
Number of instructions to fast forward before
switching
-S, --simpoint Use workload simpoints as an instruction offset for
--checkpoint-restore or --take-checkpoint.
--at-instruction Treat value of --checkpoint-restore or --take-
checkpoint as a number of
instructions.
--spec-input=SPEC_INPUT
Input set size for SPEC CPU2000 benchmarks.
--arm-iset=ARM_ISET ARM instruction set.
--timesync Prevent simulated time from getting ahead of real time
--kernel=KERNEL
--script=SCRIPT
--frame-capture Stores changed frame buffers from the VNC server to
compressed files in the gem5 output directory
--dual Simulate two systems attached with an ethernet link
################################################################
-b BENCHMARK, --benchmark=BENCHMARK
Specify the benchmark to run. Available benchmarks:
ArmAndroid-GB, ArmAndroid-ICS, IScsiInitiator,
IScsiTarget, MutexTest, NetperfMaerts, NetperfStream,
NetperfStreamNT, NetperfStreamUdp, NetperfUdpLocal,
Nfs, NfsTcp, Nhfsstone, NoRedo, Ping, PovrayAutumn,
PovrayBench, SurgeSpecweb, SurgeStandard, ValAccDelay,
ValAccDelay2, ValCtxLat, ValMemLat, ValMemLat2MB,
ValMemLat8MB, ValStream, ValStreamCopy,
ValStreamScale, ValSysLat, ValTlbLat, Validation,
bbench-gb, bbench-ics, normalBDDT, test, withRedo
################################################################
--etherdump=ETHERDUMP
Specify the filename to dump a pcap capture of
theethernet traffic
--disk-image=DISK_IMAGE
Path to the disk image to use.
其中用 ###
标出的字段可以看到可以直接执行的benchmark。参照前面的 GemFI-Full System全系统仿真 一文,可以将编译好的自己要执行的程序mount进模拟系统中。
-
现在编辑
- $gemfi/configs/common/Benchmarks.py
- $gemfi/configs/boot/*.rcS
添加自己的程序,使用 -b
命令直接执行自己的程序。
修改$gemfi/configs/common/Benchmarks.py
假设添加的程序命名为mybench,执行如下命令:
# gedit ./configs/common/Benchmarks.py
在文件68行开始看到:
Benchmarks = {
'PovrayBench': [SysConfig('povray-bench.rcS', '512MB', 'povray.img')],
……
'bbench-ics': [SysConfig('bbench-ics.rcS', '256MB',
'ARMv7a-ICS-Android.SMP.nolock.img')]
}
向Benchmarks
添加字段如下:
# ----- Add by Zoe -----
'mybench': [SysConfig('mybench.rcS', '512MB')],
# ----- Add by Zoe -----
添加$gemfi/configs/boot/*.rcS
由上一步,添加文件名为mybench.rcS
,编辑*.rcS文件:
# gedit ./configs/boot/mybench.rcS
在文件中写入:
# !/bin/sh
cd mybench
/sbin/m5 dumpresetstats
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Running test now ..."
echo "1. hello"
./hello
echo "2. queen8"
./queen8
echo "3. queen10"
./queen10
echo "3. queen12"
./queen12
echo "Finish test :D"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
/sbin/m5 exit
运行
现在可以键入命令行如下:
# dmtcp_launch build/X86/gem5.opt configs/example/fs.py -b mybench