From: Anders Nordstrom (andersn@nortelnetworks.com)
Date: Wed Jun 30 1999 - 14:01:57 PDT
BAD MSG:
Team,
ontent-Length: 4506
X-Lines: 155
X-Status: $$$$
X-UID: 0000000983
Status: RO
The errata BE84 - Function and Register name errata to review has been updated with
feedback from Stu Sutherland and Adam Krolnik.
Please review the updated proposal and vote via email to the reflector before July 10, 1999.
Thanks,
Anders
<x-html><HTML>
<HEAD>
<TITLE> BE84 </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<BR>
<HR SIZE=5 NOSHADE>
<H2> BE84 - Function and Register Name Errata</H2>
<TABLE BORDER COLS=2 WIDTH="75%" >
<TR><TD>
Section: </TD><TD> 10.3.1 and 10.3.2 (Draft 2)
</TD></TR><TR><TD>
Date Submitted: </TD><TD> 990429
</TD></TR><TR><TD>
Requestor: </TD><TD> Mike McNamara
</TD></TR><TR><TD>
Status: </TD><TD> Proposal
</TD></TR><TR><TD>
Analyzed by: </TD><TD> Mike McNamara & Anders Nordstrom
</TD></TR>
</TABLE>
<H3> Details </H3>
One of our users just got tripped up by this one. I looked in the
standard, but it is not clear.
<BR>
They had code that essentially was:
<PRE>
module test(a,b,c);
input [7:0] a;
input [2:0] b;
output [2 : 0] c ;
assign c = problem(a,b);
function [2 : 0] problem ;
input [7 : 0] a ;
input [2 : 0] b ;
reg [2 : 0] problem ;
begin
problem = b + a;
end
endfunction
endmodule
</PRE>
VCS happily accepts this code, VXL gives an error message.
Of course VXL is right, we all know that you cannot define a register
with the same name as the function, because, in truth, there is
already one implicitly defined by defining the register.
I feel we should add language that explicitly states that one cannot
declare another object with the same name as a function in the scope
where the function is declared (I.E, in the module) or inside the
function.
-mac
<PRE>
From: asingh@cupertino.synopsys.com (Ajay Singh)
To: spear@synopsys.com, vcs_support@synopsys.com, btf@boyd.com
Subject: Re: vcs/18556 : Function contains register with same name
</PRE>
Hello Chris Spear,
An Enhancement request TR 3323 is filed for this PR.
I am closing this PR for now.
Thanks,
Ajay
<p><H3> Proposal </H3>
Before the last sentence in section 10.3.2 on page 144 in Draft 2 add:
It is illegal to declare another object with the same name as the function
in the scope where the function is declared. Inside a function, there is
an implied register with the name of
the function, which may be used in expressions within the function.
It is, therefore, also illegal to declare another object with the same name as the function inside the function scope.
I also found another minor errata in section 10.3.1 of Draft 2 only.
Change the word <B>endtask</B> to the word <B>endfunction</B> on the
third line in the section below Syntax 10-3 on page 143 of Draft 2.
This is one specific instance of a more general specification problem:
<BR>
"There is no restriction of one declaration of a symbol for a given type."
Add this sentence to the end of the first paragraph in section
3.2.1 "Net declarations" and 3.2.2 "Register declarations" and before
last sentence of section 3.11 "Parameters".
"It is illegal to redeclare a name already declared by a net, parameter or
register declaration. "
Replace the last sentence of 3.12 "Name spaces" with
"Once a name is used to define a module, macromodule or primitive, the name
shall not be used again to declare another module, macromodule or
primitive."
Add to the third paragraph (sentence) that reads, "There are four
local name spaces..."
"Once a name is defined within one of the four name spaces, it shall
not be defined again with the same type or another type."
Add to the end of the second paragraph in section 12.4 "Port declarations"
"Once a name is defined in a port declaration it shall not be defined again
with the same type or another type."
Add to the end of the last paragraph of section 12.2.2.2 "Parameter value
assignment by name"
"Once a parameter is assigned a value, there shall not be another assignment
to this parameter name."
Add to the end of the last paragraph of section 12.3.1 "Port definition"
"Once a port has been defined, there shall not be another port definition
with this same name."
Add to the end of the first paragraph of section 12.3.4 "Connection module
ports by name"
"Once a port is connected by name, there shall not be another named
port connection for this port."
<HR SIZE=5 NOSHADE>
</BODY>
</HTML>
</x-html>
Attachment Converted: "E:\INCOMING\andersn4.vcf"
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:53:28 PDT
and
sponsored by Boyd Technology, Inc.