Skip to content

Commit

Permalink
Cast 0 reset values to data type
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-platzer committed Aug 26, 2024
1 parent c27bce3 commit 26ab10e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/cdc_2phase.sv
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ module cdc_2phase_src #(
always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) begin
req_src_q <= 0;
data_src_q <= '0;
data_src_q <= T'('0);
end else if (valid_i && ready_o) begin
req_src_q <= ~req_src_q;
data_src_q <= data_i;
Expand Down Expand Up @@ -171,7 +171,7 @@ module cdc_2phase_dst #(
// indicated by the async_req line changing levels.
always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) begin
data_dst_q <= '0;
data_dst_q <= T'('0);
end else if (req_q0 != req_q1 && !valid_o) begin
data_dst_q <= async_data_i;
end
Expand Down
2 changes: 1 addition & 1 deletion src/cdc_fifo_2phase.sv
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module cdc_fifo_2phase #(
for (genvar i = 0; i < 2**LOG_DEPTH; i++) begin : g_word
always_ff @(posedge src_clk_i, negedge src_rst_ni) begin
if (!src_rst_ni)
fifo_data_q[i] <= '0;
fifo_data_q[i] <= T'('0);
else if (fifo_write && fifo_widx == i)
fifo_data_q[i] <= fifo_wdata;
end
Expand Down
2 changes: 1 addition & 1 deletion src/fifo_v3.sv
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module fifo_v3 #(

always_ff @(posedge clk_i or negedge rst_ni) begin
if(~rst_ni) begin
mem_q <= '0;
mem_q <= {FifoDepth{dtype'('0)}};
end else if (!gate_clock) begin
mem_q <= mem_n;
end
Expand Down
2 changes: 1 addition & 1 deletion src/lossy_valid_to_stream.sv
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module lossy_valid_to_stream #(
read_ptr_q <= '0;
write_ptr_q <= '0;
pending_tx_counter_q <= '0;
mem_q <= '0;
mem_q <= {2{T'('0)}};
end else begin
read_ptr_q <= read_ptr_d;
write_ptr_q <= write_ptr_d;
Expand Down
2 changes: 1 addition & 1 deletion src/shift_reg_gated.sv
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module shift_reg_gated #(

// Gate each shift register with a valid flag to enable the synthsis tools to insert ICG for
// better power comsumption.
`FFL(data_q[i], data_d[i], valid_d[i], '0, clk_i, rst_ni)
`FFL(data_q[i], data_d[i], valid_d[i], dtype'('0), clk_i, rst_ni)
end

// Output the shifted result.
Expand Down
4 changes: 2 additions & 2 deletions src/spill_register_flushable.sv
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module spill_register_flushable #(

always_ff @(posedge clk_i or negedge rst_ni) begin : ps_a_data
if (!rst_ni)
a_data_q <= '0;
a_data_q <= T'('0);
else if (a_fill)
a_data_q <= data_i;
end
Expand All @@ -60,7 +60,7 @@ module spill_register_flushable #(

always_ff @(posedge clk_i or negedge rst_ni) begin : ps_b_data
if (!rst_ni)
b_data_q <= '0;
b_data_q <= T'('0);
else if (b_fill)
b_data_q <= a_data_q;
end
Expand Down
4 changes: 2 additions & 2 deletions src/stream_register.sv
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module stream_register #(
assign ready_o = ready_i | ~valid_o;
assign reg_ena = valid_i & ready_o;
// Load-enable FFs with synch clear
`FFLARNC(valid_o, valid_i, ready_o, clr_i, 1'b0, clk_i, rst_ni)
`FFLARNC(data_o, data_i, reg_ena, clr_i, '0, clk_i, rst_ni)
`FFLARNC(valid_o, valid_i, ready_o, clr_i, 1'b0 , clk_i, rst_ni)
`FFLARNC(data_o, data_i, reg_ena, clr_i, T'('0), clk_i, rst_ni)

endmodule

0 comments on commit 26ab10e

Please sign in to comment.