Skip to content
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

Boost Verilator #657

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Boost Verilator #657

wants to merge 3 commits into from

Conversation

drichmond
Copy link
Collaborator

Pulling forward these changes for future reference & possible inclusion. This was motivated by Dan suggesting that I profile the network for our network simulator.

This is a couple months work of on-and-off hacking. I figured out how to profile Verilator (not straightforward...), and then implemented some fixes.

The two significant changes:

  • Replaced bsg_mux_one_hot.v from basejump with a simulation-amenable version. (FOR VERILATOR ONLY)
  • Replaced bsg_encode_one_hot.v from basejump with a simulation-amenable version. (FOR VERILATOR ONLY)

mux_one_hot was consuming 50% of the execution time for network heavy benchmarks. Encode_one_hot was problematic because it has what Verilator calls an "unopt-flat" issue that can't be "fixed" without substantially re-writing our tape-out RTL.

I also added -O2 flags for GCC and Verilator. This makes Verilator take a long time to compile (20 minutes) but this process only needs to be done once if someone is not RTL hacking. (otherwise VCS is a better solution)

I left behind some hints for threading and profiling as well.

I haven't done a full analysis, but what I found is that some testbench programs run as fast as VCS now.

…ions

* New replacement modules for encode_one_hot, and mux_one_hot (the latter was taking 50% of simulation time!)
* Optimization flags for Verilator
* Comments for threading and profiling (Experts only!)
* Switched to static linking
@taylor-bsg
Copy link
Contributor

taylor-bsg commented Dec 29, 2020 via email

@taylor-bsg
Copy link
Contributor

taylor-bsg commented Dec 29, 2020 via email

@drichmond drichmond closed this Dec 29, 2020
@drichmond drichmond reopened this Dec 29, 2020
@drichmond
Copy link
Collaborator Author

Oops, did not mean to close.

Note the behavior is very different if multiple select lines are set. Very scary. I would suggest an implementation that uses an OR instead of assignment... Also a initial begin warning that this is deviating from the synthesized source base... M

This is good feedback, I'll implement it after the network simulator.

I also don't know why these modules are so costly. That's something I didn't explore, either.

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