Chisel sbt运行期间缺少生成文件

Chisel sbt运行期间缺少生成文件,chisel,Chisel,我将“-backend”和“v”添加到我的测试列表中,虽然我得到了verilog输出,但我也得到了一个构建错误: In file included from ./vpi.cpp:1: ./vpi.h:4:10: fatal error: 'vpi_user.h' file not found #include "vpi_user.h" ^ 1 error generated. sbt运行的完整列表如下所示: BigKiss:chisel mykland$ sbt run [i

我将“-backend”和“v”添加到我的测试列表中,虽然我得到了verilog输出,但我也得到了一个构建错误:

In file included from ./vpi.cpp:1:
./vpi.h:4:10: fatal error: 'vpi_user.h' file not found
#include "vpi_user.h"
         ^
1 error generated.
sbt运行的完整列表如下所示:

BigKiss:chisel mykland$ sbt run
[info] Set current project to chisel (in build file:/Users/mykland/work/chisel/)
[info] Compiling 1 Scala source to /Users/mykland/work/chisel/target/scala-2.10/classes...
[warn] there were 38 feature warning(s); re-run with -feature for details
[warn] one warning found
[info] Running mainStub 
[info] [0.056] // COMPILING < (class lut3to1_1)>(0)
[info] [0.078] giving names
[info] [0.088] executing custom transforms
[info] [0.089] adding clocks and resets
[info] [0.093] inferring widths
[info] [0.108] checking widths
[info] [0.110] lowering complex nodes to primitives
[info] [0.113] removing type nodes
[info] [0.117] compiling 84 nodes
[info] [0.117] computing memory ports
[info] [0.117] resolving nodes to the components
[info] [0.133] creating clock domains
[info] [0.134] pruning unconnected IOs
[info] [0.136] checking for combinational loops
[info] [0.139] NO COMBINATIONAL LOOP FOUND
[info] [0.149] COMPILING <lut3to1_1 (class lut3to1_1)> 0 CHILDREN (0,0)
In file included from ./vpi.cpp:1:
./vpi.h:4:10: fatal error: 'vpi_user.h' file not found
#include "vpi_user.h"
         ^
1 error generated.
[info] [0.666] g++ -c -o ./vpi.o -I$VCS_HOME/include -I./ -fPIC -std=c++11 ./vpi.cpp RET 1
[error] lut3to1_1.scala:58: failed to compile vpi.cpp in class mainStub$
Re-running Chisel in debug mode to obtain erroneous line numbers...
[info] [0.030] // COMPILING < (class lut3to1_1)>(0)
[info] [0.035] giving names
[info] [0.037] executing custom transforms
[info] [0.037] adding clocks and resets
[info] [0.038] inferring widths
[info] [0.045] checking widths
[info] [0.046] lowering complex nodes to primitives
[info] [0.047] removing type nodes
[info] [0.049] compiling 84 nodes
[info] [0.049] computing memory ports
[info] [0.049] resolving nodes to the components
[info] [0.055] creating clock domains
[info] [0.055] pruning unconnected IOs
[info] [0.056] checking for combinational loops
[info] [0.056] NO COMBINATIONAL LOOP FOUND
[info] [0.060] COMPILING <lut3to1_1 (class lut3to1_1)> 0 CHILDREN (0,0)
In file included from ./vpi.cpp:1:
./vpi.h:4:10: fatal error: 'vpi_user.h' file not found
#include "vpi_user.h"
         ^
1 error generated.
[info] [0.535] g++ -c -o ./vpi.o -I$VCS_HOME/include -I./ -fPIC -std=c++11 ./vpi.cpp RET 1
[error] lut3to1_1.scala:58: failed to compile vpi.cpp in class mainStub$
[error] (run-main-0) Chisel.ChiselException: failed to compile vpi.cpp
Chisel.ChiselException: failed to compile vpi.cpp
at mainStub$.main(lut3to1_1.scala:58)
[trace] Stack trace suppressed: run last compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 9 s, completed Oct 4, 2015 6:33:30 PM
BigKiss:chisel mykland$ 
BigKiss:凿子mykland$sbt运行
[信息]将当前项目设置为凿子(内置文件:/Users/mykland/work/凿子/)
[信息]正在将1个Scala源代码编译到/Users/mykland/work/凿子/target/Scala-2.10/classes。。。
[警告]共有38个功能警告;有关详细信息,请使用-功能重新运行
[警告]发现一个警告
[信息]正在运行Mainstrub
[信息][0.056]//编译<(类lut3to1_1)>(0)
[信息][0.078]点名
[info][0.088]执行自定义转换
[信息][0.089]添加时钟和重置
[info][0.093]推断宽度
[信息][0.108]检查宽度
[info][0.110]将复杂节点降低为基本体
[信息][0.113]删除类型节点
[信息][0.117]编译84个节点
[info][0.117]计算内存端口
[info][0.117]正在将节点解析为组件
[信息][0.133]创建时钟域
[info][0.134]修剪未连接的IOs
[info][0.136]检查组合循环
[info][0.139]未找到组合循环
[信息][0.149]汇编0个儿童(0,0)
包含在文件中的./vpi.cpp:1:
./vpi.h:4:10:致命错误:“找不到vpi_user.h”文件
#包括“vpi_user.h”
^
生成1个错误。
[info][0.666]g++-c-o./vpi.o-I$VCS_HOME/include-I./-fPIC-std=c++11./vpi.cpp RET 1
[错误]lut3to1_1.scala:58:未能在类mainStub中编译vpi.cpp$
在调试模式下重新运行凿子以获取错误的行号。。。
[信息][0.030]//编译<(类lut3to1_1)>(0)
[信息][0.035]点名
[info][0.037]执行自定义转换
[信息][0.037]添加时钟和重置
[info][0.038]推断宽度
[信息][0.045]检查宽度
[info][0.046]将复杂节点降低为基本体
[信息][0.047]正在删除类型节点
[info][0.049]正在编译84个节点
[info][0.049]计算内存端口
[info][0.049]正在将节点解析为组件
[info][0.055]创建时钟域
[info][0.055]修剪未连接的IOs
[信息][0.056]检查组合回路
[info][0.056]未找到组合循环
[信息][0.060]编译0个儿童(0,0)
包含在文件中的./vpi.cpp:1:
./vpi.h:4:10:致命错误:“找不到vpi_user.h”文件
#包括“vpi_user.h”
^
生成1个错误。
[info][0.535]g++-c-o./vpi.o-I$VCS_HOME/include-I./-fPIC-std=c++11./vpi.cpp RET 1
[错误]lut3to1_1.scala:58:未能在类mainStub中编译vpi.cpp$
[错误](run-main-0)凿除.凿除异常:未能编译vpi.cpp
凿子.凿子异常:未能编译vpi.cpp
在mainStub$.main(lut3to1.scala:58)
[trace]堆栈跟踪被抑制:运行上次编译:运行完整输出。
java.lang.RuntimeException:非零退出代码:1
在scala.sys.package$.error处(package.scala:27)
[trace]堆栈跟踪被抑制:运行上次编译:运行完整输出。
[错误](编译:运行)非零退出代码:1
[错误]总时间:9秒,已完成2015年10月4日下午6:33:30
BigKiss:凿子mykland$
下面是我的源代码的完整列表:

import Chisel._

class lut3to1_1 extends Module
{
    val io = new Bundle
    {
        val config  = UInt(INPUT, 8)
        val a       = Bool(INPUT)
        val b       = Bool(INPUT)
        val c       = Bool(INPUT)
        val out     = Bool(OUTPUT)
    }
    io.out :=   (io.config(0) & !io.a & !io.b & !io.c) |
                (io.config(1) &  io.a & !io.b & !io.c) |
                (io.config(2) & !io.a &  io.b & !io.c) |
                (io.config(3) &  io.a &  io.b & !io.c) |
                (io.config(4) & !io.a & !io.b &  io.c) |
                (io.config(5) &  io.a & !io.b &  io.c) |
                (io.config(6) & !io.a &  io.b &  io.c) |
                (io.config(7) &  io.a &  io.b &  io.c)
}

class lut3to1_1_Tests(c: lut3to1_1) extends Tester(c)
{
    for ( config <- 0 to 255 )
    {
        poke( c.io.config, config )
        for ( bits <- 0 to 7 )
        {
            val bitA = bits & 1
            val bitB = (bits >> 1) & 1
            val bitC = (bits >> 2) & 1
            poke( c.io.a, bitA )
            poke( c.io.b, bitB )
            poke( c.io.c, bitC )
            step( 1 )
            val result0 = ~bitA & ~bitB & ~bitC & (config & 1)
            val result1 =  bitA & ~bitB & ~bitC & ((config >> 1) & 1)
            val result2 = ~bitA &  bitB & ~bitC & ((config >> 2) & 1)
            val result3 =  bitA &  bitB & ~bitC & ((config >> 3) & 1)
            val result4 = ~bitA & ~bitB &  bitC & ((config >> 4) & 1)
            val result5 =  bitA & ~bitB &  bitC & ((config >> 5) & 1)
            val result6 = ~bitA &  bitB &  bitC & ((config >> 6) & 1)
            val result7 =  bitA &  bitB &  bitC & ((config >> 7) & 1)
            val result =    result0 | result1 | result2 | result3 | 
                            result4 | result5 | result6 | result7
            expect( c.io.out, result )
        }
    }
}

object mainStub
{
    def main( args: Array[String] ): Unit =
    {
        chiselMainTest( Array[String]("--backend", "c", "--backend", "v",
                "--compile", "--test", "--genHarness"), () => Module( new lut3to1_1() ) )
        {
            c => new lut3to1_1_Tests( c )
        }
    }
}
导入凿子_
类lut3to1_1扩展模块
{
val io=新捆绑包
{
val config=UInt(输入,8)
val a=布尔(输入)
val b=布尔值(输入)
val c=布尔(输入)
val out=Bool(输出)
}
io.out:=(io.config(0)&!io.a&!io.b&!io.c)|
(io.config(1)&io.a&!io.b&!io.c)|
(io.config(2)和!io.a和io.b和!io.c)|
(io.config(3)&io.a&io.b&io.c)|
(io.config(4)和!io.a和!io.b和io.c)|
(io.config(5)&io.a&!io.b&io.c)|
(io.config(6)和!io.a&io.b&io.c)|
(io.config(7)&io.a&io.b&io.c)
}
类lut3to1_1_测试(c:lut3to1_1)扩展测试仪(c)
{
对于(配置1)和1
val bitC=(位>>2)和1
戳(c.io.a、bitA)
戳(c.io.b、bitB)
戳(c.io.c、bitC)
步骤(1)
val result0=~bitA&~bitB&~bitC&(配置&1)
val result1=bitA&~bitB&~bitC&((配置>>1)和1)
val result2=~bitA&bitB&~bitC&((配置>>2)和1)
val result3=bitA&bitB&~bitC&((配置>>3)和1)
val result4=~bitA&~bitB&bitC&((配置>>4)和1)
val result5=bitA&~bitB&bitC&((配置>>5)和1)
val result6=~bitA&bitB&bitC&((配置>>6)和1)
val result7=bitA&bitB&bitC&((配置>>7)和1)
val结果=结果0 |结果1 |结果2 |结果3 |
结果4 |结果5 |结果6 |结果7
预期(c.io.out,结果)
}
}
}
对象主体
{
def main(参数:数组[字符串]):单位=
{
测试(数组[字符串](“--backend”,“c”,“--backend”,“v”,
“--compile”、“--test”、“--genHarness”)、()=>模块(新lut3to1_1())
{
c=>新的lut3to1测试(c)
}
}
}

缺少的头文件(vpi_user.h)与Verilog simulator vpi支持有关,这是凿子用于将测试仪连接到Verilog simulator的机制。当前版本的凿子仅支持Synopsys VCS作为Verilog仿真工具。在我的凿子叉(可用)中有对Icarus Verilog(iverilog)10.0+版、Verilator、Modelsim和Questasim的实验支持。不幸的是,我还没有时间彻底测试这些更改并向主存储库发出请求,但您可以尝试一下,看看它是否适合您

此命令用于为测试台模拟器生成verilog

如果您只想生成用于合成的verilog,只需在main()中添加以下函数:

对象主体
{
def main(参数:数组[字符串]):单位=
{
测试(数组[字符串]