-
Notifications
You must be signed in to change notification settings - Fork 613
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
[docs] Update naming explanation for newer firtool #3454
Conversation
Firtool improvements have optimized many examples to the point where they do not show anything. Using registers and assigning the same value to multiple outputs helps make the examples show interesting naming behavior.
In the following example, we prefix additional logic with "ECO", where `Example4` is pre-ECO and `Example5` is post-ECO: | ||
|
||
```scala mdoc | ||
class Example4 extends Module { | ||
val in = IO(Input(UInt(2.W))) | ||
val out = IO(Output(UInt())) | ||
|
||
val add = in + in + in | ||
|
||
out := add + 1.U | ||
} | ||
|
||
class Example5 extends Module { | ||
val in = IO(Input(UInt(2.W))) | ||
val out = IO(Output(UInt())) | ||
|
||
val add = in + in + in | ||
|
||
out := prefix("ECO") { add + 1.U + in } | ||
} | ||
``` | ||
```scala mdoc:verilog | ||
emitSystemVerilog(new Example4) | ||
emitSystemVerilog(new Example5) | ||
``` |
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 deleted the ECO example only because I literally cannot figure out a reliable way to make temporaries show up in the Verilog (other than naming the signals myself but that sort of defeats the purpose).
I do think we should have an ECO example but we need to make sure it captures enough complexity to actually be interesting. I'm also worried that firtool's much more aggressive optimizations will make this sort of ECO stuff harder to do so it may just not really be showable at the moment (without adding some sort of optimization barrier primitive).
If anyone can come up with a good example, I'm happy to add it back.
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 took a look, and it makes sense to me.
Firtool improvements have optimized many examples to the point where they do not show anything. Using registers and assigning the same value to multiple outputs helps make the examples show interesting naming behavior.
h/t @lsteveol for noticing and pointing this out on Gitter
Here's the rendered markdown after running mdoc: https://gist.github.com/jackkoenig/907017545186407f1353d145f48a4cdf
Compare this to what's currently on the website: https://www.chisel-lang.org/chisel3/docs/explanations/naming.html
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Reviewer Checklist (only modified by reviewer)
3.5.x
,3.6.x
, or5.x
depending on impact, API modification or big change:6.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.