-
Notifications
You must be signed in to change notification settings - Fork 75
Initial Flow Script for riscv-perf-model #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Flow Script for riscv-perf-model #275
Conversation
The amount of files in the |
@vinicius-r-silva Thanks for your review! I've made some improvements to the code, but there's still more to be done (e.g., better documentation and removing redundant lines/functions, PEP8 compliance ...). It's a work in progress. I've implemented the changes you suggested, as I had the same thoughts. I'd appreciate any additional feedback you have! |
80c2fec
to
df96b8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per discussion in the meeting - approving
bfea9db
to
c71307e
Compare
This PR introduces the Trace Generator Tool along with improvements in the documentation at traces/stf_trace_archive/README.md and traces/docker_stf_trace_gen/README.md. The main goal of this tool is to create STF trace and it's metadata file for workload using docker. The trace generator tool comes with three different modes - **Macro** → uses `START_TRACE` and `STOP_TRACE` macros embedded in the workload - **Instruction Count (`insn_count`)** → traces a fixed number of instructions after skipping some - **Program Counter (`pc_count`)** → traces after a specific program counter (PC) is reached Other options included in the tool are: * **`--isa ISA`**. Instruction set architecture (e.g., `rv64imafdc`). * **`--dump`**. Create a trace file dump. * **`--pk`**. Run Spike with **pk (proxy kernel)**. This PR files follows this structure: ```text README.md # Main documentation file README.md # Trace generator documentation file src/ ├── data/ # Core data models and classes ├── converters/ # Converter classes ├── factories/ # Factory classes ├── utils/ # Utility functions and helpers └── generate_trace.py # Main CLI entry point ``` ### Quickstart 1. **Macro mode (SPIKE only)** Trace using `START_TRACE` / `STOP_TRACE` markers inside the workload: ```bash python generate_trace.py --emulator spike macro workload.elf ``` 2. **Instruction Count mode** Skip 1000 instructions, then trace 5000 instructions: ```bash python generate_trace.py --emulator qemu insn_count \ --num-instructions 5000 --start-instruction 1000 workload.elf ``` 3. **Program Counter mode (QEMU only)** Start tracing after PC `0x80000000` is hit 5 times, trace 2000 instructions: ```bash python generate_trace.py --emulator qemu pc_count \ --num-instructions 2000 --start-pc 0x80000000 --pc-threshold 5 workload.elf ``` ### Next Steps: * Integrate `utils/docker_orchestrator.py` with all docker related function created on PR #275 * Add a simpoint option, passing a simpoint file as input and generating traces from it * Validate and compare trace results generated by both Spike and QEMU * Look at including a Macro mode for the qemu plugin * Create test classes
riscv-gnu-toolchain
(get-tool.sh
) for baremetal, Linux, 32-bit, and 64-bit support, including newlib for diverse workloads./outputs/
.main()
orbenchmark()
. Includes emulator-specific stubs, entry points, linker script, and UART stdout support..cfg
for easier_building_x_benchmark
definitions and support workload-specificcrt0.S
andlink.ld
overrides.doc/
.doc/emulator-comparison.md
for detailed QEMU vs. Spike STF generation analysis. Alogn with a reproducible script.full_flow.py
script for an interactive Docker-based workflow.board.cfg
in environment for streamlined workload-specific flag and configuration declarations.Next Steps:
trace_archive.py
for metadata storage and trace upload.