Kera
Kera

Reputation: 105

Chisel3: How can I remove Input and Output in Bundle definition

If I have

class ios extends Bundle{
  val wen = Input(Bool())
  val wdata = Input(UInt(8.W))
  val rdata = Output(UInt(8.W))
}

With Flipped I can get something like

class flipped_ios extends Bundle{
  val wen = Output(Bool())
  val wdata = Output(UInt(8.W))
  val rdata = Input(UInt(8.W))
}

Can I gain something like

class plain_ios extends Bundle{
  val wen = Bool()
  val wdata = UInt(8.W)
  val rdata = UInt(8.W)
}

without copying, pasting and deleting the code?

Upvotes: 1

Views: 87

Answers (1)

Kevin Laeufer
Kevin Laeufer

Reputation: 146

You can apply Output and Input to a bundle, just like Flipped. Output will make all wires in the bundle outputs. Since output is the default, afaik, applying Output to your bundle should bring everything back to default orientation.

Upvotes: 1

Related Questions