WaveDrom Timing Diagrams
How to use WaveDrom to draw digital timing diagrams, waveforms, and CPU architectures in Markdown.
WaveDrom is a specialized engine designed specifically for electronic engineers, hardware designers, and embedded software developers. It draws digital timing diagrams, logic waveforms, and register architectures using a simple JSON syntax.
To use it, wrap valid WaveDrom JSON in a wavedrom language block.
Digital Waveforms
WaveDrom uses single-character text strings to indicate the state of a digital signal over time (clock cycles).
0orL: Low Level1orH: High LevelporP: Positive clock edge (pulse)norN: Negative clock edge (pulse)x: Unknown / Don’t Care statez: High Impedance state=: Data / Valid bus value
Basic Example
|
|
|
The "wave" string tells WaveDrom what the signal does at each time step.
The "data" array provides labels when bus states (like 3, 4, 5, or =) are used.
Adding Spacers and Grouping
You can group related signals together using an array inside the "signal" array. The first element of the sub-array becomes the group’s label. To add empty space between groups or signals, insert {}.
|
|
|
Adding Arrows and Phase Edges
WaveDrom allows you to draw arrows between specific clock cycles to indicate causality (e.g., Signal B goes high because Signal A went high).
You tag specific nodes in the wave string with letters (like a or b), and then define edges connecting them in an "edge" array.
|
|
|
WaveDrom entirely eliminates the need to fiddle with vector drawing tools like Visio or Illustrator for complex timing diagrams. Whenever the protocol gets updated, simply change the JSON string and your PDF documentation updates automatically.