Skip to content

Commit

Permalink
Set initial state of all k6n10f DSP registers to zero.
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
  • Loading branch information
mkurc-ant committed Mar 29, 2022
1 parent 2cc5ef0 commit 474b430
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 23 additions & 1 deletion ql-qlf-plugin/qlf_k6n10f/cells_sim.v
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,22 @@ module dsp_t1_sim # (
reg r_rnd;
reg [NBITS_ACC-1:0] acc;

initial begin
r_a <= 'h0;
r_b <= 'h0;

r_acc_fir <= 0;
r_unsigned_a <= 0;
r_unsigned_b <= 0;
r_feedback <= 0;
r_shift_d1 <= 0;
r_shift_d2 <= 0;
r_subtract <= 0;
r_load_acc <= 0;
r_sat <= 0;
r_rnd <= 0;
end

always @(posedge clock_i or negedge reset_n_i) begin
if (~reset_n_i) begin

Expand Down Expand Up @@ -1566,7 +1582,9 @@ module dsp_t1_sim # (

wire [NBITS_ACC-1:0] add_o = add_a + add_b;

// Accumulator
// Accumulator
initial acc <= 0;

always @(posedge clock_i or negedge reset_n_i)
if (~reset_n_i) acc <= 'h0;
else begin
Expand Down Expand Up @@ -1603,6 +1621,8 @@ module dsp_t1_sim # (
assign z0 = mult_xtnd[NBITS_Z-1:0];
assign z2 = acc_sat[NBITS_Z-1:0];

initial z1 <= 0;

always @(posedge clock_i or negedge reset_n_i)
if (!reset_n_i)
z1 <= 0;
Expand All @@ -1621,6 +1641,8 @@ module dsp_t1_sim # (
z1; // if output_select_i == 3'h7

// B input delayed passthrough
initial dly_b_o <= 0;

always @(posedge clock_i or negedge reset_n_i)
if (!reset_n_i)
dly_b_o <= 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module tb();

// Error detection
reg [37:0] r_C;
initial r_C <= 0;
always @(posedge clk)
r_C <= C;

Expand Down

0 comments on commit 474b430

Please sign in to comment.