Skip to content

RTL optimizations for Verilator #66

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

Open
wants to merge 2 commits into
base: pulp-v1
Choose a base branch
from

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
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