From 821471932eb48bb39a820fc6680355231e6093fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Sat, 27 Sep 2014 14:38:05 +0200 Subject: Adding debug port for mixer and csprng. In the csprng the debug_update will trigger fifo extraction and thus force random number generation. --- src/rtl/trng.v | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/rtl/trng.v') 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 -- cgit v1.2.3