From b93eb8bf315a2edc75a28fdd86f400bcb27ff0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 26 Mar 2015 10:46:44 +0100 Subject: 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(-) (limited to 'src/rtl') 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 -- cgit v1.2.3