Overriding bad_transaction in bad_driver

Hi,
I have a bad_tx and bad_driver which are extended from base_tx and base_driver. I am using base_tx in base_driver and bad_driver. How do i override bad_tx in only in bad_driver(it should not get effected in monitor)

i am not able to use bad_tx in bad_driver as my base_driver is not parameterized.

seq_item_port.get_next_item(tx_bad); // this gives me error if i use bad_tx in bad_driver

// this is my test build phase

super.build_phase(phase);
set_inst_override_by_type(“env_h.agent_h”,base_driver::get_type(),bad_driver::get_type);
set_inst_override_by_type(“env_h.agent_h.driver_h.”,base_tx::get_type(),bad_tx::get_type);// this does not work as driver_h any way will be overridden

Regards
Kranthi

In reply to kranthi445:

"
seq_item_port.get_next_item(tx_bad); // this gives me error if i use bad_tx in bad_driver
"

I think you should use tx_base here and do dynamic casting to tx_bad. Because the sequencer connected to driver is parameterized for tx_base. Simulator won’t know that the handle it is getting from sequencer port is actually of type bad_tx.,so it will throw compile error.
You should also ensure that you are sending bad transaction from your sequence.

There is no need to override base_tx in base_driver because it can always hold the handle of tx_bad coming from sequencer port.

Regards,
Yogesh