Read a PFC frame and hold exactly the priorities it names, each for its own 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 port with priority-based flow control keeps eight queues. One PFC frame can stop some of them and leave the rest alone.
Write pfc_rx. When the frame is a valid PFC frame, it sets the hold time of each priority the frame enables and returns 1. Any other frame changes nothing and returns 0.
pfc_blocked is given. It says whether priority p is held at time t.
Time is counted in octet times. One pause quantum, 512 bit times, is 64 octet times.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
test_number | 8 | input of each check |
Full specification
int hold_end [0:7];
function automatic void pfc_reset();
function automatic bit pfc_rx(input [511:0] frame, input int n, input int t); // frame[8*k +: 8] = octet k
function automatic bit pfc_blocked(input int p, input int t); // given
| Octets | PFC frame |
|---|---|
| 0 to 5 | destination 01-80-C2-00-00-01 |
| 6 to 11 | source address |
| 12, 13 | 88-08 |
| 14, 15 | opcode 01-01 |
| 16, 17 | priority_enable_vector, high octet first |
| 18 to 33 | time[0] to time[7], two octets each, high octet first |
| 34 to 59 | zeros |
| 60 to 63 | FCS |
| Rule | Value |
|---|---|
| Valid PFC frame | exactly 64 octets, that destination, 88-08 and 01-01. Anything else is ignored |
| Longer control frames | this port discards them (a bench choice); 31.5.1 also allows truncating such a frame and acting on it |
| e[p] | bit p of octet 17. Octet 16 is reserved: ignore it |
| e[p] = 1 | priority p is held from time t until t + 64 × time[p]. 0 releases it |
| e[p] = 0 | priority p keeps whatever hold it had |
Examples
Example 1
Priorities 3 and 5- Input
vector 00-28 at t = 1000
- Output
held_priorities = 'b00101000, acted = yes
e[3] and e[5] are set. At t = 2000 priority 3 (held until 13,800) and priority 5 (until 4,200) are held.
Example 2
Later- Input
the same frame, t = 5000
- Output
held_priorities = 'b00001000, acted = yes
Priority 5's 50 quanta are over; priority 3 is still held.
Example 3
A PAUSE Frame- Input
opcode 00-01
- Output
held_priorities = 'b00000000, acted = no
Same address and type, but not the PFC opcode: nothing changes.
Constraints and Contract
- Keep the function names, the arguments and
hold_end. - The FCS was already checked; do not check it again.
tnever decreases from one call to the next.- Off limits: the names
lib,model,rng,tb,rootand the modules of the bench.
Hints
Hint 1
Which octet holds e[0], and which bit of it?
Hint 2
A frame with the PAUSE opcode also has Length/Type 88-08. Is it a PFC frame?
Hint 3
What should a priority whose e bit is 0 keep?
What the grader checks: The fixture checks seven literal frames against an independent JavaScript model. It checks 100 random frames against the bench PFC client, every priority at 71 later times. Queue behaviour beyond the hold is IEEE 802.1Q's and is not tested.
9 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