2

I am trying BlackBox feature in Chisel3. Every time I try to generate Verilog code of Chisel I got an error.enter image description here

I followed the right steps, writing the class, class driver and build.sbt.

I am not sure where the problem is

This is my Chisel Code

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.+"

1 Answer 1

2

I have figured it out. The blackboxed module shouldn't be the top one.

Sign up to request clarification or add additional context in comments.

2 Comments

Glad you were able to figure it out!
It took time, Thank you ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.