ISSUE 155

Number 155
Category errata
Synopsis A.1.3, module_declaration ambiguous
State lrmdraft
Class errata-simple
Arrival-DateOct 09 2002
Originator "Brad Pierce" <Brad.Pierce@synopsys.com>
Release 2001b: 2.8.2 (Syntax 2-4), 12.1 (Syntax 12-1), A.1.3
Environment
Description
In A.1.3, module_declaration is ambiguous.

The fix is to remove the [] from around
list_of_port_declarations in the second
option --

[list_of_port_declarations]
-->
list_of_port_declarations

To see the ambiguity, consider a case
where there is neither a list_of_ports nor
a list_of_port_declarations and, moreover,
after the semicolon there are no
port_declarations. Then it's ambiguous whether
there's a {module_item} or a {non_port_module_item}
and which of the options was used to generate
the module_declaration.

The proposed fix does more than just remove ambiguity.
It also more accurately reflects the actual intent of
the {non_port_module_item} restriction, which should
be imposed only in the case when there is a
list_of_port_declarations. Otherwise, a full
{module_item} is allowed.

-- Brad

Fix
Section A.1.3
Passed 11/18/02 by ETF:
Remove the square brackets around the
list_of_ports element in the old style
module_declaration production.

REPLACE:
module_declaration ::=
{ attribute_instance } module_keyword module_identifier
[ module_parameter_port_list ]
[ list_of_ports ] ; { module_item }
endmodule
| { attribute_instance } module_keyword module_identifier
[ module_parameter_port_list ]
[ list_of_port_declarations ] ; { non_port_module_item }
endmodule

WITH:
module_declaration ::=
{ attribute_instance } module_keyword module_identifier
[ module_parameter_port_list ]
list_of_ports ; { module_item }
endmodule
| { attribute_instance } module_keyword module_identifier
[ module_parameter_port_list ]
[ list_of_port_declarations ] ; { non_port_module_item }
endmodule

Audit-Trail

From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
To: Brad Pierce <Brad.Pierce@synopsys.com>
Cc: etf-bugs@boyd.com
Subject: Re: errata/155: A.1.3, module_declaration ambiguous
Date: Thu, 10 Oct 2002 09:33:13 +0200

>Category: errata
>Confidential: no
>Originator: Shalom Bresticker <Shalom.Bresticker@motorola.com>
>Release: 2001b
>Class: TBD
>Description:
agreed

This affects also Syntax 2-4 in 2.8.2 and Syntax 12-1 in 12.1.


From: "Brad Pierce" <Brad.Pierce@synopsys.com>
To: <etf-bugs@boyd.com>
Cc:
Subject: Re: errata/155: A.1.3, module_declaration ambiguous
Date: Mon, 11 Nov 2002 15:34:34 -0800

>Category: errata
>Confidential: no
>Originator: "Brad Pierce" <Brad.Pierce@synopsys.com>
>Release: 2001b
>Class: TBD
>Description:

Dan Jacobi points out that the correct
fix is to remove the [] from around the
list_of_ports instead, because if there
is neither a list of ports nor a list of
port declarations, then there should be no
port declarations in the body. If a missing
list is treated as an empty list of port
declarations, this will enforce that only
non_port_module_items are allowed.

-- Brad



From: Steven Sharp <sharp@cadence.com>
To: etf-bugs@boyd.com, Brad.Pierce@synopsys.com
Cc:
Subject: Re: errata/155: A.1.3, module_declaration ambiguous
Date: Mon, 11 Nov 2002 18:46:16 -0500 (EST)

>Category: errata
>Confidential: no
>Originator: Steven Sharp <sharp@cadence.com>
>Release: 2001b
>Class: TBD
>Description:

> Dan Jacobi points out that the correct
> fix is to remove the [] from around the
> list_of_ports instead, because if there
> is neither a list of ports nor a list of
> port declarations, then there should be no
> port declarations in the body. If a missing
> list is treated as an empty list of port
> declarations, this will enforce that only
> non_port_module_items are allowed.

The existing semantic rule that port declarations in the
body must match the list_of_ports will enforce that anyway.

As with any proper definition, the degenerate case works
properly in either case.

Steven Sharp
sharp@cadence.com


From: "Brad Pierce" <Brad.Pierce@synopsys.com>
To: <etf-bugs@boyd.com>
Cc:
Subject: Re: errata/155: A.1.3, module_declaration ambiguous
Date: Mon, 11 Nov 2002 16:09:15 -0800

>Category: errata
>Confidential: no
>Originator: "Brad Pierce" <Brad.Pierce@synopsys.com>
>Release: 2001b
>Class: TBD
>Description:
Whenever there's an opportunity to enforce semantic
rules with syntactic rules, I'd like to exploit it.

In the case of this erratum, a change is needed to
remove ambiguity from the grammar. The change of
removing the [] from list_of_ports expresses the
intended semantics better than does the change of
removing the [] from list_of_port_declarations.

-- Brad



From: Steven Sharp <sharp@cadence.com>
To: etf-bugs@boyd.com, Brad.Pierce@synopsys.com
Cc:
Subject: Re: errata/155: A.1.3, module_declaration ambiguous
Date: Mon, 11 Nov 2002 19:50:14 -0500 (EST)

>Category: errata
>Confidential: no
>Originator: Steven Sharp <sharp@cadence.com>
>Release: 2001b
>Class: TBD
>Description:
> The change of
> removing the [] from list_of_ports expresses the
> intended semantics better than does the change of
> removing the [] from list_of_port_declarations.

Actually, I disagree. The 1995 standard allowed an empty
port list. That was clearly an empty list_of_ports. It
is easier to see what the 2001 standard added if you have
one rule for the old syntax and another rule for the new.
And if someone is linting for features that are not
backward compatible with 1995, they had better not treat
the empty port list as a 2001 list_of_port_declarations.

Removing the [] from list_of_port_declarations expresses
the change in syntax better. And since they both have
identical semantics, neither way expresses the semantics
any better.

Steven Sharp
sharp@cadence.com


From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
To: Steven Sharp <sharp@cadence.com>
Cc: etf-bugs@boyd.com
Subject: Re: errata/155: A.1.3, module_declaration ambiguous
Date: Sun, 17 Nov 2002 11:50:50 +0200

>Category: errata
>Confidential: no
>Originator: Shalom Bresticker <Shalom.Bresticker@motorola.com>
>Release: 2001b
>Class: TBD
>Description:
I'll go with Brad on this one.
He is correct about tightening up the BNF and it comes for free.

The 2001 BNF is so different from the 1995 BNF in so many places
that a simplistic comparison using 'diff' on the BNF is not realistic.

In fact, as I recently wrote, we have a number of change proposals
on the table that, if accepted, will cause that to occur even from
2001 to 2004.

But in this case, I won't make a big thing of it because Steven is
also correct about the semantics. So what is most important is
that both ways of fixing the ambiguity work.

Shalom


Steven Sharp wrote:

> > The change of
> > removing the [] from list_of_ports expresses the
> > intended semantics better than does the change of
> > removing the [] from list_of_port_declarations.
>
> Actually, I disagree. The 1995 standard allowed an empty
> port list. That was clearly an empty list_of_ports. It
> is easier to see what the 2001 standard added if you have
> one rule for the old syntax and another rule for the new.
> And if someone is linting for features that are not
> backward compatible with 1995, they had better not treat
> the empty port list as a 2001 list_of_port_declarations.
>
> Removing the [] from list_of_port_declarations expresses
> the change in syntax better. And since they both have
> identical semantics, neither way expresses the semantics
> any better.

--
Shalom Bresticker Shalom.Bresticker@motorola.com
Design & Reuse Methodology Tel: +972 9 9522268
Motorola Semiconductor Israel, Ltd. Fax: +972 9 9522890
POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 441478

"The devil is in the details."



Unformatted


Hosted by Boyd Technology