A 100 Gb/s port sends 20 PCS lanes through a 10:4 bit mux. The far end cannot find all 20 lanes on the four wires. Find the first bad tick and the cause.
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.
The mux below takes ten input lanes, each with two PCS lanes. It sends them on four wires, each with five PCS lanes.
The bench sends 30 bits of every PCS lane. Then the far end looks at each turn of each wire. The log says: ERROR: turn 0 of wire 0 carries no whole PCS lane.
Step 1: find the first tick where a signal differs from a correct mux, and name it. Cycle N of the waveform is tick N − 1.
Step 2: choose the cause from five bugs. Each is real and fails at a different tick.
Step 3 is optional: fix the mux and run the tests.
Four things are course choices, not the standard's. Time is counted in ticks, ten to a PCS-lane bit. The first call after pma_reset is tick 0. The fixture reads each wire on even ticks. A PCS lane may be delayed by 0 to 3 of its own bit times.
The order of the PCS lanes on the wires is free in the standard (83.5.2). So the tests accept any order that is one-to-one and stays.
The lesson's eth_pma is readable. It reorders whole bit times and has no ticks. This tick-level mux is what the problem grades: the diagnosis first, then the optional fix.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
test_number | 8 | input of each check |
Full specification
function automatic void pma_reset();
function automatic [3:0] pma_tick(input [9:0] in); // one tick: ten input lanes in, four wires out
| Item | Rule |
|---|---|
| Tick | a course choice: one PCS-lane bit lasts 10 ticks. The first call after pma_reset is tick 0 |
| Input lane i | carries two PCS lanes, a bit of each in turn. A new bit starts on ticks 0, 5, 10, ... |
| Which lane first | a detail of this tick model. Input lane i sends PCS lane 2i on ticks 0 to 4 of each bit time. PCS lane 2i + 1 follows on ticks 5 to 9 |
| Wire w | carries five PCS lanes, a bit of each in turn. A new bit starts on every even tick and is held for two ticks |
| Same lane again | bits x and x + 5 of a wire belong to the same PCS lane (83.5.2: x + z/n) |
| Order | free: any PCS lane may take any turn of any wire. Each of the 20 goes out in exactly one turn |
| Order over time | the chosen order must stay while the input is valid (83.5.2). After pma_reset it may be new |
| Delay | a course choice: a fixed delay of 0 to 3 PCS-lane bit times for each lane. The standard's limit is much looser (83.5.4, Table 83-1: 92.16 ns for all 100GBASE-R PMAs of one end together) |
| Reading | a course choice: the fixture reads each wire once per bit, on the even tick |
The fixture sends random bits on all 20 PCS lanes. Then it asks, for each turn of each wire, which lane it carries.
Diagnose the Failing Run
The test below runs the buggy design. Read its log, then find where it first goes wrong in the waveform.
Log
Waveform
Click a signal at a cycle to select it. Or focus the waveform and use the arrow keys: Left and Right move one cycle, Up and Down one signal.
Step 3 is optional: fix the code in the editor, then run the tests.
Examples
Example 1
Twenty Random Lanes- Input
96 bit times of random data on all 20 PCS lanes
- Output
pcs_lanes_found_once = 20, pcs_lanes_missing = 0, pcs_lanes_repeated = 0, turns_with_no_lane = 0, turns_that_changed_lane = 0, wire_bits_not_held_two_ticks = 0
Every turn of every wire must carry one whole PCS lane, and every lane must be found once.
Example 2
A Longer Link- Input
three runs with no reset
- Output
pcs_lanes_found_once = 20, pcs_lanes_missing = 0, pcs_lanes_repeated = 0, turns_with_no_lane = 0, turns_that_changed_lane = 0, wire_bits_not_held_two_ticks = 0
The lane in each turn must be the same in all three runs. A mux may not change its order in mid-stream.
Example 3
A Reset in the Middle- Input
two runs with a reset between them
- Output
pcs_lanes_found_once = 20, pcs_lanes_missing = 0, pcs_lanes_repeated = 0, turns_with_no_lane = 0, turns_that_changed_lane = 0, wire_bits_not_held_two_ticks = 0
After a reset the order may be new. It must again be one-to-one.
Constraints and Contract
- Keep
pma_resetandpma_tickwith their arguments. - Keep your state in module-level variables.
pma_resetmust clear all of it. - Do not read the bench: only
intells you what arrives. - Off limits: the names
gen,chunk,run,score,rng,tb,root, names that begin withfx_and the modules of the bench.
Hints
Hint 1
How many PCS lanes share one wire? Count the turns pos takes before it starts again.
Hint 2
Compare pos with the tick number in the first ten ticks.
Hint 3
A wire that skips one turn drifts: the same turn then carries another lane in every bit time.
What the grader checks: The failing run is simulated live with the faulty mux. The first bad tick and each option's symptom come from runs of each version on the same bench. The fix is checked on four fixed links and 16 random ones, each with its own seeded data. The fixture accepts any one-to-one order that stays, with a fixed delay of 0 to 3 bit times. The tick model, the delay limit and the reading tick are course choices. Markers, skew between input lanes, clock recovery and PAM4 are not graded.
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