How do we access class objects and properties
An class object properities are accessed with the handle and dot operator(.)
e.g
module top();
class animal;
int age;
string name;
endclass
animal a_h ; // create handle to animal object
initial begin
a_h = new();
a_h.name = "Tiger";
a_h.age = 10;
end
endmodule
Comments
Post a Comment