Skip to content

dreamsourcelab-dslogic: support DSLogic Plus Pango variant (2a0e:0034)#291

Open
huehuehuehueing wants to merge 1 commit into
sigrokproject:masterfrom
huehuehuehueing:dslogic-plus-0034-wip
Open

dreamsourcelab-dslogic: support DSLogic Plus Pango variant (2a0e:0034)#291
huehuehuehueing wants to merge 1 commit into
sigrokproject:masterfrom
huehuehuehueing:dslogic-plus-0034-wip

Conversation

@huehuehuehueing

Copy link
Copy Markdown

Summary

Adds support for the DSLogic Plus hardware revision shipping with a Pango FPGA in place of the original Xilinx Spartan-6. The device enumerates as 2a0e:0034 ("USB-based DSL Instrument v2") and ships with the DSLogicPlus-pgl12-2.bin bitstream.

DreamSourceLab has been transitioning the DSLogic series away from Spartan parts to Pango (PGL12 family) silicon. The newer hardware speaks a different USB command transport than the existing flat-opcode protocol the upstream dreamsourcelab-dslogic driver implements, so --scan recognised the device only after a USB-ID addition, and any capture attempt hung on opcode collisions (e.g. the legacy DS_CMD_START=0xb2 collides with the new firmware's CMD_CTL_RD=0xb2).

This change keeps the existing V1 (flat-opcode) path untouched for all currently-supported PIDs and adds a parallel V2 (envelope) path that the Pango variant binds to.

Approach

A struct dslogic_protocol_ops vtable in protocol.h decouples wire-format-specific operations from the rest of the driver:

struct dslogic_protocol_ops {
    int (*fpga_firmware_upload)(...);
    int (*fpga_config)(...);
    int (*acquisition_start)(...);
    int (*acquisition_stop)(...);
    int (*set_samplerate)(...);
    int (*set_voltage_threshold)(...);
    int (*set_trigger)(...);
    int (*set_external_clock)(...);
    int (*set_clock_edge)(...);
    int (*security_check)(...);
};

Each profile in supported_device[] gains a protocol_version field (DSL_PROTO_V1 or DSL_PROTO_V2) and an ops pointer. All existing entries are tagged V1 and bound to a new dslogic_v1_ops table whose entries are thin façades over the unchanged V1 functions (no behaviour change for existing hardware). The 0x0034 entry is tagged V2.

protocol_v1.c (new) holds the V1 façades. protocol_v2.{c,h} (new) hold the V2 envelope implementation: three-opcode transport (CMD_CTL_WR/RD_PRE/RD) with a ctl_header selector, register/NVM access wrappers, FPGA bitstream upload (the multi-step PROG_B/INIT_B/GPIF_DONE/FPGA_DONE/LED sequence), an 8-step security challenge over the I²C-mapped SEC_CTRL/DATA registers, the FPGA arm sequence with the struct DSL_setting blob, acquisition start/stop, and a two-stage stop that issues CTR0_ADDR := bmFORCE_RDY before DSL_CTL_STOP so the FPGA capture engine releases cleanly.

The Pango variant also ships its FX2 firmware in internal flash and presents the product string "USB-based DSL Instrument v2", so the existing has_firmware product-string probe is extended to recognise it and skip the legacy FX2 firmware upload (which would otherwise renumerate the device to 0x0020 running the V1 firmware).

The V2 envelope protocol, security challenge, FPGA arm sequence, struct DSL_setting layout, and register addresses all mirror DSView 1.3.2's libsigrok4DSL/hardware/DSL/ reference implementation byte-for-byte. The new files in protocol_v2.{c,h} carry the original Bert Vermeulen and DreamSourceLab copyrights alongside the new contributor line; both projects are GPLv3 so the license stack is compatible.

What works

  • sigrok-cli --scan recognises the device (PID 0x2a0e:0x0034, product string "USB-based DSL Instrument v2")
  • V2 hello reads return firmware version 2.2
  • Pango FPGA bitstream upload (530620 bytes) completes; device's green status LED lights solid
  • Security challenge passes
  • FPGA arm sequence completes
  • Sample capture returns data — 100 samples × 16 channels at 1 MHz returns 1959 bytes in bits format in well under a second
  • Acquisition stop returns the LED to its idle (solid green) state matching DSView's behaviour
  • Build is clean (no new warnings on the dreamsourcelab-dslogic translation units)

What's not in this change

  • The Pango bitstream itself is not redistributable by sigrok-firmware. For now users must place DSLogicPlus-pgl12-2.bin (extracted from DSView) at $prefix/share/sigrok-firmware/dreamsourcelab-dslogic-plus-fpga.fw. A follow-up should extend sigrok-fwextract-dreamsourcelab-dslogic in sigrok-util to fetch it.
  • The V1 path is untested by me (no V1-original Spartan hardware available); the refactor was kept as a mechanical vtable bind to avoid behaviour drift, but please run on a Spartan DSLogic if you have one handy.
  • 32-channel struct DSL_setting_ext32 (gated on CAPS_FEATURE_LA_CH32) is intentionally not added; the 16-channel Plus does not need it.

Test plan

  • make builds clean
  • sigrok-cli --scan recognises a connected 2a0e:0034 device
  • sigrok-cli -d dreamsourcelab-dslogic -c samplerate=1000000 --samples 1000 -O bits returns 1000 samples within ~1 s
  • Acquisition stop leaves the device's green LED solid (not flashing); no PIPE errors on the next --scan
  • A V1-hardware user runs sigrok-cli --scan + a small capture on an unmodified DSLogic / DSLogic Pro / DSLogic Plus (Spartan) to confirm no regression in the V1 path

…0034)

Adds support for the DSLogic Plus hardware revision that enumerates
as USB ID 2a0e:0034 ("USB-based DSL Instrument v2") and ships with a
Pango FPGA bitstream. This revision speaks a newer envelope-style
control protocol than the existing DSLogic family; the driver gains a
parallel V2 path while leaving the V1 (flat-opcode) path untouched.

Architecture
------------

- struct dslogic_protocol_ops vtable in protocol.h with one slot per
  operation whose wire format differs between protocol versions
  (fpga_firmware_upload, fpga_config, acquisition_start/stop,
  set_samplerate/voltage_threshold/trigger/external_clock/clock_edge,
  security_check).
- enum dslogic_protocol_version per profile (DSL_PROTO_V1 or
  DSL_PROTO_V2). All existing profiles tagged V1; PID 0x0034 tagged V2.
- dev_context gains a cached ops pointer resolved at dev_open.
- protocol_v1.c (new): thin facades over the existing V1 functions,
  bound into dslogic_v1_ops. Pure refactor with no wire changes.
- protocol_v2.{c,h} (new): the envelope-protocol implementation.

Wire format (V2)
----------------

- Three control opcodes only: CMD_CTL_WR=0xb0, CMD_CTL_RD_PRE=0xb1,
  CMD_CTL_RD=0xb2. The packed struct ctl_header (dest, offset, size)
  carries the real destination via a DSL_CTL_* enum
  (HW_STATUS, INTRDY, WORDWIDE, START, STOP, BULK_WR, NVM, I2C_REG,
  I2C_STATUS, PROG_B, LED, FW_VERSION).
- command_ctl_rd_v2 is two-phase: PRE (OUT) writes the header, 10 ms
  sleep, then RD (IN) collects the requested bytes.
- Register R/W (dsl_wr_reg_v2 / dsl_rd_reg_v2) wraps the envelope with
  I2C_REG (write) / I2C_STATUS (read) destination and a 1-byte address
  in offset. NVM reads use DSL_CTL_NVM.

Bitstream upload (V2)
---------------------

Mirrors DSView's dsl_fpga_config sequence:
PROG_B low -> LED off -> PROG_B high -> wait FPGA_INIT_B -> INTRDY
low -> DSL_CTL_BULK_WR with 3-byte filesize -> bulk transfer bitstream
on ep2 OUT -> INTRDY high -> wait GPIF_DONE -> INTRDY low -> wait
FPGA_DONE -> LED green -> WORDWIDE high.

Security challenge (V2)
-----------------------

The 0x0034 firmware gates capture on an 8-step challenge-response over
an I2C register block (SEC_CTRL_ADDR=0x73, SEC_DATA_ADDR=0x75). The
encryption blob is read from device NVM at SECU_EEP_ADDR=0x3C00 via
DSL_CTL_NVM. Implemented as v2_security_check; called from dev_open
after the FPGA bitstream is loaded. Mirrors DSView's dsl_secuCheck.

FPGA arm (V2)
-------------

WORDWIDE -> DSL_CTL_BULK_WR (3-byte word count = sizeof(setting)/2 =
186) -> poll bmSYS_CLR -> bulk transfer struct DSL_setting (372 bytes)
on ep2 OUT -> DSL_CTL_INTRDY -> read HW_STATUS once and check
bmGPIF_DONE. The DSL_setting layout (with its (register_index << 8) |
word_count header encoding) and the samplerate divider math
(hw_max=500 MHz, pre_div=5 for DSLogic Plus pgl12) mirror DSView's
dsl_fpga_arm. Sample count is shifted right by 4 because the FPGA's
minimum capture unit is 16 samples.

V2 acquisition stop is two-stage like DSView's: write CTR0_ADDR :=
bmFORCE_RDY first (soft FPGA abort that releases the GPIF capture
engine and resets the green LED to solid), then DSL_CTL_STOP.

dev_open changes
----------------

- Extends has_firmware product-string probe to recognise "USB-based
  DSL Instrument v2" so the V2 device skips the legacy FX2 firmware
  upload (which would renumerate it to 0x0020 with the V1 firmware).
- V2 path performs DSL_CTL_FW_VERSION + DSL_CTL_HW_STATUS reads at the
  start of dev_open (matches DSView's hw_dev_open + dsl_dev_open
  initialisation). The pre-existing V1 firmware version probe at
  bRequest 0xb0 collides with V2's CMD_CTL_WR opcode and is now
  V1-gated.
- After bitstream upload + security check, an initial voltage threshold
  is written to VTH_ADDR via the new vtable slot.

Tested on real PID 0x2a0e:0x0034 hardware: scan, FPGA bitstream upload,
security challenge, FPGA arm, sample capture (100 samples / 16 channels
at 1 MHz returns 1959 bytes), and clean stop with idle-LED state.

Co-authored-by: Larry Hernandez <l.gr@dartmouth.edu>
@vhdirk

vhdirk commented Jun 8, 2026

Copy link
Copy Markdown

You are awesome. I just purchased this exact same device!

One question though:

The Pango bitstream itself is not redistributable by sigrok-firmware. For now users must place DSLogicPlus-pgl12-2.bin (extracted from DSView) at $prefix/share/sigrok-firmware/dreamsourcelab-dslogic-plus-fpga.fw. A follow-up should extend sigrok-fwextract-dreamsourcelab-dslogic in sigrok-util to fetch it.

It seems that the current master branch of DSView no longer ships with DSLogicPlus.fw. should I pull this from a really old commit (pre-1.3.0 at least), or has the file simply been renamed to something else?

EDIT:
nevermind, I re-read your post and saw that the *.fw is not needed for this to work.

At first glance this seems to work quite nicely, thanks a lot!

@huehuehuehueing

Copy link
Copy Markdown
Author

@vhdirk Thank you for your appreciation! I figured there must be other people who are either broke, or want to push cheap "crap" to its Rohde & Schwarz pedigree potential, or both. As they say, great things have smol beginnings.

It would be fantastic if you had a chance to test the full set of changes. The chunked transfer feature is something I hope to see merged. It should enable using any LA, and especially the cheap DSLogic series, for full duty/continuous streaming, by stitching the transfers. Normally you are limited to whatever caching/on-board RLE/storage tricks are available, with degraded channel counts and bandwidth per channel.

You may need to fine-tune the settings if you are using one of the USB 2.0 models (as was my case), as that will quickly saturate the bus bandwidth. Happy to provide suggestions. Hammer it with high speed SPI (e.g. SD card transfers).

@vhdirk

vhdirk commented Jun 10, 2026

Copy link
Copy Markdown

I tested with the full set of changes from the start.
I also have the usb2 model (but type-c connector), which is odd since their website lists usb3 as a selling point. It's one of the reasons I chose this one in the first place. Oh well.

One thing I noticed, and I'm not sure where this originates, is that all signals just flatline after about 2 minutes of recording ( 12 channels, at 1Mhz). It was always 2 minutes and a couple of seconds. I don't think it's always exactly at the same time.

Restarting the session fixes it, but that makes it unusable for now.

Any idea what could be the cause of this? I'm using PulseView so I haven't looked if there are any meaningful log message or errors.

I won't be able to assist with code, but I'm happy to test and provide logs or so.

@huehuehuehueing

Copy link
Copy Markdown
Author

No problem re code. Logs/diagnostic data is enough.

  • Could you show me a time-wrapped execution of the command, the exact command line, and preferably share a compressed dump (sr file)?

e.g. time sigrok-cli (...)

  • What model and lsusb output (strip anything not relevant, I only need the exact device line for the LA) is present?
  • PulseView should not differ much from sigrok cli. Try to repro with the cli tool to rule out operator mistakes.
  • By flat line, do you mean the LA is returning zeroes for the channel(s) (e.g. bitstream all zeroed)? (this is why we will need to dump to a SR file)
  • Use verbose logging so we can get full logs.

TL;DR We will need to isolate logs and SR dump files, compress those and upload them here. Do note that the chunked transfer mode is essentially abusing the hardware. I have no idea if it will not cause undefined behavior after some time (e.g. overheating). I will try to repro this locally.

Thank you again :)

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