Is there a simple example of how to generate verilog from Chisel3 module?

做~自己de王妃 提交于 2019-11-29 02:17:05

Thank you for your interest in Chisel! We generally encourage people to use our chisel-template repo as a starting point for Chisel3 projects: https://github.com/ucb-bar/chisel-template

If you want to do the most barebones possible thing. Create this build.sbt and put it in the root directory for your project.

scalaVersion := "2.12.8"

resolvers ++= Seq(
  Resolver.sonatypeRepo("snapshots"),
  Resolver.sonatypeRepo("releases")
)

libraryDependencies += "edu.berkeley.cs" %% "chisel3" % "3.1.+"

Put the above GCD source code in GCD.scala and add the following to the file:

object GCDDriver extends App {
  chisel3.Driver.execute(args, () => new GCD)
}

You can then generate the Verilog by running: sbt "runMain GCDDriver". The default output directory is the current directory>

You can see what command-line options are available by running sbt "runMain GCDDriver --help" For example --target-dir will let you change the target directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!