Subject: [sv-ec] Comments on classes
From: Chris Spear (Chris.Spear@synopsys.com)
Date: Wed Jan 22 2003 - 07:38:40 PST
I may not be able to make the next call. Here are my comments on Ch.11, Classes.
11.4 - What happens if a user tries to access an object's members but the
handle is null? Should the simulator crash like a C program with a bad pointer?
Should a read of a variable using a null handle return a default value?
What if a method is called using a null pointer? Anything other than a
segfault is going to cost performance. But the user needs a way to debug
this very common problem.
11.7 The example at the bottom of 75 has a variable called time which is
a keyword.
11.8 Does a class have to be instantiated before its static properties can
be accessed? The example seems to show this. In general, will SystemVerilog
provide a way to access static properties outside of objects, like C++ ?
Are we going to support Class::myStaticVar ?
11.17 This needs to be a little more clear. Specify that only one assignment
can be done at run time. The current wording would seem to forbid:
const int size;
function new();
if (flag) size = 1; // First assignment
else size = 2; // second assignment
endfunction
11.18 Page 82, the third paragraph, second sentence should be changed as follows.
The new wording is in quotes:
In general, if an abstract class has "any" virtual methods, all of the methods
must be overridden for the subclass to be instantiated. If all of the
"virtual" methods are not overridden, the subclass needs to be abstract.
11.20 The last line should be changed to the less ambiguous:
"The out of block method declaration must match the actual method's declaration
statement."
Even this is not perfect. Can we state this in terms of BNF ?
Second, do the argument names have to match? Is the following legal?
class Packet;
int a;
extern function new(int b);
endclass
function Packet::new(int c);
a = c;
endfunction
/***************************************************************
Chris Spear Verification Specialist
Synopsys, Inc. Phone 508-263-8114 .. __@
377 Simarano Drive Fax 508-263-8123 _`\<,_
Marlboro, MA 01752 USA Cell 508-254-7223 .. (*)/ (*)
Chris.Spear@Synopsys.com http://Chris.Spear.net
***************************************************************/
This archive was generated by hypermail 2b28 : Wed Jan 22 2003 - 07:39:54 PST