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
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/scala/gcd/GCD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package gcd

import chisel3._
import circt.stage.ChiselStage
jackkoenig marked this conversation as resolved.
Show resolved Hide resolved

/**
* Compute GCD using subtraction method.
Expand Down Expand Up @@ -32,3 +33,13 @@ class GCD extends Module {
io.outputGCD := x
io.outputValid := y === 0.U
}

/**
* Generate Verilog sources and save it in file GCD.v
*/
object GCD extends App {
val verilog_src = ChiselStage.emitSystemVerilogFile(
new GCD(),
firtoolOpts = Array("-disable-all-randomization",
"-strip-debug-info"))
jackkoenig marked this conversation as resolved.
Show resolved Hide resolved
}