【发布时间】:2021-08-12 09:28:28
【问题描述】:
我有一个工作的偷看测试仪,在 jupyter notebook 中测试过。 我正在将它移植到 sbt,我尝试了两本书和我教授的一本书的语法,但到目前为止都没有。
项目目录结构基于模板—— https://github.com/freechipsproject/chisel-template
我需要移植到 sbt 的工作基础测试器是 -
def test_sync_fifo: Boolean = {
test(new sync_fifo(64, 32)) { c =>
// .... Pokes and peeks
}
println(getVerilog(new sync_fifo(64, 32)))
true
}
assert(test_sync_fifo)
我已经尝试过的是-
import chisel3 ._
import chisel3 . iotesters ._ // Gives error - iotesters not found
class TesterSimple (dut: sync_fifo(64, 32) ) extends
PeekPokeTester (dut) { // Gives error = PeekPokeTester not found
// .. Peeks and pokes
}
object TesterSimple extends App {
chisel3 . iotesters . Driver (() => new sync_fifo(64, 32)) { c =>
new TesterSimple (c)
}
}
我也试过了-
//In build.sbt - I expect this to be wrong
lazy val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
libraryDependencies ++= scalatest
import org. scalatest ._
class SimpleSpec extends FlatSpec with Matchers {
" Test " should "pass" in {
chisel3 . iotesters . Driver (() => new sync_fifo(64, 32)) { c =>
new Tester (c)
} should be (true)
}
}
我也试过了-
import Chisel._
class test_sync_fifo (c: sync_fifo(64, 32))
extends Tester(c) {
// Peeks and pokes
}
任何指针都会很有帮助。谢谢
【问题讨论】:
-
你的例子看起来不错。您收到什么错误消息
-
嗨@ChickMarkley。谢谢。案例 1 -
[error] test_funnel_shifter.scala:7:16: object iotesters is not a member of package chisel3 import chisel3.iotesters._ ^ [error] test_funnel_shifter.scala:13:5: not found: type PeekPokeTester PeekPokeTester (c) { [error] test_funnel_shifter.scala:13:21: no arguments allowed for nullary constructor Object: ()Object PeekPokeTester (c) { [error] test_funnel_shifter.scala:169:13: object iotesters is not a member of package chisel3 [ chisel3.iotesters.Driver(() => new funnel_shifter(4, 21, 9, 42) ) { c => -
我得到了案例 2 的工作,谢谢。
标签: scala sbt scalatest chisel