forked from M-Labs/artiq
1
0
Fork 0

analyzer: use picosecond resolution in VCD output. Closes #528

This commit is contained in:
Sebastien Bourdeauducq 2016-08-03 10:56:21 +08:00
parent d5711133be
commit ff1e35e03f
1 changed files with 3 additions and 3 deletions

View File

@ -109,8 +109,8 @@ class VCDManager:
self.codes = vcd_codes() self.codes = vcd_codes()
self.current_time = None self.current_time = None
def set_timescale_ns(self, timescale): def set_timescale_ps(self, timescale):
self.out.write("$timescale {}ns $end\n".format(timescale)) self.out.write("$timescale {}ps $end\n".format(round(timescale)))
def get_channel(self, name, width): def get_channel(self, name, width):
code = next(self.codes) code = next(self.codes)
@ -367,7 +367,7 @@ def decoded_dump_to_vcd(fileobj, devices, dump):
vcd_manager = VCDManager(fileobj) vcd_manager = VCDManager(fileobj)
ref_period = get_ref_period(devices) ref_period = get_ref_period(devices)
if ref_period is not None: if ref_period is not None:
vcd_manager.set_timescale_ns(ref_period*1e9) vcd_manager.set_timescale_ps(ref_period*1e12)
else: else:
logger.warning("unable to determine core device ref_period") logger.warning("unable to determine core device ref_period")
ref_period = 1e-9 # guess ref_period = 1e-9 # guess