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

Adding companion main class to generate GCD.v verilog source #126

Merged
merged 5 commits into from
Mar 7, 2024
Merged

Adding companion main class to generate GCD.v verilog source #126

merged 5 commits into from
Mar 7, 2024

Conversation

Martoni
Copy link
Contributor

@Martoni Martoni commented Mar 7, 2024

It's not straightforward to write code for generating verilog.
So this merge request provide a way to do it.

Fixes #54

* Generate Verilog sources and save it in file GCD.v
*/
object GCD extends App {
val verilog_src = ChiselStage.emitSystemVerilog(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be simpler to call ChiselStage.emitSystemVerilogFile rather than emitting as a string and then writing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course ! I didn't know about this function.
That's why it's useful to provide an example :)

Copy link
Contributor

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with a couple of minor sylistic changes)

We also need to make sure this is tested in CI, I'll push a test.

src/main/scala/gcd/GCD.scala Outdated Show resolved Hide resolved
src/main/scala/gcd/GCD.scala Outdated Show resolved Hide resolved
@jackkoenig jackkoenig enabled auto-merge (squash) March 7, 2024 22:29
@jackkoenig jackkoenig merged commit 29b1f00 into chipsalliance:main Mar 7, 2024
1 check passed
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.

Add Main Method to Generate Verilog
3 participants