Verification #9 · 2026-10-02 · Classes · Medium · about 15 min
The copy that shares its header
monitor rebuilds packets from bus beats and appends each finished one to done, where a scoreboard reads them later. Two things must hold:
- Every packet in
donekeeps theid,addrand payload it had on the bus, whatever the monitor sees afterwards. packet::copy()returns an independent packet. Afterq = p.copy(), changing anything inpnever changesq, and changing anything inqnever changesp.
Run sends three packets and prints done. Fix packet.sv.
Write and run your answer in the browser. The hidden tests check it, and it’s free.