Skip to content

Conversation

@wirew0rm
Copy link
Member

  • switch to composition
    Do not use inheritance for the different Picoscope models but
    encapsulate the APIs for the different models without gnuradio
    dependencies.
    There are now three levels of abstraction:

    • PicoscopeXXX.hpp: wraps the picoscope C headers and macros in a C++ friendlier way. Has to implement PicoscopeImplementationLike
    • PicoscopeAPI: defines PicoscopeImplementationLike implements a wrapper for shared functionality which does not depend on gnuradio.
    • Picoscope.hpp: The actual GNURadio block.
  • Add a qa_PicoscopeAPI unittest
    This allows to test the Picoscope abstraction without any dependencies
    on gr4 to allow fast testing and verifying API assumptions.

  • remove atomic and blocking IO logic
    The previous logic was unsafe because it copied data outside of the
    callback in which copying is safe. Additionally by spawning its own
    threads in addition to the picoscope driver's own threads, it was
    heavy on CPU. The actual data transfer is handled by the Picoscope
    driver thread, and the picoscope's work function just polls the driver
    functions. In combination with the blocking scheduler, this should
    reduce CPU load (trading off against latency).
    Also does not reimplement internal block functions like workInternal.

  • switch from std::vector<Port<...>> to std::array<Port<..>, N_Channels>

  • Add simple picoscope cli application to test the low level API
    independent of gr4

  • Support for digitial, AUX and EXTERNAL triggers
    Digital is intentionally simple and only allows a single digital
    input. AUX is only available on the PS600 and EXTERNAL is only
    relevant for the non MSO variant of the 3000A/5000A.

Open issues:

  • testing should be extended massively and structured better
  • tag matching still has some issues depending on settings for timeout and sample-rate.
  • error handling
  • investigate control of buffer sizes and polling rates to improve
    latencies. Ideally some of it can be done in the gr4 scheduler
    already.

Remove unused parts of the project.

Signed-off-by: Alexander Krimm <A.Krimm@gsi.de>
gr4 misses to add the Python target to the header-only part of the
gr-basic library (it's only added to the shared library part.)
This leads to compiler errors in opendigitizer which only uses the
header.

Signed-off-by: Alexander Krimm <A.Krimm@gsi.de>
Signed-off-by: Alexander Krimm <A.Krimm@gsi.de>
Signed-off-by: Alexander Krimm <A.Krimm@gsi.de>
@wirew0rm wirew0rm force-pushed the picoscopeRefactor branch 4 times, most recently from e946feb to 67df81d Compare November 24, 2025 18:46
- switch to composition
  Do not use inheritance for the different Picoscope models but
  encapsulate the APIs for the different models without gnuradio
  dependencies.
  These are then used interchangably in the Picoscope block.

- Add a qa_PicoscopeAPI unittest
  This allows to test the Picoscope abstraction without any dependencies
  on gr4 to allow fast testing and verifying API assumptions.

- remove atomic and blocking IO logic
  The previous logic was unsafe because it copied data outside of the
  callback in which copying is safe. Additionally by spawning its own
  threads in addition to the picoscope driver's own threads, it was
  heavy on CPU. The actual data transfer is handled by the Picoscope
  driver thread, and the picoscope's work function just polls the driver
  functions. In combination with the blocking scheduler, this should
  reduce CPU load (trading off against latency).
  Also does not reimplement internal block functions like workInternal.

- switch from `std::vector<Port<...>>` to `std::array<Port<..>,
  N_Channels>`

 - Add simple picoscope cli application to test the low level API
   independent of gr4

 - Support for digitial, AUX and EXTERNAL triggers
   Digital is intentionally simple and only allows a single digital
   input. AUX is only available on the PS600 and EXTERNAL is only
   relevant for the non MSO variant of the 3000A/5000A.

Open issues:
- testing should be extended massively and structured better
- tag matching still has some issues
- error handling
- investigate control of buffer sizes and polling rates to improve
  latencies. Ideally some of it can be done in the gr4 scheduler
  already.

Signed-off-by: Alexander Krimm <A.Krimm@gsi.de>
@wirew0rm wirew0rm merged commit be76c1c into main Nov 25, 2025
8 of 9 checks passed
@wirew0rm wirew0rm deleted the picoscopeRefactor branch November 25, 2025 07:31
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

Successfully merging this pull request may close these issues.

2 participants