waveform

2022-12-30

Generates unicode waveforms that can be embedded into code comments.

software (29) zig (14)

Table of Contents
  1. Input Files
  2. Rendered Output
  3. Links

Generates unicode waveforms that can be embedded into code comments

During my work on the Ashet Home Computer, I wanted to document certain wave forms that are required in the SPI module in my Verilog code and started drawing some diagrams:

code with waveforms written as 1001110101

This didn’t really scale well and was badly readable. So when implementing the next module, I started using block drawing characters:

code using unicode block drawing characters

I really liked the visuals of those drawings, so I wrote myself a small tool that can render such diagrams: waveforms

Select anchorInput Files

The tool takes input in a line-based fashion:

CLK  | LLHLHLHLHLHLHLHLHLHLLLL
/CE  | HLLLLLLLLLLLLLLLLLHHHHH
MOSI | ZZB-B-B-B-B-B-B-B-ZZZZZ
MISO | ZZZB-B-B-B-B-B-B-B-ZZZZ

It starts with a signal name, a pipe separator to mark the start of the signal. After that, the following symbols are legal:

Select anchorRendered Output

The tool will then create a timing sequence, and renders the described waveforms in unicode characters:

code using unicode block drawing characters

Select anchorLinks