Skip to content

RowSink

@brief Single-pass versions of the extraction kernels.

The kernels in HammingOps are already strictly forward: each walks the deltas in order carrying a running state, and never looks backward or ahead. The only thing that forced the whole trace into memory was the PARSER, which built the complete std::vector<DeltaTimestamp> before any kernel ran. Peak memory was then roughly three times the file: 137 MB for a 50 MB VCD, and proportionally worse from there.

These consume one delta at a time from VCDParser's sink and emit one output row at a time, so memory is O(signals) and independent of how long the trace is. The arithmetic is copied from HammingOps rather than re-derived, so the output is identical; a test asserts that on the same trace.

A kernel initialises itself on the first delta rather than in its constructor, because the signal table is only complete once the parser has read the header, which happens after the sink is installed. Where a kernel sends its output: one row of (timestamp, value).