If the SnitchSim instance is waiting on a read() from the pipe to the simulation, and the RTL simulation terminates prematurely (e.g. due to a fatal assertion failure), the SnitchSim instance would block on the read() and any verification script based on it would not terminate.
Fix
When the simulation subprocess is spawned, a separate thread is created to monitor it. If the simulation terminates prematurely, the monitor will notice and send a SIGINT signal to interrupt the read(). The signal is handled by the main thread which will stop the simulation monitor, communicate the cause of the failure and gracefully terminate the verification script.
Bug diagnosis
If the
SnitchSim
instance is waiting on aread()
from the pipe to the simulation, and the RTL simulation terminates prematurely (e.g. due to a fatal assertion failure), theSnitchSim
instance would block on theread()
and any verification script based on it would not terminate.Fix
When the simulation subprocess is spawned, a separate thread is created to monitor it. If the simulation terminates prematurely, the monitor will notice and send a
SIGINT
signal to interrupt theread()
. The signal is handled by the main thread which will stop the simulation monitor, communicate the cause of the failure and gracefully terminate the verification script.