Fst Writer#671
Conversation
Clarify comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Adds FST format support as an alternative output format for WaveDumper: - lib/src/fst/fst_types.dart: FST type definitions (FstVarType, FstVarDirection, FstScopeType, FstFileType, FstSignalHandle, FstWriterConfig) - lib/src/fst/fst_writer.dart: GTKWave-compatible binary FST writer - lib/src/wave_dumper.dart: adds WaveFormat enum (vcd/fst) and FST format support - lib/rohd.dart: exports fst_types.dart and fst_writer.dart - test/fst_writer_test.dart: FST writer tests No DevTools integration on this branch; that is added later.
Uses Directory.createSync / dart:io — fails on JS with _Namespace error.
| @@ -0,0 +1,236 @@ | |||
| // Copyright (C) 2021-2026 Intel Corporation | |||
There was a problem hiding this comment.
nit: new file not copyrighted since 2021?
| final FstWriterConfig? fstConfig; | ||
|
|
||
| /// The file to write dumped output waveform to (VCD only). | ||
| File? _outputFile; |
| // ─────────────── VCD initialization ─────────────── | ||
|
|
||
| /// Initializes VCD output. | ||
| void _initVcd() { |
There was a problem hiding this comment.
it feels a little odd that all the VCD-specific stuff lives in wave_dumper, but all the FST-specific stuff is in a separate FSTWriter. Should we extract a common API of some sort for "writers" rather than have such a difference in implementation?
There was a problem hiding this comment.
I am applying this comment to fst-writer which will have the WaveformService form of API. This branch was designed to be mergeable independent of module_services_api as I wasn't sure when we would merge. FST is interesting for exploring waveforms with structure (array/struct).
There was a problem hiding this comment.
Actually it just seems easier to merge this after module_services_api. So I will presume this from now on to make it easier to review.
| export 'src/exceptions/exceptions.dart'; | ||
| export 'src/external.dart'; | ||
| export 'src/finite_state_machine.dart'; | ||
| export 'src/fst/fst_types.dart'; |
There was a problem hiding this comment.
it might be nice to have our vcd tests and fst tests somehow both parse the same simulation and confirm that both saw certain events at the same times
Description & Motivation
It would be nice to have a
WaveDumperthat can output the FST format because it is much more dense and can be incrementally accessed.Related Issue(s)
None
Testing
We ran the output through a few tools, notably Wellen and GTKwave.
Backwards-compatibility
No.
Documentation
No. We will need to add. But at the user level, it becomes a choice between VCD and FST>