[Cryptech-Commits] [test/external_avalanche_entropy] 01/02: Fixing synthesis warnings.

git at cryptech.is git at cryptech.is
Wed Aug 12 11:59:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch master
in repository test/external_avalanche_entropy.

commit 60572e981b333d407360bac64a6813586ac281b2
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Wed Aug 27 18:23:26 2014 +0200

    Fixing synthesis warnings.
---
 src/rtl/external_avalanche_entropy.v | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/rtl/external_avalanche_entropy.v b/src/rtl/external_avalanche_entropy.v
index 3f1c3f9..a5b6881 100644
--- a/src/rtl/external_avalanche_entropy.v
+++ b/src/rtl/external_avalanche_entropy.v
@@ -61,7 +61,8 @@ module external_avalanche_entropy(
                                   input wire           entropy_read,
                                   output wire          entropy_ready,
                                   output wire [31 : 0] entropy_data,
-                                  output wire [7 : 0]  debug
+                                  output wire [7 : 0]  debug,
+                                  output wire [7 : 0]  debug2
                                  );
 
 
@@ -149,6 +150,7 @@ module external_avalanche_entropy(
   assign entropy_ready = entropy_ready_reg;
   assign entropy_data  = entropy_reg;
   assign debug         = debug_reg;
+  assign debug2        = debug_reg;
 
   assign read_data     = tmp_read_data;
   assign error         = tmp_error;
@@ -189,7 +191,7 @@ module external_avalanche_entropy(
           entropy_ready_reg <= entropy_ready_new;
 
           cycle_ctr_reg     <= cycle_ctr_reg + 1'b1;
-          seconds_ctr_reg   <= cycle_ctr_reg + 1'b1;
+          seconds_ctr_reg   <= cycle_ctr_new;
           debug_ctr_reg     <= debug_ctr_new;
 
           if (bit_ctr_we)
@@ -318,16 +320,28 @@ module external_avalanche_entropy(
       negflank_ctr_new = 32'h00000000;
       negflank_ctr_we  = 1'b0;
 
+      if (posflank_ctr_rst)
+        begin
+          posflank_ctr_new = 32'h00000000;
+          posflank_ctr_we  = 1'b1;
+        end
+
+      if (negflank_ctr_rst)
+        begin
+          negflank_ctr_new = 32'h00000000;
+          negflank_ctr_we  = 1'b1;
+        end
+
       if ((flank0_reg) && (!flank1_reg))
         begin
           posflank_ctr_new = posflank_ctr_reg + 1'b1;
-          posflank_ctr_we  = 1'b0;
+          posflank_ctr_we  = 1'b1;
         end
 
       if ((!flank0_reg) && (flank1_reg))
         begin
           negflank_ctr_new = negflank_ctr_reg + 1'b1;
-          negflank_ctr_we  = 1'b0;
+          negflank_ctr_we  = 1'b1;
         end
     end // flank_counters
 
@@ -351,7 +365,7 @@ module external_avalanche_entropy(
 
       if (seconds_ctr_reg == SECONDS_RATE)
         begin
-          seconds_ctr_new = 32'h00000000;
+          seconds_ctr_new     = 32'h00000000;
           posflank_sample_new = posflank_ctr_reg;
           negflank_sample_new = negflank_ctr_reg;
           totflank_sample_new = posflank_ctr_reg + negflank_ctr_reg;



More information about the Commits mailing list