diff --git a/csrc/emulator.cc b/csrc/emulator.cc index c5d408b3..35bfaccb 100644 --- a/csrc/emulator.cc +++ b/csrc/emulator.cc @@ -176,6 +176,8 @@ int main(int argc, char** argv) if (vcd) fclose(vcdfile); + delete htif; + if (failure) { fprintf(logfile, "*** FAILED *** (%s) after %lld cycles\n", failure, (long long)trace_count); diff --git a/csrc/vcs_main.cc b/csrc/vcs_main.cc index 00bbf270..862621cb 100644 --- a/csrc/vcs_main.cc +++ b/csrc/vcs_main.cc @@ -101,6 +101,11 @@ void htif_init htif = new htif_emulator_t(args); } +void htif_fini() +{ + delete htif; +} + void htif_tick ( vc_handle htif_in_valid,