2013-04-22 46 views
0

我想爲rsa cryptosystem做一個verilog代碼模塊的基本結構就像下面顯示的代碼一樣。如何防止邏輯修整

Althogh代碼工作在模擬精細它給出了警告:

Xst:1710 - FF/Latch <out_en> (without init value) has a constant value of 1 in block <o1>. This FF/Latch will be trimmed during the optimization process. 
and Xst:1895 - Due to other FF/Latch trimming, FF/Latch <aa_1> (without init value) has a constant value of 0 in block <test1>. This FF/Latch will be trimmed during the optimization process. 

我使用的賽靈思ISE 13.1。

請幫我

module okletssee(
input en, 

input clk, 

input[2:0] a,b, 

output reg[2:0] c, 

output reg out_en 
    ); 

always @(posedge clk) 

begin 

if(en==1'b1) 
begin 

c=a+b; 

out_en=1'b1; 

end 

else out_en=1'b0; 

end 

endmodule 

module test1(

input[2:0] a,b, 

input clk, 

output reg[2:0] out_reg 
    ); 


wire[2:0] cc; 

    wire out1_en; 

    reg[2:0] aa,bb; 

    reg en; 

okletssee o1(en,clk,aa,bb,cc,out1_en); 

reg cse; 

always @(posedge clk) 

begin 

case(cse) 

default: begin 

     aa=a; 

     bb=b; 

     en=1'b1; 

     cse=1'b1; 

     end 

1'b1: begin 

     if(out1_en==1'b1) 

     out_reg=cc; 

     else cse=1'b1; 

     end 

endcase 

end 


endmodule 

回答

1

好吧......你的代碼是真窮。邏輯完全搞砸了;沒有辦法模擬「好」。你的第一個明顯的問題是,test1.en實際上高舉,所以是多餘的。這正是你的合成器告訴你的。

+0

這不是我的原始代碼。這實際上是我的代碼的簡化格式。我通過簡單的復位就擺脫了錯誤。不管怎麼說,還是要謝謝你。 – 2013-04-23 13:44:48

0

如果你不想輸出被修剪,你應該以某種方式使用它。例如在另一個模塊或作爲輸出引腳。