From 8dcb4d016e3f6fe18da0e00ddb21f3bf5859cd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Mon, 21 Sep 2015 17:01:57 +0200 Subject: Added control FSM states to handle entropy for testing. Nits: Changed to localparam. --- src/rtl/trng_mixer.v | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'src/rtl') diff --git a/src/rtl/trng_mixer.v b/src/rtl/trng_mixer.v index 449dc5c..0d565c7 100644 --- a/src/rtl/trng_mixer.v +++ b/src/rtl/trng_mixer.v @@ -80,30 +80,32 @@ module trng_mixer( //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- - parameter MODE_SHA_512 = 2'h3; - - parameter ENTROPY_IDLE = 4'h0; - parameter ENTROPY_SRC0 = 4'h1; - parameter ENTROPY_SRC0_ACK = 4'h2; - parameter ENTROPY_SRC1 = 4'h3; - parameter ENTROPY_SRC1_ACK = 4'h4; - parameter ENTROPY_SRC2 = 4'h5; - parameter ENTROPY_SRC2_ACK = 4'h6; - - parameter CTRL_IDLE = 4'h0; - parameter CTRL_COLLECT = 4'h1; - parameter CTRL_MIX = 4'h2; - parameter CTRL_SYN = 4'h3; - parameter CTRL_ACK = 4'h4; - parameter CTRL_NEXT = 4'h5; - - parameter ADDR_MIXER_CTRL = 8'h10; - parameter MIXER_CTRL_ENABLE_BIT = 0; - parameter MIXER_CTRL_RESTART_BIT = 1; - parameter ADDR_MIXER_STATUS = 8'h11; - parameter ADDR_MIXER_TIMEOUT = 8'h20; - - parameter DEFAULT_ENTROPY_TIMEOUT = 24'h100000; + localparam MODE_SHA_512 = 2'h3; + + localparam ENTROPY_IDLE = 4'h0; + localparam ENTROPY_SRC0 = 4'h1; + localparam ENTROPY_SRC0_ACK = 4'h2; + localparam ENTROPY_SRC1 = 4'h3; + localparam ENTROPY_SRC1_ACK = 4'h4; + localparam ENTROPY_SRC2 = 4'h5; + localparam ENTROPY_SRC2_ACK = 4'h6; + localparam TEST_ENTROPY = 4'he; + localparam TEST_ENTROPY_ACK = 4'hf; + + localparam CTRL_IDLE = 4'h0; + localparam CTRL_COLLECT = 4'h1; + localparam CTRL_MIX = 4'h2; + localparam CTRL_SYN = 4'h3; + localparam CTRL_ACK = 4'h4; + localparam CTRL_NEXT = 4'h5; + + localparam ADDR_MIXER_CTRL = 8'h10; + localparam MIXER_CTRL_ENABLE_BIT = 0; + localparam MIXER_CTRL_RESTART_BIT = 1; + localparam ADDR_MIXER_STATUS = 8'h11; + localparam ADDR_MIXER_TIMEOUT = 8'h20; + + localparam DEFAULT_ENTROPY_TIMEOUT = 24'h100000; //---------------------------------------------------------------- -- cgit v1.2.3