[Cryptech-Commits] [core/rng/rosc_entropy] 01/01: Changed fromm hard coded oscillator adder width to localparam and updated operand sizes used. Changed to localparams for parameters since they don't need to be exposed outside the module. Updated the oscillator array instantiation to reflect what is done.

git at cryptech.is git at cryptech.is
Thu Mar 26 09:46:49 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 core/rng/rosc_entropy.

commit b93eb8bf315a2edc75a28fdd86f400bcb27ff0a1
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Thu Mar 26 10:46:44 2015 +0100

    Changed fromm hard coded oscillator adder width to localparam and updated operand sizes used. Changed to localparams for parameters since they don't need to be exposed outside the module. Updated the oscillator array instantiation to reflect what is done.
---
 src/rtl/rosc_entropy_core.v | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/rtl/rosc_entropy_core.v b/src/rtl/rosc_entropy_core.v
index eb9dd6e..cd70f8a 100644
--- a/src/rtl/rosc_entropy_core.v
+++ b/src/rtl/rosc_entropy_core.v
@@ -60,9 +60,10 @@ module rosc_entropy_core(
   //----------------------------------------------------------------
   // Parameters.
   //----------------------------------------------------------------
-  parameter DEBUG_DELAY       = 32'h002c4b40;
-  parameter NUM_SHIFT_BITS    = 8'h20;
-  parameter SAMPLE_CLK_CYCLES = 8'hff;
+  localparam ADDER_WIDTH       = 1;
+  localparam DEBUG_DELAY       = 32'h002c4b40;
+  localparam NUM_SHIFT_BITS    = 8'h20;
+  localparam SAMPLE_CLK_CYCLES = 8'hff;
 
 
   //----------------------------------------------------------------
@@ -123,18 +124,20 @@ module rosc_entropy_core(
   //----------------------------------------------------------------
   // module instantiations.
   //
-  // 32 1-bit wide oscillators. We want them to run as fast as
-  // possible to maximize differences over time.
+  // 32 oscillators each ADDER_WIDTH wide. We want them to run
+  // as fast as possible to maximize differences over time.
+  // We also only sample the oscillators SAMPLE_CLK_CYCLES number
+  // of cycles.
   //----------------------------------------------------------------
   genvar i;
   generate
     for(i = 0 ; i < 32 ; i = i + 1)
       begin: oscillators
-        rosc #(.WIDTH(1)) rosc_array(.clk(clk),
+        rosc #(.WIDTH(ADDER_WIDTH)) rosc_array(.clk(clk),
                                      .we(rosc_we),
                                      .reset_n(reset_n),
-                                     .opa(opa),
-                                     .opb(opb),
+                                     .opa(opa[(ADDER_WIDTH - 1) : 0]),
+                                     .opb(opb[(ADDER_WIDTH - 1) : 0]),
                                      .dout(rosc_dout[i])
                                     );
       end



More information about the Commits mailing list