this is a handle to the current class object. Useful for accessing class members re-declared within a local scope super is a handle to the parent class object. Essential for accessing parent class members hidden in subclass For example, constructor Only 1 super allowed at a time. super.super.new() is illegal. The existence of a parent class can be tested for
01.
class
base;
02.
logic
b1;
03.
protected
logic
c1;
04.
05.
function
new
(input
logic
pone);
06.
b1 = pone;
07.
endfunction
08.
endclass
09.
10.
class
sub1
extends
base;
11.
logic
[1:0] b1;
12.
local integer length;
13.
14.
function
new
(input
logic
pone);
15.
super.
new
(pone);
16.
this
.b1 = super.b1;
17.
endfunction
18.
endclass
19.
20.
class
sub2
extends
sub1;
21.
...
22.
function
new
(input
logic
pone);
23.
super.
new
(pone);
24.
endfunction
25.
endclass