为什么 Verilog 验证文件不是模块
形式的?
我看到的文件仅以 initial begin
开头,有些文件名使用 .inc
扩展名。
最佳答案
将任意内容的文件包含到 Verilog 模块中是很常见的。这是使用 `include
编译器指令完成的,如 IEEE Std 1800-2012,“22.4 `include” 部分所述:
The file inclusion (include) compiler directive is used to insert the entire contents of a source file in another file during compilation. The result is as though the contents of the included source file appear in place of the `include compiler directive.
它对于在不同模块之间共享公共(public)代码非常有用:参数、定义宏、任务、函数等。
一般来说,.inc
文件扩展名并不特殊。这可能是某些模拟工具使用的约定。
关于verilog - 为什么verilog验证文件不是模块形式的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30727199/