WaveformService class

A waveform capture service that writes signal changes to a file.

Selects the output backend via format. FST-specific writer tuning is available through WaveformService.fst.

Inheritance

Constructors

WaveformService(Module module, {String? outputDirectory, String? outputBaseName, String? outputFileName, WaveOutputFormat format = WaveOutputFormat.vcd, bool signalFilter(Logic signal)?, WaveformTimeScale timescale = WaveformTimeScale.onePicosecond, int? startTime, int? stopTime, int flushBufferSize = 100000, OverwritePolicy overwritePolicy = OverwritePolicy.overwrite, bool register = true, bool writeToFile = false, bool? retainInMemory, bool enableDevToolsStreaming = false})
Creates a WaveformService for module.
WaveformService.fromOutputPath(Module module, {required String outputPath, WaveOutputFormat format = WaveOutputFormat.vcd, bool signalFilter(Logic signal)?, WaveformTimeScale timescale = WaveformTimeScale.onePicosecond, int? startTime, int? stopTime, int flushBufferSize = 100000, OverwritePolicy overwritePolicy = OverwritePolicy.overwrite, bool register = true, bool? retainInMemory, bool enableDevToolsStreaming = false})
Legacy factory that accepts a single outputPath argument.
factory
WaveformService.fst(Module module, {String? outputDirectory, String? outputBaseName, String? outputFileName, bool signalFilter(Logic signal)?, WaveformTimeScale timescale = WaveformTimeScale.onePicosecond, int? startTime, int? stopTime, OverwritePolicy overwritePolicy = OverwritePolicy.overwrite, bool register = true, bool writeToFile = true, FstWriterConfig config = const FstWriterConfig(), bool enableDevToolsStreaming = false})
Creates an FST capture with backend-specific config tuning.

Properties

artifacts → Iterable<ModuleServiceArtifact>
The waveform artifact produced by this service.
no setteroverride
enableDevToolsStreaming → bool
Whether to expose captured values to DevTools.
final
flushBufferSize → int
Number of characters accumulated in the VCD write buffer before it is flushed to disk.
final
format → WaveOutputFormat
Output format.
final
hashCode → int
The hash code for this object.
no setterinherited
inMemoryOutput → String?
The retained VCD waveform, or null when retention is disabled.
no setter
module → Module
The top-level Module this service operates on.
finalinherited
outputBaseName → String
Filename stem used for primary artifacts.
finalinherited
outputDirectory → String
Directory receiving filesystem artifacts when this service writes them.
finalinherited
outputFileName → String?
Exact output filename override.
final
outputFilePath → String
Path of the output waveform file.
no setter
outputPath → String
Path of the output waveform file.
no setter
overwritePolicy → OverwritePolicy
What to do when the output file already exists.
final
register → bool
Whether to register this service with ModuleServices for inspection.
final
retainInMemory → bool
Whether to retain a complete in-memory copy for debugging consumers.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
signalFilter → bool Function(Logic signal)?
Optional predicate that determines whether a given Logic signal is captured.
final
startTime → int?
Simulation time at which recording begins.
final
stopTime → int?
Simulation time at which recording ends.
final
timescale → WaveformTimeScale
The physical duration represented by one unit of Simulator.time.
final
writer → WaveformWriter
The concrete output writer used by this service.
no setter
writeToFile → bool
Whether waveform bytes are written to outputPath.
final

Methods

canSendWaveforms() → bool
Whether this service can provide waveform data to debugging consumers.
createWaveformQuery() → WaveformQuery
Creates a format-independent query provider for this capture.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSignalCollected(Logic signal) → void
Called once for each Logic signal that passes signalFilter.
onSimulationEnd() → void
Called after the final timestamp has been written and the file is closed.
onTimestampCapture(int timestamp, Set<Logic> changed) → void
Called once after each captured timestamp batch.
onValueChange(Logic signal, int timestamp) → void
Called once for each signal's final value in a callback batch at timestamp.
toJson() → Map<String, Object?>
Returns a JSON-serialisable summary of this service.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

current → WaveformService?
The most recently registered WaveformService, or null.
no setter