Skip to content

Commit ff1e35e

Browse files
committedAug 3, 2016
analyzer: use picosecond resolution in VCD output. Closes #528
1 parent d571113 commit ff1e35e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎artiq/coredevice/analyzer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def __init__(self, fileobj):
109109
self.codes = vcd_codes()
110110
self.current_time = None
111111

112-
def set_timescale_ns(self, timescale):
113-
self.out.write("$timescale {}ns $end\n".format(timescale))
112+
def set_timescale_ps(self, timescale):
113+
self.out.write("$timescale {}ps $end\n".format(round(timescale)))
114114

115115
def get_channel(self, name, width):
116116
code = next(self.codes)
@@ -367,7 +367,7 @@ def decoded_dump_to_vcd(fileobj, devices, dump):
367367
vcd_manager = VCDManager(fileobj)
368368
ref_period = get_ref_period(devices)
369369
if ref_period is not None:
370-
vcd_manager.set_timescale_ns(ref_period*1e9)
370+
vcd_manager.set_timescale_ps(ref_period*1e12)
371371
else:
372372
logger.warning("unable to determine core device ref_period")
373373
ref_period = 1e-9 # guess

0 commit comments

Comments
 (0)
Please sign in to comment.