Difference between revisions of "TODO"

From sigrok
Jump to navigation Jump to search
m
 
(183 intermediate revisions by 11 users not shown)
Line 1: Line 1:
== At 28C3 ==
== libsigrok ==


* <s>The great time/duration vs. range argument:</s>
=== Hardware support ===
** <s>Specify ranges as (start, stop) or (start, length)?</s>
** <s>Specify ranges in number of samples or in picoseconds, or both?</s>
<blockquote>'''We will have an extra datafeed type SR_DF_LOGIC_INDEXED, which contains [samplenumber, sample] instead of just raw samples. Samplenumber is a uint64_t, and sample is unchanged (unitsize). Frontends must be able to handle both, and modular filters in libsigrok or the sampling filter in libsigrokdecode may convert from SR_DF_LOGIC to SR_DF_LOGIC_INDEXED at any time.'''</blockquote>
* <s>PD API: finalize naming convention</s> '''start/decode/put/config/add as method names'''
* ANT8/18e unified driver
** Figure out how to upload a firmware/bitstream.
** Figure out how to start an acquisition (with certain samplerate and trigger settings etc).
** Write an initial driver.
* <s>Change libsigrokdecode to use and require Python >= 3.0.</s>
** <s>Use the new API calls for C/Python interaction.</s>
** Use 'bytes' and/or 'memoryview' and the new Python 3 buffer API.
* PD performance:
** How to pass (and what exactly, and in which format) samples and already decoded protocol packets
*** From C to Python (i.e. from libsigrokdecode/controller to the lowest-level decoder)
*** From Python to Python (i.e., from one decoder to the next in the stack)
*** From Python to C (i.e., from a decoder back to libsigrokdecode, which then hands it over to the CLI/GUI, which write it to file or display it in the GUI).
*** Various options: TODO
** <s>Processing raw logic vs. everything else up the stack: (optionally) deliver pre-sampled by clock or rate?</s>
<blockquote>'''Yes, the controller will deliver a clock- or rate-sampled feed instead, if the PD requests this via a configuration option.'''</blockquote>
* Other PD issues:
** <s>Many decoders can output data in various formats (ASCII, hex, BCD, MSB-first vs. LSB-first and many more). In addition, in some decoders there can be various fields which contain data of various lengths (6bits, 8bits, 9bits, 32bits, other). Each of these fields can have a different "sane" default display format (BCD for e.g. "minutes" data coming from an RTC, hex for device ID of an SPI flash chip, ASCII for UART data that is human-readable, and many many more). Should the decoder data output format(s) be decoder options or a GUI/frontend features?</s>
*** Decoder option:
**** '''Pro: Only the decoder itself knows which fields mean what, which "sane"/"native" display format makes sense for each field of data.'''
**** <s>Con: Requires a full (or partial) re-decode if the GUI wants to switch from ASCII to hex for example.</s>
*** Frontend feature:
**** <s>Con: Every frontend needs to re-implement this feature.
**** Con: GUI needs inside knowlegde and special-casing for every PD (very bad!).</s>
*** Both:
**** '''Every decoder has its own options to control the display format of data; additionally'''
*** <s>Other:
**** Always pass the raw data as integer value (up to 64 bits, but what if a decoder needs bigger structures? pass a list? tuples? other?); In addition the decoder also passes another data field for each integer value, which is a string containing the same value in the user-configured output format.</s>
<blockquote>'''The PD start() function should return metadata about the SRD_OUTPUT_ANNOTATION data formats it can submit back to SRD, in the form of a list: [ ["7-bit shifted hex", "Read/Write bit shifted out from the 8-bit i2c slave address"], ["7-bit shifted hex", ...] ]. The first option is the default way in which the frontend will display an item of data; the other formats will be available to use as an option by the user. This metadata is independent of type: strings, hex-formatted numeric data, etc. The data submitted by the PD for output streams of type SRD_OUTPUT_ANNOTATION while decoding will have index values indicating which data format that item is: [[0, '0x10'], [1, '0x20']] '''</blockquote>


== sigrok 0.3 ==
* Clean up device-specific globals in hardware drivers, to properly permit multiple devices per driver: fx2lafw, zeroplus-logic-cube, others(?)
* Chronovu LA8/LA16 driver: support multiple devices properly (currently only one is supported).


* stackable protocol decoder implementation
=== Input modules ===
** <s>accept PD options on commandline: -a i2c:foo=bar</s>
** enforce input/output options in PDs: don't send logic if PD only accepts i2c etc.
** free all instances at end of session
** proper python exception handling in libsrd: output only error message with srd_err(), and full traceback with srd_dbg()
** <s>Bugfix: The input of decode() is in the form [samplenum, (probe1, probe2, ...)], but samplenum is a relative number (in an input chunk), not the absolute sample number.</s>
** Annotations need an additional 'type' field, so that PDs/GUIs can differentiate between different output "things".
*** Types are not yet defined, but could be things like DEFAULT, ERR, WARN, DBG, and others.
** The assignment of probes to the input probes a PD wants to get via decode() is not handled correctly, yet. If an .sr file has 7 probes defined/enabled, and this file is passed to the I2C PD for example, it will fail, as that PD only expects 2 input probes (SCL, SDA). The srd code should make sure only those two probes are passed to the PD.
*** Additionally, the selection of which probe to pass in as SCL, and which one to pass as SDA must be user-selectable (in srd, and in the UIs).
** <s>PD config options (baudrate, clock_polarity, etc.) cannot be set/passed from any UI, yet. The PDs have defaults, but those cannot be overridden by the user, yet.</s>


* change all code to start counting probes at 0, not 1.
* Add OLS input module support.
* Get rid of the use of manual polling of FDs, which is not portable (doesn't work on Windows). Use g_poll() instead (which spawns a new thread on Windows).
* Add gnuplot input module support ([[User:Uwe Hermann|Uwe Hermann]]).
* <s>[http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/tcsetattr.3.html Mac OS X: B460800] is not available it seems. Find the correct header (if any) and/or find a (possibly platform-specific) workaround, or drop this on Mac OS X.</s>
* Add a --start-sampling (TODO: Better name?) option, which just starts sampling with the supplied or default samplerate. Contrary to --time or --samples you don't need to explicitly specify a duration or number of samples here, that's automatically determined by the available memory of the logic analyzer and the selected samplerate.
** TODO: Similar to --continuous? Merge both?
* <s>Make sure all combinations of --enable-*/--disable-* options works for configure.
** There may be issue if none of the drivers is enabled, print useful error in that case(?)</s>
* libsigrok.h/libsigrokdecode.h: Only list public API functions.
* Windows port:
** Implement anykey.c replacement.
** hex output: Not all lines/columns are of the same length (as they are with real LAs).
** VCD: All samplenumbers are 0 (instead of the proper samplecount).
** OLS, gnuplot: Hangs on MinGW for some reasons (not sure if related).
* <s>Finish protocol decoder API design.</s>
* CLI/libsigrok: Eliminate all printing to stdout, only sample data or decoder output should end up there. Error/debug messages should go to stderr always.
** Also, libsigrok should never print anything directly via (f)printf or similar, only via sr_info()/sr_err()/sr_dbg().
* MinGW: Fix Python path decoder issues due to Windows vs. Linux path specification.
* Run the code receiving the samples as quickly as possible, run output format code and other non-timing-critical stuff (protocol decoders) in an extra thread. The problem is nicely visible with FX2-based logic analyzers, the longer an output format takes to produce its output, the better your chances to get "oops, I just lost samples" errors.
* Hardware drivers: Make specification of triggering capabilities more detailed, so that frontends/GUIs can auto-generate GUI forms out of that metadata.


== sigrok 0.4 ==
=== Miscellaneous ===


* modular filter system
* Check all public API calls to see whether they need an sr_context parameter.
** take arguments in the regular thing:key=value format
* sr_errno:
** integrate current probe compression filter
** Most functions should return SR_OK or SR_ERR_* (same for SRD_OK etc).
** resampling module: sample up/down based on factor argument
** Most backend functions return status as an integer, which is SR_OK if all went well, or SR_ERR_* if an error occurred.
** noise filter: filter out pulses shorter than the samplerate's period
** However, there is no way to pass any information back as to what went wrong &mdash; and this is important for user-friendliness.
** Perhaps an error code is not enough; maybe something like sigrok_errno(errorcode, "unsupported device") is better.
* Support specifying the firmware directory at runtime.


== Before 1.0 ==
== libsigrokdecode ==
==== Major features ====
* Add high-precision timer to runtc
* Add annotation mime types
* Add annotation metadata (type/value/unit) to allow clients to format the value as the user desires (ASCII/dec/hex/bin/whatever)


* all output modules should use GString API instead of estimating output size
==== Other ====
* VCD input modules
* Test/implement support for multiple outputs of one PD, and stacking different additional PDs on those outputs.
* OLS format input module
* Test/implement multiple inputs support.
* Python exception handling in libsrd: add full traceback support with srd_dbg().


== Future ==
== sigrok-cli ==


* udev:
== fx2lafw ==
** Make udev optional, only build MSO driver if it's available
 
** have OLS driver use udev if available, fall back to serial port probing otherwise
* Analog sampling: 1-channel, 2-channel, voltage meter
** Find alternative to udev for windows and macos
* Trigger pin
* Fix/workaround libusb 1.0 [[Windows]] port issues:
* Clock input
** Device renumeration not yet supported (needed for FX2 based LAs)
* Clock output
** File descriptor / socket based polling not supported in Windows. Workaround (short-term): Use a thread in sigrok.
* Frequency/pulse counter
* Make sure all optional components are really optional in the build system:
* Signal generator
** Only require Python if the users wants protocol decoders, the rest should also build/compile/run fine without Python installed.
* Fix power consumption during enumeration.  
* sigrok uses uint64_t as an internal datatype to represent a sample, limiting the number of probes on supported hardware to 64. But high-end logic analyzers can have hundreds of probes. A solution would be to switch to either a roll-our-own byte array type, or use [http://gmplib.org/ GMP]. In any case, the overhead of switching over shouldn't be too bad: the filter code and frontend datafeed callback functions will need to use it, but hardware drivers should have enough with a couple of lightweight wrappers.
** Non-LP FX2's consume more than 100mA during enumeration. This is outside of the USB specification
* sr_errno:
** Official workaround is to enumerate first as full-speed, then as high-speed. This is overkill for sigrok.
** Most functions should return SR_OK or SR_ERR_* (same for SRD_OK etc).
** Investigate putting the CPU to sleep (except for processing interrupts) until enumerated.
** Most backend functions return status as an integer, which is SR_OK if all went well, or SR_ERR_* and similar if an error occurred.
 
** However there is no way to pass any information back as to what went wrong &mdash; and this is important for user-friendliness.
== PulseView ==
** Perhaps an error code is not enough; maybe something like sigrok_errno(errorcode, "unsupported device") is better.
 
* Clean up device-specific globals in hardware drivers, to properly permit multiple devices per driver: <s>asix-sigma</s>, <s>demo</s> (not relevant), <s>link-mso19</s>, <s>openbench-logic-sniffer</s>, saleae-logic, zeroplus-logic-cube
* Deduplicate property setting functionality between SamplingBar and DeviceOptions - make SamplingBar a properties container
* Python bindings for libsigrok and libsigrokdecode.
* Analog interpolation (cosine? sinc? some kind of interpolation filter?)
* Signal overview
* Transition coding


== Contributors wanted ==
== sigrok-meter ==


* Add output for latex package [http://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-timing tikz-timing].
* Make the list of measurements look nicer without using too much additional space.
* Add output for browser waveform viewer/editor written in javascript/JSON called [http://code.google.com/p/wavedrom WaveDrom].
* Add graphs.
* Linux distro packages for non-Debian distros.
** [http://www.pyqtgraph.org/ PyQtGraph] looks like a nice graphing library.
* FreeBSD packages/ports.
*** Works with PyQt and PySide.
* Open-source firmware for the FX2 devices
*** Pure python, easy to install.
<blockquote>
*** Few dependencies: '''scipy''' is not required any more in the upcoming version 0.9.9, '''numpy''' is already a dependency of the python bindings.
The Cypress FX2-based devices, such as the Saleae Logic and the USBee SX, use only a minimal vendor-provided firmware. The only thing it really does is set the sample rate and turn on the chip's auto-mode. Nevertheless, the vendors provide the firmware as a binary blob, with no source.
*** From looking at the examples, it seems more than fast enough for our requirements.
It would be great if sigrok could ship with an own firmware implementation for these devices. Some links:
** Pass all samples (not only the most recent one) to the GUI thread and store them there.
** [http://sdcc.sourceforge.net/ SDCC], the Small Devices C Compiler, is a compiler specifically suited to small MCUs, and has support for the 8051 core in the FX2.
*** The packet payload object is currently not thread save.
** [http://allmybrain.com/2008/12/05/an-open-source-library-for-writing-firmware-on-the-cypress-fx2-with-sdcc/ fx2lib] is an open-source library for writing firmware on the FX2. It has a number of interesting functions, including implementing custom USB vendor commands.
** [http://gnuradio.org/ GNU Radio]'s USRP2 board has an FX2 on it, and GNU Radio has extensive custom firmware for it.
</blockquote>

Latest revision as of 14:11, 19 July 2020

libsigrok

Hardware support

  • Clean up device-specific globals in hardware drivers, to properly permit multiple devices per driver: fx2lafw, zeroplus-logic-cube, others(?)
  • Chronovu LA8/LA16 driver: support multiple devices properly (currently only one is supported).

Input modules

  • Add OLS input module support.
  • Add gnuplot input module support (Uwe Hermann).

Miscellaneous

  • Check all public API calls to see whether they need an sr_context parameter.
  • sr_errno:
    • Most functions should return SR_OK or SR_ERR_* (same for SRD_OK etc).
    • Most backend functions return status as an integer, which is SR_OK if all went well, or SR_ERR_* if an error occurred.
    • However, there is no way to pass any information back as to what went wrong — and this is important for user-friendliness.
    • Perhaps an error code is not enough; maybe something like sigrok_errno(errorcode, "unsupported device") is better.
  • Support specifying the firmware directory at runtime.

libsigrokdecode

Major features

  • Add high-precision timer to runtc
  • Add annotation mime types
  • Add annotation metadata (type/value/unit) to allow clients to format the value as the user desires (ASCII/dec/hex/bin/whatever)

Other

  • Test/implement support for multiple outputs of one PD, and stacking different additional PDs on those outputs.
  • Test/implement multiple inputs support.
  • Python exception handling in libsrd: add full traceback support with srd_dbg().

sigrok-cli

fx2lafw

  • Analog sampling: 1-channel, 2-channel, voltage meter
  • Trigger pin
  • Clock input
  • Clock output
  • Frequency/pulse counter
  • Signal generator
  • Fix power consumption during enumeration.
    • Non-LP FX2's consume more than 100mA during enumeration. This is outside of the USB specification
    • Official workaround is to enumerate first as full-speed, then as high-speed. This is overkill for sigrok.
    • Investigate putting the CPU to sleep (except for processing interrupts) until enumerated.

PulseView

  • Deduplicate property setting functionality between SamplingBar and DeviceOptions - make SamplingBar a properties container
  • Analog interpolation (cosine? sinc? some kind of interpolation filter?)
  • Signal overview
  • Transition coding

sigrok-meter

  • Make the list of measurements look nicer without using too much additional space.
  • Add graphs.
    • PyQtGraph looks like a nice graphing library.
      • Works with PyQt and PySide.
      • Pure python, easy to install.
      • Few dependencies: scipy is not required any more in the upcoming version 0.9.9, numpy is already a dependency of the python bindings.
      • From looking at the examples, it seems more than fast enough for our requirements.
    • Pass all samples (not only the most recent one) to the GUI thread and store them there.
      • The packet payload object is currently not thread save.