Verilog 输入端口变量的默认数据类型是什么?
你好,我是 Verilog 新手,对此我一直很困惑。在某些示例中,输入和输出被声明为电线或寄存器,而在其他示例中,它们只是这样列出: Module(输入 a, b, 输出 c)
赋予这些值的默认数据类型是什么?
Hello I’m new to Verilog and I’ve been confused over this. In some examples the inputs and outputs are declared as wires or regs and on others they are just listed like this:
Module(input a, b, output c)
What is the default data type given to these values?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何方向端口的默认数据类型都是无符号 4 状态标量(1 个二进制数字)。在 Verilog 中,
input
和inout
端口必须是且默认为网络类型wire
。output
端口也默认为wire
,但也可以指定为变量reg
。 (SystemVerilog 通过允许输入端口也被声明为变量来放宽其中一些规则)。既然您知道隐式默认值是什么,请成为一名优秀的工程师,并且永远不要依赖它们——要明确。
The default data type for a port in any direction is an unsigned 4-state scalar (1 binary digit). In Verilog,
input
andinout
ports must be and default to the net typewire
.output
ports also default towire
but can also be specified as a variablereg
. (SystemVerilog relaxes some of these rules by allowing input ports to also be declared as variables).Now that you know what the implicit defaults are, please be a good engineer and never rely on them—be explicit.