我正在尝试为名为 Processor 的模块编写一个测试平台
测试台中的这一行用于实例化 我的处理器仅将时钟和重置作为输入
//instantiation for processor module
Processor dut (.Clk(clock), .Reset(reset));
当我尝试访问实例化 dut 内的电线时,某些情况下会出现错误: 当使用 dut.pcOut
时,tb 中的 ifStatement 行出现此错误无法解析对对象 pcOut 的引用
在处理器中,有一条名为 pcOut 的线,我已经定义了这条线并将其用作处理器模块中某些模块的实例化
这就是我尝试在测试台中使用 pcOut 线(32 位)的方式: 此代码来自测试台,而我尝试在测试台中使用来自 dut 的内部信号 尝试在某些 if 语句中使用来自 dut 的 pcOut 到测试台中
// analysis for the current instruction
always @ (posedge clock)
begin
// reset before start - no instruction
if (dut.pcOut === 32'b0)
begin
isInstruction <= 1'b0;
end
// instructions in mif file from 1hex to 19 hex
// note that pc always point to next instruction
else if (dut.pcOut>8'h1 && dut.pcOut<8'h20)
begin
isInstruction <= 1'b1;
end
// after finish all instructions
else
begin
isInstruction <= 1'b0;
end
i <= i+1;
end
请注意,我以相同的方式使用其他电线(用于显示而不是特定条件),没有显示错误
还有一件事,我确信处理器模块中的pcOut线拼写与这里的名称相同,这一面没有问题
您无法使用 Quartus 来综合您的测试平台。