In reply to murali anumanth:
Murali,
- Yes, you can use ovm_transaction class object in the ovm_sequence_item class. But why do you need to do that? For an user, there is no difference between an ovm_transaction class & ovm_sequence_item class. They can be used in the same manner.
- There is no such hierarchy needed as you did, which is more confusing
- Just get rid of basic_transfer class. Whatever sequence you need to create, do that in my_sequence class by creating the wap/wdp etc objects there.
- My one more suggestion is to combine address-phase & data-phase into a single transaction (sequence item) so taht it will be easy for post-processing.
- set_transaction_id can be used only after you create that transaction. You can do the following in the my_sequence class:
virtual task body();
wap = write_waddr_phase::type_id::create("wap");
wdp = write_waddr_phase::type_id::create("wdp");
start_item(wap);
wap.set_transaction_id(1);
assert(wap.randomize());
finish_item(wap);
start_item(wdp);
wdp.set_transaction_id(1); // I hope you want to give same ID for a seq
assert(wdp.randomize());
finish_item(wdp);
endtask