Skip to content

Add instrumentation report (re-)generation to the dvsim-admin CLI#211

Merged
AlexJones0 merged 4 commits into
lowRISC:masterfrom
AlexJones0:instrumentation_regeneration
May 21, 2026
Merged

Add instrumentation report (re-)generation to the dvsim-admin CLI#211
AlexJones0 merged 4 commits into
lowRISC:masterfrom
AlexJones0:instrumentation_regeneration

Conversation

@AlexJones0
Copy link
Copy Markdown
Contributor

This PR is the eighteenth of a series of PRs to introduce instrumentation reporting to DVSim.

This PR integrates the HTML instrumentation report generation with the dvsim-admin CLI to allow reports to be re-generated from previously saved metrics.json files after DVSim runs have already completed.

Importantly, it also provides an interface for specifying a custom rendering profile. This means that we can render with the "Normal" profile by default for regular DVSim runs, minimizing the size and increasing the performance of the generated instrumentation reports - whilst at the same time retaining the ability to browse fully-detailed reports via the dvsim-admin CLI.

For example, you might run:

dvsim <your arguments here> --instrument all

And then later run e.g.

dvsim-admin report instrumentation --profile=full scratch/<branch>/reports/metrics.json .

to generate a new metrics.json with fully-detailed graphs (without any regard for report size or performance).

@AlexJones0 AlexJones0 requested a review from machshev May 20, 2026 22:55
Copy link
Copy Markdown
Collaborator

@machshev machshev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlexJones0!

Comment thread src/dvsim/cli/admin.py Outdated
These aren't particularly necessary, are currently causing issues with
the click CLI autocomplete times due to the modules being loaded each
time, and will potentially long-term cause circular import issues. Let's
just use the full paths for imports instead here.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
@AlexJones0 AlexJones0 force-pushed the instrumentation_regeneration branch from 65bc427 to c806aa6 Compare May 21, 2026 13:13
This keeps this as a nice light-weight import that can be used by the
click CLI, also helping to keep potentially user-facing data boundaries
isolated.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
There was an existing ruff D401 error here because ruff wants the
docstring to be in an imperative mood, but the click CLI uses the
docstring to determine the actual documentation provided in the
`dvsim-admin --help` menu - so we don't want ruff dictating the text
here. Tell ruff to ignore this with an appropriate noqa.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
This will allow instrumentation reports to be re-generated from
previously saved `metrics.json` files after runs are completed.

Importantly, it also provides an interface for specifying a custom
rendering profile. This allows us to reduce the level of detail in
regular DVSim runs, to minimize the size and increase the performance of
the generated instrumentation reports - whilst retaining the ability to
browse fully-detailed reports using `dvsim-admin report instrumentation`
with e.g. `--profile=high` or `--profile=full` as needed.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
@AlexJones0 AlexJones0 force-pushed the instrumentation_regeneration branch from c806aa6 to 5006012 Compare May 21, 2026 13:17
@machshev machshev self-requested a review May 21, 2026 13:26
Copy link
Copy Markdown
Collaborator

@machshev machshev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlexJones0!

@AlexJones0 AlexJones0 added this pull request to the merge queue May 21, 2026
Merged via the queue into lowRISC:master with commit 9454708 May 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants