diff --git a/src/AxiStreamTypes.bsv b/src/AxiStreamTypes.bsv index 1a2fb1b..ae7ff38 100644 --- a/src/AxiStreamTypes.bsv +++ b/src/AxiStreamTypes.bsv @@ -39,7 +39,7 @@ typedef struct { Bit#(keepWidth) tKeep; Bool tLast; Bit#(usrWidth) tUser; -} AxiStream#(numeric type keepWidth, numeric type usrWidth) deriving(Bits, FShow, Eq); +} AxiStream#(numeric type keepWidth, numeric type usrWidth) deriving(Bits, FShow, Eq, Bounded); (*always_ready, always_enabled*) interface RawAxiStreamMaster#(numeric type keepWidth, numeric type usrWidth); diff --git a/src/SemiFifo.bsv b/src/SemiFifo.bsv index 38e3db6..cd2a46b 100644 --- a/src/SemiFifo.bsv +++ b/src/SemiFifo.bsv @@ -184,4 +184,20 @@ module mkDummyPipeOut(PipeOut#(dType)) provisos(Bits#(dType, dSize)); method Action deq if (False); noAction; endmethod -endmodule \ No newline at end of file +endmodule + +module mkPutToPipeIn#( + Put#(dType) put +)(PipeIn#(dType)) provisos(Bits#(dType, dSize)); + FIFOF#(dType) interBuf <- mkFIFOF; + mkConnection(toGet(interBuf), put); + return convertFifoToPipeIn(interBuf); +endmodule + +module mkGetToPipeOut#( + Get#(dType) get +)(PipeOut#(dType)) provisos(Bits#(dType, dSize)); + FIFOF#(dType) interBuf <- mkFIFOF; + mkConnection(toPut(interBuf), get); + return convertFifoToPipeOut(interBuf); +endmodule