diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2014-09-27 14:38:05 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2014-09-27 14:38:05 +0200 |
commit | 821471932eb48bb39a820fc6680355231e6093fa (patch) | |
tree | 0a1fe14247b4a15f7ac49351483b3aa683f52eb7 /src/rtl/trng.v | |
parent | f2d1d8430c9ed9923e9cd701744e705f2c91751b (diff) |
Adding debug port for mixer and csprng. In the csprng the debug_update will trigger fifo extraction and thus force random number generation.
Diffstat (limited to 'src/rtl/trng.v')
-rw-r--r-- | src/rtl/trng.v | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/rtl/trng.v b/src/rtl/trng.v index f00aa79..7d0e45d 100644 --- a/src/rtl/trng.v +++ b/src/rtl/trng.v @@ -119,6 +119,8 @@ module trng( reg mixer_api_we; wire [31 : 0] mixer_api_read_data; wire mixer_api_error; + wire [7 : 0] mixer_debug; + reg mixer_debug_update; wire csprng_more_seed; wire csprng_seed_ack; @@ -126,6 +128,8 @@ module trng( reg csprng_api_we; wire [31 : 0] csprng_api_read_data; wire csprng_api_error; + wire [7 : 0] csprng_debug; + reg csprng_debug_update; wire entropy0_entropy_enabled; wire [31 : 0] entropy0_entropy_data; @@ -214,7 +218,10 @@ module trng( .seed_data(mixer_seed_data), .seed_syn(mixer_seed_syn), - .seed_ack(csprng_seed_ack) + .seed_ack(csprng_seed_ack), + + .debug(mixer_debug), + .debug_update(mixer_debug_update) ); trng_csprng csprng( @@ -235,7 +242,10 @@ module trng( .seed_data(mixer_seed_data), .seed_syn(mixer_seed_syn), - .seed_ack(csprng_seed_ack) + .seed_ack(csprng_seed_ack), + + .debug(csprng_debug), + .debug_update(csprng_debug_update) ); avalanche_entropy entropy1( @@ -328,6 +338,8 @@ module trng( begin : debug_mux entropy1_debug_update = 0; entropy2_debug_update = 0; + mixer_debug_update = 0; + csprng_debug_update = 0; tmp_debug = 8'h00; @@ -344,6 +356,18 @@ module trng( tmp_debug = entropy2_debug; end + DEBUG_MIXER: + begin + mixer_debug_update = debug_update; + tmp_debug = mixer_debug; + end + + DEBUG_CSPRNG: + begin + csprng_debug_update = debug_update; + tmp_debug = csprng_debug; + end + default: begin |