One overall comment.
A method is a member that can be a function or a task. The term subroutine is also used for a function or a task and can be a class subroutine (or method) or a procedural subroutine (non-class) function or task. This is somewhat confusing but is consistent. A member is a method or property (data, variable, etc) in a class. I suspect that in the next Version of the LRM this terminology is going to have to be made more rigorous and consistently used.
Another comment. I really like the rework you did on Section11. It is much better. Thanks!
Phil Moorby in Enhancement Committee
OK
What is the change bar for? I do not see any text in blue.
Your change in 2.8 has a grammar problem. It should be:
When an array of structures is initialized,
the nested braces should reflect the array and the structure.
What is the change bar for? I do not see any text in blue.
An unassigned enumerated name that follows and enum
name with x or z assignments shall be a syntax error.
An enum
variable or identifier used as part
of an expression is automatically cast to the base type of the enum
declaration (either explicitly or
using int
as the default). An assignment to an enum
variable from an expression
other than an enum
variable or identifier of the same
type shall require a cast. Casting to an enum
type shall cause a conversion of the
expression to its base type without checking the validity of it the value (unless a dynamic cast is used as described in Section 3.15).
Changes (The following
change I did wrong, you are correct, it was supposed to be method and not
member and I missed the int unsigned change):
3.11.4.2 last()
The syntax for
the last() method is:
function enum last();
The last()method returns the value of the last
member of the enumeration enum.
Editor’s Note: Should “function” be “method”, above?
3.11.4.3 next()
The syntax for
the next() method is:
function enum next( int unsigned int N = 1 );
Editor’s Note: Shouldn’t it be “int
unsigned” instead of “unsigned int”?
The next()function method returns the Nth
next enumeration value (default is the next one) starting from the current
value of the given variable. A wrap to the start of the enumeration occurs when
the end of the enumeration is reached. If the given value is not a member of
the enumeration, the next()function method returns the first member.
Editor’s Note: Why does this change (and subsequent changes) have “name() method” in the first paragraph, and “name() member”
in second paragraph? Is the term “member” defined anywhere?
3.11.4.4 prev()
The syntax for
the prev() method is:
function enum prev( int unsigned int N = 1 );
Editor’s Note: Shouldn’t it be “int
unsigned” instead of “unsigned int”?
The prev() function method returns the Nth
previous enumeration value (default is the previous one) starting from the
current value of the given variable. A wrap to the end of the enumeration
occurs when the start of the enumeration is reached. If the given value is not
a member of the enumeration, the prev()function method returns the last member.
3.11.4.5 num()
The syntax for
the num() method is:
function int num();
The num() method returns the number of elements in
the given enumeration.
3.11.4.6 name()
The syntax for
the name() method is:
function string name();
The name() method returns the string representation
of the given enumeration value. If the given value is not a member of the
enumeration, the name()function method returns the empty string.
Please use the following to remove your Editor’s Note.
3.15 $cast dynamic casting
To check if the assignment will succeed, one can use The following
example shows how to use the $cast to check if an assignment will succeed:
Editor’s Note: Rephrase to avoid “one can use”
The following
restatement makes a semantic change in the sentence. I am referring the deletion of wire. Is this because
you think it is redundant or incorrect? The editor’s note topic was discussed
in committee and I thought that the input from Cliff (since this was his and
Kevin’s) was that this would an ok phrase.
5.7 Signal Aliasing
The bit overlay
rules are the same as those for a packed union with the same member types: each
member should shall be the
same size, and connectivity is independent of the simulation host. The types of nets connected with an alias statement
must be compatible, all the nets have to be of the same type or "wire",; i.e. it would be illegal to connect a wand net to
a wor net with an
alias statement. This is a stricter rule than applied to nets joining at
ports because the scope of an alias is limited and such connections are more
likely to be a design error. Variables and hierarchical references cannot be
used in alias statements. Any violation of these rules is shall be considered
a fatal error.
Your editor note on 6 is somewhat confusing. This appears to me to be an issue that SV-BC should have addressed. The new item is the “default data type” for attributes (according to the text). We do not need to add program blocks, assertions since the list is not definitive (thereby the use of “such as”. The change is that an attribute with no value is bit with a value of 1. This was not in 2001 (since bit was not). I suggest you make the editor note clearer if there is a problem. This was part of 3.0 and is definitely not new.
OK
In Verilog, there are three types of case statements,
introduced by case,
casez
and casex. With SystemVerilog, each of these can be qualified
by priority or unique. A priority case shall act on the first match only. A unique
case shall guarantee no overlapping
case values, allowing the case items to be evaluated in parallel. If the case
is qualified as priority or unique, the simulator shall issue an error message if an unexpected case
value is found. By specifying unique or
priority, it is not necessary to code a default case
to trap unexpected case values. For example:
Note: by specifying unique or priority, it is
not necessary to code a default case to trap unexpected case values. For
example:
The committee specifically wanted this as informative and NOT in a later section. Please return to the original and delete 9.9.
SystemVerilog final blocks
execute in an arbitrary but deterministic sequential order. This is possible because
final blocks are limited to the legal set of statements allowed for
functions. SystemVerilog does not specify the ordering, but implementations
should define rules that will preserve the ordering between runs. This helps
keep the output log file stable since final blocks are mainly used for displaying
statistics.
Editor’s Note: The
preceding paragraph does not belong in the informative introduction. I moved it
to a new, normative subsection at the end of this section..
SystemVerilog extends Verilog functions to allow the same formal arguments as tasks
to be inputs or outputs. Function arguments are all passed by value, i.e. copied. directions are:
class
Packet ;
// data or class properties
bit
[3:0] command; // data portion
bit
[40:0] address;
bit
[4:0] master_id;
integer
time_requested;
integer
time_issued;
integer
status;
The previous section only provided the
definition of a class Packet. That is a new, complex data type, but one
can’t do anything with the class itself. First, one needs to create an instance
of the class, a single Packet object. The first step is to create a variable
that can hold an object handle:
A class defines a data type. An object is an
instance of that class. An object is used by first declaring a variable of that
class type (that holds an object handle) and then creating an object of that
class (using the new function) and assigning it to the variable.
Packet
p; // declare a variable of class Packet
p = new; // initialize the variable to a new
allocated object of the class Packet
The variable p is said to hold an object
handle to an object of class Packet.
You missed one of your
notes to yourself!
Editor’s Note: If you are reading this note,
it is because I forgot to come back after making all other changes to draft 5
and implement change LRM-208 (make 11.8.1 a new 11.9 and renumber succeeding
sections).
The member property may
be a
member declared a level up or be a member inherited
by the class one level up. There is no way to reach higher (for example, super.super.count is not allowed
There is a font problem on “the” in the first paragraph.
class
Bus;
rand
bit[15:0] addr;
rand
bit[31:0] data;
constraint
word_align {addr[1:0]
== ‘2’b0;}
endclass
In the f.randomize() with constraint
block, x is a member of class Foo, and hides the x in class Bar. It also hides the x argument parameter in
the doit() task. y is a
member of Bar. z is a local argument parameter.
Where dynamic_type
represents a special type-less that enables
run-time type-checking (the default).
Editor’s Note: “type-less” what? object?
OK