Passing Comparator Results or Checked Variable Upstream

Trying to determine if there is a way to pass comparator matches and mismatches from a lower-level agent’s scoreboard to the overall testbench environment’s scoreboard.

In that way when a test is ran, all checked variables or comparator matches/mismatches are funneled up to the top.

For example, I’m envisioning in my top scoreboard_c that my report_phase can gather the comparator results from any agent that ran a comparison.

function void scoreboard_c::report_phase(uvm_phase phase);
  int checked;
  `uvm_info(name,$sformatf("Reporting scoreboard information...\n%s", this.sprint()), UVM_LOW)

  //add results of lower level comparators to number of checked
  top.checked += tb_env_h.env1_h.comparator_h.m_matches + env1_h.comparator_h.m_mismatches;

  `uvm_info(get_type_name(), $sformatf("Matches: %0d", tb_env_h.env1_h.comparator_h.m_matches), UVM_LOW)
  `uvm_info(get_type_name(), $sformatf("Mismatches: %0d", env1_h.comparator_h.m_mismatches), UVM_LOW)

  if (top.checked == 0)
    `uvm_error(name, "No Transactions Processed.");

  if (env1_h.comparator_h.m_mismatches > 0)
    `uvm_error(name, "Compare Failed");

endfunction : report_phase

In reply to solosys:

The extract/check/report_phases are all executed bottom-up, so you can use that information to help propagate totals up. Even better would be to separate the checking to the check_phase.

In reply to solosys:

Trying to determine if there is a way to pass comparator matches and mismatches from a lower-level agent’s scoreboard to the overall testbench environment’s scoreboard.
In that way when a test is ran, all checked variables or comparator matches/mismatches are funneled up to the top.
For example, I’m envisioning in my top scoreboard_c that my report_phase can gather the comparator results from any agent that ran a comparison.

function void scoreboard_c::report_phase(uvm_phase phase);
int checked;
`uvm_info(name,$sformatf("Reporting scoreboard information...\n%s", this.sprint()), UVM_LOW)
//add results of lower level comparators to number of checked
top.checked += tb_env_h.env1_h.comparator_h.m_matches + env1_h.comparator_h.m_mismatches;
`uvm_info(get_type_name(), $sformatf("Matches: %0d", tb_env_h.env1_h.comparator_h.m_matches), UVM_LOW)
`uvm_info(get_type_name(), $sformatf("Mismatches: %0d", env1_h.comparator_h.m_mismatches), UVM_LOW)
if (top.checked == 0)
`uvm_error(name, "No Transactions Processed.");
if (env1_h.comparator_h.m_mismatches > 0)
`uvm_error(name, "Compare Failed");
endfunction : report_phase

The question is what is the benefit of this approach. Finally you want to see all matches/mismatches somewhere in 1 log-file. This can be done from any level.
In your approach you can pass the lower-level matches/mismatches through the config_db to the test.

In reply to dave_59:

So I guess that’s more of my question of what the proper syntax/mechanism to propagate up. Attempting something like the code above doesn’t work because it seems like the scoreboard isn’t “aware” of the testbench hierarchy.

i.e. top.checked += tb_env_h.env1_h.comparator_h.m_matches returns an error

the actual comparator is actually a few more levels down.
more like tb_env_h.env1_h.env1_h.scoreboard_h.comparator_h

In reply to chr_sue:

chr_sue,
Wouldn’t this require a change to the lower level egent’s code? The scoreboard is part of a UVC, of which I do not wish to modify.

In reply to solosys:

Yes it’s true you had to modify this UVC code. But you have to do this in any way, except the compare results are passed to the config_db and you can retrieve them from a higher level.

In reply to dave_59:

Are they any examples on how to propagate the comparator matche/mismatches upstream?