U17.4.1 The Watchdog That Barked at Everyone

MediumFixUVM · server4 hidden designsReview the topic

A heartbeat watchdog raises alarms on a healthy bench and sleeps through a stalled one. Fix its wiring so it is silent through reset and catches any part that stops working.

Hardware context: A bench whose driver, monitor and scoreboard each finish an item every 30 ns, with a reset in the middle of the run. Wire a uvm_heartbeat so it is silent on a healthy bench and through reset, and catches any stalled part.

A bench has a driver, a monitor and a scoreboard. Each finishes an item every 30 ns and proves it by raising and dropping the environment's progress objection. From 300 to 420 ns the design is in reset, and all three are rightly silent.

The bench's watchdog uses a uvm_heartbeat on that objection. As written, it reports failures on a healthy bench, and it misses a scoreboard that stops working.

A debug port, env.ext, is plugged in from 485 to 705 ns. While it is plugged in it must make progress too; before and after, it is rightly silent.

Fix bench_watchdog. It must stay silent on the healthy bench, including through reset and after the port is unplugged. It must report a failure when any one part, all of them, or the plugged-in port stops working, within 100 ns.

Full specification
What you fix
// The bench's watchdog. hb_env creates it and sets env before build_phase ends.
class bench_watchdog extends uvm_component;
  `uvm_component_utils(bench_watchdog)
  hb_env env;
  uvm_heartbeat hb;
  uvm_event #(uvm_object) window;
  function new(string name, uvm_component parent); super.new(name, parent); endfunction
  task run_phase(uvm_phase phase);
    uvm_component parts[$] = '{env.drv, env.mon, env.sb};
    window = new("window");
    hb = new("hb", env.sb, env.progress);       // where the progress objection is counted
    void'(hb.set_mode(UVM_ANY_ACTIVE));
    hb.set_heartbeat(window, parts);
    fork
      forever begin                                // a window of 2 clocks
        repeat (2) env.tick.wait_trigger();
        window.trigger();
      end
    join_none
  endtask
endclass
GivenWhat it offers
env.drv, env.mon, env.sbEach raises and drops env.progress once per item, every 30 ns, at its own offset.
env.progressThe environment's own uvm_objection, with default propagation.
env.tickTriggered every clock, 10 ns.
env.rstOn from 300 to 420 ns: use wait_on and wait_off.
env.ext, env.plugThe debug port raises env.progress every 30 ns while plugged in. plug is on from 485 to 705 ns.

A failure is any HBFAIL report that names this bank. Each bank runs to 800 ns. A planted fault starts at 600 ns, or at 485 ns for a dead port. It counts as caught only when the bank's first HBFAIL comes after the fault starts and at most 100 ns later.

Examples

Example 1

The Healthy Bench Must Stay Silent
Input
Healthy bench; items every 30 ns per part; reset 300-420 ns; run to 800 ns
Output
alarm = no

Every part raises once per 30 ns, except in reset. A window of at least 30 ns in ALL mode, with the heartbeat stopped in reset, never fails.

Example 2

A Stalled Scoreboard Must Be Caught
Input
Scoreboard stalls at 600 ns; items every 30 ns per part; reset 300-420 ns; run to 800 ns
Output
alarm = yes

From 600 ns the scoreboard never raises. The first full window after that has no raise from it, and ALL mode reports it.

Example 3

A Stalled Monitor Must Be Caught
Input
Monitor stalls at 600 ns; items every 30 ns per part; reset 300-420 ns; run to 800 ns
Output
alarm = yes

The same, for the monitor. In ANY mode the driver's raises would hide it.

Constraints and Contract

  • Keep the class name, its fields and the use of uvm_heartbeat.
  • Do not raise, drop or reconfigure the objection for the parts.
  • Do not change the severity of HBFAIL.

Hints

Hint 1

A heartbeat counts a raise only when it reaches the heartbeat's context. Which component do all three parts' raises pass through?

Hint 2

In which mode does one silent part fail the window? In which mode is one busy part enough?

Hint 3

How long is the longest gap between two items of one part? A window shorter than that fails a healthy part.

Hint 4

A component the heartbeat never hears from is not checked unless it is listed. What happens to a listed part that goes quiet for good?

What the grader checks: Your watchdog runs in five real benches. One is healthy, three have parts that stall at 600 ns, and one has a dead plugged-in port. A bench raises an alarm when the library reports HBFAIL for it. The reports are counted per bench, with the time of the first. The planted fault lives in private fields your code cannot read.

5 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 2 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

The Healthy Bench Must Stay Silent

Input
Healthy bench; items every 30 ns per part; reset 300-420 ns; run to 800 ns
Expected output
alarm = no

Every part raises once per 30 ns, except in reset. A window of at least 30 ns in ALL mode, with the heartbeat stopped in reset, never fails.

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

UVM · server