aboutsummaryrefslogtreecommitdiff
path: root/src/rtl
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-04-02 16:00:00 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-04-02 16:00:00 +0200
commit49853e846c426f72a507bf877872e329a4a8d926 (patch)
treec75985bbbdf4ec44a8bb1c1facb75976be8c31d7 /src/rtl
parentdd11b056b46be8f5ee17147265c4ba7dd6b660f2 (diff)
(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.
Diffstat (limited to 'src/rtl')
-rw-r--r--src/rtl/trng_csprng_fifo.v17
1 files changed, 12 insertions, 5 deletions
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;