为什么有verilog验证文件不是模块形式的?

Why there are verilog verification files not in the form of module?

为什么Verilog验证文件不是module形式的? 我看到的文件仅以 initial begin 开头,有些文件名使用 .inc 扩展名。

将任意内容的文件包含到 Verilog 模块中是很常见的。这是使用 `include 编译器指令完成的,如 IEEE 标准 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.

它可以用于在不同模块之间共享通用代码:参数、定义宏、任务、函数等。

一般来说,.inc 文件扩展名并不特殊。这可能是某些模拟工具使用的约定。