P11.23.1 Verify the PCS Receive Sequence

MediumVerifyIcarus Verilog · server8 hidden designsReview the topic

Write the checker that passes a correct 10 Gb/s PCS receiver and fails eight that get the order of blocks wrong. It sees one block 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 decodes 66-bit blocks into XGMII characters. It must also check their order: a Start block, data blocks, a Terminate block.

Write a checker with three functions. For each block it gets the class of the block and of the next one. It also gets the decoded characters and what the receiver sent.

The fixture runs your checker on a correct receiver and on eight hidden broken ones. All get the same blocks, about 900 of them. Then the correct receiver runs once more, on other blocks.

Your checker must stay silent on the correct receiver and raise an alarm on every broken one.

The receiver has no EEE. So the optional state RX_LI of the standard's diagram is not used, and no block has class LI.

The lesson's library has a readable model of the transmit diagram, eth_66_tx. The receive side differs from it, and that side is graded here.

Signals in the Timeline

SignalWidthRole
hidden_receiver8input of each check
Full specification
Signatures (keep them)
function automatic void chk_reset();
function automatic void chk_block(input bit lock, input int t, input int tn, input [71:0] dec, input [71:0] out);
function automatic bit  chk_alarm();   // 1 = alarm
ItemRule
t, tnthe class of this block and of the next one: 0 C, 1 S, 2 T, 3 D, 4 E. After the last block, tn is 0 (a fixture choice)
dec, outEight characters: bit k is the control flag of character k, bits 8+8k to 15+8k its octet. For a class E block, dec is already eight Error characters
lock = 0stands for every cause that restarts the receiver: reset, test mode, no block lock, a high error ratio. It must send two local fault sets (LBLOCK). The next block is judged as the first one
First block, or after a Terminate, or between framesclass C and class S are passed on. Anything else is an error
Inside a frameclass D is passed on. A good Terminate is passed on. Anything else is an error
A good Terminatea class T block whose next block is class C or class S
After an errora good Terminate, class D and class C are passed on, and the receiver goes on from there. Anything else is another error
Passed onout equals dec
An errorout is eight Error characters (EBLOCK)

These are the rules of Figure 49-17 of IEEE Std 802.3-2022 without its EEE state. A Start block puts the receiver inside a frame; a good Terminate ends it.

After an error, a class D block puts the receiver back inside a frame. A class C block puts it between frames.

Examples

Example 1

The Correct Receiver
Input
About 900 blocks: clean frames, frames with a stray block, damaged blocks and losses of lock
Output
alarm = no

It passes clean frames, also two with no idle between them. It sends eight Error characters for every block out of order, and local fault without lock.

Example 2

A Broken Receiver
Input
The same blocks through one hidden broken receiver
Output
alarm = yes

The receiver accepts every Terminate block, whatever block follows it.

Example 3

A Different Broken Receiver
Input
The same blocks through one hidden broken receiver
Output
alarm = yes

Between frames the receiver passes a data block on as if a frame had started.

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 out only. The fixture's own instances are off limits.
  • Off limits: the names code_ref, rx_under_test, rng, tb, root, names that begin with fx_ and the modules of the bench.

Hints

Hint 1

How many states does the receiver need? What does each one accept?

Hint 2

One broken receiver is stricter than the standard, not looser. Which legal sequence does it flag?

Hint 3

Compare all 72 bits of out. Which broken receiver gets the control flags right and the octets wrong?

What the grader checks: The fixture runs your checker on a private receive model: a correct receiver and eight fault switches. Each gets the same blocks, about 900, built from scripted sequences and random frames. The class of each block and its decoded characters come from the fixture; decoding is not graded here. The receiver has no EEE, so the RX_LI state of Figure 49-17 is not exercised.

10 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 3 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
About 900 blocks: clean frames, frames with a stray block, damaged blocks and losses of lock
Expected output
alarm = no

It passes clean frames, also two with no idle between them. It sends eight Error characters for every block out of order, and local fault without lock.

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

Icarus Verilog · server