chisel-example \ chisel-tutorial 同样代码,生成器输出不一致问题
同样的一份代码
src/main/scala/GCD.scala
src/test/scala/GCDTester.scala
其中生成vcd波形的代码1
2
3
4
5object GCDTester extends App {
iotesters.Driver.execute(Array("--target-dir", "generated", "--fint-write-vcd"), () => new GCD){
c => new GCDTests(c)
}
}
在chisel-example 目录下 sbt "test:runMain simple.GCDTester"
可以生成GCD波形1
2
3
4>> l generated/examples.GCDTester1802184992
-rwxr-xr-x+ 1 Administrator None 6 Dec 5 14:53 GCD.anno.json
-rwxr-xr-x+ 1 Administrator None 1.5K Dec 5 14:53 GCD.fir
-rwxr-xr-x+ 1 Administrator None 1.5K Dec 5 14:53 GCD.lo.fir
在chisel-tutorial 目录下 sbt "test:runMain simple.GCDTester"
不能生成GCD波形
1 | >> l generated/examples.GCDTester1802184992 |
导致的原因是,build.sbt 不一样 , 可能是引入的库的版本不一致导致,1
2
3
4
5
6
7
8
9//chisel-tutorial/build.sbt
val defaultVersions = Map(
// "chisel3" -> "3.1.+",
// "chisel-iotesters" -> "1.2.+"
//将上面两行注释掉,改为3.1.2, 1.2.2
//否则可能会默认使用.ivy2/cache/edu.berkeley.cs/chisel3_2.11/jars/chisel3_2.11-3.1.3.jar
"chisel3" -> "3.1.2",
"chisel-iotesters" -> "1.2.2"
)
iotesters.Driver.execute(Array("--target-dir", "generated", "--fint-write-vcd"), () => new GCD){
结论:
保险起见,使用一下两个版本号:1
2libraryDependencies += "edu.berkeley.cs" %% "chisel3" % "3.1.2"
libraryDependencies += "edu.berkeley.cs" %% "chisel-iotesters" % "1.2.2"