【问题标题】:Getting errors in porting a Chisel test to sbt将 Chisel 测试移植到 sbt 时出错
【发布时间】: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


【解决方案1】:

查看完整的SBT 文件会很有帮助,但我很确定您缺少对iotesters 的依赖。假设您使用的是 chisel3 版本 3.4.x 或更高版本,您应该将以下内容添加到您的 build.sbt

libraryDependencies += "edu.berkeley.cs" %% "chisel-iotesters" % "1.5.3"

有关各个项目的哪些版本可以协同工作的信息,请参阅此文档页面:https://www.chisel-lang.org/chisel3/docs/appendix/versioning.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-01
    • 2017-04-16
    • 1970-01-01
    • 1970-01-01
    • 2013-01-29
    • 2018-09-28
    • 2012-11-22
    • 1970-01-01
    相关资源
    最近更新 更多