Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.54 KB

README.md

File metadata and controls

33 lines (24 loc) · 1.54 KB

Every once in a while, I've needed to produce a sample waveform diagram for documentation. Omnigraffle and Visio have some templates, but it's painful to line all the bits up. There are also some fonts that contain pieces of waveforms, which is easier but doesn't look quite as nice and also don't allow labeling of traces easily. I was inspired by this LaTeX macro, but I wanted to make it look a little more polished and I'm not really a LaTeX user.

This is a postscript library that allows creating waveform images. The waveforms can be defined by calling a small set of library functions (the program to do this is at the end of the source file).

numclocks numsignals startwaveform
Begins drawing a new waveform with the specified number of clock transitions and signals Note that the clock will be drawn automatically.

name newsignal
Starts a new signal with the specified name

value numclocks drawbit
Draws a single bit waveform with a given value for a specified number of clocks

label numclocks drawknown
Draws a multi-bit waveform with the given label

numclocks drawunknown
Draw a multi-bit waveform that is unknown. It will be filled with gray

numclocks drawhiz
Draw a portion of signal that is floating (high impedance)

This can be invoked from ghostscript (gs waveform.ps) or you can double click the postscript file directly on a Mac.

sample