Mips 如何在icarus verilog中包含文件?

Mips 如何在icarus verilog中包含文件?,mips,verilog,cpu-architecture,iverilog,icarus,Mips,Verilog,Cpu Architecture,Iverilog,Icarus,我知道基本的“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. 在

我知道基本的“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”中。这个文件的第一条语句是“`include”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

您需要使用
-I
标志告诉
iverilog
在哪里查找

top.v
中:

`include "foo.v"

program top;
    initial begin
        foo();
    end
endprogram
task foo;
    $display("This was printed in the foo module");
endtask
foo/foo.v
中:

`include "foo.v"

program top;
    initial begin
        foo();
    end
endprogram
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 module

通常,您希望创建一个列出所有RTL文件(和路径)的文件在您的设计中使用,并将此文件传递给工具。快速谷歌搜索显示此工具也是如此。您是否尝试使用“-h”限定符寻求帮助?如果尝试,您应该看到
-I includedir
,您可以在命令行上指定搜索包含文件的目录。