this: Reference to the current instance
System verilog has a default reference pointer to its own objects.
we use the "this" syntax to refer to its own objects within the methods
e.g
class animal;
int age;
string name;
function new (int age, string name);
this.age = age;
this.name = name;
endfunction
endclass
module top;
animal a_h;
initial begin
a_h = new(7, "lion");
end
endmodule
Comments
Post a Comment