`REPEAT_
as a macro actual argument.". Otherwise for the following case it is
not sure what should be expected result:Regards Surya
Wilson Snyder wrote:
Using my suggestedCan we rewrite REPEAT (preferrably with an existing simulator, or at least in a way that *might* be next-spec compliant) so that this will work: `REPEAT(`FUNC(n), d) Or this `REPEAT(`REPEAT(n,foo), d)`define
ofREPEAT,
My preprocessor yields the following:
`REPEAT(`REPEAT(n,foo), d )
`REPEAT_`REPEAT_n(foo)(d)
^^^^^^^^
Error: ./svpp4.sv:18: The macro 'REPEAT_' has not been defined. (VER-913)
For this reason, I think it was a mistake to passxpand the actual argument macro invocation at the point when it is used in a formal substitution.Yes, I think that's the right track.`REPEAT_
as a macro actual argument.
You can use`CONCAT(REPEAT_,n)
to form the identifier, but you don't want to
invoke that identifier until after it has been formed. So the macro tic mark has to apply
to the result of another macro expansion. That is not a feature mentioned in the LRM, and
I know of at least one preprocessor in which it is missing.
`define REPEAT( n, d ) ` ` CONCAT ( REPEAT_ , n ) ( d ) // not universally supported
probably should work, but its equivalent:
`define REPEAT( n, d ) `REPEAT_``n(d)
is guaranteed to work because it resembles the examples of section 22.5.1
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
This archive was generated by hypermail 2.1.8 : Wed Jun 23 2010 - 21:05:00 PDT