From ebb058c161f7ea63d01182febc6a47975240b68f Mon Sep 17 00:00:00 2001 From: Paul Rigge Date: Wed, 10 Oct 2018 23:50:16 +0000 Subject: [PATCH] Add makeStrb to AXI4Stream bundle. If there's no strb field, we need a convenient way to construct the default strb, an all-ones mask of n bits. --- rocket/src/main/scala/amba/axi4stream/Bundles.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rocket/src/main/scala/amba/axi4stream/Bundles.scala b/rocket/src/main/scala/amba/axi4stream/Bundles.scala index c656bab5..789854a1 100644 --- a/rocket/src/main/scala/amba/axi4stream/Bundles.scala +++ b/rocket/src/main/scala/amba/axi4stream/Bundles.scala @@ -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 } /**