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

[docs] Update naming explanation for newer firtool #3454

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

jackkoenig
Copy link
Contributor

@jackkoenig jackkoenig commented Aug 3, 2023

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

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Documentation or website-related

Desired Merge Strategy

  • Squash

Release Notes

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.5.x, 3.6.x, or 5.x depending on impact, API modification or big change: 6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

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.
@jackkoenig jackkoenig added the Documentation Only changing documentation label Aug 3, 2023
@jackkoenig jackkoenig requested review from azidar and seldridge August 3, 2023 06:06
Comment on lines -160 to -184
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)
```
Copy link
Contributor Author

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.

@jackkoenig jackkoenig requested a review from mwachs5 August 3, 2023 06:12
Copy link
Contributor

@mikeurbach mikeurbach left a 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.

@jackkoenig jackkoenig merged commit 2cc2278 into main Aug 3, 2023
@jackkoenig jackkoenig deleted the jackkoenig/update-naming-explanation branch August 3, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Only changing documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants