-
Notifications
You must be signed in to change notification settings - Fork 484
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
Add matrix_multiplier to examples. #1502
Conversation
2952dc1
to
b13bbcb
Compare
There were some unaddressed comments in #1286 that would be good to apply here, I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like HDL examples should be examples of clean synthesizable reusable code, which is where most of my heartache lies.
I don't know much about the base classes included in cocotb, but it seems like it's forcing your into a coding style that isn't very reusable. Monitor
s and Drivers
should be able to be written to be reusable. Ideally, you should be able to write the entire testbench in such a way that the driving and analysis are segregated, so that you can reuse the analysis side to test the module (the DUT in this unit-level test) while it is driven by an external system. Such a refactor would be pretty extensive, so this is more of a comment.
Thoughts on synchronous vs asynchronous resets? |
@garmin-mjames Synchronous IMO, but it doesn't really matter, we aren't here to dictate one approach over the other. |
Asynchronous assert, synchronous deassert, active-low is ASIC style. But I agree with Kaleb, it doesn't really matter here. |
b13bbcb
to
e9eef94
Compare
Needs #1507 first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested with Questa 10.7c. All seems good, except that I had to add SIM_ARGS="-t ps"
to get it to run. Questa defaults time precision to 1ns, it would be nice if regressions ran without any additional args.
@elgorwi Could you test the changes with Verilator? |
@garmin-mjames It fails. Generics are not being passed properly. Verilator support |
I couldn't tell from the Verilator documentation whether I need the top-level module name in the generic parameters. The examples in the docs don't have it, so I didn't put it in. |
Nvm me. I was a little behind, before you added support to the makefile for Verilator. It runs in Verilator. We should work on adding Verilator to the CI. |
Pinging @imphil. |
Add matrix multiplication example and test. The test is heavily weighted towards use of the BinaryValue class. The random seed is set to a default value to provide a deterministic test for performance regression.
7ab5717
to
b9d95e1
Compare
Close/reopen to get a fresh private CI run (which was failing before). If that one passes LGTM. Thanks a lot @garmin-mjames for your persistence on this one, it looks like a really nice example now -- and sorry for being so slow to actually getting back to you. You've at least earned a drink of your choice should we meet at some time 😄 |
Add matrix multiplication example and test. The test is heavily
weighted towards use of the BinaryValue class. By fixing the random
seed by default, it also provides a deterministic test for performance
regression.
This example and test are designed to be a testbench for various
performance enhancements, especially involving BinaryValue.
Split from gh-1286