You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments