$bits Usage

In reply to dave_59:

Hi Dave,
Is the $bits() a runtime function or parsed at compile/elab time? Can I use it in a parameter definition? For example:

logic [$bits(in_header.set_get_hdr.num_word32)-1:0] wr32_remain;

It seems to compiled OK, but not sure if it works similar to the $clog2()?

Thanks,
Richard