Skip to content

Conversation

MaxWipfli
Copy link

This patch replaces some 2 ** X constructs by the equivalent 1 << X. This is significantly faster when using Verilator, which lacks a special case optimization for powers of two and falls back to an iterative approach.

This change increases simulation performance using Verilator on the Cheshire SoC (pulp-platform/cheshire#230) by roughly 2 percent.

I have also added an ifndef so the instruction tracer can be disabled by defining CVA6_NO_TRACE.

Note: This PR targets the pulp-v1 branch that is currently used by Cheshire.

Verilator does not include a special case for (2 ** X), making this
very slow. This change increases simulation speed with Verilator by
around 2 percent for the entire Cheshire SoC.
@MaxWipfli MaxWipfli requested a review from niwis as a code owner July 11, 2025 11:58
@MaxWipfli
Copy link
Author

It looks like there is a infrastructure-related CI failure (failed to verify a package signature) that is unrelated to my changes. Could you please check this? Let me know if you think it is related to my changes.

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.

1 participant