[英]how to set generated directory of emitVerilog?
I just started with chisel-template.我刚开始使用凿模板。
I added below statement in DecoupledGCD.scala per a stackoverflow post .我根据stackoverflow 帖子在 DecoupledGCD.scala 中添加了以下语句。
object DecoupledGcdDriver extends App {
(new ChiselStage)emitVerilog(new DecoupledGcd(16))
}
When I ran当我跑
sbt run
The verilog file was generated in current directory per se. verilog 文件本身是在当前目录中生成的。
However either I run但是要么我跑
sbt "runMain gcd.DecoupledGcdDriver --help"
or或者
sbt "runMain gcd.DecoupledGcdDriver --target-dir <my dir>"
doesn't change anything.不会改变任何东西。
My build.sbt is from latest template:我的 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"
I don't have enough "reputation" so start a new thread here.我没有足够的“声誉”,所以在这里开始一个新线程。
Set the arguments as a call to the ChiselStage
.将 arguments 设置为对
ChiselStage
的调用。 Below is an example.下面是一个例子。 This will put the Verilog and FIRRTL in the output dir.
这会将 Verilog 和 FIRRTL 放在 output 目录中。 The output dir will be created if it doesn't exists.
如果 output 目录不存在,则将创建它。
object MyAsyncResetModuleGen extends App {
val myverilog = (new ChiselStage).emitVerilog(
new MyAsyncResetModule,
//args
Array("--target-dir", "output/")
)
}
Extending App is just syntactic sugar for writing a main
function with the argument args: Array[String]
.扩展App只是编写带有参数
args: Array[String]
的main
function 的语法糖。 If you want the arguments to propagate to ChiseStage
, you need to propagate them:如果您希望 arguments 传播到
ChiseStage
,您需要传播它们:
object DecoupledGcdDriver extends App {
(new ChiselStage)emitVerilog(new DecoupledGcd(16), args)
}
You can see that ChiselStage.emitVerilog
accepts args
in the Chisel API Docs .您可以看到
ChiselStage.emitVerilog
接受Chisel API Docs args
的参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.