class TestClass; // name of class. int integer_a,integer_b; // sample variables. function new(int a, int b); // function that is run when instance of object is created. integer_a = a; integer_b = b; endfunction function display_class(); $display("integer_a=%d integer_b=%d",integer_a,integer_b); endfunction endclass // Simple test bench to exercise the test class. module tbTestClass; TestClass tc1; // declare instance of class. initial begin tc1 = new(10,20); // create a new instance of TestClass with sample values. tc1.display_class(); // Call the display_class function in TestClass $stop; end endmodule