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 done keeps the id, addr and payload it had on the bus, whatever the monitor sees afterwards.
  • packet::copy() returns an independent packet. After q = p.copy(), changing anything in p never changes q, and changing anything in q never changes p.

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.