如何修复Xilinx Xst 1710警告

时间:2018-04-24 03:41:13

标签: verilog fpga xilinx

当我尝试在xilinx 14.3上合成时,我在verilog代码中发出此警告。它们来自这部分代码:

module Output_calc_debug(
 input clk,
input wire signed [0:7]oc_in,
input [0:2]pid,
output reg signed[0:31]oc_out_1d);
/***code***/
    reg signed[0:1]  L,W,S;  //lines name from output calculator
                    parameter N=2'd0, E=2'd3;
    if(pid==3'd0) // if port=0(North) then this port only can send data to other ports
            begin
            W<=2'd0; S<=2'd1; L<=2'd2; //assigning indecies to assosiated port directions
            end
            else if(pid==3'd1)
            begin
                  S<=2'd1; L<=2'd2;W<=-2'd1;
            end
            else if(pid==3'd2)
            begin
                 W<=2'd1; L<=2'd2;S<=-2'd1;
            end
            else if(pid==3'd3)
            begin
                 W<=2'd1; S<=2'd2;L<=-2'd1;
            end
            else if(pid==3'd4)
            begin
                  W<=2'd1; S<=2'd2; L<=2'd3;
            end
            else
            begin
            W<=-2'd1;L<=-2'd1;S<=-2'd1;
            end
/**code***/

在另一个名为Port_Debug的模块中实例化此模块的代码:

module Port_Debug(
output signed [0:31]oc_out_1d 
,input wire signed [0:31]sc_in_1d 
,input wire signed[0:7]main_in
,output wire signed[0:7]main_out 
,input clk,input [0:2]pid 
);

wire  signed[0:7]inport_out1; 

inport_debug i1(clk,main_in,inport_out1); 
Output_calc_debug oc1(clk,inport_out1,pid,oc_out_1d);  //module output_calc object in port
Scheduler_Debug s1(clk,sc_in_1d,main_out); 

endmodule

注意: 此模块Port_Debug在另一个模块中实例化了五次

警告说:

  

警告:Xst:1710 - FF / Latch&lt; L_1&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为0。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_0&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为1。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_1&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为0。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_0&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为1。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_1&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为0。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_0&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为1。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_1&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为1。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; W_0&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为0。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; L_1&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为1。这个FF / Latch将被修剪   在优化过程中。

     

警告:Xst:1710 - FF / Latch&lt; W_0&gt; (没有init值)有一个   块&lt; oc1&gt;中的常量值为0。这个FF / Latch将被修剪   在优化过程中。

我在谷歌和其他论坛上搜索过,但似乎没有可能的解决方案来删除它,人们一直建议忽略它,这是不想要的。

1 个答案:

答案 0 :(得分:0)

该错误可能来自您的代码。例如如果您的pid是常量或不能具有所有可能的值,则派生值也是常量。

同样修复代码,索引从高到低:wire signed[7:0]在一个字节中,LS位是位0而不是位7.

  

......请解释......

示例:

wire [1:0] sel;
...
   case(sel)
   2'b00 : examp = 4'h0001;
   2'b01 : examp = 4'h0010;
   2'b10 : examp = 4'h0100;
   2'b11 : examp = 4'h1000;
   endcase

如果sel仅取值00和01,则value将仅为0001或0010.在这种情况下,值[3]和值[2]将优化为零。

sel只取两个值可能有很多原因,其中一些可能是你身边的错误。综合工具非常聪明,它发现了这些并相应地优化了所有代码。

最终的例子是一个非常大的设计,带有一个串行输出。如果没有连接输出(例如输入错误),整个设计将被优化掉,最终会变空。