P11.6.1 Verify the Interframe Gap

MediumVerifyIcarus Verilog · server4 hidden designsReview the topic

Write the checker that passes a correct XGMII reconciliation sublayer and fails four broken ones, by watching the lanes alone.

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.

On a 10 Gb/s XGMII, every Start must sit on lane 0. The reconciliation sublayer (RS) moves the gap a little to get there. It uses the deficit idle count of 46.3.1.4.

Write a checker with three functions. chk_reset() starts a run. chk_col(c, d) takes one XGMII column. chk_alarm() says, after the run, whether the RS broke a rule.

The fixture runs your checker on a correct RS and on four hidden broken ones. Each sees the same five runs of back-to-back frames. Then the correct RS runs once more, on other frames.

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

Signals in the Timeline

SignalWidthRole
hidden_rs8input of each check
Full specification
Signatures (keep them)
function automatic void chk_reset();
function automatic void chk_col(input [3:0] c, input [31:0] d);   // lane l: c[l], d[8*l +: 8]
function automatic bit chk_alarm();   // 1 = alarm
CharacterControl flagOctet
Start1FBh
Terminate1FDh
Idle107h
Preamble, SFD, frame data0any
ItemRule
GapThe Terminate and every character after it, up to the character before the next Start
MACEvery frame is sent with the minimum gap of 12 characters; there are no idle periods
RSDeletes or inserts idle so that Start lands on lane 0, keeping the deficit idle count of 46.3.1.4. An RS that always inserts is legal by 46.3.1.4, but not one that claims the count, as this one does
RunsFive runs; each begins with a Start on lane 0 after reset, and ends with a Start

Examples

Example 1

The Correct RS
Input
Five runs of back-to-back frames on the correct RS
Output
alarm = no

Its gaps run from 9 to 15 characters, and its count stays between 0 and 3.

Example 2

A Broken RS
Input
The same five runs on one hidden broken RS
Output
alarm = yes

The RS deletes idle every time Start would miss lane 0, and never inserts. Every gap is 9 to 12 characters.

Example 3

A Different Broken RS
Input
The same five runs on one hidden broken RS
Output
alarm = yes

The RS sends the MAC's 12 characters as they are, so Start lands on any lane.

Constraints and Contract

  • Keep the three function names and their arguments.
  • Keep your state in module-level variables, and clear it in chk_reset().
  • Decide from the columns only. The fault switches are not visible to you.
  • Off limits: the names rs, scenario, rng, tb, root, names that begin with fx_ and the modules of the bench.

Hints

Hint 1

Turn each gap into a number first. Where does a gap start, and does the Terminate count?

Hint 2

With the MAC at 12, a gap of 10 means two idles were deleted. A gap of 15 means three were inserted.

Hint 3

The count has a lower bound as well as an upper one. Which broken RS breaks only the lower one?

What the grader checks: The fixture runs your checker on the library's RS model: a correct one and four fault switches. Each gets five runs of back-to-back frames at a MAC gap of 12. The faulty count reaches 4 inside a run and ends it in range, so it is caught only gap by gap. There are no idle periods and no Error or LPI characters. On a full check the frames change with every submission. Each run of one size then begins with a few frames of other sizes.

6 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 1 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 RS

Input
Five runs of back-to-back frames on the correct RS
Expected output
alarm = no

Its gaps run from 9 to 15 characters, and its count stays between 0 and 3.

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

Icarus Verilog · server