An always-on receiver counts requests from a block that has its own warm reset. After a reset of the sender, the receiver counts one request too many. Find the first bad cycle, name the cause, and fix the receiver.
Hardware context: Reset domains of ap_soc v1.5: a core-only reset beside a running fabric, the always-on bridge's guards, and a gate netlist. A receiver that takes a reset for a request.
A request crosses from clk_sys to the always-on clock as a toggle. The sender flips one flop for each request; the receiver finds each edge after two flops. The sender also has a flag, alive, that is 1 while it is out of reset. Both are reset by the sender's warm reset; the receiver is not.
This copy of the receiver fails the bench below. Run it and read the log and the waveform. The bench sends three requests, resets the sender while its toggle is 1, then sends one more.
Step 1: find the first cycle where take or taken differs from what the bench expects, and name the signal. Step 2: choose the cause. Step 3, optional: fix the receiver; the fix is graded by the normal cases.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
scenario | 4 | input of each check |
Full specification
// The always-on receiver of a request toggle from clk_sys. The sender's toggle flop and its alive flag are reset by the
// sender's warm reset; this receiver is reset by power-on only.
module rdc_rx (
input logic clk_a, // the always-on clock
input logic resetn_a, // power-on reset of the receiver
input logic toggle, // the sender's request: it changes once for each request
input logic alive, // 1 while the sender is out of reset
output logic take, // one cycle for each request taken
output logic [7:0] taken // requests taken so far
);
...
endmodule
A correct receiver takes a request once the edge of toggle has passed both flops. The sender must also be out of reset, as alive says. It ignores any edge the sender's reset makes.
Cycle N is the stretch after the N-th rising edge of clk_a. The bench checks take and taken in the middle of every cycle.
Diagnose the Failing Run
The test below runs the buggy design. Read its log, then find where it first goes wrong in the waveform.
Log
Waveform
Click a signal at a cycle to select it. Or focus the waveform and use the arrow keys: Left and Right move one cycle, Up and Down one signal.
Step 3 is optional: fix the code in the editor, then run the tests.
Examples
Example 1
A Reset with the Toggle at 1- Input
3 requests, a warm reset of 40 ns, 1 requests, 150 ns apart
- Output
taken = 4, take_pulses = 4, early = 0
The reset clears the sender's toggle from 1 to 0: an edge nobody sent. A correct receiver counts four requests, not five.
Example 2
A Reset with the Toggle at 0- Input
2 requests, a warm reset of 40 ns, 2 requests, 150 ns apart
- Output
taken = 4, take_pulses = 4, early = 0
Here the reset makes no edge, so even a careless receiver gets this one right.
Example 3
A Long Reset- Input
1 requests, a warm reset of 200 ns, 1 requests, 150 ns apart
- Output
taken = 2, take_pulses = 2, early = 0
The length of the reset does not matter; what matters is the edge it makes.
Constraints and Contract
- Keep the module name and the ports.
- The receiver is reset by resetn_a only.
Hints
Hint 1
When the sender is reset, what happens to its toggle flop, and how does the receiver see that?
Hint 2
Which input tells the receiver that an edge of toggle was made by a reset?
Hint 3
Look at the cycle the error appears: was any request sent near it?
What the grader checks: The failing run is simulated live with the shipped receiver. The fix is graded on five scripts of requests and warm resets of the sender. Each reports how many requests were taken, how many take pulses there were, and how many came too soon after an edge.
5 checks on Icarus · browser samples / server checks. 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