Search code examples
verilogfpgasystem-verilogsynthesis

Is there a system verilog task which returns the length of a reg / logic?


It would be nice to have something similar to sizeof() from C. Needless to mention I don't expect it to be synthesizeable.


Solution

  • $bits(variable) is what you want.