Xilinx Verilog 硬件仿真 warning
这是我程序的一个子函数,在Implementation下做语法检查的时候出现Warning:WARNING:Xst:905-"register.v"line45:Oneo...
这是我程序的一个子函数,在Implementation下做语法检查的时候出现Warning:
WARNING:Xst:905 - "register.v" line 45: One or more signals are missing in the sensitivity list of always block. To enable synthesis of FPGA/CPLD hardware, XST will assume that all necessary signals are present in the sensitivity list. Please note that the result of the synthesis may differ from the initial design specification. The missing signals are: <regFile>
但是我的regFile仅在一个always里面运行,请问是哪里出现了问题?谢谢。
module register(re_set, clock_in, readReg1, readReg2, writeReg, writeData, regWrite, readData1, readData2, reg1);
input re_set;
input clock_in;
input [25:21] readReg1;
input [20:16] readReg2;
input [4:0] writeReg;
input [31:0] writeData;
input regWrite;
output [31:0] readData1;
output [31:0] readData2;
output [31:0] reg1;
reg [31:0] regFile[7:0];
reg [31:0] readData1;
reg [31:0] readData2;
integer count;
initial
begin
$readmemb("./reg_mem.mem", regFile);
end
always @ (readReg1 or readReg2)
begin
readData1 = regFile[readReg1];
readData2 = regFile[readReg2];
end
assign reg1 = regFile[1];
always @ (negedge clock_in)
begin
if (regWrite == 1) regFile[writeReg] = writeData;
if (re_set == 1)
begin
for (count = 0; count < 7; count = count+1)
regFile[count] = 0;
end
end
endmodule 展开
WARNING:Xst:905 - "register.v" line 45: One or more signals are missing in the sensitivity list of always block. To enable synthesis of FPGA/CPLD hardware, XST will assume that all necessary signals are present in the sensitivity list. Please note that the result of the synthesis may differ from the initial design specification. The missing signals are: <regFile>
但是我的regFile仅在一个always里面运行,请问是哪里出现了问题?谢谢。
module register(re_set, clock_in, readReg1, readReg2, writeReg, writeData, regWrite, readData1, readData2, reg1);
input re_set;
input clock_in;
input [25:21] readReg1;
input [20:16] readReg2;
input [4:0] writeReg;
input [31:0] writeData;
input regWrite;
output [31:0] readData1;
output [31:0] readData2;
output [31:0] reg1;
reg [31:0] regFile[7:0];
reg [31:0] readData1;
reg [31:0] readData2;
integer count;
initial
begin
$readmemb("./reg_mem.mem", regFile);
end
always @ (readReg1 or readReg2)
begin
readData1 = regFile[readReg1];
readData2 = regFile[readReg2];
end
assign reg1 = regFile[1];
always @ (negedge clock_in)
begin
if (regWrite == 1) regFile[writeReg] = writeData;
if (re_set == 1)
begin
for (count = 0; count < 7; count = count+1)
regFile[count] = 0;
end
end
endmodule 展开
展开全部
目测你这个会有问题,因为initial不能被综合,只能仿真的时候用。。你把initial这段先注释掉,试试综合后还会出这个警告不。。
还有for语句最好要综合的程序里不要用这个,用if和计数语句代替吧。。
还有interger也是,用reg比较好。。你最好去查查verilog中什么语句是不能被综合的。。
还有你的时序逻辑里用了阻塞赋值,不太好吧。。。
还有for语句最好要综合的程序里不要用这个,用if和计数语句代替吧。。
还有interger也是,用reg比较好。。你最好去查查verilog中什么语句是不能被综合的。。
还有你的时序逻辑里用了阻塞赋值,不太好吧。。。
追答
always @ (readReg1 or readReg2)
begin
readData1 = regFile[readReg1];
readData2 = regFile[readReg2];
end
问题是这句,把里面改成时钟敏感的always @ (negedge clock_in)应该就不会有这个warning了。。
意思可能是说,你这样写的话,变量可能不同时变化,会出现一些你不期望的中间状态。。因为你下面那个always中的变量是在时钟沿变化的,但是上面那个,不一定啥时候发生变化,两者可能会有不同步。(我以前没有这么写过,没遇到过这个warning,这意思是我猜的。。)
还有建议你去看一下阻塞赋值和非阻塞赋值的用法。我觉得这个程序里用非阻塞赋值比较好 <=
名片
2024-10-28 广告
2024-10-28 广告
HyperWorks是一款功能强大的工程仿真软件套件,由优菁科技(上海)有限公司代理。它提供了从概念设计到详细分析的全面解决方案,支持多种物理场的仿真分析,包括结构、流体动力学、热分析及电磁场等。该软件还具备拓扑优化、形状优化和尺寸优化等设...
点击进入详情页
本回答由名片提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询