In reply to dave_59:
Hi Dave,
“body() has to be virtual so it can be called from the uvm_sequence base class variable.”
Say if we have a extended sequence that extends from the base sequence. And in case we are going to use a object of type (extended class sequence) then in this case it would automatically call the task body() defined in the extended sequence right and, for this you dont need to have the base sequence as virtual. This will be just pure inheritance right.
But yes if you want to use the base sequence handle which is pointing to extended sequence class object then in this case you need the base class as a virtual method so that the appropriate call is made. Hope my understanding is correct.
Also now if you have another ext2 sequence which extends from this extended sequence and, say this ext2 sequence is pointing to the extended sequence object. Now if you want to call the method defined in the ext2 sequence then the extended class sequence method needs to be virtual correct.
Also can you please elaborate on this if possible with a quick example. Thanks
“The problem with a later non-virtual method is that class_variable only know about the method prototype for that point in the inheritance tree, so it assumes all later derived methods are virtual”