aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-03-26 10:46:44 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-03-26 10:46:44 +0100
commitb93eb8bf315a2edc75a28fdd86f400bcb27ff0a1 (patch)
tree5d09949016b1cc710cf771ff42af7e80bacefd31 /src
parentcbd0a6984725964e26ecc0dccd0fbd17e79dca84 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/rtl/rosc_entropy_core.v19
1 files 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