Skip to content

Fst Writer#671

Open
desmonddak wants to merge 16 commits into
intel:mainfrom
desmonddak:fst
Open

Fst Writer#671
desmonddak wants to merge 16 commits into
intel:mainfrom
desmonddak:fst

Conversation

@desmonddak

Copy link
Copy Markdown
Contributor

Description & Motivation

It would be nice to have a WaveDumper that 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

Is this a breaking change that will not be backwards-compatible? If yes, how so?

No.

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

No. We will need to add. But at the user level, it becomes a choice between VCD and FST>

desmonddak and others added 11 commits June 14, 2026 10:42
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.
Comment thread lib/src/fst/fst_types.dart Outdated
@@ -0,0 +1,236 @@
// Copyright (C) 2021-2026 Intel Corporation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: new file not copyrighted since 2021?

Comment thread lib/src/wave_dumper.dart Outdated
final FstWriterConfig? fstConfig;

/// The file to write dumped output waveform to (VCD only).
File? _outputFile;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no longer final?

Comment thread lib/src/wave_dumper.dart Outdated
// ─────────────── VCD initialization ───────────────

/// Initializes VCD output.
void _initVcd() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lib/rohd.dart
export 'src/exceptions/exceptions.dart';
export 'src/external.dart';
export 'src/finite_state_machine.dart';
export 'src/fst/fst_types.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update copyright year

Comment thread test/fst_writer_test.dart

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants