我正在尝试实现一个在always块中使用for循环的模块我们使用0和1的数组来记录在特定时间内收到的信号数.
不幸的是,我们收到了这样的错误:
ERROR:Xst:2636 - "Tourniquet.v" line 54: Loop has iterated 10000 times. Use "set -loop_iteration_limit XX" to iterate more.
Run Code Online (Sandbox Code Playgroud)
似乎for循环不允许在always块内(n似乎没有重置).我看过各种网站和论坛,但没有找到任何解决方案.
这是我的代码:
module Tourniquet(
input t0,
input mvt,
input clk,
output init
);
reg initialisation;
reg [0:99] memoire;
reg count = 0;
reg compteur = 0;
reg n;
assign init = initialisation;
always @(posedge clk)
begin
if (count==99)
begin
if (mvt)
begin
memoire[count]=1;
count=0;
end
else
begin
memoire[count]=0;
count=0;
end
end
else
begin
if (mvt)
begin
memoire[count]=1;
count = count + …Run Code Online (Sandbox Code Playgroud) verilog ×1