In reply to Reuben:
Hi Reuben,
I have used the callback method to inject an error. I have injected an error in SV testbench, so I have used a polymorphism to inject an error, but u can use the uvm_callback.
In my case, I have an abstract class “error_injector”, which has two virtual methods, pre_drive() and post_drive(). These methods are called from a driver class, before and after a drive() method. By default, these methods do nothing, but these methods can be overridden by its (error_injector’s) extended class.
So, using the callback method, we can,
- Inject an error
- provide a delay in the transaction
- drop the transaction