P11.10.1 Verify Pause Handling

MediumVerifyIcarus Verilog · server4 hidden designsReview the topic

Write the checker that passes a correct 10 Gb/s station and fails four that mishandle PAUSE frames. It sees only the frame starts.

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 10 Gb/s station receives PAUSE frames from its link partner. It must stop starting data frames for the time each one asks, and start again when that time is over.

Write a checker with five functions. It hears every PAUSE the station receives and every frame the station starts. At the end it says whether the station broke a rule.

The fixture runs your checker on a correct station and on four hidden broken ones. All get the same PAUSE frames in the same run. Then the correct station runs once more, with other frame sizes. The station always has data waiting.

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

Signals in the Timeline

SignalWidthRole
hidden_station8input of each check
Full specification
Signatures (keep them)
function automatic void chk_reset();
function automatic void chk_pause(input int t, input int q);                  // a valid PAUSE ended at t
function automatic void chk_start(input int t, input int dur, input bit ctrl); // a frame starts at t
function automatic void chk_done(input int t);                                 // end of the run
function automatic bit  chk_alarm();                                           // 1 = alarm
ItemRule
Timeoctet times: 8 bit times. One pause quantum is 64 octet times
durhow long the frame keeps the line busy, with its preamble, delimiter and gap
Stopafter a PAUSE with q > 0 at time t, no data frame may start from t + 60 quanta until t + q quanta. 31B.3.7 allows 60 quanta at 10 Gb/s
Overridea newer PAUSE replaces the older one. q = 0 ends the pause at once
Control framesctrl = 1 marks a MAC Control frame. PAUSE never holds those back
Keep busy (bench rule)the station always has data. Once the line is free and no pause holds it, a data frame must start within one quantum

Calls come in time order. A frame already started always finishes.

Examples

Example 1

The Correct Station
Input
One run of 120,000 octet times with eight PAUSE frames
Output
alarm = no

It stops within its reaction time, waits out each PAUSE, obeys every override and sends its own control frame while paused.

Example 2

A Broken Station
Input
The same run on one hidden broken station
Output
alarm = yes

The station keeps sending data frames whatever it receives.

Example 3

A Different Broken Station
Input
The same run on one hidden broken station
Output
alarm = yes

A new PAUSE adds its time to what is left, and pause_time 0 cancels nothing.

Constraints and Contract

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

Hints

Hint 1

Keep only the latest PAUSE. Which two times does it define?

Hint 2

A data frame that starts just after a PAUSE arrives may be legal. How long may the station take to react?

Hint 3

One broken station never breaks the stop rule. What does it do wrong instead?

What the grader checks: The fixture runs your checker on the library's PAUSE model: a correct station and four fault switches. Each gets one run with the same eight PAUSE frames and random frame sizes. On a full check the PAUSE frames and the frame sizes change with every submission. Time is counted in octet times; the keep-busy rule is a bench rule, not 802.3's.

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 Station

Input
One run of 120,000 octet times with eight PAUSE frames
Expected output
alarm = no

It stops within its reaction time, waits out each PAUSE, obeys every override and sends its own control frame while paused.

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

Icarus Verilog · server