我知道基本的‘`include“filename.v命令。但是,我正在尝试包含一个位于另一个文件夹中的模块。现在,该模块还包括同一文件夹中的其他模块。但是,当我试图在最顶层运行模块时,我得到了一个错误。
C:\Users\Dell\Desktop\MIPS>iverilog mips.v
./IF/stage_if.v:2: Include file instruction_memory_if.v not found
No top level modules, and no -s option.这里,我正在尝试制作一个MIPS处理器,它包含在"mips.v“文件中。这个文件的第一个语句是“` included " IF / stage_if.v”。在IF文件夹中,有许多我已经包含在stage_if.v中的文件,其中之一是"instruction_memory_if.v“。下面是目录级别的示意图。
-IF
instruction_memory_if.v
stage_if.v
+ID
+EX
+MEM
+WB
mips.v发布于 2017-11-24 08:56:52
您需要使用-I标志告诉iverilog在哪里查找。
在top.v中
`include "foo.v"
program top;
initial begin
foo();
end
endprogram在foo/foo.v中
task foo;
$display("This was printed in the foo module");
endtask它可以使用以下命令运行:
iverilog -g2012 top.v -I foo/
vvp a.out
>>> This was printed in the foo modulehttps://stackoverflow.com/questions/47449489
复制相似问题