Write the checker that passes a correct 10 Gb/s block lock and fails fourteen broken ones. It sees one sync header at a time.
Hardware context: An Ethernet MAC and physical coding sublayer: frame builder and checker, reconciliation sublayer and block encoder. Build, check and pace Ethernet frames, and code them for the physical layer as IEEE 802.3 specifies.
A 10GBASE-R receiver finds the 66-bit block boundary from the sync headers. It sets block lock, holds it through a few bad headers, and gives it up after too many.
Write a checker with three functions. For each sync header it is told whether the header is valid. It also sees what the receiver did: its block lock, and whether it slipped.
The fixture runs your checker on a correct receiver and on fourteen hidden broken ones. Each run has a few thousand headers.
Every run starts with random headers of its own, then a restart. The last run is the correct receiver again, on other headers.
Your checker must stay silent on the correct receiver and raise an alarm on every broken one.
Two things are fixture choices, not the standard's. The checker gets only the headers the receiver tests: the bits skipped by a slip are not shown. And restart stands for both reset and loss of signal.
The receiver has no EEE, so its block lock is the lock of the diagram.
P10.4 has a readable receiver, hs_blk_lock, that works on line bits with the same counts. You may port its logic.
What is graded is the checker around it: one call per header, the restart, and the comparison of both outputs.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
hidden_receiver | 8 | input of each check |
Full specification
function automatic void chk_reset();
function automatic void chk_header(input bit restart, input bit sh_valid, input bit lock, input bit slip);
function automatic bit chk_alarm(); // 1 = alarm
| Item | Rule |
|---|---|
restart = 1 | the receiver is in reset or has no signal. Its block lock must be 0 and it must not slip. The header is not counted, and all counts start again |
sh_valid | 1 if the two bits of the sync header differ (01 or 10) |
lock, slip | what the receiver shows after it has acted on this header |
| Window | 64 sync headers. The first window starts at the first header after a restart. A new one starts after every window, every slip and every lock |
| Out of lock, an invalid header | the receiver slips. The window starts again |
| Out of lock, a window of 64 valid headers | block lock is set at the 64th header |
| In lock, the 16th invalid header of a window | block lock is cleared and the receiver slips, both at that header |
| In lock, a window with 0 to 15 invalid headers | nothing changes, and no slip. The next window starts with both counts at zero |
| Slip | 1 only at a header that makes the receiver slip. 0 at every other header |
These are the rules of Figure 49-14 of IEEE Std 802.3-2022. In the standard a slip moves the search by one bit, and the next header tested is at the new position.
The fixture calls chk_reset() once, before the first header of a run.
Examples
Example 1
The Correct Receiver- Input
A few thousand sync headers: a random lead-in, near misses, windows with 15 and 16 invalid headers, restarts and random noise
- Output
alarm = no
It locks at the 64th valid header in a row. It holds lock through windows with 15 invalid headers and drops it at the 16th.
Example 2
A Broken Receiver- Input
The same kind of run through one hidden broken receiver
- Output
alarm = yes
Out of lock, the receiver sets block lock at the first valid sync header.
Example 3
A Different Broken Receiver- Input
The same kind of run through one hidden broken receiver
- Output
alarm = yes
The receiver sets block lock after 63 valid sync headers.
Constraints and Contract
- Keep the three function names and their arguments.
- Keep your state in module-level variables, and clear it in
chk_reset(). - Judge the receiver by
lockandsliponly. The fixture's own instances are off limits. - Off limits: the names
lock_under_test,shake,rng,tb,root, names that begin withfx_and the modules of the bench.
Hints
Hint 1
Which header sets block lock: the 63rd, the 64th or the 65th valid one?
Hint 2
In lock, does an invalid header at the very end of a window count in the next window too?
Hint 3
Some broken receivers show the right lock and the wrong slip. Compare both.
What the grader checks: The fixture runs your checker on a private lock model: a correct receiver and fourteen fault switches. Each run has a few thousand headers: a random lead-in of its own, scripted sequences and random noise. The correct receiver runs twice, the second time on other headers. On a full check the headers change with every submission. Random headers and a restart then come before each scripted sequence. The checker sees headers, not line bits. The bits skipped by a slip are not shown. restart stands for reset and loss of signal. The receiver has no EEE.
16 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 2 steps and the final capstone