NJU-ProjectN / nvboard

NJU Virtual Board
Other
198 stars 38 forks source link

event: add manual exit handler #30

Closed KevlarKanou closed 2 months ago

KevlarKanou commented 2 months ago

nvboard_manual_exit_handler() is used to perform certain actions in the testbench when the simulation is manually terminated.

sashimi-yzh commented 2 months ago

Would you please provide any actions for example which should be performed in the exit handler?

KevlarKanou commented 2 months ago

Would you please provide any actions for example which should be performed in the exit handler?

eg: exporting logs when manually stopping an endless simulation

void nvboard_manual_exit_handler() {
  std::fwrite(..., fp);
  std::fclose(fp);
}
sashimi-yzh commented 2 months ago

I think this does not belong to the responsibility of NVBoard. Therefore we are not going to provide this API. You can use atexit() instead, or modify code directly.