Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 将凿子测试移植到sbt时出错_Scala_Sbt_Scalatest_Chisel - Fatal编程技术网

Scala 将凿子测试移植到sbt时出错

Scala 将凿子测试移植到sbt时出错,scala,sbt,scalatest,chisel,Scala,Sbt,Scalatest,Chisel,我有一个工作窥视戳测试仪,在jupyter笔记本上测试。 我正在把它移植到sbt,我试过两本书中的语法,一本是我教授的,但到目前为止还没有一本有效 项目目录结构基于模板- 我需要移植到sbt的工作基础测试仪是- def test_sync_fifo: Boolean = { test(new sync_fifo(64, 32)) { c => // .... Pokes and peeks } println(getVerilog(new syn

我有一个工作窥视戳测试仪,在jupyter笔记本上测试。 我正在把它移植到sbt,我试过两本书中的语法,一本是我教授的,但到目前为止还没有一本有效

项目目录结构基于模板-

我需要移植到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
}
我也试过了-

//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
}

任何指针都会非常有用。谢谢

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

libraryDependencies+=“edu.berkeley.cs”%%“凿子”%%“1.5.3”

有关各种项目的哪些版本可以协同工作的信息,请参见本文档页面:

您的示例看起来不错。你收到了什么错误消息hi@ChickMarkley。谢谢案例1-
[error]test\u funnel\u shifter.scala:7:16:对象iotesters不是程序包凿子3导入凿子3.iotesters.\u^[error]test\u funnel\u shifter.scala:13:5:未找到:类型PeekPokeTester peeTennel\u shifter(c){[error]test\u funnel\u shifter.scala:13:21:空构造函数对象不允许参数:()Object PeekPokeTester(c){[error]test_漏斗移位器。scala:169:13:Object iotesters不是程序包凿子3[凿子3.iotesters.Driver(()=>新漏斗移位器(4,21,9,42))的成员。{c=>
我让案例2正常工作了,谢谢。