top of page

[Chisel]What to connect to Bundle is hardware


Phenomenon

When I run the following code:

class Signals extends Bundle{
  val pc = UInt((32.W))
  ・・・
}

val sig = Wire(new Signals)
sig.pc := 0.U

The following error occurs:

chisel3.package$ExpectedHardwareException: data to be connected 'UInt' must be hardware, not a bare Chisel type. Perhaps you forgot to wrap it in Wire() or IO()?


Causes and Solutions

As the error message says, you must have hardware connected to sig.pc. To do this:

sig.pc := WireDefault(0.U)

At first I thought, "Bundle is just a collection of data" and confused to connect hardware.

After some thoughts I reached a conclusion that Bundle is a group of signal lines that are connected simultaneously.


So I tried to define it as follows, but it gave me a compilation error.

class Signals extends Bundle{
  val pc = Wire(UInt((32.W)))
  ・・・
}

In the end, a Bundle is a definition of "how to interpret the values of each signal line," so it seems best to interpret it as a chisel type rather than a hardware type (although it is hardware that is actually connected).

Recent Posts

See All

[Chisel] Don't use polymorphism

What I want to do There are multiple similar units Most of processes are the same, only some differences. Select an appropriate unit...

Comments


category

Let's do our best with our partner:​ ChatReminder

iphone6.5p2.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Let's do our best with our partner:​ ChatReminder

納品:iPhone6.5①.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Theme diary: Decide the theme and record for each genre

It is a diary application that allows you to post and record with themes and sub-themes for each genre.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png
bottom of page