Skip to content

Conversation

MaxWipfli
Copy link
Contributor

@MaxWipfli MaxWipfli commented Jun 20, 2025

These modification are intended to generate better code for Verilator simulation without changing functional behavior.

Using the Cheshire SoC (pulp-platform/cheshire#230), these changes reduce total simulation time by around 8%.

This enables Verilator optimizations as it now understands there are no
combinatorial loops. For the Cheshire SoC, this can reduce simulation
time by around 3%.
This enables Verilator optimizations as it now understands there are no
combinatorial loops. For the Cheshire SoC, this can reduce simulation
time by around 2.5%.
In case the vector is not flipped, using a direct assignment can lead to
an approximately 2% decrease in total system simulation time (measured
using the Cheshire SoC).
This decreases total simulation time of the Cheshire SoC by around 1.8%.
@MaxWipfli MaxWipfli marked this pull request as ready for review July 11, 2025 10:48
@phsauter
Copy link
Collaborator

Everything looks good.

The cb_filter is equivalent in all legal cases.
The lzc change is a reordering of operations and also equivalent plus the split_var optimization to guide Verilator into better variable partitioning.
rr_arb_tree only adds the split_var optimization.

Note: I think the lzc implementation should be optimized further but this is not part of this PR.

@phsauter phsauter merged commit b20ad7a into pulp-platform:master Aug 18, 2025
Scheremo pushed a commit to mosaic-soc/common_cells that referenced this pull request Sep 12, 2025
…m#259)

* rr_arb_tree: Add Verilator pragmas to split tree node signals

This enables Verilator optimizations as it now understands there are no
combinatorial loops. For the Cheshire SoC, this can reduce simulation
time by around 3%.

* lzc: Add Verilator pragmas to split tree node signals

This enables Verilator optimizations as it now understands there are no
combinatorial loops. For the Cheshire SoC, this can reduce simulation
time by around 2.5%.

* lzc: Optimize reversing of input vector for Verilator speedup

In case the vector is not flipped, using a direct assignment can lead to
an approximately 2% decrease in total system simulation time (measured
using the Cheshire SoC).

* cb_filter: Logic simplification for Verilator speed-up

This decreases total simulation time of the Cheshire SoC by around 1.8%.
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