I am trying to use a Verilog preprocessor macro in Altera Quartus requiring use of a parameter value inside a variable name.
Example:
`define INCREMENT_COUNTER(parsername) \
__parsername_counter <= __parsername_counter + 4'h1;
So using `INCREMENT_COUNTER(p1)
should give
__p1_counter <= __p1_counter + 4'h1;
However parsername is not properly replaced and returns
__parsername_counter <= __parsername_counter + 4'h1;
I have also tried using
__``parsername``_counter <= __``parsername``_counter + 4'h1;
which doesn't work either. Any help would be appreciated.