vcd: change VCD time base to 1 ns to handle higher AVR speeds (e.g. 20 MHz / max...
[simavr] / tests / test_atmega88_vcd.c
diff --git a/tests/test_atmega88_vcd.c b/tests/test_atmega88_vcd.c
new file mode 100644 (file)
index 0000000..63c788b
--- /dev/null
@@ -0,0 +1,23 @@
+#include "sim_avr.h"
+#include "avr_ioport.h"
+#include "sim_vcd_file.h"
+
+#include "tests.h"
+
+int main(int argc, char **argv) {
+       tests_init(argc, argv);
+
+
+       avr_t *avr = tests_init_avr("atmega88_vcd.axf");
+
+       avr_vcd_t vcd_file;
+       avr_vcd_init(avr, "atmega88_vcd.vcd", &vcd_file, 10000);
+       avr_vcd_add_signal(&vcd_file, avr_io_getirq(avr, AVR_IOCTL_IOPORT_GETIRQ('B'), IOPORT_IRQ_PIN0), 1, "PB0" );
+       avr_vcd_start(&vcd_file);
+
+       tests_run_test(avr, 10000);
+
+       avr_vcd_stop(&vcd_file);
+       tests_success();
+       return 0;
+}