Class a_xaction #(int N_SZ = 40, F_SZ=100) extends a_original_c;
//a lot of members
extern virtual function a_original_c copy(a_original_c to=null);
endclass
function a_original_c a_xaction ::copy(a_original_c to=null);
a_xaction vr_cpy; // <<—Here is the question, I need a parameterized class itself.
if(to !=null) begin
if(!cast(vr_cpy, to) begin
$display(“ERROR!”); // The error will report when the b_xaction is used,in which the N_SZ is 50
end
end
endfunction : copy
typedef a_xaction #(.N_SZ(50)) b_xaction
So when I call the copy() for the b_xaction ,it will report the error.
And my question is : How to declare the vr_cpy in the copy function could avoid that?