HAMZA
HAMZA

Reputation: 21

How can I modify an int type argument to a T type?

Hello I'm trying to learn chisel and I'm compiling an existing project, but I get a problem with the mem instantiation :

Compile result

How can i modify the int type to type T and what is type T ?

Waiting for your answers.

Thank you.

Upvotes: 0

Views: 84

Answers (1)

joel
joel

Reputation: 7877

type T needs to be a subtype of Data. It appears numAddresses is an Int

From the UC Berkeley Chisel guide it looks like subtypes of Data include

  • Bool, SInt or UInt
  • Bundle or Vec

From here it looks like you could convert a Scala Int to a UInt as numAddresses.U (I assumed numAddresses is non-negative)

Upvotes: 1

Related Questions