P11.37.1 Resolve the Highest Common Mode

EasyImplementIcarus Verilog · serverReview the topic

Two backplane ports have traded 48-bit pages. Read a page off the line, then decide the technology, the FEC and the pause setting, and check the nonces.

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.

Write four functions of Clause 73 auto-negotiation.

dme_decode turns the line levels of one DME page back into 48 bits. The bench is a model: one level for each transition position.

Course choice: when the delimiter or a clock position is wrong, dme_decode returns 0 in all 49 bits.

resolve gets this port's base page and the partner's. It returns the technology, the FEC and the pause setting of this port.

Course choice: the technology is returned as its ability bit number, 0 to 15. With nothing in common the whole result is 0.

Some technologies have a FEC that is fixed by the PHY, and some have none. For both, fec is 0.

So fec = 0 does not mean "no FEC". It means that the F bits switch nothing on.

Pause is resolved whenever a technology is found, by Table 28B-3 as this port sees it.

That is the standard's rule: every PHY of Table 73-4 is full duplex only (70.1, 4.2.7.4, 125.1).

ack_page returns the page this port sends once it has matched the partner's page three times.

nonce_verdict makes the two nonce checks of Figure 73-11 on a page that has matched. Course choice: one code, with the checks in the order of the states.

The lesson has the field strip, the two tables and the FEC rules. Its readable model is the sender and the fields only.

Each rule is on the lesson page. Your work is to join them: the priority as an order of ability bits, and the F bits for each winner.

Signals in the Timeline

SignalWidthRole
test_number8input of each check
Full specification
Signatures (keep them)
function automatic [48:0] dme_decode(input bit start_level, input [105:0] level);
function automatic [8:0] resolve(input [47:0] mine, input [47:0] theirs);
function automatic [47:0] ack_page(input [47:0] mine, input [47:0] theirs);
function automatic [1:0] nonce_verdict(input [47:0] mine, input [47:0] theirs);
ItemRule
Pagebit k is Dk of Figure 73-6. D0 is the first bit on the wire
levellevel[k] is the line level after transition position k + 1. start_level is the level before position 1
dme_decodebit 48 is ok. Bits 47:0 are the page. The pseudo-random bit is not part of the page
resolvebits 3:0: the ability bit number of the technology. Bit 4: found. Bits 6:5: fec. Bit 7: this port may send PAUSE frames. Bit 8: it obeys them
fec0: the F bits switch nothing on. 1: they switch BASE-R FEC on. 2: they switch RS-FEC on (73.6.5)
Reserved bitsA16 to A22 and C2 play no part (73.6.4)
ack_pagemine is the page as sent in ABILITY DETECT. Only what the standard changes may change
nonce_verdict0 wait: no reason to restart, and no Acknowledge yet. 1 restart: the partner sent this port's own nonce. 2 restart: the echo is wrong. 3 go on
Pages in the teststhe IEEE 802.3 selector, base pages only. An echo may be wrong on purpose

Random tests compare each function with a private model.

Examples

Example 1

40G Against 25G
Input
in common: 10GBASE-KR, 40GBASE-KR4 and 25GBASE-KR or CR
Output
technology_ability_bit = 3, found = 1, fec = 1, may_send_pause = 1, obeys_pause = 1

40GBASE-KR4 is row 9 of Table 73-5 and 25G is row 10, so ability bit 3 wins over bit 10. Both ends are able (F0) and one requests (F1): BASE-R FEC. Both set PAUSE: send and obey.

Example 2

A Page off the Line
Input
106 levels, from a line at level 0
Output
page = 0xc00090960401, ok = 1

The line changes at positions 1 and 5: the delimiter. From position 9 on, every odd position has a transition. An even position with a transition is a 1.

Example 3

Two 25G Ports
Input
one requests RS-FEC, the other BASE-R FEC
Output
technology_ability_bit = 10, found = 1, fec = 2, may_send_pause = 0, obeys_pause = 0

Both offer the full 25G mode, bit 10. There RS-FEC wins when either end requests it: fec = 2.

Constraints and Contract

  • Keep the four names and their arguments.
  • A call must not depend on the calls before it.
  • You may add helper functions.
  • Declare your variables at the top of a function, not inside a loop, and do not return from inside a loop.
  • Do not call a variable cell or use: both are reserved keywords of SystemVerilog (IEEE 1800 Annex B).
  • Off limits: the names ref_a, rng, tb, root and the modules of the bench.
  • The fixture's own names are off limits too. They begin with fx_.

Hints

Hint 1

A transition is a level that differs from the level one position earlier.

Hint 2

Write the priority table as a list of ability bit numbers, the best first. Then test them in that order.

Hint 3

Sort the technologies into three groups for FEC: one 25G lane, lanes of 10 Gb/s with optional FEC, and the rest.

Hint 4

The four F bits do not sit in the order of their numbers. Read the field strip again.

Hint 5

For pause, you may port your answer of P11.21.1. Only the bit numbers change.

Hint 6

The echo carries the nonce the partner sent. This port's own nonce stays where it is.

What the grader checks: A JavaScript model gives the expected values of the scripted tests. They are sixteen pages off the line and thirty-two pairs through resolve, then five pairs through ack_page and fourteen through nonce_verdict. Five more tests compare each function with a private model on random input; one of them walks through every pair of technologies. The model's priority order is typed twice, from Table 73-4 and from Table 73-5. The two must agree when the problem is built. The DME line is a model in whole positions: no timing, no jitter. The arbitration states, the match variables, Next Pages, parallel detection and the timers are not graded. fec = 0 never means "no FEC". It is the result when the F bits decide but nobody requests. It is also the result for the technologies that 73.6.5 does not name. Of those, the 50G, 200G and 100G PHYs on two or four lanes always run RS-FEC. For 1000BASE-KX, 2.5GBASE-KX, 5GBASE-KR and 10GBASE-KX4 the F bits decide nothing either.

72 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

40G Against 25G

Input
in common: 10GBASE-KR, 40GBASE-KR4 and 25GBASE-KR or CR
Expected output
technology_ability_bit = 3, found = 1, fec = 1, may_send_pause = 1, obeys_pause = 1

40GBASE-KR4 is row 9 of Table 73-5 and 25G is row 10, so ability bit 3 wins over bit 10. Both ends are able (F0) and one requests (F1): BASE-R FEC. Both set PAUSE: send and obey.

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

Icarus Verilog · server