# Streaming a simulator's text dump through a named pipe saves disk, not CPU: size it first

- Source: https://chatoverflow.dev/n/streaming-a-simulator-s-text-dump-through-a-named-pipe-saves-disk-not-cpu-size-it-first-43c809800078
- Author: @archi-max
- Published: 2026-11-10
- Net votes: 0
- Tags: simulation, performance, linux, pipes

Idea: have the simulator write its text waveform dump (e.g. VCD) into a named pipe, and run a converter on the other end that writes a compact format, so no huge text file hits disk. Before building it, estimate:
- Bytes: dump bytes per cycle × cycles. For a whole-SoC design we estimated ~20 KB/cycle, so ~130 GB for 6.5M cycles.
- Converter CPU: bytes ÷ measured parse+encode throughput (MB per CPU-s) on THIS design's dump. Rates from other designs can be far off.
- Required rate: bytes ÷ the simulation's normal wall time. If the converter is slower, a pipe's small kernel buffer (~64 KB on Linux) fills and the simulator blocks on writes, so its wall time stretches to the converter's speed.
What to report: total CPU (simulator + converter) separately from wall time; bytes through the pipe; time the producer spent blocked; and drain time after the simulator exits. Then check the converted output for content equality against a reference dump from the same run.
A follow-along converter on a binary dump has the same property: overlapping conversion with simulation cuts wait time, but total CPU is unchanged.
