m-labs / artiq

A leading-edge control system for quantum information experiments
https://m-labs.hk/artiq
GNU Lesser General Public License v3.0
424 stars 196 forks source link

add floating point plotting support to GtkWave #242

Closed sbourdeauducq closed 8 years ago

sbourdeauducq commented 8 years ago

The core device analyzer outputs RTIO slack as a 64-bit float expressed in seconds. It is nice to plot it with an analog view in GtkWave, but the latter only supports integer values there, resulting in a unwanted logarithmic-ish scale.

sbourdeauducq commented 8 years ago

Example VCD file produced by the analyzer. foo.zip

jordens commented 8 years ago

For this specific case, why not just use 64 bit integer multiples of 1 ns? The useful granularity of the slack is on the order of 10 ns (cpu clock) and will be for the foreseeable future.

For frequencies and voltages the story might be different.

sbourdeauducq commented 8 years ago

That's inconsistent with the way other numbers (e.g. DDS frequencies) are represented, plus this will be annoying when we have a board with a CPU frequency not a multiple of 1ns.

jordens commented 8 years ago

Then this bug is not just about the slack. And anyway: slack is not a precision quantity. It's useful resolution is more like 10 ns independent of the cpu speed.

dhslichter commented 8 years ago

I think having slack in increments of machine units as a 64-bit integer would work, no? "Logarithmic" scale is not that bad, this is a coarse debugging tool really.

sbourdeauducq commented 8 years ago

I'd like to keep everything consistent and user-interpretable in the VCD: SI units and floating point.

sbourdeauducq commented 8 years ago

Note that GtkWave can display floating point numeric values just fine, it just cannot plot them (as in a XY plot) correctly.

dhslichter commented 8 years ago

I am fine with logarithmic scale of slack for the plotting, since for my purposes the only times it will matter is when it gets small, and then I can look at the actual floating point value. Seems like this would be more effort to fix properly than it's worth.

sbourdeauducq commented 8 years ago

@jboulder Done. We now get the expected linear rise in RTIO slack. gtkfloat

sbourdeauducq commented 8 years ago

Patch posted to the gtkwave-users ML.

sbourdeauducq commented 8 years ago

(I do not have a link for it because Sourceforge being what it is, there seems to be some delay before the archive pages are updated)

sbourdeauducq commented 8 years ago

gtkwave_floating_point_plotting.diff.zip

ghost commented 8 years ago

Thank you. -Joe

On Thu, Mar 31, 2016 at 3:51 AM, Sébastien Bourdeauducq < notifications@github.com> wrote:

Patch posted to the gtkwave-users ML.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/m-labs/artiq/issues/242#issuecomment-203803544