Is it possible to parameterize a bit-field in verilog? Essentially I want to use a parameter or alternative to define a bit-range. The only way I can think of doing this is with a `define as shown below but it seems like there should be a better way.
`define BITFIELD_SELECT 31:28
foo = bar[BITFIELD_SELECT]
Parameters are nicer(safer) than defines since the namespace is not global to the project. You should be able to do this with two parameters.
Alternatively