U18.6.3 Audit the Catchers

HardImplementUVM · serverReview the topic

Build a small debug kit for report catchers. Walk a queue both ways, count what is on it, and switch a catcher off by name. See reports as they were, and let one kind of error past every catcher.

Hardware context: Agents and scoreboards whose reports pass through report catchers. Audit a reporter's catchers and let one kind of error past them.

A nightly run lost a DATA error: somewhere in the env a report catcher changed it. The env stacks catchers typewide and on single reporters, in an order nobody wrote down. You are writing the kit the team will use to find out what happens to a report.

Write the seven pieces below. The bench builds six environments, each with its own catchers, and calls your kit on the scoreboard sb and the checker chk.

Full specification
What you write
// The names of the catchers o's reports pass through, in the order they run, one space apart.
function automatic string walk(uvm_report_object o);
  return "";
endfunction

// The same names from the last catcher to the first.
function automatic string walk_back(uvm_report_object o);
  return "";
endfunction

// How many different catchers sit on o's queue; a catcher that is there twice counts once.
function automatic int distinct(uvm_report_object o);
  return 0;
endfunction

// Prints o's callbacks in the log, with the library's own listing.
function automatic void show(uvm_report_object o);
endfunction

// Switches off the typewide catcher with this name, then lists the typewide catchers in the log.
function automatic void switch_off(string name);
endfunction

// raw(1): reports pass every catcher unchanged and uncaught. raw(0): catchers work again.
function automatic void raw(bit on);
endfunction

// In front of every catcher on its reporter: sends DATA errors to the log at once, as they are,
// and stops them there, so no later catcher can change them.
class bypass_c extends uvm_report_catcher;
  function new(string name = "bypass"); super.new(name); endfunction
  function action_e catch();
    return THROW;
  endfunction
endclass

function automatic void bypass(uvm_report_object sb);
endfunction
PieceWhat the bench checks
walk(sb)Equals the names the report path runs, in order, copies included
walk_back(sb)The same names from last to first
distinct(sb)Different catchers on sb's queue
show(sb)The library's callback listing for sb alone appears in the log
switch_off(name)That typewide catcher is switched off, and a typewide catcher list printed afterwards no longer shows it
raw(1), raw(0)With raw on, sb's DATA error counts as an error and chk's LINK warning as a warning, whatever the catchers do. With raw off, the catchers work again.
bypass(sb)sb's next DATA error is counted once, as an error, and sb's catchers never see it

The env's catcher kinds: quiet drops NOISE infos, tag prefixes the message, demote makes DATA errors infos, swallow drops warnings. The bench works on one environment at a time and removes its typewide catchers before the next. Reports are counted, not printed.

Examples

Example 1

Typewide Catchers First, Then Demote on Sb
Input
quiet (quiet) typewide; tag (tag) typewide; demote (demote) on sb; swallow (swallow) on chk; switch off tag
Output
walk_matches = yes (1), walk_back_matches = yes (1), catcher_runs_on_sb = 5, distinct = 3, display_lists_sb = yes (1), switched_off = yes (1), list_printed_after = yes (1), raw_errors = 1, raw_warnings = 1, normal_errors = 0, normal_warnings = 0, bypass_errors = 1, demote_saw_after_bypass = 0

sb's first instance add copied quiet and tag twice each, then demote: five runs, three different catchers. With raw off, demote and swallow hide the error and the warning.

Example 2

Instance Catchers First
Input
demote (demote) on sb; swallow (swallow) on chk; quiet (quiet) typewide; tag (tag) typewide; switch off quiet
Output
walk_matches = yes (1), walk_back_matches = yes (1), catcher_runs_on_sb = 3, distinct = 3, display_lists_sb = yes (1), switched_off = yes (1), list_printed_after = yes (1), raw_errors = 1, raw_warnings = 1, normal_errors = 0, normal_warnings = 0, bypass_errors = 1, demote_saw_after_bypass = 0

demote came first, so sb's queue is demote, quiet, tag: three runs, three catchers.

Example 3

A Typewide Swallow, Switched Off
Input
hush (swallow) typewide; stamp (tag) on chk; mark (tag) on sb; quiet (quiet) typewide; switch off hush
Output
walk_matches = yes (1), walk_back_matches = yes (1), catcher_runs_on_sb = 4, distinct = 3, display_lists_sb = yes (1), switched_off = yes (1), list_printed_after = yes (1), raw_errors = 1, raw_warnings = 1, normal_errors = 1, normal_warnings = 1, bypass_errors = 1, demote_saw_after_bypass = 0

hush is switched off, so chk's warning counts with raw off too. sb has no demote, so its error counts either way.

Constraints and Contract

  • Keep every name and signature.
  • The kit reads and switches catchers; it adds only bypass_c, and only in bypass.

Hints

Hint 1

One way of listing a queue hides the copies the report path runs. Which one?

Hint 2

The callback pools have static functions that start at either end of a queue.

Hint 3

print_catcher lists only typewide catchers that are switched on, and get_report_catcher finds one by name.

Hint 4

One debug call can stop catchers from catching and from changing reports. Remember to give the flags back.

Hint 5

issue() sends the report as it is now. What else must bypass do so the report is not counted twice, and where in the queue must it sit?

What the grader checks: Your kit runs on six environments with hidden catcher stacks. The checks compare your walks with the report path's own and read your counts. They also read the library's listings in the log, the catchers' modes and the report server's counts.

6 checks on UVM · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 3 problems on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

Typewide Catchers First, Then Demote on Sb

Input
quiet (quiet) typewide; tag (tag) typewide; demote (demote) on sb; swallow (swallow) on chk; switch off tag
Expected output
walk_matches = yes (1), walk_back_matches = yes (1), catcher_runs_on_sb = 5, distinct = 3, display_lists_sb = yes (1), switched_off = yes (1), list_printed_after = yes (1), raw_errors = 1, raw_warnings = 1, normal_errors = 0, normal_warnings = 0, bypass_errors = 1, demote_saw_after_bypass = 0

sb's first instance add copied quiet and tag twice each, then demote: five runs, three different catchers. With raw off, demote and swallow hide the error and the warning.

Run samples executes all 3 public checks. Check all tests runs 6 checks on the server.

UVM · server