Skip to content

Commit

Permalink
Adding companion main class to generate GCD.v verilog source (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Martoni authored Mar 7, 2024
1 parent a05d3ce commit 29b1f00
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/scala/gcd/GCD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package gcd

import chisel3._
// _root_ disambiguates from package chisel3.util.circt if user imports chisel3.util._
import _root_.circt.stage.ChiselStage

/**
* Compute GCD using subtraction method.
Expand Down Expand Up @@ -32,3 +34,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 {
ChiselStage.emitSystemVerilogFile(
new GCD,
firtoolOpts = Array("-disable-all-randomization", "-strip-debug-info")
)
}

0 comments on commit 29b1f00

Please sign in to comment.