In reply to dave_59:
Thanks Dave for your kind suggestion. Here transactions are different only however multiple subscriber uses either part OR all of monitored information.
// two types of transaction
class tr_1 extends uvm_transaction;
// ..
endclass
class tr_2 extends uvm_transaction;
// ..
endclass
// option-1: multiple ap in monitor
class my_mon_1 extends uvm_monitor;
uvm_analysis_port#(tr_1) ap_1;
uvm_analysis_port#(tr_2) ap_2;
endclass
// subscriber-1 only use tr_1
class my_sub_1 extend uvm_subscriber;
uvm_analysis_export#(tr_1) exp; // connected to ap_1
endclass
// subscriber-2 only use tr_2
class my_sub_2 extend uvm_subscriber;
uvm_analysis_export#(tr_2) exp; // connected to ap_2
endclass
// subscriber-3 only use both tr_1 and tr_2
class my_sub_3 extend uvm_subscriber;
uvm_analysis_export#(tr_1) exp_1; // connected to ap_1
uvm_analysis_export#(tr_2) exp_2; // connected to ap_2
// use tr_1 from exp_1
// use tr_2 from exp_2
endclass
// Option-2: SINGLE analysis port in monitor
// create wrapper having both tr_1 and tr_2
class tr_wrap extends uvm_transaction;
tr_1 t1;
tr_2 t2;
// ..
endclass
// single analysis port to send tr_wrap
class my_mon_2 extends uvm_monitor;
uvm_analysis_port#(tr_wrap) ap;
endclass
// subscriber-1 use tr_1
class my_sub_1 extend uvm_subscriber;
uvm_analysis_export#(tr_wrap) exp; // connected to ap
// use tr_wrap.t1 if not null
endclass
// subscriber-2 use tr_2
class my_sub_2 extend uvm_subscriber;
uvm_analysis_export#(tr_wrap) exp; // connected to ap
// use tr_wrap.t2 if not null
endclass
// subscriber-3 only use both tr_1 and tr_2
class my_sub_3 extend uvm_subscriber;
uvm_analysis_export#(tr_wrap) exp; // connected to ap
// use both tr_wrap.t1 and tr_wrap.t2 if not null
endclass
If I understand correctly I hope I should stick to option-2. Please do confirm or guide accordingly.
While I understand both option-1 and option-2 are expected to work fine, I am just seeking opinion here from better structure and performance point of view.