]> sigrok.org Git - libsigrok.git/commitdiff
output/vcd: support smaller timescales with higher resolution
authorGerhard Sittig <redacted>
Fri, 12 Oct 2018 10:35:50 +0000 (12:35 +0200)
committerUwe Hermann <redacted>
Sat, 21 Dec 2019 16:19:50 +0000 (17:19 +0100)
The previous implementation inspected the input stream's samplerate, and
simply used the next 1kHz/1MHz/1GHz timescale for VCD export. Re-import
of the exported file might suffer from rather high an overhead, where
users might have to downsample the input stream. Also exported data
might use an "odd" timescale which doesn't represent the input stream's
timing well.

Rephrase the samplerate to VCD timescale conversion such that the lowest
frequency is used which satisfies the file format's constraints as well
as provides high enough a resolution to communicate the input stream's
timing with minimal loss. Do limit this scaling support to at most three
orders above the input samplerate, to most appropriately cope with odd
rates.

As a byproduct the rephrased implementation transparently supports rates
above 1GHz. Input streams with no samplerate now result in 1s timescale
instead of the 1ms timescale of the previous implementation.


No differences found