Re: 1364.1 pragmas


Subject: Re: 1364.1 pragmas
From: Michael McNamara (mac@verisity.com)
Date: Thu Oct 10 2002 - 09:30:40 PDT


John Michael Williams writes:
> Hi Paul.
>
> Paul Graham wrote:
> >
> > > My suggestion was to define the syntax
> > > of attributes NOT by using comments, but
> > > by using a token string which would be
> > > read (=ignored) as a comment by tools not
> > > equipped to read attributes.
> >
> > Doesn't using "(* ... *)" match your suggestion? A tool that wishes
> > to ignore attributes can easily do so.
> >
> > Paul
>
> So far as I know, only certain Verilog tools will
> treat "(* . . .*)" as a comment (=ignore it). It
> actually is a Pascal comment syntactically, so a
> Pascal compiler would treat it as a comment.
>
> The suggestion I made was to standardize on a
> language-independent format for attributes. The first
> requirement would be that the format should be ignored by
> tools not programmed to parse it. So far as I know,
> only a format beginning with an open-comment string
> could fulfill that. It's just logic, here.
>
> Some of the format would be an interface to the language;
> other of it would define, or maybe declare, the attribute.
>
> I'm not stuck on comment formats for the interface, but I
> can't think of anything else that would work.
>
> If you are not interested in a language-independent attribute
> format, then of course, this won't mean anything to you.
> --
> John
> jwill@AstraGate.net
> John Michael Williams
>

OK, perhaps there is now enough email to understand what you are
proposing.

Verilog for the past ten years has had a attribute in comment usage,
that is non standard: // synopsys translate_off

Fortran has had this for thirty years : C$DIR VECTOR

Certain C compilers had comment directives; and then the #pragma was
introduced in ANSI C, formalizing the syntax.

There is nothing we are doing in 1364 to make comment attributes
illegal.

What we did was add a full fleged language construct, that is illegal
in 1364-1995, called attributes. So all existing 1364-1995 tools
require a change to support this, (In truth Cadence supported
attributes in the early 90's as a private extentsion, using similar
syntax, so there is less work for the Cadence folks).

The two fatal problems with comments as attributes are:

1) one can not detect a typographical error: // synopsis translate_off

2) one can not detect when a ordinary comment will be misconstrued as
   a directive // so this is the
                // synopsys of the problem

Using a very long distinctive leading character string helps, but can
not avoid the problem.

Another downside of a long intro is it simply uses up space;
stretching code out, and hence decreasing the signal to noise ratio of
the tyipcal file.

All that said, we did not make such usage illegal.

We did introduce a new syntatic structure that can appear in all the
necessary places, which can be easily ignored by tools choosing to do
so, but that can be safely syntax checked by tools deciding to give
the attributes meaning.

As for language independent attributes, there are already a number of
tools (Verisity's Specman is one) that read other languages (like
Verilog and VHDL) for hook up information. 1364-2001's attributes
could also be read this way; and again with the (* ... *) constructs
making it quite easy for the foreign tool to easily discern the
attributes.

That said, the foreign tool would presuambly have to parse a fair bit
of verilog to figure out exactly what a particular attribute was
pertaining to.

-mac



This archive was generated by hypermail 2b28 : Thu Oct 10 2002 - 09:39:51 PDT