In the preferred functional coverage code below, I have many different sequence items in our environment as they are generated from scripts, then how do we go-ahead to implement the functional coverage class?
Any other ways to implement?
class my_coverage_collector extends uvm_subscriber #([b]my_tx[/b]);
my_tx tx; // the transaction object on which value changes will be covered
option.per_instance = 1; // track coverage for each instance
Opc: coverpoint tx.opcode;
Opa: coverpoint tx.operand_a;
Opb: coverpoint tx.operand_b;
function new(string name, uvm_component parent );
dut_inputs = new(); // construct the covergroup
function void write(my_tx t);
tx = t; // copy transaction handle received from the monitor
function void report_phase(uvm_phase phase);
`uvm_info("DEBUG", $sformatf("\n\n Coverage for instance %s = %2.2f%%\n\n",
this.get_full_name(), this.dut_inputs.get_inst_coverage()), UVM_HIGH)