Hardware interview practice
Print a periodic heartbeat
Print a still-alive message every period_cycles while simulation runs.
Reviewed example
Work through one case
Input
period_cycles=3; clock advances through cycle9Expected output
still-alive messages at cycles3,6,9 with their simulation timestampsThe forever loop counts three positive edges per report rather than using wall-clock delay.
What to cover
Requirements
- Require period_cycles to be positive.
- Count clock cycles rather than wall-clock time.
- Repeat forever.
- Include simulation time in the message.
