70. Design a Serial Timeout and Event Supervisor

Loading simulator…

The timeout counter runs only while a serial transaction is active and no progress is detected.

Count_Enable =
Transaction_Active · Progress_Event' · Clear_Status' · Timeout'

The counter is cleared whenever the transaction ends, progress occurs, or status is cleared.

Count_Clear =
Transaction_Active' + Progress_Event + Clear_Status

The 4-bit counter counts from 0000 toward 1111. When the current count is 1110 and one more enabled clock edge occurs, the circuit detects the timeout condition.

Count_14 =
C3 · C2 · C1 · C0'

Timeout_Set =
Count_Enable · Count_14

Timeout is stored in a D flip-flop and remains HIGH until Clear_Status is asserted.

D_Timeout =
Clear_Status' · (Timeout + Timeout_Set)

The RX, TX, and protocol-error inputs are also stored as sticky events. A short input pulse therefore remains visible until the status is cleared.

D_RX_Event =
Clear_Status' · (RX_Event + RX_Valid)

D_TX_Event =
Clear_Status' · (TX_Event + TX_Done)

D_Error_Event =
Clear_Status' · (Error_Event + Protocol_Error)

Finally, all stored status signals are combined to generate one shared interrupt.

Interrupt =
Timeout + RX_Event + TX_Event + Error_Event

This allows the system to detect a stalled transaction or any completed/error event without missing short input pulses.