从Chisel代码生成Verilog代码的最简单方法 [英] Simplest way to generate Verilog code from Chisel code
问题描述
从现有的Chisel代码中生成Verilog 代码的最简单方法是什么?
我是否必须创建自己的构建文件?
例如独立的Scala文件(AND.scala),类似于以下文件。
导入凿子。_
类并扩展模块{
val io = IO(新捆绑包{
val a = Bool(INPUT)
val b = Bool(INPUT)
val out = Bool(OUTPUT)
})
io.out:= io.a& io.b
}
我已经安装了完整的 Chisel3工具链 >在ubuntu 16.4下。
在此处查看答案:是否有一个简单的示例,如何从Chisel3模块生成verilog?
简而言之,请在项目的根目录下创建一个build.sbt文件,其中应包含以下内容: scalaVersion:= 2.12.8
解析器++ = Seq(
Resolver.sonatypeRepo( snapshots),
Resolver.sonatypeRepo(版本)
)
libraryDependencies + = edu.berkeley.cs %% chisel3% 3.1.6
将此代码添加到AND.scala
对象ANDDriver扩展App {
chisel3.Driver.execute(args,()=>新AND)
}
在协作平台上键入 sbt运行
mmand行位于项目的根部。
What is the simplest way to generate Verilog code from existing Chisel code?
Would i have to create my own build file?
For example from a standalone scala file (AND.scala) like the following one..
import Chisel._
class AND extends Module {
val io = IO(new Bundle {
val a = Bool(INPUT)
val b = Bool(INPUT)
val out = Bool(OUTPUT)
})
io.out := io.a & io.b
}
I have the complete Chisel3 Toolchain installed under ubuntu 16.4.
See answer here: Is there a simple example of how to generate verilog from Chisel3 module?
In short, create a build.sbt file at the root of your project with the following in it:
scalaVersion := "2.12.8"
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
)
libraryDependencies += "edu.berkeley.cs" %% "chisel3" % "3.1.6"
Add this code to AND.scala
object ANDDriver extends App {
chisel3.Driver.execute(args, () => new AND)
}
Type sbt run
on the command line at the root of your project.
这篇关于从Chisel代码生成Verilog代码的最简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!