-
Notifications
You must be signed in to change notification settings - Fork 177
Conversation
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.
This looks awesome. I added some small initial feedback.
Before this gets merged we need some tests. You can look at https://github.com/chipsalliance/firrtl/tree/master/src/test/scala/firrtl/backends/experimental/smt for inspiration.
A minimal smoke test could be to run your backend on all our regression firrtl files and then to just read the result with yosys to make sure it is at least valid RTLIL. Like: https://github.com/chipsalliance/firrtl/blob/master/src/test/scala/firrtl/backends/experimental/smt/end2end/SMTCompilationTest.scala
Thanks!
src/main/scala/firrtl/backends/experimental/rtlil/RtlilEmitter.scala
Outdated
Show resolved
Hide resolved
src/main/scala/firrtl/backends/experimental/rtlil/RtlilEmitter.scala
Outdated
Show resolved
Hide resolved
One test I did use throughout development was using yosys's |
I would go for "does yosys consume this" for all regression designs and then a |
To solve the CI issues, you just need to run:
|
Not saying you need to do this to get the PR merged, but just as another idea on how we could test this backend: |
Looks like some of your code doesn't compile on scala 2.13. To debug that you can do |
@nxmq We discussed this PR in our dev meeting and we are happy to merge it once the tests pass. I assume that the reason the CI fails right now is that we might be using an older version of |
Could you also add some of your formal equivalence check tests? Maybe marked as |
The failures do seem to be due to the old version of yosys used during testing, my backend as is only supports versions of yosys released in the last 6 months or so. I can def pass some debug output through for showing whats wrong. |
Do you have a good source of yosys binaries that you can recommend or are you just building from the latest |
Sure, I should be able to add a few of those test circuits soon. As for yosys binary sources, currently I just build master. |
This PR might help us get a newer yosys version: #2365 |
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.
Two small changes and then I think this new experimental backend is ready to 🚢
case "mverilog" => new MinimumVerilogEmitter | ||
case "sverilog" => new SystemVerilogEmitter | ||
case "experimental-rtlil" => new RtlilEmitter | ||
case _ => throw new OptionsException(s"Unknown compiler name '$a'! (Did you misspell it?)") |
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.
Please undo your changes to this file. This code is for the (soon to be) deprecated -X
option. New emitters should only use the -E
option.
…nd apply bugfixes for inconsistencies found during testing.
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.
Awesome! Thank you very much for your patience and your hard work!
Looks like this change will make it into the upcoming release and it should be part of the snapshot in 1-2h. I would be happy to review any followup PRs if you see that something is missing or anything needs to be fixed.
Contributor Checklist
Type of Improvement
API Impact
This PR adds the names "experimental-rtlil" and "rtlil" to the list of valid emitters, and also adds the annotations required to utilize the emitter. These are the only changes to the public-facing API.
Backend Code Generation Impact
This PR introduces an entirely new code generation backend, targeting the textual representation of the RTLIL IR format used by the Yosys open synthesis tool. As such, it should have minimal effects on the existing Verilog backend, as the only change made which could affect that backend was making verilog-specific memory lowering an optional dependency of the CombineCats pass, instead of a required one.
Desired Merge Strategy
Rebase please.
Release Notes
Reviewer Checklist (only modified by reviewer)
Please Merge
?