[DV] Add exit check for setup call

Check the return value and exit program execution.
This commit is contained in:
Tobias Wölfel 2019-11-17 11:56:18 +01:00 committed by Tobias Woelfel
parent 7465a68615
commit 21f2a842d8

View file

@ -20,6 +20,9 @@ int main(int argc, char **argv) {
// Setup simctrl
retcode = simctrl->SetupSimulation(argc, argv);
if (retcode != 0) {
goto free_return;
}
// Initialize RAM
simctrl->InitRam("TOP.ibex_riscv_compliance.u_ram");
@ -27,6 +30,7 @@ int main(int argc, char **argv) {
// Run the simulation
simctrl->RunSimulation();
free_return:
delete top;
delete simctrl;
return retcode;