From ff1e35e03f7a59e96aa2e34ea5f35c2ced8b27e1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 3 Aug 2016 10:56:21 +0800 Subject: [PATCH] analyzer: use picosecond resolution in VCD output. Closes #528 --- artiq/coredevice/analyzer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/coredevice/analyzer.py b/artiq/coredevice/analyzer.py index 8dab93b39..b2ffffefe 100644 --- a/artiq/coredevice/analyzer.py +++ b/artiq/coredevice/analyzer.py @@ -109,8 +109,8 @@ class VCDManager: self.codes = vcd_codes() self.current_time = None - def set_timescale_ns(self, timescale): - self.out.write("$timescale {}ns $end\n".format(timescale)) + def set_timescale_ps(self, timescale): + self.out.write("$timescale {}ps $end\n".format(round(timescale))) def get_channel(self, name, width): code = next(self.codes) @@ -367,7 +367,7 @@ def decoded_dump_to_vcd(fileobj, devices, dump): vcd_manager = VCDManager(fileobj) ref_period = get_ref_period(devices) if ref_period is not None: - vcd_manager.set_timescale_ns(ref_period*1e9) + vcd_manager.set_timescale_ps(ref_period*1e12) else: logger.warning("unable to determine core device ref_period") ref_period = 1e-9 # guess