This allow the VCD file to be flushed and closed properly.
Signed-off-by: Michel Pollet <buserror@gmail.com>
3 files changed:
}
for (;;)
- avr_run(avr);
+ avr_run(avr);
+
+ avr_terminate(avr);
}
#include "sim_avr.h"
#include "sim_core.h"
#include "sim_gdb.h"
+#include "sim_vcd_file.h"
int avr_init(avr_t * avr)
return 0;
}
+void avr_terminate(avr_t * avr)
+{
+ if (avr->vcd)
+ avr_vcd_close(avr->vcd);
+ avr->vcd = NULL;
+}
+
void avr_reset(avr_t * avr)
{
memset(avr->data, 0x0, avr->ramend + 1);
void avr_reset(avr_t * avr);
// run one cycle of the AVR, sleep if necessary
int avr_run(avr_t * avr);
+// finish any pending operations
+void avr_terminate(avr_t * avr);
// load code in the "flash"
void avr_loadcode(avr_t * avr, uint8_t * code, uint32_t size, uint32_t address);