Section 3.10

Modify the BNF at the beginning of the section and in Annex A.2.1.3 as shown in red:

 

type_declaration ::= // from Annex A.2.1.3

typedef data_type type_declaration_identifier ;

| typedef interface_identifier { [ constant_expression ] } . type_identifier

type_declaration_identifier ;

| typedef enum type_declaration_identifier ;

| typedef struct type_declaration_identifier ;

| typedef union type_declaration_identifier ;

| typedef class type_declaration_identifier ;

| typedef type_declaration_identifier ;

 

Add the following to the end of Section 3.10 (as shown in red):

 

Sometimes a user defined type needs to be declared before the contents of the type has been defined. This is of use with user defined types derived from enum, struct, union, and class. For an example see Section 11.22. Support for this is provided by the five additional forms for typedef:

 

typedef enum type_declaration_identifier;

typedef struct type_declaration_identifier;

typedef union type_declaration_identifier;

typedef class type_declaration_identifier;

typedef type_declaration_identifier;

 

Note that, while this is useful for coupled definitions of classes as shown in Section 11.22 it cannot be used for coupled definitions of structs since structs are statically declared and there is no support for pointers to structs. The last form shows that the type of the user defined type does not have to be defined in the forward declaration.

Section 3.13

Change the second paragraph as shown in red:

 

The object-oriented class extension allows objects to be created and destroyed dynamically. Class instances, or objects, can be passed around via object handles, which add a safe-pointer capability to the language.  An object can be declared as an argument of type input, output, inout, or, ref.  In each case, the argument copied is the object handle, not the contents of the object.

 

Section 3.15

Change the example as shown in red:

 

typedef enum { red, green, blue, yellow, white, black } Colors;

Colors col;

$cast( col, 2 + 3 );

 

Section 10.5.2

Add the following as a new paragraph at the end of the section (shown in red):

 

A ref argument is similar to an inout argument except that an inout argument is copied twice: once from the actual into the argument when the subroutine is called and once from the argument into the actual when the subroutine returns.  Passing object handles are no exception and have similar semantics when passed as ref or inout arguments, thus, a ref of an object handle allows changes to the object handle (for example assigning a new object) in addition to modification of the contents of the object.

Section 11.20

Change the following line as shown in red:

 

It is convenient to be able to move method definitions out of the body of the class declaration. This is done in two steps. Declare, within the class body, the method prototypes —whether it is a function or task, any attributes (local, protected, or virtual), and the full argument specification plus the extern qualifier. The extern qualifier indicates that the body of the method (its implementation) is to be found outside the declaration. Then, outside the class declaration, declare the full method—like the prototype but without the attributes—and, to tie the method back to its class, qualify the method name with the class name and a pair of colons:

Section 12.4.2


Add to the end of 12.4.2 num() section:


The returned value should be used with care, since it is valid only until the next get() or put() is executed on the mailbox. These mailbox operations may be from different processes than the one executing the num() method, therefore the validity of the returned value will depend on the time that the other methods start and finish.

Annex B

Remove public from the list of keywords.

Annex C

Remove the Editor’s note. These are required (as indicated in Section 3) and not suggested.

Annex C.4

Change the paragraph with the following (shown in red):

 

SystemVerilog also includes a number of special methods to work with strings. These methods use the built-in method notation. These methods are described in the following sections.

Annex C.5

Change the following line as shown in red:

 

function int len()

 

Annex C.6

Change the following lines as shown in red:

 

task putc(int i, string s)

task putc(int i, char c)

 

Annex C.7

Change the following line as shown in red:

 

function int getc(int i)

 

Annex C.10

Change the following line as shown in red:

 

function int compare(string s)

 

and

  str.compare(s) compares str and s like the ANSI C strcmp function with a compatible return value.

— If the strings are equal, str.compare(s) returns 0. (like strcmp in ANSI C).

Annex C.11

Change the following line as shown in red:

 

function int icompare(string s)

str.icompare(s) compares str and s like the ANSI C strcmp function with a compatible return value, but the comparison is case insensitive.

Annex C.12

Change the following line as shown in red:

 

function string substr(int i, int j)

str.substr(i, j) returns a new string which is a sub-string formed by characters in position i through j of str.

— If i<0,  j <i, or j >=str.len(), substr() returns “” (the empty string).

Annex C.13

Change the following line as shown in red:                                                                           

 

The string is converted until to the first non-digit is encountered.

Section 3.8

Remove the contents of Section 3.8 starting from:

 

SystemVerilog also includes a number of special methods to work with strings.

 

through the end of the section.

 

Move the contents of C.4 to the new end of Section 3.8. Add Section C.5 through C.19 as Section 3.8.1 through 3.8.15.