在使用Quartus II进行编译时,我在verilog代码中遇到错误
错误(10119):DE1_SOC_golden_top.v上的Verilog HDL循环语句错误(313):具有非常量循环条件的循环必须在250次迭代中终止
第313行是#50 clock = ~clock;
测试台模块的代码是
module test;
// Inputs
reg clock;
reg reset;
reg start;
// Outputs
wire [3:0] d0;
wire [3:0] d1;
wire [3:0] d2;
// Instantiate the Unit Under Test (UUT)
stopwatch uut (
.clock(clock),
.reset(reset),
.start(start),
.d0(d0),
.d1(d1),
.d2(d2)
);
initial
begin
clock = 0;
forever
#50 clock = ~clock;
end
initial begin
// Initialize Inputs
reset = 0;
start = 0;
// Wait 100 ns for global reset to finish
#100;
reset = 1;
#100;
reset = 0;
#100;
start = 1;
// Add stimulus here
end
endmodule
任何纠正相同的建议。我正在产生0.1秒的延迟..
答案 0 :(得分:0)
private IEnumerable<Contracts.Models.Translation> GetTranslationsIfEmpty(IEnumerable<Contracts.Models.Translation> translations, string locale, Expression<Func<Contracts.Models.Translation, Boolean>> where)
{
if (!locale.Equals(EnglishLocale, StringComparison.OrdinalIgnoreCase) && !translations.Any())
{
var englishTranslations = _translationService.Get(where);
translations = GetTranslations(englishTranslations.ToArray(), locale);
AddNewTranslations(translations);
}
return translations;
}
这种生成时钟的方法仅适用于模拟工作流程。对于综合,您需要将实际时钟信号连接到FPGA。
答案 1 :(得分:-1)
您可以按如下所示重写该行以清除错误
clock = #50 ~clock;