首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FF/舱口修整

FF/舱口修整
EN

Stack Overflow用户
提问于 2014-09-09 16:51:45
回答 1查看 1.2K关注 0票数 0

以下是我的Verilog代码的一部分:

代码语言:javascript
复制
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中运行时,13.1在行为模拟中,它工作得非常好,但是在翻译后的模拟中,ISE会生成警告:

代码语言:javascript
复制
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>.

由于这些修剪,除了通道之外,所有通道的输出数据都为零。输入数据不断变化,因此通道不应该是常量,也不应该被裁剪。有谁能给我解释一下这个代码有什么问题吗?

使用(* KEEP = "TRUE" *)(* KEEP_HIERARCHY = "TRUE" *)不起作用。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-12 06:17:43

顶替

代码语言:javascript
复制
tmp[scounter_samp][scounter_bits] <= !input_data[8];

使用

代码语言:javascript
复制
case(scounter_samp)
    0: tmp[0][scounter_bits] <= !input_data[8];
    1: tmp[1][scounter_bits] <= !input_data[8];
    2: tmp[2][scounter_bits] <= !input_data[8];
    3: tmp[3][scounter_bits] <= !input_data[8];
    4: tmp[4][scounter_bits] <= !input_data[8];
    5: tmp[5][scounter_bits] <= !input_data[8];
    6: tmp[6][scounter_bits] <= !input_data[8];
    7: tmp[7][scounter_bits] <= !input_data[8];
endcase

解决了问题,但我不知道为什么。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25750049

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档