例如
module top
debouncer debouncer(...);
endmodule
module debouncer
...
endmodule
Run Code Online (Sandbox Code Playgroud)
我可以在顶级模块中将debouncer实例化为"debouncer",还是非法的?
是的,模块实例名称与Verilog 中的模块名称匹配是合法的,当您只需要一个模块实例时,这是很常见的.但是,您可以通过简单地使用您喜欢的模拟器编译文件来快速验证这一点.以下是法律语法并为我编译:
module top;
debouncer debouncer();
endmodule
module debouncer;
endmodule
Run Code Online (Sandbox Code Playgroud)