Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Refence Program

Usage

1. Compile

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 reference

2. Collect an O3PipeView trace with gem5

Navigate 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=8GB

The trace file reference.out will be created in the gem5 output directory (usually m5out/).

3. Convert the trace using uScope

In the gem5 output directory (e.g., m5out), run tool:

uScope --input-file reference.out --output reference.json

4. Visualize the result

Open the generated reference.json in the Perfetto UI. You can also use the built-in Chrome Tracing viewer at chrome://tracing.

5. Compare with the reference

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.