[otbn,dv] Fix segfault when otbn_top_sim exited with failure
[otbn,dv] Fix segfault when otbn_top_sim exited with failure

The verilator_top.reset() line was only being run when we exited
successfully. If not, we ended up destructing the std::unique_ptr and
thus its contents somewhere inside the CRT's run_exit_handlers.

It turns out that there's a race where a singleton in the Verilator
library *must* exist when you run the constructor or destructor and
you get a segfault if verilator_top happens to have a longer lifetime
than the singleton.

Fix things by being stupider: use a raw pointer to pass the object to
OtbnTopApplyLoopWarp (the DPI function that needs it). This will be
dangling after we exit main() and have destroyed the object, but we
don't really care.

Signed-off-by: Rupert Swarbrick <290093e2ad2515ed2f14d749293c8cf8e02ca274@lowrisc.org>

lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan