`define for value replacement does not work
Closed this issue · 2 comments
maltaisn commented
I can use `define
in conjunction with `ifdef
, but it fails for any value replacement. Since this is not covered by tests, I assume macros with or without arguments are not yet implemented.
`define MACRO1 256
`define MACRO2(a) ((a)+1)
amykyta3 commented
Not sure what you mean. Preprocessor macros have been supported for several years now and are indeed covered by tests.
I just expanded your example and ran it through the preprocessor:
`define MACRO1 256
`define MACRO2(a) ((a)+1)
EXAMPLE1 `MACRO1
EXAMPLE2 `MACRO2(1234)
peakrdl preprocess test.rdl -o test.pp.rdl
Results in:
EXAMPLE1 256
EXAMPLE2 ((1234)+1)
maltaisn commented
Oh I missed the backtick that's why. Thanks.