【问题标题】:Generating Verilog code after BlackBoxing in Chisel3在 Chisel3 中的 BlackBoxing 之后生成 Verilog 代码
【发布时间】:2019-04-15 05:41:48
【问题描述】:

我正在尝试 Chisel3 中的 BlackBox 功能。每次我尝试生成 Chisel 的 Verilog 代码时都会出错。

我遵循了正确的步骤,编写了类、类驱动程序和 build.sbt。

我不确定问题出在哪里

这是我的凿子密码

import chisel3._
import chisel3.util._
import chisel3.experimental._

class BlackBoxRealAdd extends BlackBox with HasBlackBoxInline {
  val io = IO(new Bundle() {
    val in1 = Input(UInt(64.W))
    val in2 = Input(UInt(64.W))
    val out = Output(UInt(64.W))
  })
  setInline("BlackBoxRealAdd.v",
    s"""
      |module BlackBoxRealAdd(
      |    input  [15:0] in1,
      |    input  [15:0] in2,
      |    output [15:0] out
      |);
      |always @* begin
      |  out <= (in1) + (in2));
      |end
      |endmodule
    """.stripMargin)
}


object BlackBoxRealAddDriver extends App {
  chisel3.Driver.execute(args, () => new BlackBoxRealAdd)
}

scalaVersion := "2.11.12"

resolvers ++= Seq(
  Resolver.sonatypeRepo("snapshots"),
  Resolver.sonatypeRepo("releases")
)

libraryDependencies += "edu.berkeley.cs" %% "chisel3" % "3.1.+"

【问题讨论】:

    标签: chisel


    【解决方案1】:

    我已经想通了。黑盒模块不应该是最上面的。

    【讨论】:

    • 很高兴你能弄明白!
    • 花了一些时间,谢谢;)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-12
    • 2017-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多