U18.5.1 Two Teams, One Driver

MediumImplementUVM · serverReview the topic

Three teams change one lane driver: two add beat edits that must stack, one replaces the timing. Pick the extension point for each and register it at the right moment.

Hardware context: Lane VIP with a callback hook, a virtual method and a timing delegate. Combine two stacking edits and one timing replacement on one driver.

The lane VIP offers three extension points. There is a callback hook, pre_send, and a virtual method, shape, for a subclass. There is also a timing delegate, lane_pacer, read from the configuration database in build_phase.

Team A wants bad parity on chosen items; team B wants inverted data on chosen items. Any lane may use either team, both, or neither. Team C replaces the timing on some lanes: two idle clocks before every beat. Write the three extensions and the two setup functions so every combination reaches the pins.

Full specification
What you write
// Team A: bad parity on the items in on.
class team_a_cb extends lane_cb;
  `uvm_object_utils(team_a_cb)
  int on[$];
  function new(string name = "team_a_cb"); super.new(name); endfunction
endclass

// Team B: inverted data on the items in on.
class team_b_cb extends lane_cb;
  `uvm_object_utils(team_b_cb)
  int on[$];
  function new(string name = "team_b_cb"); super.new(name); endfunction
endclass

// Team C: two idle clocks before every beat.
class slow_pacer extends lane_pacer;
  `uvm_object_utils(slow_pacer)
  function new(string name = "slow_pacer"); super.new(name); endfunction
endclass

// Called in the test's build_phase, before the lane named lane is created.
function automatic void at_build(uvm_component test, string lane, bit slow);
endfunction

// Called in the test's connect_phase with the lane's driver and the two teams' item lists.
function automatic void at_connect(lane_driver drv, int par_on[$], int inv_on[$]);
endfunction
Extension pointHow the VIP uses it
lane_cb::pre_send(drv, it, beat)A callback hook, after the driver builds the beat.
lane_driver::shape(it, beat)A virtual method, before the callbacks. A subclass may override it.
lane_pacer::before_beat(drv)A task the driver calls before it raises valid. The default waits for one falling edge. The driver reads "pacer" from the configuration database in build_phase.

With normal timing the beats are taken at 15, 35, 55 and 75 ns. With team C's timing the driver raises valid on the third falling edge after it is free. The beats are then taken at 35, 65, 95 and 125 ns.

Examples

Example 1

Both Teams on One Lane
Input
team A on [2], team B on [3], normal timing
Output
bad_parity_beats = {2}, inverted_data_beats = {3}, beat1_ns_div5 = 3, beat2_ns_div5 = 7, beat3_ns_div5 = 11, beat4_ns_div5 = 15, beats = 4

Two callbacks on one driver: beat 2 has bad parity, beat 3 inverted data, normal timing.

Example 2

Both Teams and the Slow Timing
Input
team A on [1], team B on [4], slow timing
Output
bad_parity_beats = {1}, inverted_data_beats = {4}, beat1_ns_div5 = 7, beat2_ns_div5 = 13, beat3_ns_div5 = 19, beat4_ns_div5 = 25, beats = 4

The slow pacer was in the configuration database before the driver's build_phase, so every beat comes 30 ns apart from 35 ns.

Example 3

Team A Only, Slow
Input
team A on [3, 4], team B on [], slow timing
Output
bad_parity_beats = {3, 4}, inverted_data_beats = {}, beat1_ns_div5 = 7, beat2_ns_div5 = 13, beat3_ns_div5 = 19, beat4_ns_div5 = 25, beats = 4

Only team A's callback is active on this lane; beats 3 and 4 carry bad parity.

Constraints and Contract

  • Keep every name and signature; the bench calls at_build and at_connect for each lane.
  • Edit the beat, never the item.
  • Both teams' edits must appear when both are asked for, even on the same item.

Hints

Hint 1

Which extension points can two teams use on the same lane at once?

Hint 2

The driver reads its pacer once, in build_phase. When must the pacer be in the configuration database?

Hint 3

A callback cannot wait inside pre_send, and the timing change happens before valid rises. Which extension point owns that moment?

What the grader checks: Your extensions run on six real lanes, each with a hidden mix of teams. The checks read the parity, data and time of every beat the sink took.

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 1 problem 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

Both Teams on One Lane

Input
team A on [2], team B on [3], normal timing
Expected output
bad_parity_beats = {2}, inverted_data_beats = {3}, beat1_ns_div5 = 3, beat2_ns_div5 = 7, beat3_ns_div5 = 11, beat4_ns_div5 = 15, beats = 4

Two callbacks on one driver: beat 2 has bad parity, beat 3 inverted data, normal timing.

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

UVM · server