Easy version: - Send a "reset everything" packet at startup of host program (i.e. include that as a flag). - Use an inner clock/reset domain for most of the logic; reset it when a "reset everything" packet is received. Hard version: - Make the above self-synchronizing, in case the previous program didn't end having sent a complete packet.
Easy version:
Hard version: