我最近开始用Chisel编程,我需要在我的项目中使用dsptools。然而,我有问题,甚至有一个非常简单的案例工作。
例如,下面的代码:
package radix2
import chisel3._
import chisel3.experimental._
import chisel3.util._
import dsptools._
import dsptools.numbers._
class Radix2Butterfly extends Module {
val io = IO(new Bundle {
val x1 = Input(FixedPoint(6.W, binaryPoint = 2.BP))
val x2 = Input(FixedPoint(6.W, binaryPoint = 2.BP))
val y1 = Output(FixedPoint(12.W, binaryPoint = 4.BP))
val y2 = Output(FixedPoint(12.W, binaryPoint = 4.BP))
})
// Real op
val twiddle = 1.0.F(2.BP)
io.y1 := io.x1 + twiddle * io.x2
io.y2 := io.x1 - twiddle * io.x2
}
object Radix2ButterflyMain extends App {
println("Generating the Butterfly hardware.")
emitVerilog(new Radix2Butterfly(), Array("--target-dir", "generated"))
}在进行sbt测试后,没有问题地工作(我有一个简单的测试)。
但是,只需添加一行,并调用dsptools,如下所示:
package radix2
import chisel3._
import chisel3.experimental._
import chisel3.util._
import dsptools._
import dsptools.numbers._
class Radix2Butterfly extends Module {
val io = IO(new Bundle {
val x1 = Input(FixedPoint(6.W, binaryPoint = 2.BP))
val x2 = Input(FixedPoint(6.W, binaryPoint = 2.BP))
val a1 = Input(DspComplex(FixedPoint(6.W, 4.BP), FixedPoint(6.W, 4.BP)))
val y1 = Output(FixedPoint(12.W, binaryPoint = 4.BP))
val y2 = Output(FixedPoint(12.W, binaryPoint = 4.BP))
})
// Real op
val twiddle = 1.0.F(2.BP)
io.y1 := io.x1 + twiddle * io.x2
io.y2 := io.x1 - twiddle * io.x2
}
object Radix2ButterflyMain extends App {
println("Generating the Butterfly hardware.")
emitVerilog(new Radix2Butterfly(), Array("--target-dir", "generated"))
}产生以下错误:
[info] - should pass *** FAILED ***
[info] java.lang.AssertionError: assertion failed: The Chisel compiler plugin is now required for compiling Chisel code. Please see https://github.com/chipsalliance/chisel3#build-your-own-chisel-projects.
[info] at ... ()
[info] at dsptools.numbers.DspComplex.<init>(DspComplex.scala:59)
[info] at dsptools.numbers.DspComplex$.apply(DspComplex.scala:24)
[info] at radix2.Radix2Butterfly$$anon$1.$anonfun$a1$1(Radix2Butterfly.scala:21)
[info] at chisel3.internal.plugin.package$.autoNameRecursively(package.scala:33)
[info] at radix2.Radix2Butterfly$$anon$1.<init>(Radix2Butterfly.scala:21)
[info] at radix2.Radix2Butterfly.$anonfun$io$2(Radix2Butterfly.scala:13)
[info] at chisel3.internal.prefix$.apply(prefix.scala:48)
[info] at radix2.Radix2Butterfly.$anonfun$io$1(Radix2Butterfly.scala:13)
[info] at chisel3.internal.plugin.package$.autoNameRecursively(package.scala:33)
[info] ...我的文件build.sbt如下所示:
// scalaVersion := "2.13.7"
scalaVersion := "2.12.13"
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-unchecked",
// "-Xfatal-warnings",
// "-Xsource:2.11", // not for 3.5, but for 3.4
"-language:reflectiveCalls",
"-Xcheckinit",
// Enables autoclonetype2
"-P:chiselplugin:genBundleElements" // not for 3.5, but for 3.4
)
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
)
val chiselVersion = "3.5.3"
addCompilerPlugin("edu.berkeley.cs" %% "chisel3-plugin" % chiselVersion cross CrossVersion.full)
libraryDependencies += "edu.berkeley.cs" %% "chisel3" % chiselVersion
libraryDependencies += "edu.berkeley.cs" %% "chisel-iotesters" % "2.5.0"
libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "0.5.3"
libraryDependencies += "edu.berkeley.cs" %% "rocket-dsptools" % "1.2.6"我相信它拥有我所需要的一切,包括错误输出所指的Chisel编译器插件。将非常感谢帮助解决这个问题。
非常感谢。
发布于 2022-07-11 16:18:14
rocket-dsptools是针对CHISE3.2.6 1编译的。Chisel只维护主要版本的二进制兼容性(版本控制方案为<epoch>.<major>.<minor>,参见2)。火箭-dsptools不是由任何人维护的,所以您不能将它与最新版本的Chisel一起使用。如果您愿意的话,您将需要从源代码构建它(并且可能会更新很多东西,因为3.2.6已经超过2年了)。
Maven POM:https://search.maven.org/artifact/edu.berkeley.cs/rocket-dsptools_2.12/1.2.6/jar中的
https://www.chisel-lang.org/chisel3/docs/appendix/versioning.html
https://stackoverflow.com/questions/72908415
复制相似问题