diff options
author | Paul Selkirk <paul@psgd.org> | 2015-04-28 18:03:27 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2015-04-28 18:03:27 -0400 |
commit | 40c7808f6be265fd4a44b35b195980dfbf473812 (patch) | |
tree | 4f9822ac7f0dbbfffb9734371c89b98c03479d76 /src/rtl/trng.v | |
parent | bce36af5ceacb2ae840878b3999c29c86d18ef9b (diff) |
(1) Remove the delayed read for EIM (see core/platform/novena commit 2f58e8f). (2) Add the code to read the csprng name and version registers.
Diffstat (limited to 'src/rtl/trng.v')
-rw-r--r-- | src/rtl/trng.v | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/rtl/trng.v b/src/rtl/trng.v index 15714c5..728fa39 100644 --- a/src/rtl/trng.v +++ b/src/rtl/trng.v @@ -123,8 +123,6 @@ module trng( //---------------------------------------------------------------- wire trng_api_cs = cs && (addr_core_num == TRNG_PREFIX); wire trng_api_we = we; - reg [31 : 0] trng_api_read_data_reg; - reg [31 : 0] trng_api_read_data_new; reg [31 : 0] trng_api_read_data; reg trng_api_error; @@ -343,7 +341,7 @@ module trng( case (address[11 : 8]) TRNG_PREFIX: begin - tmp_read_data = trng_api_read_data_reg; + tmp_read_data = trng_api_read_data; tmp_error = trng_api_error; end @@ -397,16 +395,12 @@ module trng( debug_delay_reg <= DEFAULT_DEBUG_DELAY; debug_delay_ctr_reg <= 32'h00000000; debug_out_reg <= 8'h00; - trng_api_read_data_reg <= 32'h00000000; end else begin discard_reg <= discard_new; debug_delay_ctr_reg <= debug_delay_ctr_new; - if (trng_api_cs) - trng_api_read_data_reg <= trng_api_read_data_new; - if (debug_out_we) debug_out_reg <= tmp_debug; @@ -504,7 +498,7 @@ module trng( debug_mux_we = 0; debug_delay_new = 32'h00000000; debug_delay_we = 0; - trng_api_read_data_new = 32'h00000000; + trng_api_read_data = 32'h00000000; trng_api_error = 0; if (trng_api_cs) @@ -547,17 +541,17 @@ module trng( // Read operations. ADDR_NAME0: begin - trng_api_read_data_new = TRNG_NAME0; + trng_api_read_data = TRNG_NAME0; end ADDR_NAME1: begin - trng_api_read_data_new = TRNG_NAME1; + trng_api_read_data = TRNG_NAME1; end ADDR_VERSION: begin - trng_api_read_data_new = TRNG_VERSION; + trng_api_read_data = TRNG_VERSION; end ADDR_TRNG_CTRL: @@ -571,12 +565,12 @@ module trng( ADDR_DEBUG_CTRL: begin - trng_api_read_data_new = {29'h0000000, debug_mux_new}; + trng_api_read_data = {29'h0000000, debug_mux_new}; end ADDR_DEBUG_DELAY: begin - trng_api_read_data_new = debug_delay_reg; + trng_api_read_data = debug_delay_reg; end default: |