Subject: Re: Attributes and constant expressions
From: Shalom Bresticker (Shalom.Bresticker@motorola.com)
Date: Wed Oct 24 2001 - 22:54:07 PDT
One of the problems with pragmas is that you cannot distinguish it from comments.
This leads to problems such as:
- tools which strip off comments (such as Verilog-XL decompilation (-d switch) will strip off the pragmas as well
- mis-spelled pragmas cannot be detected. At least if you mis-spell an attribute, you can at least still get a report of all the
attributes defined, which makes it easier to detect a mis-spelling
Shalom
Adam Krolnik wrote:
> Precedence: bulk
>
> Good afternoon;
>
> I don't understand the desire to replace pragmas with attributes.
> I think that the meta comments can stay and attributes can be
> there as well. Developers should pick the element that works best.
>
> For example, surelint allows embedded directives to control
> lint reporting.
>
> You can say
>
> begin
> ...
> a = b + c; //surefire lint_off_line LINT_CODE
>
> And it will not produce any report of the type LINT_CODE.
>
> This could be translated to attributes:
>
> (* surefire_lint_off=LINT_CODE *)
> a = b + c;
>
> (I converted lint_off_line to lint_off since it is directly attributed
> to a particular element of the language.)
>
> You can also say
>
> //surefire lint_off SYN
>
> // Here's some verification code that I don't want to have
> // any lint reports of the synthesis group.
> always @(*)
> begin
> ...
> end
>
> // Turn it back on again.
> //surefire lint_on SYN
>
> Which is just like the synopsys translate pragmas. Note that this
> doesn't disable the parsing, but the analyzing - and only some
> of the analysis is omitted.
>
> Now you could use the Mac_attribute trick to convert the comment pragmas
> into attributes. Too bad I didn't make this request:
>
> [Desire a new block type - final that runs once, before the simulation
> terminates. The purpose is to do some code before the simulation exits.
> Syntax - 'final <statement>']
>
> Then Mac's trick would look like
>
> initial (* synthesis=0 *);
> ...
> final (* synthesis=1 *);
>
> a (* ripple_add *) + b
>
> For verilog parser people (or verilog parser scripters) is there a
> decided ease for stylistic comments vs. attributes? From the
> parsers I have written, I don't see an advantage.
>
> I do see an advantage for attributes when you are not in the
> parser tool game. I as a simple developer want tools that can handle
> attributes so that I can put in my information and have tools that
> allow me to extract that information. So if I have a parser tool,
> I want to extract the attribute values for a given element. I want
> to be able to do different things based on the attributes. Some
> compilers will create and read the attributes to do defined things.
>
> Adam Krolnik
> Verification Mgr.
> LSI Logic Corp.
> Plano TX. 75074
-- ************************************************************************** Shalom Bresticker Shalom.Bresticker@motorola.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 **************************************************************************
This archive was generated by hypermail 2b28 : Wed Oct 24 2001 - 23:02:17 PDT