Skip to content

Commit

Permalink
add conversion between PipeIn/Out and Put/Get
Browse files Browse the repository at this point in the history
  • Loading branch information
wengwz committed Nov 20, 2023
1 parent a9da96e commit 86fe7e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AxiStreamTypes.bsv
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 17 additions & 1 deletion src/SemiFifo.bsv
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,20 @@ module mkDummyPipeOut(PipeOut#(dType)) provisos(Bits#(dType, dSize));
method Action deq if (False);
noAction;
endmethod
endmodule
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

0 comments on commit 86fe7e3

Please sign in to comment.