简体   繁体   English

如何设置 emitVerilog 的生成目录?

[英]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.

相关问题 后端验证器:黑盒模块无法实例化 Chisel 模块(使用 emitVerilog 生成) - backend verilator: blackbox module unable to instantiate Chisel-module (generated using emitVerilog) 如何从凿子解读生成的Verilog中的注释? - How to decipher comments in generated Verilog from chisel? 如何更改Chisel3 Iotester生成的VCD中的时间刻度 - How to change timescale in vcd generated by chisel3 iotester 在chisel中,如何判断一个模块的Bundle是否实际生成为verilog - In chisel, how to judge whether the Bundle of a module is actually generated as a verilog 如何在生成的 Verilog 中使用 chisel Vector 中所选元素的 val 名称 - How to to use the val name of selected element in a chisel Vector in the generated Verilog 如何在VCS中测试Chisel生成的verilog模块? vpi_uer.cc如何在凿子中工作? - How to test the verilog module generated by Chisel in VCS ? How does vpi_uer.cc work in chisel? 如何指定Mill运行的main class(在根目录下)? - How to specify the main class (in the root directory) for Mill to run? 为什么除了chisel生成的ProgramCounter之外没有其他模块的verilog代码? - Why there is no verilog code of other module except ProgramCounter generated by chisel? 火箭芯片上的设置关联 TLB - Set-associative TLB on Rocket Chip 为什么根据 ChiselTest 没有正确设置这个本地变量 - Why is this local var not set correctly according to ChiselTest
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM