[Cryptech-Commits] [staging/core/rng/trng] 11/30: Debug fixes found during simulation. Now the trng generates data and provides an api.
git at cryptech.is
git at cryptech.is
Tue Mar 17 13:19:00 UTC 2015
This is an automated email from the git hooks/post-receive script.
paul at psgd.org pushed a commit to branch master
in repository staging/core/rng/trng.
commit 3e5ec06bd7779ee6546ffa4a921b5b8a0e1859fb
Author: Joachim Strömbergson <joachim at secworks.se>
Date: Tue Sep 16 17:18:46 2014 +0200
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),
More information about the Commits
mailing list