UVM uvm_sequence_item do_copy and field macros
I was asked what would have if, in a class derived from a UVM uvm_sequence_item class, one overrode the do_copy method and also specified a copy method using the field macros . I said I think I knew, because I knew exactly what would happen if the case of the compare method and that I expected the same behaviour with the copy method. However, it pays to confirm this by having a play on EDA Playground . So, what would happen with the compare method? Well, (i) both methods would be called and (ii) the field macro method would be called first and (iii) the result from each would be ANDed together. So, what would happen with the copy method? I wrote some code to find out. Here is a class derived from a uvm_sequence_item class, with overridden do_compare and do_copy methods and field macros that also specified both. It turns out that, just like with compare , (i) both methods would be called and (ii) the field macro method would be called first. https://www.edaplayground....