In my Testbench, I have an interface that I need to drive. The interface can be driven in 2 different modes, with each mode having its own driver protocol and transaction type.
So far, I have designed both uvm_agents separately. Now, I need a way to swap one or the other in, depending on the testcase I am running. I also want to do this in the way that best fits with UVM philosophy.
My best method that I could come up with is: in my uvm_env, getting a uvm_db_config parameter from the test that says either "ModeA" or "ModeB", and based on that, setting is_active for the agents to "UVM_ACTIVE" and "UVM_PASSIVE" appropriately.
I would like an opinion on this method.
A way suggested to me was to keep a common uvm_agent, and instantiate the uvm_driver/uvm_sequencer based on the configuration. Not too sure about this method as it looks messy.