A traffic sequence holds the run phase open while it sends, then lets the run end with results still inside the pipeline. Make it hold the run until every result is checked.
Hardware context: Pipelines of different latency whose traffic sequences hold the run phase. Hold the run phase until the last result of each lane is checked.
Each lane has a pipeline that returns x + 1 some clocks after it takes x. A checker counts what went in and checks what comes out. The test raises no objection of its own: each lane's traffic_seq keeps the run phase open.
The regression passes, but the checkers report fewer results than items sent. traffic_seq drops its objection as soon as its last item is driven, while the last results are still in the pipeline. Fix traffic_seq so the run ends only after every result of its lane has been checked, whatever the pipeline's latency.
Full specification
class traffic_seq extends uvm_sequence #(pipe_item);
`uvm_object_utils(traffic_seq)
int n_items;
pipe_checker chk; // this lane's checker, set by the test
uvm_phase run; // the run phase, set by the test
function new(string name = "traffic_seq"); super.new(name); endfunction
task pre_start();
run.raise_objection(this, "traffic");
endtask
task body();
for (int i = 0; i < n_items; i++) begin
pipe_item it = pipe_item::type_id::create("it");
start_item(it);
it.x = 8'(16 * i + 3);
finish_item(it);
end
endtask
task post_start();
run.drop_objection(this, "traffic");
endtask
endclass
| Given | Meaning |
|---|---|
| run | The run phase. The test sets it before starting the sequence. |
| chk.sent, chk.checked | Items the pipeline took, and results the checker has compared. |
Latencies differ by lane and are not known to the sequence. The lanes share one run phase. So the bench records when each lane's objection dropped, and how many results its checker had compared by then. The drop must come within one clock after the lane's last check. The bench's timeout is 3000 ns.
Examples
Example 1
Three Items, Latency 3- Input
3 items, pipeline latency 3 clocks
- Output
items = 3, sent = 3, checked = 3, wrong = 0, still_owed = 0, checked_when_dropped = 3, dropped_within_a_clock_of_the_last_check = yes (1)
Three items go in, and all three results are checked before this lane drops its objection. It drops in the clock of the last check; nothing is owed.
Example 2
Five Items, Latency 6- Input
5 items, pipeline latency 6 clocks
- Output
items = 5, sent = 5, checked = 5, wrong = 0, still_owed = 0, checked_when_dropped = 5, dropped_within_a_clock_of_the_last_check = yes (1)
The last result comes back six clocks after the last item. The sequence holds its objection until the checker has seen it.
Example 3
Two Items, Latency 1- Input
2 items, pipeline latency 1 clocks
- Output
items = 2, sent = 2, checked = 2, wrong = 0, still_owed = 0, checked_when_dropped = 2, dropped_within_a_clock_of_the_last_check = yes (1)
A short pipeline: this lane drops one clock after its last item, while slower lanes still hold the run.
Constraints and Contract
- Keep the class name and its fields.
- Raise and drop exactly one objection per sequence.
Hints
Hint 1
When does body return: when the last result is back, or when the last item has been driven?
Hint 2
A fixed delay before the drop is a guess about the slowest lane.
Hint 3
The checker already counts what came back. What can the sequence wait for before it drops?
What the grader checks: Your sequence runs on six real pipelines with hidden latencies and item counts, and nothing else holds the run phase open. The checks read, after the run, how many items each pipeline took and how many results its checker compared.
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