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 如何使用Verilator修复凿子测试错误(应与Verilator一起使用***失败***)?_Scala_Chisel_Verilator - Fatal编程技术网

Scala 如何使用Verilator修复凿子测试错误(应与Verilator一起使用***失败***)?

Scala 如何使用Verilator修复凿子测试错误(应与Verilator一起使用***失败***)?,scala,chisel,verilator,Scala,Chisel,Verilator,我运行了凿子测试,希望用verilator生成输出。我无法准确地找到错误的原因,但我认为这与verilator有关。 这是执行测试的代码部分。它必须打印一些输出并生成模拟文件 class ComplexMemoryLoadingSpec extends FreeSpec with Matchers { "memory loading should be possible with complex memories" - { val targetDirName = "test_ru

我运行了凿子测试,希望用verilator生成输出。我无法准确地找到错误的原因,但我认为这与verilator有关。 这是执行测试的代码部分。它必须打印一些输出并生成模拟文件

class ComplexMemoryLoadingSpec extends  FreeSpec with Matchers {
  "memory loading should be possible with complex memories" - {

    val targetDirName = "test_run_dir/complex_mem_test"
    FileUtils.makeDirectory(targetDirName)

    val path1 = Paths.get(targetDirName + "/mem_cameraman.bin")


    Files.copy(getClass.getResourceAsStream("/cameraman.bin"), path1, REPLACE_EXISTING)



    "should work with verilator" in {
      iotesters.Driver.execute(
        args = Array("--backend-name", "verilator", "--target-dir", targetDirName, "--top-name", "complex_mem_test"),
        dut = () => new HasComplexMemory(memoryDepth = 65536)
      ) { c =>
        new HasComplexMemoryTester(c)
      } should be(true)
    }
  }
}

它不起作用,我有以下错误:

[info] Done compiling.
[info] [0.005] Elaborating design...
[info] [0.515] Done elaborating.
Total FIRRTL Compile Time: 1965.5 ms
cd /home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test && verilator --cc HasComplexMemory.v --assert -Wno-fatal -Wno-WIDTH -Wno-STMTDLY -O1 --top-module HasComplexMemory +define+TOP_TYPE=VHasComplexMemory +define+PRINTF_COND=!HasComplexMemory.reset +define+STOP_COND=!HasComplexMemory.reset -CFLAGS "-Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VHasComplexMemory -DVL_USER_FINISH -include VHasComplexMemory.h" -Mdir /home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test -f /home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test/firrtl_black_box_resource_files.f --exe /home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test/HasComplexMemory-harness.cpp --trace
make: Entering directory '/home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test'
g++  -I.  -MMD -I/usr/local/share/verilator/include -I/usr/local/share/verilator/include/vltstd -DVL_PRINTF=printf -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -faligned-new -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VHasComplexMemory -DVL_USER_FINISH -include VHasComplexMemory.h   -c -o HasComplexMemory-harness.o /home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test/HasComplexMemory-harness.cpp
g++  -I.  -MMD -I/usr/local/share/verilator/include -I/usr/local/share/verilator/include/vltstd -DVL_PRINTF=printf -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -faligned-new -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VHasComplexMemory -DVL_USER_FINISH -include VHasComplexMemory.h   -c -o verilated.o /usr/local/share/verilator/include/verilated.cpp
g++  -I.  -MMD -I/usr/local/share/verilator/include -I/usr/local/share/verilator/include/vltstd -DVL_PRINTF=printf -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -faligned-new -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VHasComplexMemory -DVL_USER_FINISH -include VHasComplexMemory.h   -c -o verilated_vcd_c.o /usr/local/share/verilator/include/verilated_vcd_c.cpp
/usr/bin/perl /usr/local/share/verilator/bin/verilator_includer -DVL_INCLUDE_OPT=include VHasComplexMemory.cpp VHasComplexMemory___024unit.cpp > VHasComplexMemory__ALLcls.cpp
/usr/bin/perl /usr/local/share/verilator/bin/verilator_includer -DVL_INCLUDE_OPT=include VHasComplexMemory__Trace.cpp VHasComplexMemory__Syms.cpp VHasComplexMemory__Trace__Slow.cpp > VHasComplexMemory__ALLsup.cpp
g++  -I.  -MMD -I/usr/local/share/verilator/include -I/usr/local/share/verilator/include/vltstd -DVL_PRINTF=printf -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -faligned-new -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VHasComplexMemory -DVL_USER_FINISH -include VHasComplexMemory.h   -c -o VHasComplexMemory__ALLcls.o VHasComplexMemory__ALLcls.cpp
g++  -I.  -MMD -I/usr/local/share/verilator/include -I/usr/local/share/verilator/include/vltstd -DVL_PRINTF=printf -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -faligned-new -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VHasComplexMemory -DVL_USER_FINISH -include VHasComplexMemory.h   -c -o VHasComplexMemory__ALLsup.o VHasComplexMemory__ALLsup.cpp
      Archiving VHasComplexMemory__ALL.a ...
ar r VHasComplexMemory__ALL.a VHasComplexMemory__ALLcls.o VHasComplexMemory__ALLsup.o
ranlib VHasComplexMemory__ALL.a
g++    HasComplexMemory-harness.o verilated.o verilated_vcd_c.o VHasComplexMemory__ALL.a    -o VHasComplexMemory -lm -lstdc++ 
make: Leaving directory '/home/med/workspace/ChiselProjects/convolution/test_run_dir/complex_mem_test'
sim start on Dell at Fri Sep 27 13:38:29 2019
inChannelName: 00008431.in
outChannelName: 00008431.out
cmdChannelName: 00008431.cmd
STARTING test_run_dir/complex_mem_test/VHasComplexMemory
Enabling waves..%Error: test_run_dir/complex_mem_test/mem_a:0: $readmem file not found
Aborting...
[info] ComplexMemoryLoadingSpec:
[info] memory loading should be possible with complex memories
[info] - should work with verilator *** FAILED ***
[info]   chisel3.iotesters.TestApplicationException: test application exit - exit code 134
[info]   at chisel3.iotesters.SimApiInterface.throwExceptionIfDead(SimApiInterface.scala:98)
[info]   at chisel3.iotesters.SimApiInterface.chisel3$iotesters$SimApiInterface$$mwhile(SimApiInterface.scala:107)
[info]   at chisel3.iotesters.SimApiInterface$$anonfun$start$3.apply$mcVI$sp(SimApiInterface.scala:268)
[info]   at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
[info]   at chisel3.iotesters.SimApiInterface.start(SimApiInterface.scala:266)
[info]   at chisel3.iotesters.SimApiInterface.<init>(SimApiInterface.scala:325)
[info]   at chisel3.iotesters.VerilatorBackend.<init>(VerilatorBackend.scala:295)
[info]   at chisel3.iotesters.setupVerilatorBackend$.apply(VerilatorBackend.scala:284)
[info]   at chisel3.iotesters.Driver$$anonfun$execute$1$$anonfun$apply$mcZ$sp$1.apply$mcZ$sp(Driver.scala:56)
[info]   at chisel3.iotesters.Driver$$anonfun$execute$1$$anonfun$apply$mcZ$sp$1.apply(Driver.scala:39)
[info]   ...
[info] ScalaTest
[info] Run completed in 1 minute, 41 seconds.
[info] Total number of tests run: 1
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0
[info] *** 1 TEST FAILED ***
[error] Failed: Total 1, Failed 1, Errors 0, Passed 0
[error] Failed tests:
[error]     util.ComplexMemoryLoadingSpec
[error] (Test / testOnly) sbt.TestsFailedException: Tests unsuccessful
[info]已完成编译。
[信息][0.005]详细设计。。。
[info][0.515]已完成详细说明。
总FIRRTL编译时间:1965.5毫秒
cd/home/med/workspace/chiveprojects/convolution/test\u run\u dir/complex\u mem\test&verilator--cc HasComplexMemory.v--assert-Wno fatal-Wno WIDTH-Wno STMTDLY-O1--top模块HasComplexMemory+define+top\u TYPE=VHasComplexMemory+define+PRINTF COND=!HasComplexMemory.reset+define+STOP\u COND=!HasComplexMemory.reset-CFLAGS“-Wno未定义的bool转换-O1-DTOP_TYPE=VHasComplexMemory-DVL_USER_FINISH-包括VHasComplexMemory.h”-Mdir/home/med/workspace/firrtl\u black\u resource\u files.f--exe/home/med/complex\u mem\u test-f/home/med/workspace/med/workspace/fikeprojects/ficket\u run\u dir/complex\u mem\u test/HasComplexMemory-harness.cpp--
make:输入目录“/home/med/workspace/projects/volumion/test\u run\u dir/complex\u mem\u test”
g++-I.-MMD-I/usr/local/share/verilator/include-I/usr/local/share/verilator/include/vltstd-DVL_PRINTF=PRINTF-DVM_COVERAGE=0-DVM_SC=0-DVM_TRACE=1-faligned new-Wno bool operation-Wno符号比较-Wno未初始化-Wno未使用但设置变量-Wno未使用参数-Wno未使用变量-Wno未使用变量-Wno阴影-Wno未定义bool转换-O1-DTOP_TYPE=VHasComplexMemory-DVL_USER_FINISH-include VHasComplexMemory.h-c-o HasComplexMemory-harness.o/home/med/workspace/choveprojects/coulsion/test_run_dir/complex_mem_test/HasComplexMemory-harness.cpp
g++-I.-MMD-I/usr/local/share/verilator/include-I/usr/local/share/verilator/include/vltstd-DVL_PRINTF=PRINTF-DVM_COVERAGE=0-DVM_SC=0-DVM_TRACE=1-faligned new-Wno bool operation-Wno符号比较-Wno未初始化-Wno未使用但设置变量-Wno未使用参数-Wno未使用变量-Wno未使用变量-Wno阴影-Wno未定义bool转换-O1-DTOP_TYPE=VHasComplexMemory-DVL_USER_FINISH-include VHasComplexMemory.h-c-o verilated.o/usr/local/share/verilator/include/verilated.cpp
g++-I.-MMD-I/usr/local/share/verilator/include-I/usr/local/share/verilator/include/vltstd-DVL_PRINTF=PRINTF-DVM_COVERAGE=0-DVM_SC=0-DVM_TRACE=1-faligned new-Wno bool operation-Wno符号比较-Wno未初始化-Wno未使用但设置变量-Wno未使用参数-Wno未使用变量-Wno未使用变量-Wno阴影-Wno未定义bool转换-O1-DTOP_TYPE=VHasComplexMemory-DVL_USER_FINISH-include VHasComplexMemory.h-c-o veralidated_vcd_c.o/usr/local/share/verilator/include/veraliated_vcd_c.cpp
/usr/bin/perl/usr/local/share/verilator/bin/verilator\u INCLUDE-DVL\u INCLUDE\u OPT=INCLUDE VHasComplexMemory.cpp VHasComplexMemory\uuuuuuuu 024unit.cpp>VHasComplexMemory\uuu ALLcls.cpp
/usr/bin/perl/usr/local/share/verilator/bin/verilator\u INCLUDE-DVL\u INCLUDE\u OPT=INCLUDE VHasComplexMemory\uuuu Trace.cpp VHasComplexMemory\uu Syms.cpp VHasComplexMemory\uu Trace\uu Slow.cpp>VHasComplexMemory\uu ALLsup.cpp
g++-I.-MMD-I/usr/local/share/verilator/include-I/usr/local/share/verilator/include/vltstd-DVL_PRINTF=PRINTF-DVM_COVERAGE=0-DVM_SC=0-DVM_TRACE=1-faligned new-Wno bool operation-Wno符号比较-Wno未初始化-Wno未使用但设置变量-Wno未使用参数-Wno未使用变量-Wno未使用变量-Wno阴影-Wno未定义bool转换-O1-DTOP_TYPE=VHasComplexMemory-DVL_USER_FINISH-包括VHasComplexMemory.h-c-o VHasComplexMemory_uuallcls.o VHasComplexMemory_uallcls.cpp
g++-I.-MMD-I/usr/local/share/verilator/include-I/usr/local/share/verilator/include/vltstd-DVL_PRINTF=PRINTF-DVM_COVERAGE=0-DVM_SC=0-DVM_TRACE=1-faligned new-Wno bool operation-Wno符号比较-Wno未初始化-Wno未使用但设置变量-Wno未使用参数-Wno未使用变量-Wno未使用变量-Wno阴影-Wno未定义bool转换-O1-DTOP_TYPE=VHasComplexMemory-DVL_USER_FINISH-包括VHasComplexMemory.h-c-o VHasComplexMemory_uuallsup.o VHasComplexMemory_uallsup.cpp
归档VHasComplexMemory\uuuu ALL.a。。。
ar r VHasComplexMemory\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuovhasComplexMemory\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
ranlib VHasComplexMemory\uuu ALL.a
g++HasComplexMemory线束。o verilated.o verilated_vcd_c.o VHasComplexMemory_uuAll.a-o VHasComplexMemory-lm-lstdc++
make:离开目录“/home/med/workspace/projects/volumion/test\u run\u dir/complex\u mem\u test”
2019年9月27日星期五13:38:29戴尔sim卡启动
inChannelName:00008431.in
outChannelName:00008431.out
cmdChannelName:00008431.cmd
启动测试\u运行\u目录/复杂\u内存\u测试/VHasComplexMemory
启用waves..%错误:测试\u运行\u目录/complex\u mem\u测试/mem\u a:0:$readmem文件未找到
流产。。。
[信息]ComplexMemoryLoadingSpec:
[信息]对于复杂的内存,应该可以加载内存
[信息]-应与verilator配合使用***失败***
[info]3.iotesters.TestApplicationException:测试应用程序退出-退出代码134
[信息]位于3.IoTests.SimApiInterface.ThroweExceptionIfDead(SimApiInterface.scala:98)
[信息]位于凿岩3.IoTests.SimApiInterface.凿岩3$IoTests$SimApiInterface$$mwhile(SimApiInterface.scala:107)
[信息]在3.IoTests.SimApiInterface$$anonfun$start$3.apply$mcVI$sp(SimApiInterface.scala:268)
[info]位于scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
[信息]位于3.IoTests.SimApiInterface.start(SimApiInterface.scala:266)
[信息]位于3.IoTests.SimApiInterface.(SimApiInterface.scala:325)
[信息]见3.IoTests.VerilatorBackend.(VerilatorBackend.scala:295)
[信息]位于3.iotesters.setupVerilatorBackend$.apply(VerilatorBackend.scala:284)
[信息]位于3.IoTests.Driver$$anonfun$execute$
val path1 = Paths.get(targetDirName + "/mem_cameraman.bin")
Files.copy(getClass.getResourceAsStream("/cameraman.bin"), path1,REPLACE_EXISTING)