Verification #5 · 2026-09-28 · Constraints · Easy · about 10 min
Weighting a random length
len must be one of 1, 2, 4 or 8. The value 8 should come up about half the time, and 1, 2 and 4 should share the other half equally.
Write the c_len constraint in packet.sv. Run randomizes 1,200 packets and prints how often each length came up.
Write and run your answer in the browser. The hidden tests check it, and it’s free.