From 3e5ec06bd7779ee6546ffa4a921b5b8a0e1859fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Tue, 16 Sep 2014 17:18:46 +0200 Subject: Debug fixes found during simulation. Now the trng generates data and provides an api. --- src/rtl/trng.v | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/src/rtl/trng.v b/src/rtl/trng.v index f296ce5..0d6b7b0 100644 --- a/src/rtl/trng.v +++ b/src/rtl/trng.v @@ -1,4 +1,4 @@ -//====================================================================== + //====================================================================== // // trng.v // -------- @@ -50,6 +50,8 @@ module trng( output wire [31 : 0] read_data, output wire error, + output wire [7 : 0] debug, + output wire security_error ); @@ -163,10 +165,9 @@ module trng( wire [31 : 0] entropy2_data; wire entropy2_ack; - reg mixer_enable; + wire mixer_enable; wire [511 : 0] mixer_seed_data; wire mixer_seed_syn; - wire mixer_seed_ack; wire csprng_enable; wire csprng_debug_mode; @@ -174,6 +175,7 @@ module trng( wire [63 : 0] csprng_num_blocks; wire csprng_seed; wire csprng_more_seed; + wire csprng_seed_ack; wire csprng_ready; wire csprng_error; wire [31 : 0] csprng_rnd_data; @@ -189,6 +191,7 @@ module trng( assign read_data = tmp_read_data; assign error = tmp_error; assign security_error = 0; + assign debug = 0; assign csprng_num_blocks = {csprng_num_blocks_high_reg, csprng_num_blocks_low_reg}; @@ -197,6 +200,12 @@ module trng( assign entropy1_enable = entropy1_enable_reg; assign entropy2_enable = entropy2_enable_reg; + assign mixer_enable = enable_reg; + + assign csprng_enable = enable_reg; + assign csprng_seed = csprng_seed_reg; + assign csprng_debug_mode = 0; + //---------------------------------------------------------------- // core instantiations. @@ -225,7 +234,7 @@ module trng( .seed_data(mixer_seed_data), .seed_syn(mixer_seed_syn), - .seed_ack(mixer_seed_ack) + .seed_ack(csprng_seed_ack) ); trng_csprng csprng( @@ -265,22 +274,22 @@ module trng( .entropy_ack(entropy0_ack) ); - avalance_entropy entropy1( - .clk(clk), - .reset_n(reset_n), + avalance_entropy_core entropy1( + .clk(clk), + .reset_n(reset_n), - .enable(entropy1_enable), + .enable(entropy1_enable), - .noise(avalanche_noise), + .noise(avalanche_noise), - .raw_entropy(entropy1_raw), - .stats(entropy1_stats), + .raw_entropy(entropy1_raw), + .stats(entropy1_stats), - .enabled(entropy1_enabled), - .entropy_syn(entropy1_syn), - .entropy_data(entropy1_data), - .entropy_ack(entropy1_ack) - ); + .enabled(entropy1_enabled), + .entropy_syn(entropy1_syn), + .entropy_data(entropy1_data), + .entropy_ack(entropy1_ack) + ); ringosc_entropy entropy2( .clk(clk), -- cgit v1.2.3