File tree Expand file tree Collapse file tree
src/user_peripherals/trng Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ module tqvp_TRNG_20RO7FF_PC #(
2626 output [7 : 0 ] data_out // Data out from the peripheral, set this in accordance with the supplied address
2727);
2828
29- reg [SIZE_RO : 0 ] oscillator_ring [ N_RO ] = 0 ;
29+ reg [N_RO : 0 ][ SIZE_RO : 0 ] oscillator_ring = 0 ;
3030 reg [N_RO : 0 ] oscillator_ring_Q = 0 ;
3131
3232 reg [7 : 0 ] ro_data = 0 ;
@@ -40,22 +40,22 @@ module tqvp_TRNG_20RO7FF_PC #(
4040
4141 for (j = 0 ; j < N_RO ; j = j + 1 ) begin
4242 for (i = 1 ; i <= SIZE_RO ; i = i + 1 ) begin
43- [i] oscillator_ring[j] = ~ [ i- 1 ]oscillator_ring[j ];
43+ oscillator_ring[j][i] = ~ oscillator_ring[j][ i- 1 ];
4444 end
45- [ 0 ] oscillator_ring[j] = ~ [ SIZE_RO ] oscillator_ring[j];
45+ oscillator_ring[j][ 0 ] = ~ oscillator_ring[j][ SIZE_RO ];
4646 end
4747 end
4848
4949 always_ff @ (posedge clk) begin // sampling FF logic
5050 for (i = 0 ; i < N_RO ; i = i + 1 ) begin
51- oscillator_ring_Q[i] = [ SIZE_RO ] oscillator_ring[i]
51+ oscillator_ring_Q[i] = oscillator_ring[i][ SIZE_RO ];
5252 end
5353 end
5454
5555 always_comb @ (* ) begin // xor logic
56- xorA = oscillator_ring_Q[0 ] ^ oscillator_ring_Q[1 ]
56+ xorA = oscillator_ring_Q[0 ] ^ oscillator_ring_Q[1 ];
5757 for (i = 2 ; i < N_RO ; i = i + 1 ) begin
58- xorA = xorA ^ oscillator_ring_Q[i]
58+ xorA = xorA ^ oscillator_ring_Q[i];
5959 end
6060 end
6161
You can’t perform that action at this time.
0 commit comments