Write an interrupt service sequence whose three items reach the driver back to back, ahead of waiting lock requests. It must always release the sequencer.
Hardware context: A shared sequencer with background traffic, locking bursts and an interrupt. Send interrupt service items back to back ahead of waiting lock requests.
A sequencer carries background traffic and, now and then, a burst that holds a lock around its three items. When the interrupt fires, the bench starts service_seq on the same sequencer.
Write service_seq. If the interrupt is still pending, its three items must reach the driver one after another, with nothing between them. They must also go ahead of any burst whose lock request is already waiting. A lock that is already held still finishes first. If the interrupt was already serviced, send nothing. Either way, leave the sequencer free for the others.
Full specification
// Interrupt service: three items, back to back, ahead of any lock request already waiting.
class service_seq extends uvm_sequence #(svc_item);
`uvm_object_utils(service_seq)
bit pending; // 0: the interrupt was already serviced
function new(string name = "service_seq"); super.new(name); endfunction
task body();
endtask
endclass
Each item's code is 4. The sequencer uses the default FIFO arbitration. The driver takes an item every 10 ns. The bench counts every UVM error, including the one a sequence causes if it ends while holding the sequencer.
Examples
Example 1
Interrupt During Background Traffic- Input
12 background items; no burst K; no burst L; interrupt at 25 ns, pending
- Output
service_items = 3, back_to_back = 1, l_items_before_service = 0, background_items = 12, grants = 15
The three service items are granted one after another; the background traffic resumes after them.
Example 2
Burst K Holds a Lock, Burst L Is Waiting- Input
12 background items; burst K locks at 15 ns; burst L locks at 20 ns; interrupt at 25 ns, pending
- Output
service_items = 3, back_to_back = 1, l_items_before_service = 0, background_items = 12, grants = 21
K keeps the sequencer until it unlocks. The service goes next, ahead of L, so no L item comes before it.
Example 3
Interrupt Already Serviced- Input
12 background items; no burst K; no burst L; interrupt at 35 ns, already serviced
- Output
service_items = 0, back_to_back = 1, l_items_before_service = 0, background_items = 12, grants = 12
No service item is sent, and the sequencer is released at once; all twelve background items still go.
Constraints and Contract
- Keep the class name and the pending field.
- Send exactly three items when pending is 1, none when it is 0.
Hints
Hint 1
Under FIFO arbitration, an item priority changes nothing. What keeps other sequences out between your items?
Hint 2
lock() and grab() differ only in where the request goes when other lock requests are already waiting.
Hint 3
Every path out of body must release what it took.
What the grader checks: Your sequence runs on six real sequencers with background traffic, locking bursts and an interrupt at hidden times. The checks read the driver's grant log and count every UVM error.
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