我刚刚开始使用凿子模板。
我在 De CoupledGCD.scala 中添加了以下语句 stackoverflow post .
object DecoupledGcdDriver extends App {
(new ChiselStage)emitVerilog(new DecoupledGcd(16))
}
当我运行时
sbt run
verilog 文件本身是在当前目录中生成的。
但是我要么跑
sbt "runMain gcd.DecoupledGcdDriver --help"
或
sbt "runMain gcd.DecoupledGcdDriver --target-dir <my dir>"
不会改变任何东西。
我的 build.sbt 来自最新模板:
ThisBuild / scalaVersion := "2.12.13"
ThisBuild / version := "0.1.0"
ThisBuild / organization := "com.github.riggy2013"
lazy val root = (project in file("."))
.settings(
name := "chisel-gcd",
libraryDependencies ++= Seq(
"edu.berkeley.cs" %% "chisel3" % "3.4.3",
"edu.berkeley.cs" %% "chiseltest" % "0.3.3" % "test"
我没有足够的“声誉”,所以在这里开始一个新线程。
最佳答案
将参数设置为对 ChiselStage 的调用。下面是一个例子。这会将 Verilog 和 FIRRTL 放入输出目录中。如果输出目录不存在,则会创建它。
object MyAsyncResetModuleGen extends App {
val myverilog = (new ChiselStage).emitVerilog(
new MyAsyncResetModule,
//args
Array("--target-dir", "output/")
)
}
关于chisel - 如何设置emitVerilog的生成目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67657956/