Hello All,
In my code I have three sequence items, trans1,trans2(extended from trans1),trans3(extended from trans1).Here I have specified code for trans1 and trans2.In trans2 I have made changes regarding to constraint only and set_type_override_by_type working perfectly.In trans3 I want to make change in the length of a and b from [3:0] to [4:0] so how to use set_type_override_by_type because in extended class we are not registering variables in factory again.
class trans1 extends uvm_sequence_item;
rand logic [3:0]a,b;
rand logic [3:0]s;
rand bit c;
constraint c1{a>=0;a<=10;b>=11;b<=15;}
function new(string name=“trans1”);
super.new(name);
endfunction
uvm_object_utils_begin(adtrans)
uvm_field_int(a,UVM_ALL_ON)
uvm_field_int(b,UVM_ALL_ON)
uvm_field_int(s,UVM_ALL_ON)
uvm_field_int(c,UVM_ALL_ON)
uvm_object_utils_end
endclass
class trans2 extends trans1;
constraint c1{b>=0;b<=10;a>=11;a<=15;}
function new(string name=“trans2”);
super.new(name);
endfunction
uvm_object_utils_begin(trans2)
uvm_object_utils_end
endclass