Verification #45 · 2026-11-07 · Constructors · Easy · about 10 min
The constructor that assigns a field to itself
A packet carries an address and a length, both passed to its constructor. A generator builds many packets with different values, and a scoreboard later reads them back by field.
Right now every packet reports addr = 00 and len = 00, whatever it was built with — the values handed to new never reach the object. Fix packet.sv so each packet keeps the addr and len it was constructed with.
Write and run your answer in the browser. The hidden tests check it, and it’s free.