P11.24.1 Verify Block Lock

MediumVerifyIcarus Verilog · server14 hidden designsReview the topic

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

SignalWidthRole
hidden_receiver8input of each check
Full specification
Signatures (keep them)
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
ItemRule
restart = 1the 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_valid1 if the two bits of the sync header differ (01 or 10)
lock, slipwhat the receiver shows after it has acted on this header
Window64 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 headerthe receiver slips. The window starts again
Out of lock, a window of 64 valid headersblock lock is set at the 64th header
In lock, the 16th invalid header of a windowblock lock is cleared and the receiver slips, both at that header
In lock, a window with 0 to 15 invalid headersnothing changes, and no slip. The next window starts with both counts at zero
Slip1 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 lock and slip only. The fixture's own instances are off limits.
  • Off limits: the names lock_under_test, shake, rng, tb, root, names that begin with fx_ 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

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

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
Expected 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.

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

Icarus Verilog · server