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:
- The source code of GTKWave.
- The documentation of GTKWave.
- An unofficial specification for FST format.
§Examples
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")?
.timescale_from_str("1ns")?;
// 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_time_change(10)?;
writer.emit_value_change(var, b"10011100")?;
writer.emit_time_change(42)?;
writer.emit_value_change(var, b"00111001")?;
writer.emit_time_change(100)?;
Print all variables of an FST waveform:
let mut reader = fstapi::Reader::open("hello.fst")?;
for var in reader.vars() {
let (name, _) = var?;
println!("{name}");
}
§More Examples
See the GitHub repository: fst-tools, which contains 3 command line tools with this library for manipulating FST waveforms.
Modules§
- array_
type - Enum values of type
ArrayType
. - attr_
type - Enum values of type
AttrType
. - block_
type - Enum values of type
BlockType
. - enum_
value_ type - Enum values of type
EnumValueType
. - file_
type - Enum values of type
FileType
. - misc_
type - Enum values of type
MiscType
. - pack_
type - Enum values of type
PackType
. - scope_
type - Enum values of type
ScopeType
. - supplemental_
data_ type - Enum values of type
SupplementalDataType
. - supplemental_
var_ type - Enum values of type
SupplementalVarType
. - var_dir
- Enum values of type
VarDir
. - var_
type - Enum values of type
VarType
. - writer_
pack_ type - Enum values of type
WriterPackType
.
Structs§
- Attr
- An attribute in FST hierarchy.
- Handle
- Handle type, which is actually a 32-bit non-zero unsigned integer.
- Hiers
- An iterator over the hierarchies of an FST waveform.
- Reader
- FST waveform reader.
- Scope
- A scope in FST hierarchy.
- Var
- A variable in FST hierarchy.
- Vars
- An iterator over the variables of an FST waveform.
- Writer
- FST waveform writer.
Enums§
Type Aliases§
- Array
Type - Subtype of the attribute of type
ARRAY
. - Attr
Type - Type of attribute.
- Block
Type - Type of block.
- Enum
Value Type - Subtype of the attribute of type
ENUM
. - File
Type - Type of file.
- Misc
Type - Subtype of the attribute of type
MISC
. - Pack
Type - Subtype of the attribute of type
PACK
. - Result
- Result with error type
Error
. - Scope
Type - Type of scope.
- Supplemental
Data Type - Type of supplemental data.
- Supplemental
VarType - Type of supplemental variable.
- VarDir
- Type of variable direction.
- VarType
- Type of variable.
- Writer
Pack Type - Type of packaging method of writer.