Every PCS lane of a 40 or 100 gigabit receiver finds its own block boundary. Build that lock, with the counts of Clause 82.
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.
Each lane of a 40GBASE-R or 100GBASE-R receiver locks to its 66-bit blocks alone, from its own sync headers (82.2.12).
Write lane_lock. The bench calls it once for every sync header of every lane. It returns the block lock of that lane, and whether the lane slips.
The diagram is Figure 82-12. It has the shape of the 10GBASE-R one in P11.24, with other numbers.
To get lock, a lane still needs 64 valid headers in a row. In lock the window is 1,024 headers, and 65 invalid ones make the lane slip.
You may port your checker from P11.24.1. P10's readable hs_blk_lock has these counts as settings, and you may port that too.
That is why this problem is Easy. What is yours: the two windows, the limit, and a state for every lane.
Three things are bench choices. The headers come already marked as valid or invalid. The bits a slip skips are not shown.
And restart is one call that stands for reset and for loss of signal. In the standard that term is common to all lanes.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
test_number | 8 | input of each check |
Full specification
function automatic [1:0] lane_lock(input bit restart, input int lane, input bit sh_valid);
// returns {slip, lock} of that lane after this header
| Item | Rule |
|---|---|
restart = 1 | every lane is out of lock and all counts start again. lane, sh_valid and the result are ignored |
lane | 0 to 19. A 40GBASE-R PCS uses 0 to 3. Each lane has its own lock and its own counts |
sh_valid | 1 if the two bits of the sync header differ (01 or 10) |
| Out of lock, a valid header | it is counted. The 64th in a row sets lock at that header |
| Out of lock, an invalid header | the lane slips. The count starts again |
| In lock | headers are counted in windows of 1,024. The first window starts with the header after the one that set lock |
| In lock, the 65th invalid header of a window | lock is cleared and the lane slips, both at that header |
| In lock, a window with 0 to 64 invalid headers | nothing changes. The next window starts with both counts at zero |
slip | 1 only at a header that makes this lane slip |
| Other lanes | a header of one lane changes nothing on another lane |
These are the rules of Figure 82-12 of IEEE Std 802.3-2022. The PCS has no EEE, so this lock is the block_lock of 82.2.12.
The fixture starts every run with one call that has restart = 1.
Examples
Example 1
64 Valid Headers- Input
lane 0: 64 valid headers
- Output
lock = yes, slips = 0, lock_set_at_header = 64, lock_lost_at_header = 0, headers = 64
The lane starts out of lock. The 64th valid header in a row sets lock.
Example 2
64 Invalid Headers in One Window- Input
lane 3: 64 valid headers, then 64 invalid ones, then 100 valid ones
- Output
lock = yes, slips = 0, lock_set_at_header = 64, lock_lost_at_header = 0, headers = 228
The first window starts after the lock. It holds 64 invalid headers, one fewer than the limit, so lock is kept and nothing slips.
Example 3
The 65th Invalid Header- Input
lane 19: 64 valid headers, then 65 invalid ones
- Output
lock = no, slips = 1, lock_set_at_header = 64, lock_lost_at_header = 129, headers = 129
Lock is set at header 64. The 65th invalid header of the window is header 129. There the lane slips and lock is lost.
Constraints and Contract
- Keep the name and the arguments of
lane_lock. - Keep your state in module-level variables.
restartmust clear all of it. - Off limits: the names
rng,tb,root, names that begin withfx_and the modules of the bench.
Hints
Hint 1
Out of lock, can the count of invalid headers ever be more than zero?
Hint 2
In lock, which headers end a window: the 1,024th, the 65th invalid one, or both?
Hint 3
An invalid header is the 65th of its window and also the 1,024th header. Which rule wins?
What the grader checks: The fixture checks 22 scripted lanes against an independent JavaScript model. It then sends 60,000 random headers on five lanes and compares every answer with a private model. The random headers change with every full check. Headers are already marked valid or invalid, and the bits a slip skips are not shown: both are bench choices. Line bits, EEE and the marker lock that follows are not graded.
24 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