FPGA: Specify the bit width to comply with the [IEEE 1364] standard to resolve synthesis tool warnings.

This commit is contained in:
dxl committed 2026-10-09 11:33:10 +08:00
1 parent b36b61feb0
commit 52e4f6ba92
9 files changed
+31 -31

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ module clk_divider(
div_cnt_ <= 8'd0;
div_clk_ = !div_clk_;
end else
div_cnt_ <= div_cnt_ + 1;
div_cnt_ <= div_cnt_ + 1'b1;
end
endmodule
+8 -8
View File
@@ -105,7 +105,7 @@ reg zero = 1'b0; // Manchester first halfbit low second high corresponds to this
reg [8:0] ssp_cnt = 9'd0;
always @(posedge adc_clk)
ssp_cnt <= (ssp_cnt + 1);
ssp_cnt <= (ssp_cnt + 1'b1);
//maybe change it so that ARM sends preamble as well.
//then: ready bits sent to ARM, 8 bits sent from ARM (all ones), then preamble (all zeros, presumably) - which starts modulation
@@ -169,7 +169,7 @@ begin
if (power)
bit_counts <= 0;
else
bit_counts <= bit_counts + 1;
bit_counts <= bit_counts + 1'b1;
end
else
begin
@@ -179,7 +179,7 @@ begin
end
else
begin
fccount <= fccount + 1;
fccount <= fccount + 1'b1;
end
end
@@ -271,7 +271,7 @@ begin
mid <= 8'd128;
end
else
tsinceedge <= (tsinceedge + 1);
tsinceedge <= (tsinceedge + 1'b1);
end
end
@@ -320,18 +320,18 @@ begin
begin
// minimum-maximum calc
if(adc_d > curmaxthres)
mid <= mid + 1;
mid <= mid + 1'b1;
else if (adc_d < curminthres)
mid <= mid - 1;
mid <= mid - 1'b1;
else
begin
if (after_hysteresis)
begin
mid <= mid + 1;
mid <= mid + 1'b1;
end
else
begin
mid <= mid - 1;
mid <= mid - 1'b1;
end
end
end
+4 -4
View File
@@ -29,7 +29,7 @@ module hi_get_trace(
reg [6:0] clock_cnt;
always @(negedge ck_1356megb)
begin
clock_cnt <= clock_cnt + 1;
clock_cnt <= clock_cnt + 1'b1;
end
// sample at 13,56MHz / 8. The highest signal frequency (subcarrier) is 848,5kHz, i.e. in this case we oversample by a factor of 2
@@ -39,7 +39,7 @@ begin
if (sample_clock == 3'd7)
sample_clock <= 3'd0;
else
sample_clock <= sample_clock + 1;
sample_clock <= sample_clock + 1'b1;
end
@@ -62,7 +62,7 @@ begin
if (addr == 12'd3071)
addr <= 12'd0;
else
addr <= addr + 1;
addr <= addr + 1'b1;
end
end
else if (major_mode != `FPGA_MAJOR_MODE_OFF)
@@ -89,7 +89,7 @@ begin
end
else
begin
addr <= addr + 1;
addr <= addr + 1'b1;
end
end
end
+10 -10
View File
@@ -70,7 +70,7 @@ begin
end
else
begin
has_been_low_for <= has_been_low_for + 1;
has_been_low_for <= has_been_low_for + 1'b1;
end
end
@@ -94,7 +94,7 @@ begin
saw_deep_modulation <= 8'd0;
end
else
deep_counter <= deep_counter + 1;
deep_counter <= deep_counter + 1'b1;
end
else
begin
@@ -102,7 +102,7 @@ begin
if(saw_deep_modulation == 8'd255) // adc_d != 0 for 256 adc_clk ticks -> deep_modulation is over, probably waiting for tag's response
deep_modulation <= 1'b0;
else
saw_deep_modulation <= saw_deep_modulation + 1;
saw_deep_modulation <= saw_deep_modulation + 1'b1;
end
end
@@ -153,7 +153,7 @@ begin
begin
if (reader_falling_edge_time == 4'd1) // reader signal changes right after sampling. Better sample earlier next time.
begin
negedge_cnt <= negedge_cnt + 2; // time warp
negedge_cnt <= negedge_cnt + 2'd2; // time warp
end
else if (reader_falling_edge_time == 4'd0) // reader signal changes right before sampling. Better sample later next time.
begin
@@ -161,7 +161,7 @@ begin
end
else
begin
negedge_cnt <= negedge_cnt + 1; // Continue as usual
negedge_cnt <= negedge_cnt + 1'b1; // Continue as usual
end
reader_falling_edge_time[3:0] <= 4'd8; // adjust only once per detected edge
end
@@ -171,7 +171,7 @@ begin
end
else
begin
negedge_cnt <= negedge_cnt + 1;
negedge_cnt <= negedge_cnt + 1'b1;
end
end
@@ -341,12 +341,12 @@ begin
end
else
begin
sub_carrier_cnt <= sub_carrier_cnt + 1;
sub_carrier_cnt <= sub_carrier_cnt + 1'b1;
end
end
else
begin
fdt_counter <= fdt_counter + 1;
fdt_counter <= fdt_counter + 1'b1;
end
end
@@ -407,7 +407,7 @@ begin
if (mod_sig_ptr == 5'd31)
mod_sig_ptr <= 5'd0; // buffer overflow - data loss.
else
mod_sig_ptr <= mod_sig_ptr + 1; // increase buffer (= increase delay by 16 adc_clk ticks). mod_sig_ptr always points ahead of first 1.
mod_sig_ptr <= mod_sig_ptr + 1'b1; // increase buffer (= increase delay by 16 adc_clk ticks). mod_sig_ptr always points ahead of first 1.
else if(fdt_elapsed && ~temp_buffer_reset)
begin
// wait for the next 1 after fdt_elapsed before fixing the delay and starting modulation. This ensures that the response can only happen
@@ -417,7 +417,7 @@ begin
if(mod_sig_ptr == 5'd1)
mod_sig_ptr <= 5'd8; // still nothing received, need to go for the next interval
else
mod_sig_ptr <= mod_sig_ptr - 1; // decrease buffer.
mod_sig_ptr <= mod_sig_ptr - 1'b1; // decrease buffer.
end
end
end
+3 -3
View File
@@ -64,7 +64,7 @@ begin
after_hysteresis <= 1'b1;
end
else
has_been_low_for <= has_been_low_for + 1;
has_been_low_for <= has_been_low_for + 1'b1;
end
end
@@ -75,7 +75,7 @@ end
// We need a 6-bit counter for the timing.
reg [5:0] corr_i_cnt;
always @(negedge adc_clk)
corr_i_cnt <= corr_i_cnt + 1;
corr_i_cnt <= corr_i_cnt + 1'b1;
`ifdef WITH_HF_15
reg [1:0] fskout = 2'd0;
@@ -405,7 +405,7 @@ always @(negedge adc_clk)
begin
if (corr_i_cnt == 6'd0)
begin
jam_counter <= jam_counter + 1;
jam_counter <= jam_counter + 1'b1;
jam_signal <= jam_counter[1] ^ jam_counter[3];
end
end
+2 -2
View File
@@ -83,7 +83,7 @@ begin
end
else
begin
has_been_low_for <= has_been_low_for + 1;
has_been_low_for <= has_been_low_for + 1'b1;
end
end
end
@@ -93,7 +93,7 @@ end
reg [8:0] ssp_clk_divider;
always @(negedge adc_clk)
ssp_clk_divider <= (ssp_clk_divider + 1);
ssp_clk_divider <= (ssp_clk_divider + 1'b1);
always @(negedge adc_clk)
begin
+1 -1
View File
@@ -48,7 +48,7 @@ assign ssp_din = adc_d_out[0];
always @(posedge ssp_clk)
begin
ssp_cnt <= ssp_cnt + 1;
ssp_cnt <= ssp_cnt + 1'b1;
if(ssp_cnt[2:0] == 3'b000) // set frame length
begin
+1 -1
View File
@@ -84,7 +84,7 @@ begin
end
else
begin
pck_divider <= pck_divider + 1;
pck_divider <= pck_divider + 1'd1; // Increments by 1 on each rising edge of sspclk.
end
end
+1 -1
View File
@@ -72,7 +72,7 @@ module lp20khz_1MSa_iir_filter(
// We could use 9bit x registers for that, but that would be
// a waste, let's just add the constant during the computation
// (x0+109) + 2*(x1+109) + (x2+109) = x0 + 2*x1 + x2 + 436
x0 + {x1, 1'b0} + adc_d + 436
x0 + {x1, 1'b0} + adc_d + 14'd436
// we want "- y0 * 0xd6 / 0x100" using only shift and add
// 0xd6 == 0b11010110
// so *0xd6/0x100 is equivalent to