From 49853e846c426f72a507bf877872e329a4a8d926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 2 Apr 2015 16:00:00 +0200 Subject: (1) Added a state in the write fifo machine to actually drop request between csprng data words. (2) Updated the testbench with better test vector generation. --- src/rtl/trng_csprng_fifo.v | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/rtl') diff --git a/src/rtl/trng_csprng_fifo.v b/src/rtl/trng_csprng_fifo.v index e4abc26..9c52ef5 100644 --- a/src/rtl/trng_csprng_fifo.v +++ b/src/rtl/trng_csprng_fifo.v @@ -60,8 +60,7 @@ module trng_csprng_fifo( localparam FIFO_MAX = (2 ** FIFO_ADDR_BITS) - 1; localparam WR_IDLE = 0; - localparam WR_WAIT = 1; - localparam WR_WRITE = 2; + localparam WR_STORE = 1; localparam WR_DISCARD = 7; localparam RD_IDLE = 0; @@ -453,13 +452,21 @@ module trng_csprng_fifo( if (csprng_data_valid) begin - fifo_mem_we = 1; - wr_ptr_inc = 1; - fifo_ctr_inc = 1; + wr_ctrl_new = WR_STORE; + wr_ctrl_we = 1; end end end + WR_STORE: + begin + fifo_mem_we = 1; + wr_ptr_inc = 1; + fifo_ctr_inc = 1; + wr_ctrl_new = WR_IDLE; + wr_ctrl_we = 1; + end + WR_DISCARD: begin fifo_ctr_rst = 1; -- cgit v1.2.3