inputs without type in system verilog

爱⌒轻易说出口 提交于 2019-12-06 11:10:50

There is no difference between stating logic and not stating any type.

input newdata,

is equivalent to

input logic newdata,

The SystemVerilog IEEE Std (1800-2009) describes this in section: "23.2.2.3 Rules for determining port kind, data type and direction".

It is very common to not assign inputs a data type, as they should almost always be wire.

input [7:0] newdata

Is nominally equivalent to:

input wire [7:0] newdata

It is actually picking up `default_nettype wire which could be changed to say uwire to enforce compiler checks for unique drivers, which will fail on wiring mistakes with multiple drives.

Using logic as a type allows the auto selection between wire and reg which is useful for outputs and allows easier refracting. Inputs can never be reg type.

Stuart Sutherlands SNUG2013 paper, section 12 covers how uwire could be used to better imply design intent if it was supported correctly by the tools.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!