Waveflow Timing Analysis Tools
Waveflow provides some basic package for python processing of timing diagrams relevant for hardware workflows:
- Creating timing and plotting timing diagrams in matplotlib
- Running Xilinx RTL simulations to produce VCD outputs
- Extracting information from timing diagrams
- Python-based analysis for AXI protocols including AXI-Lite, AXI-Streaming, and AXI memory-mapped
The waveflow.utils.timing module renders two complementary views, each of which can be built by
hand or from a trace: Timing Diagrams (waveforms — value boxes per transition, for a
~10–50 cycle zoom) and Activity Diagrams (activity bands + an optional occupancy
panel, for the whole-run and stage-overlap view).
For a free-running (ap_ctrl_none) hls::task kernel, Tracing a kernel run
covers the four build steps that dump a VCD of its internal channels and bind the signals by exact
name; Trace pitfalls collects the three subtle ways such a measurement goes
silently wrong (sampling phase, ap_done anchoring, occupancy vs write-enable). The
memcpy timing example applies the whole flow to one kernel.
Table of contents
- Timing Diagrams - Building waveform diagrams by hand, from any Python arrays rather than from a simulation trace. SigTimingInfo holds a signal's (time, value) transitions, ClkSig is the clock, and TimingDiagram renders them in matplotlib — used for teaching material and for figures in papers.
- Activity Diagrams - The view for a thousand cycles rather than fifty: labelled lanes on a common cycle axis, filled with when each stage was busy instead of what each signal held. Bands collapse contiguous active cycles into one bar, beats draw a hairline per cycle, and an optional occupancy panel shades wherever a FIFO sat at capacity — which is where the producer was blocked.
- Extracting VCD Files - Vitis cosim writes its waveforms to a proprietary .wdb; this re-runs the existing RTL simulation and exports an open VCD instead, so the per-cycle waveform is readable from Python and from other tools. Covers the parameters the helper needs, where to find each one in the directory structure Vitis leaves behind, and the cosim_design -trace_level the export depends on having been set.
- Parsing VCD Files - Reading a VCD into Python with VcdParser: loading the file, finding the signal names inside it, and adding the ones you want under short display names. The starting point for every other page in this section.
- AXI4-Stream Timing Analysis - Pulling AXI4-Stream activity out of a VCD: add_axiss_signals loads a stream's TDATA, TVALID, TREADY and TLAST from one name prefix, and the result plots on a timing diagram or extracts as accepted beats. Worked on the polynomial example's two streams.
- AXI4 Memory-Mapped Timing Analysis - Pulling AXI4 memory-mapped activity out of a VCD: add_aximm_signals loads the read and write address, data and handshake nets from one prefix — including the burst-length and last-beat signals on an AXI4-Full interface — and the accepted read and write bursts come out as data. Worked on the histogram example's m_axi_gmem master.
- Stream-of-Blocks Timing Analysis - A stream of blocks lowers to a block-RAM port rather than an AXI stream, so its activity lives on a different set of nets than the two protocol pages cover. add_sob_signals finds a named buffer's port nets from the owning component, and extract_sob_span turns them into spans. Worked on the interleaver's gather stage, which holds two read blocks and one write block.
- Cosim timing - Comparing the Python timing estimate against the cycle count Vitis cosim reports, as a build step with a recorded verdict. Three steps chain: extract the Python timing, parse the cosim report, and compare within a tolerance — always writing timing_verdict.json, and raising after writing it when the difference exceeds the tolerance.
- Tracing a kernel run - Getting a VCD of a free-running kernel's internal signals, as four ordinary build steps rather than a procedure. The XSI value API resolves top-level ports only, and the interesting nets in a composite are the FIFOs between tasks, so a small Verilog module elaborated alongside the DUT dumps them. General infrastructure: the only example-specific input is the component class.
- Trace pitfalls - Three ways a trace measurement returns a plausible number that is wrong, each of which produced a confident incorrect conclusion before it was caught. Sampling on the rising edge rather than mid clock-low read 16 accepted AXI-MM addresses instead of 128. The fixes are built into the Waveflow accessors; the pitfalls return the moment you step outside them.