2014-11-03 47 views
0

我在做一個ROM和代碼是完全合成和工作正常,但顯示爲嚴重警告,當我運行實施時顯示「[地方30-494]設計是空的」我看了xillinx網站但沒有解決這個錯誤。我會告訴我的代碼在這裏希望你們幫幫我:在執行過程中的錯誤

`timescale 1ns/1ps 
 
module ROM(output [7:0] LED, [4:0] Ao, input [7:0] D, [4:0] A, Clear, Load); 
 
reg [7:0] Store [0:31]; 
 

 
initial 
 
    begin      
 

 
    Store[0]<=4'b00000000; 
 
    Store[1]<=4'b00000000; 
 
    Store[2]<=4'b00000000; 
 
    Store[3]<=4'b00000000; 
 
    Store[4]<=4'b00000000; 
 
    Store[5]<=4'b00000000; 
 
    Store[6]<=4'b00000000; 
 
    Store[7]<=4'b00000000; 
 
    Store[8]<=4'b00000000; 
 
    Store[9]<=4'b00000000; 
 
    Store[10]<=4'b00000000; 
 
    Store[11]<=4'b00000000; 
 
    Store[12]<=4'b00000000; 
 
    Store[13]<=4'b00000000; 
 
    Store[14]<=4'b00000000; 
 
    Store[15]<=4'b00000000; 
 
    Store[16]<=4'b00000000; 
 
    Store[17]<=4'b00000000; 
 
    Store[18]<=4'b00000000; 
 
    Store[19]<=4'b00000000; 
 
    Store[20]<=4'b00000000; 
 
    Store[21]<=4'b00000000; 
 
    Store[22]<=4'b00000000; 
 
    Store[23]<=4'b00000000; 
 
    Store[24]<=4'b00000000; 
 
    Store[25]<=4'b00000000; 
 
    Store[26]<=4'b00000000; 
 
    Store[27]<=4'b00000000; 
 
    Store[28]<=4'b00000000; 
 
    Store[29]<=4'b00000000; 
 
    Store[30]<=4'b00000000; 
 
    Store[31]<=4'b00000000; 
 
    end 
 
always @(*) 
 
begin 
 
    if(Load) 
 
    if (D[7:0]) 
 
    begin 
 
     Store[0]<= LED; 
 
     Store[1]<= LED; 
 
     Store[2]<= LED; 
 
     Store[3]<= LED; 
 
     Store[4]<= LED; 
 
     Store[5]<= LED; 
 
     Store[6]<= LED; 
 
     Store[7]<= LED; 
 
     Store[8]<= LED; 
 
     Store[9]<= LED; 
 
     Store[10]<= LED; 
 
     Store[11]<= LED; 
 
     Store[12]<= LED; 
 
     Store[13]<= LED; 
 
     Store[14]<= LED; 
 
     Store[15]<= LED; 
 
     Store[16]<= LED; 
 
     Store[17]<= LED; 
 
     Store[18]<= LED; 
 
     Store[19]<= LED; 
 
     Store[20]<= LED; 
 
     Store[21]<= LED; 
 
     Store[22]<= LED; 
 
     Store[23]<= LED; 
 
     Store[24]<= LED; 
 
     Store[25]<= LED; 
 
     Store[26]<= LED; 
 
     Store[27]<= LED; 
 
     Store[28]<= LED; 
 
     Store[29]<= LED; 
 
     Store[30]<= LED; 
 
     Store[31]<= LED; 
 
    end 
 
    
 
    else if(A[4:0]) 
 
    begin 
 
    Store[0]<= Ao; 
 
    Store[1]<= Ao; 
 
    Store[2]<= Ao; 
 
    Store[3]<= Ao; 
 
    Store[4]<= Ao; 
 
    Store[5]<= Ao; 
 
    Store[6]<= Ao; 
 
    Store[7]<= Ao; 
 
    Store[8]<= Ao; 
 
    Store[9]<= Ao; 
 
    Store[10]<= Ao; 
 
    Store[11]<= Ao; 
 
    Store[12]<= Ao; 
 
    Store[13]<= Ao; 
 
    Store[14]<= Ao; 
 
    Store[15]<= Ao; 
 
    Store[16]<= Ao; 
 
    Store[17]<= Ao; 
 
    Store[18]<= Ao; 
 
    Store[19]<= Ao; 
 
    Store[20]<= Ao; 
 
    Store[21]<= Ao; 
 
    Store[22]<= Ao; 
 
    Store[23]<= Ao; 
 
    Store[24]<= Ao; 
 
    Store[25]<= Ao; 
 
    Store[26]<= Ao; 
 
    Store[27]<= Ao; 
 
    Store[28]<= Ao; 
 
    Store[29]<= Ao; 
 
    Store[30]<= Ao; 
 
    Store[31]<= Ao; 
 
    end 
 
    
 
    else if (Clear) 
 
    begin 
 
    Store[0]<=4'b00000000; 
 
    Store[1]<=4'b00000000; 
 
    Store[2]<=4'b00000000; 
 
    Store[3]<=4'b00000000; 
 
    Store[4]<=4'b00000000; 
 
    Store[5]<=4'b00000000; 
 
    Store[6]<=4'b00000000; 
 
    Store[7]<=4'b00000000; 
 
    Store[8]<=4'b00000000; 
 
    Store[9]<=4'b00000000; 
 
    Store[10]<=4'b00000000; 
 
    Store[11]<=4'b00000000; 
 
    Store[12]<=4'b00000000; 
 
    Store[13]<=4'b00000000; 
 
    Store[14]<=4'b00000000; 
 
    Store[15]<=4'b00000000; 
 
    Store[16]<=4'b00000000; 
 
    Store[17]<=4'b00000000; 
 
    Store[18]<=4'b00000000; 
 
    Store[19]<=4'b00000000; 
 
    Store[20]<=4'b00000000; 
 
    Store[21]<=4'b00000000; 
 
    Store[22]<=4'b00000000; 
 
    Store[23]<=4'b00000000; 
 
    Store[24]<=4'b00000000; 
 
    Store[25]<=4'b00000000; 
 
    Store[26]<=4'b00000000; 
 
    Store[27]<=4'b00000000; 
 
    Store[28]<=4'b00000000; 
 
    Store[29]<=4'b00000000; 
 
    Store[30]<=4'b00000000; 
 
    Store[31]<=4'b00000000; 
 
    end 
 
end 
 
endmodule

臨界警告

[通用17-69]命令失敗:網站不能分配給更多的則一個端口

+0

您是否嘗試在'initial'塊中切換您的任務以阻止assig nments('=')而不是非阻塞('<=')?在這種情況下,阻塞更好,因爲它是第一次初始化(其他地方正確使用非阻塞賦值給您的順序元素,即RAM)。 – Unn 2014-11-03 16:12:02

+0

是的,我做了它不會合成我不知道它爲什麼這樣做,但謝謝 – Sultan 2014-11-04 06:05:16

回答

1

看來,你的輸出(LED和AO)作爲輸入代碼:

... 
Store[15]<= LED; 
... 
Store[7]<= Ao; 
... 

它應該是:

... 
LED <= Store[15]; 
... 
Ao <= Store[7]; 
... 

如果你的輸出絕不驅動,該工具將根本就沒有既不用模塊也沒有信號。

+0

哦,你是對的。我只是改變了整個事物,並將其保存爲Store [A] <= D;爲負載和<= 8'b00000000清除和它的工作 – Sultan 2014-11-04 06:09:56

0

後,我之前做過的賦值一些變化總是阻止我改變了整個always塊:

這裏是我做過什麼,感謝給@grorel:

`timescale 1ns/1ps 
 
module ROM(output [7:0] LED, [4:0] Ao, input [7:0] D, [4:0] A, input Clear, input Load); 
 
reg [7:0] Store [0:31]; 
 
assign Ao = A; 
 
assign LED = Store[A]; 
 
initial 
 
    begin  
 

 
    Store[0]<=8'b00000000; 
 
    Store[1]<=8'b00000000; 
 
    Store[2]<=8'b00000000; 
 
    Store[3]<=8'b00000000; 
 
    Store[4]<=8'b00000000; 
 
    Store[5]<=8'b00000000; 
 
    Store[6]<=8'b00000000; 
 
    Store[7]<=8'b00000000; 
 
    Store[8]<=8'b00000000; 
 
    Store[9]<=8'b00000000; 
 
    Store[10]<=8'b00000000; 
 
    Store[11]<=8'b00000000; 
 
    Store[12]<=8'b00000000; 
 
    Store[13]<=8'b00000000; 
 
    Store[14]<=8'b00000000; 
 
    Store[15]<=8'b00000000; 
 
    Store[16]<=8'b00000000; 
 
    Store[17]<=8'b00000000; 
 
    Store[18]<=8'b00000000; 
 
    Store[19]<=8'b00000000; 
 
    Store[20]<=8'b00000000; 
 
    Store[21]<=8'b00000000; 
 
    Store[22]<=8'b00000000; 
 
    Store[23]<=8'b00000000; 
 
    Store[24]<=8'b00000000; 
 
    Store[25]<=8'b00000000; 
 
    Store[26]<=8'b00000000; 
 
    Store[27]<=8'b00000000; 
 
    Store[28]<=8'b00000000; 
 
    Store[29]<=8'b00000000; 
 
    Store[30]<=8'b00000000; 
 
    Store[31]<=8'b00000000; 
 
    end 
 
always @(*) 
 
begin 
 
    if (Load) 
 
    begin 
 
     Store[A]<= D; 
 
    end 
 
    
 
    else if (Clear) 
 
    begin 
 
    Store[A]<= 8'b00000000; 
 
    end 
 
    
 
end 
 
endmodule

也應該是最初的8位不是4位