ISSUE 621

Add Proposal  Add Analysis  Edit Class, Environment, or Release
Number 621
Category errata
Synopsis 19.3.1, one-line comments in macro arguments
State open
Class errata-discuss
Arrival-DateSep 14 2004
Originator "Brad Pierce" <Brad.Pierce@synopsys.com>
Release 2001b
Description
It's not clear from 19.3.1 whether one-line comments in a macro
argument are stripped out before the argument is substituted into
the text of the macro. I think they should be, for the same reasons
that one-line comments are not included in the text of the macro.

In my opinion, if you want to embed a pragma in a macro argument,
then you need to use a /* block comment */.

`define LOOP(I,X) for(I=0;I!=1;I=1) begin X end
module m;
reg i;
always
`LOOP( i,
/*
This is part of the begin-end block.
*/
// Is this part of the begin-end block????
/*
This is part of the begin-end block.
*/
)
endmodule

// Brad.Pierce@synopsys.com


Fix

Unknown
Audit-Trail
From: Shalom.Bresticker@freescale.com
To: Brad Pierce <Brad.Pierce@synopsys.com>
Cc: etf-bugs@boyd.com
Subject: Re: errata/621: 19.3.1, one-line comments in macro arguments
Date: Wed, 15 Sep 2004 10:46:37 +0300 (IDT)

It seems to me that you could not even embed a block comment into the macro
via its argument. The block comment will be stripped out before the macro
is substituted as well.

Note that the BNF shows "actual argument" as "expression".
Not everything can be used as an argument. Only expressions.

Shalom


> It's not clear from 19.3.1 whether one-line comments in a macro
> argument are stripped out before the argument is substituted into
> the text of the macro. I think they should be, for the same reasons
> that one-line comments are not included in the text of the macro.
>
> In my opinion, if you want to embed a pragma in a macro argument,
> then you need to use a /* block comment */.
>
> `define LOOP(I,X) for(I=0;I!=1;I=1) begin X end
> module m;
> reg i;
> always
> `LOOP( i,
> /*
> This is part of the begin-end block.
> */
> // Is this part of the begin-end block????
> /*
> This is part of the begin-end block.
> */
> )
> endmodule

--
Shalom Bresticker Shalom.Bresticker @freescale.com
Design & Verification Methodology Tel: +972 9 9522268
Freescale Semiconductor Israel, Ltd. Fax: +972 9 9522890
POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 5441478

[ ]Freescale Internal Use Only [ ]Freescale Confidential Proprietary

Unformatted



Hosted by Boyd Technology