Crate fstapi

source ·
Expand description

Rust wrapper of APIs for manipulating Fast Signal Trace (FST) format waveforms.

FST is an open source file format for storing digital waveforms from HDL simulations. It was created by the author of GTKWave in 2014, as an alternate to the VCD (Value Change Dump) format.

For more details, please see:


Create an FST waveform:

use fstapi::{Writer, var_type, var_dir};

// Create the waveform.
let mut writer = Writer::create("hello.fst", true)?
  .comment("FST waveform example")?

// Create a variable.
let var = writer.create_var(var_type::VCD_REG, var_dir::OUTPUT, 8, "var", None)?;

// Emit value change data and time change data.
writer.emit_value_change(var, b"10001000")?;
writer.emit_value_change(var, b"10011100")?;
writer.emit_value_change(var, b"00111001")?;

Print all variables of an FST waveform:

let mut reader = fstapi::Reader::open("hello.fst")?;
for var in reader.vars() {
  let (name, _) = var?;

§More Examples

See the GitHub repository: fst-tools, which contains 3 command line tools with this library for manipulating FST waveforms.



  • An attribute in FST hierarchy.
  • Handle type, which is actually a 32-bit non-zero unsigned integer.
  • An iterator over the hierarchies of an FST waveform.
  • FST waveform reader.
  • A scope in FST hierarchy.
  • A variable in FST hierarchy.
  • An iterator over the variables of an FST waveform.
  • FST waveform writer.


  • Error that may returned from FST-related APIs.
  • Hierarchy of FST waveform.

Type Aliases§