From 2eebbe25d8100b213077a4c70156d00854b426d2 Mon Sep 17 00:00:00 2001 From: myrfy001 <11474381+myrfy001@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:50:55 +0800 Subject: [PATCH] fix timing --- src/includes/EthUtils.bsv | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/includes/EthUtils.bsv b/src/includes/EthUtils.bsv index 3d1235b..3a15c41 100644 --- a/src/includes/EthUtils.bsv +++ b/src/includes/EthUtils.bsv @@ -363,11 +363,17 @@ module mkSizedBramFifoToFifoOut#( )(FifoOut#(dType)) provisos(Bits#(dType, dSize), Add#(1, a__, dSize), FShow#(dType)); FIFOF#(dType) fifo <- mkSizedBRAMFIFOF(depth); + // to fix timing, BRAM fifo is complex at it's output port. + FIFOF#(dType) outBuffer <- mkFIFOF; rule doEnq; fifo.enq(pipe.first); pipe.deq; endrule - return convertFifoToFifoOut(fifo); + rule doDeq; + outBuffer.enq(fifo.first); + fifo.deq; + endrule + return convertFifoToFifoOut(outBuffer); endmodule module mkSizedFifoToFifoOut#(