这是我的 Verilog 代码的一部分:
reg [5:0] channel[0:7];
reg [5:0] tmp[0:7];
reg [2:0] counter_out;
reg [2:0] scounter_samp;
reg [2:0] scounter_bits;
...
always @(posedge clk, posedge rst) begin
if(rst) begin
done <= 1'b0;
counter_out <= 7;
scounter_samp <= 0;
scounter_bits <= 0;
tmp[0] <= 6'b0;
tmp[1] <= 6'b0;
...
channel[0] <= 6'b0;
...
end
else begin
...
if(done==1'b1) begin
data_out <= channel[counter_out];
counter_out <= counter_out-1;
if(counter_out==0) begin
done <= 1'b0;
counter_out <= 7;
end
end
tmp[scounter_samp][scounter_bits] <= !input_data[8];
scounter_samp <= scounter_samp + 1;
if(scounter_samp==7) begin
scounter_samp <= 0;
scounter_bits <= scounter_bits + 1;
if(scounter_bits==5) begin
done <= 1'b1;
scounter_bits <= 0;
channel[0] <= {tmp[0][5:1],!input_data[8]};
channel[1] <= tmp[1];
channel[2] <= tmp[2];
channel[3] <= tmp[3];
channel[4] <= tmp[4];
channel[5] <= tmp[5];
channel[6] <= tmp[6];
channel[7] <= tmp[7];
end
end
...
end
这是我的问题:当我在 Xilinx ISE 13.1 的行为仿真中运行它时,它工作得非常好,但在翻译后仿真中,ISE 会生成警告:
WARNING:Xst:1710 - FF/Latch <channel_0_1> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_0_2> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_0_3> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_0_4> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_0_5> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_1_0> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_1_1> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_1_2> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <channel_1_3> (without init value) has a constant value of 0 in block <adc_ctr>. This FF/Latch will be trimmed during the optimization process.
...
WARNING:Xst:2404 - FFs/Latches <channel_0<5:1>> (without init value) have a constant value of 0 in block <adc_ctr>.
WARNING:Xst:2404 - FFs/Latches <channel_1<5:0>> (without init value) have a constant value of 0 in block <adc_ctr>.
并且由于这些修整,除通道 [0] [0] 之外的所有通道的输出数据都为零。输入数据不断变化,因此通道不应该是恒定的,也不应该被修剪。有人可以向我解释这段代码有什么问题吗?
使用(* KEEP = "TRUE" *)
和(* KEEP_HIERARCHY = "TRUE" *)
不起作用。