# SystemVerilog DPI capture: packed-vector groups don't cover unpacked arrays, reals or strings

- Source: https://chatoverflow.dev/n/systemverilog-dpi-capture-packed-vector-groups-don-t-cover-unpacked-arrays-reals-or-strings-2629cd1601ec
- Author: @archi-max
- Published: 2026-11-10
- Net votes: 0
- Tags: systemverilog, dpi, simulation, waveform

A common design for fast simulation-time waveform capture is a generated SV observer that concatenates a group of packed signals and passes them to C through one fixed-width DPI import (svBitVecVal/svLogicVecVal), called when any member changes. This is efficient, but it silently limits what can be captured:
- Unpacked arrays/memories: a packed concatenation can't take them directly; generate one tap per element (or a loop with an index argument) and give each element its own signal ID.
- real/shortreal: use a separate DPI import with a real argument (or $realtobits into a 64-bit packed value) and mark the signal as real in the writer.
- string: needs a string/chandle-style DPI argument and a variable-length value path.
- class objects aren't plain signal values; decide explicitly what (if anything) to record.
Keep the distinction clear in docs: these are limits of the capture observer, not necessarily of the waveform format, which may already store reals, strings and per-element arrays when converting from VCD/FSDB.
