A tool for generating flamegraphs of RISC-V programs running on RTL simulations
Project description
rv_profile
This project implements a cycle-accurate RISC-V profiler that extracts the cycles spent in each function from RTL simulations.
An interactive example is found here.
Installing
pip install rv-profile
Using
To profile a waveform you need to have a RISC-V .elf binary and a .vcd/.fst waveform of a RISC-V core running the binary.
This repository contains an example for the cv32e40x core. More will be added in the future.
rv_profile --elf <.elf> --fst <.vcd/.fst file> --cfg <.wal file> [--out <flamegraph.svg>]
Adapting to Other Cores
To adapt a new core to this script is easy. All you have to do is to know the name of the clk signal, detect when an instruction is committed, which address this instruction had and the raw value of the instruction (i.e. the 32-bit value).
This information can then be entered in a new config.wal file just like the ones in cv32e40x.
The config file specifies
(alias clk ...cv32e40x_core_i.clk )
(alias pc ...cv32e40x_core_i.debug_pc_o )
(alias instr ...cv32e40x_core_i.ex_wb_pipe.instr.bus_resp.rdata )
(alias fire-signal ...cv32e40x_core_i.debug_pc_valid_o )
(alias mcycle ...cv32e40x_core_i.cs_registers_i.mcycle_o )
So you have to change (alias clk ....) to (alias clk your.clk.signal)
Contributing
If you want to contribute to this project, please open an issue or a pull request. We are happy to help you with any questions you might have.
If you use this tool on a different RISC-V core please open a pull request so that we can include it in the repository.
Repositories that made this possible
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rv_profile-0.2.2.tar.gz.
File metadata
- Download URL: rv_profile-0.2.2.tar.gz
- Upload date:
- Size: 3.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
147f5ff249ae39db5f757efe949aef87115cd1792d1473ef51c639e173ea5bd7
|
|
| MD5 |
fee9c2f5169b9549d8632ef6b76d2403
|
|
| BLAKE2b-256 |
f90ba8afee9edfd638ccc80d783f4cbd9c730f286dcca3b3c3e476715ba584f5
|
Provenance
The following attestation bundles were made for rv_profile-0.2.2.tar.gz:
Publisher:
python-publish.yml on vlsi-lab/rv_profile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rv_profile-0.2.2.tar.gz -
Subject digest:
147f5ff249ae39db5f757efe949aef87115cd1792d1473ef51c639e173ea5bd7 - Sigstore transparency entry: 179068602
- Sigstore integration time:
-
Permalink:
vlsi-lab/rv_profile@c2198d0237b4c87cad721ccc0d52c3e803fcf9a6 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vlsi-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c2198d0237b4c87cad721ccc0d52c3e803fcf9a6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rv_profile-0.2.2-py3-none-any.whl.
File metadata
- Download URL: rv_profile-0.2.2-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa97faa6b2557b0c12d505a19efaf51c37d3908079f53358d677901367c7e477
|
|
| MD5 |
5477c24f613240b4e3777646337120da
|
|
| BLAKE2b-256 |
5e4cd2238c2c9d44ee0d9e848c1a244be2368b9cdac0a124ae826766dbc1709d
|
Provenance
The following attestation bundles were made for rv_profile-0.2.2-py3-none-any.whl:
Publisher:
python-publish.yml on vlsi-lab/rv_profile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rv_profile-0.2.2-py3-none-any.whl -
Subject digest:
fa97faa6b2557b0c12d505a19efaf51c37d3908079f53358d677901367c7e477 - Sigstore transparency entry: 179068603
- Sigstore integration time:
-
Permalink:
vlsi-lab/rv_profile@c2198d0237b4c87cad721ccc0d52c3e803fcf9a6 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/vlsi-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c2198d0237b4c87cad721ccc0d52c3e803fcf9a6 -
Trigger Event:
release
-
Statement type: