-
Reference sample assembly program is designed to test a wide range of Functional Units in an O3CPU Gem5 simulation.
-
It sequentially executes blocks of instructions targeting
IntALU,IntMultDiv,FP_ALU,FP_MultDiv,SIMD_Unit,ReadPort, andWritePort. The resulting O3PipeView trace is used as a reference to verify that uScope correctly maps all operation classes to their respective functional units in the Perfetto JSON output.
From the examples/reference directory, run:
riscv64-linux-gnu-gcc reference.S -O0 -march=rv64imafdv -mabi=lp64d -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -o referenceNavigate to your gem5 build directory and execute:
/path/to/gem5.opt \
--debug-flags=O3PipeView \
--debug-file=reference.out \
configs/example/se.py \
--cpu-type=O3CPU \
--caches \
--cmd=/path/to/reference \
--mem-size=8GBThe trace file reference.out will be created in the gem5 output directory (usually m5out/).
In the gem5 output directory (e.g., m5out), run tool:
uScope --input-file reference.out --output reference.jsonOpen the generated reference.json in the Perfetto UI. You can also use the built-in Chrome Tracing viewer at chrome://tracing.
A pre‑converted reference JSON (reference.json) is provided in this directory.
You can use it to verify that your conversion matches the expected output.