while (!avr_vcd_fifo_isempty(&vcd->log)) {
avr_vcd_log_t l = avr_vcd_fifo_read(&vcd->log);
- // 1ns base
- uint64_t base = avr_cycles_to_nsec(vcd->avr, l.when - vcd->start);
+ // 10ns base -- 100MHz should be enough
+ uint64_t base = avr_cycles_to_nsec(vcd->avr, l.when - vcd->start) / 10;
/*
* if that trace was seen in this nsec already, we fudge the
return -1;
}
- fprintf(vcd->output, "$timescale 1ns $end\n"); // 1ns base
+ fprintf(vcd->output, "$timescale 10ns $end\n"); // 10ns base, aka 100MHz
fprintf(vcd->output, "$scope module logic $end\n");
for (int i = 0; i < vcd->signal_count; i++) {