Re: BTF - BNF98 Update (HTML)

From: Stuart Sutherland (stuart@sutherland.com)
Date: Wed Mar 04 1998 - 08:53:48 PST


BAD MSG:
Cliff,
-Lines: 66
Content-Type: text/plain; charset="us-ascii"
Content-Length: 2908
X-Status: $$$$
X-UID: 0000000332
Status: RO

I like the colorized BNF -- can I use it to justify buying a color laser
printer for my business so that I can print it and study it? ;)

I was sure one of the things I had flagged many moons ago, when there was
an errata task force, was a problem with the use of the word "identifier"
throughout the BNF (module_identifier, port_identifier, task_identifier,
etc.). The problem is in the General section at the end, where
"identifier" is finally described, it says identifier can be:

   IDENTIFIER :=
                simple_identifier
               |escaped_identifier

My understanding of the | token in BNF is that it is an OR, meaning either
choice is valid.

In the context of most of the places identifier is used, an escaped
identifier should be illegal, but the | in the identifier definition makes
it legal. Thus the BNF makes these examples legal:

module top.u1.i1.my_mod(...);
input [7:0] i1.in;
task foo.bar.my_task;

My original suggestion was to leave the identifier term in most of the
places it is used, and remove the "escaped_identifier" option from the
definition of identifier. Then create a new term for the few usages of
"identifier" where escaped identifiers are legal, and define the new term
to allow both simple and escaped identifiers.

One other issue with escaped identifiers is that it conflicts with the note
at the end of the General section in the BNF. The note says "The period in
identifier cannot be preceded for followed by a white space." In reality,
and escaped identifier MUST precede the period with a white space, or else
the period becomes escaped. The following is legal, despite the note:

    assign net = top.foo.\74ls74 .q;

In the above example, the real path is top.foo.74ls74.q, but since
identifiers cannot begin with numbers, the 74ls74 must be escaped and a
white space must be place before the period that follows it.

On a side note, the definition for "white_space" in the General section is
also not correct. Section 2.2 says form feeds are also white space, and
not documented anywhere is that end-of-file is a white space (at least
most, if not all, Verilog simulators allow modules to be split into
multiple files -- I have not tried end-of-file in every place a white space
could appear).

Stu

At 01:21 PM 3/1/98 -0800, Clifford E. Cummings wrote:
>Updated BNF98 in HTML format. Still not perfect but working on it!
>
>- Cliff
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stuart Sutherland Sutherland HDL Inc.
stuart@sutherland.com 22805 SW 92nd Place
phone: 503-692-0898 Tualatin, OR 97062
www.sutherland.com

Specializing in Verilog HDL consulting and training. Publisher of the
popular Verilog HDL and Verilog PLI quick reference guides.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:52:46 PDT and
sponsored by Boyd Technology, Inc.