【问题标题】:Are you allowed to have a module identifier be the same as the module type in Verilog?是否允许模块标识符与 Verilog 中的模块类型相同?
【发布时间】:2010-02-23 20:44:47
【问题描述】:

例如

module top
    debouncer debouncer(...);
endmodule

module debouncer
...
endmodule

我可以在顶部模块中将去抖动器实例化为“去抖动器”,还是非法?

【问题讨论】:

    标签: verilog


    【解决方案1】:

    是的,模块 instance 名称与 Verilog 中的 module 名称匹配是合法的,当您只需要一个一个模块。但是,您可以通过简单地使用您最喜欢的模拟器编译文件来快速验证这一点。以下是合法的语法并为我编译:

    module top;
        debouncer debouncer();
    endmodule
    
    module debouncer;
    endmodule
    

    【讨论】:

      猜你喜欢
      • 2017-05-07
      • 1970-01-01
      • 1970-01-01
      • 2022-12-04
      • 1970-01-01
      • 2019-06-06
      • 1970-01-01
      • 2020-08-01
      • 2012-11-17
      相关资源
      最近更新 更多