Skip to content

Commit

Permalink
Add makeStrb to AXI4Stream bundle.
Browse files Browse the repository at this point in the history
If there's no strb field, we need a convenient way to construct the default strb, an all-ones mask of n bits.
  • Loading branch information
grebe committed Oct 10, 2018
1 parent e9a5662 commit ebb058c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rocket/src/main/scala/amba/axi4stream/Bundles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class AXI4StreamBundlePayload(params: AXI4StreamBundleParameters) extends AXI4St
val id = Output(UInt(params.i.W))
val dest = Output(UInt(params.d.W))
val user = Output(UInt(params.u.W))

def makeStrb: UInt = if (params.hasStrb) strb else ((BigInt(1) << params.n) - 1).U
}

/**
Expand Down

0 comments on commit ebb058c

Please sign in to comment.