Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualisation of fixed-point signals as Analog #9

Open
umarcor opened this issue Apr 5, 2020 · 5 comments
Open

Visualisation of fixed-point signals as Analog #9

umarcor opened this issue Apr 5, 2020 · 5 comments

Comments

@umarcor
Copy link
Contributor

umarcor commented Apr 5, 2020

First off, thanks a lot for keeping this awesome tool alive for +20 years!

I'm using v3.3.104 installed through MSYS2 (Windows 10). I'm trying to visualise the signals of a closed-loop control system. These are modelled in VHDL as std_logic_vector, simulated with GHDL and saved to a GHW file. Inside some components, ieee.fixed_generic_pkg is used to perform arithmetic operations. Since these type of signals are typically seen as analog signals (see http://ctms.engin.umich.edu/CTMS/index.php?example=MotorPosition&section=ControlPID) I'm using the Analog -> Step Data Format of GtkWave. I'm finding it cumbersome to work with these, and I feel I might be missing something. Hence, these are just some questions regarding the user experience:

  • I found that the vertical resizing can be adjusted depending on the data in the screen or to all data. However, it seems not to be possible to adjust it to the actual range of the signal. For instance, for an std_logic_vector of 8 bits, I'd expect the range to be [0,255] (unsigned) or [-128,127] (signed), regardless of the actual values that were logged.

  • The fixed-point format can be seen in the range of the signals. For example, signal d : sfixed(4 downto -4); is shown as d[4:-4] in GtkWave. However, the Fixed Point Shift needs to be specified manually. I'd expect to be able to get the number of shifts from the right index of the range. Even if it needs to be manually set, it'd be helpful to have the value preloaded (as a default suggestion).

  • It seems not possible to see the binary value of a signal, if the Data Format is set to any other option. I believe it would be handy to see the actual binary representation of the numbers that are been otherwise shown as floats.

  • When comparing Analog outputs of multiple blocks, it would be useful to visualise them on the same axis. This is common in control applications where a target needs to follow a given setpoint or trajectory.

  • I think it makes sense for the height of analog signals to be a multiple of the height of a regular digital row. However, it doesn't feel intuitive to move an analog signal along with the corresponding additional spacers. One needs to select the first hone, then hold Shift and move the last one. I found that moving any other, or selecting them in a different order won't work. I think it would be more intuitive if the height was a parameter of the signal (just as the Data Format), so that moving the first row would take others with it.

  • It would be handy to perform arithmetic operations on two or more signals, similar to oscilloscopes.

  • I found a reference to X11 colors in the docs, which points to https://github.com/gtkwave/gtkwave/blob/master/gtkwave3-gtk3/src/rgb.c. However, it seems not to be possible to set one of those colors as the signal color through the GUI. Is it limited to TCL scripting and/or to set the background?

Once again, thanks for maintaining this great tool!

@umarcor
Copy link
Contributor Author

umarcor commented May 7, 2020

For the record, I evaluated PulseView as a complement to GtkWave for visualization of "analog channels" (i.e. real/float values or fixed-point types). See Reading waveforms from HDL simulators with PulseView. The TL;DR is that sigrok/PulseView do not support multi-bit signals, hierarchy or 9-value logic, and they have serious performance issues with small time scales (fs, ps or even ns). However, protocol decoders written in Python are a really nice feature.

@gtkwave
Copy link
Collaborator

gtkwave commented May 7, 2020 via email

@umarcor
Copy link
Contributor Author

umarcor commented May 7, 2020

Tony, thanks a lot for taking time to provide your very insightful comments. I believe there is lots of knowledge in this project's codebase, and I find painful to see it getting superficially old because of contraints imposed by the toolkit, at the same time that other projects seem to step on the same stones that you did many years ago.

Regarding your idea of a "Ted Talk" (maybe a FOSDEM talk?), I would love to see any related content. Maybe it exists already, but I didn't find it :(. Shall I expect to find "guidelines for developers" anywhere in the docs or the codebase?

Overall, it feels to me that GtkWave is both a C toolkit for dumpfile formats and a viewer. Does GtkWave implement some mechanism as what you described about Novas? I'd like to know whether it is possible to extract a kind of API for dumpfile parsing, seeking, rewinding, keeping it in memory or in file, etc. How do you feel about this 30s (talk referenced in #12)?

The idea of starting some "waveform post-processing tool" by reusing GtkWave's codebase has been bouncing in my head for long. Either for chopping VCD or GHW files, or for converting them to other formats. For instance, metrics of web services are kind of similar to dumpfiles and in the last years nice web frontends (https://play.grafana.org/d/000000016/graph-styles) and specilized databases (https://github.com/influxdata/influxdb) have been developed. Grafana feels quite reponsive, even used remotely. Since screens are no wider than 1-4k pixels, I wonder if performance of the database would suffice. To write an exporter, I'd like to know whether GtkWave has some "unique" internal format that unifies the different support input formats, or conversely, if each format is parsed to some data model specific for Gtk.

Once again, thanks for your time and congratulations for this great tool.

@gtkwave
Copy link
Collaborator

gtkwave commented May 9, 2020 via email

@umarcor
Copy link
Contributor Author

umarcor commented May 10, 2020

For rendering speed, that Grafana example is acceptable, but for my day job I would get frustrated quickly with something that runs that slow*.

Agree. It's mostly a demo strategy to fight a battle at a time: dump formats first, viwer toolkits then.

Appendix F in the user manual in doc/ explains how to do this in detail.

I had completely overlooked the content of Appendix F!

Thanks again for your explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant