SystemVerilogService class

A service that wraps SystemVerilog synthesis of a Module hierarchy.

Provides access to the generated SV file contents and per-module synthesis results, and optionally registers with ModuleServices for DevTools inspection.

Example:

final dut = MyModule(...);
await dut.build();
final sv = SystemVerilogService(
  dut,
  outputDirectory: 'build',
  multiFile: true,
);

// Write individual .sv files:
sv.writeOutputs();

// Or get the concatenated output:
print(sv.output);
Inheritance

Constructors

SystemVerilogService(Module module, {String outputDirectory = '.', String? outputBaseName, bool multiFile = false, bool? includeHeader, bool embedSourceTraceComments = true, SystemVerilogSynthesizerConfiguration configuration = const SystemVerilogSynthesizerConfiguration(), bool register = true})
Creates a SystemVerilogService for module.

Properties

allContents → String
Returns the concatenated SystemVerilog module definitions as a single string, without the generation header.
no setter
artifacts → Iterable<ModuleServiceArtifact>
The artifacts generated by this service.
no setteroverride
configuration → SystemVerilogSynthesizerConfiguration
Configuration controlling generated SystemVerilog.
final
contentsByDefinitionName → Map<String, String>
Returns generated SV contents keyed by original module definition name.
no setter
embedSourceTraceComments → bool
Whether generated SV includes embedded source-trace comments.
final
fileContents ↔ List<SynthFileContents>
The generated file contents (one per unique module definition).
latefinal
hashCode → int
The hash code for this object.
no setterinherited
The generation header included in each emitted SV file, when enabled.
latefinal
headerLineCount → int
The number of newlines in the emitted header.
no setter
includeHeader → bool
Whether generated SV files include the ROHD generation header.
final
instanceTypeLineOffsets → Map<String, int>
The 0-based line offset of each generated implementation within output.
latefinal
module → Module
The top-level Module this service operates on.
finalinherited
moduleLineOffsets → Map<String, int>
The 0-based line offsets keyed by requested source definition name.
latefinal
multiFile → bool
Whether the artifact layout emits one .sv file per module definition (true) or a single concatenated file (false).
final
output → String
Returns the full single-file SystemVerilog output with header, identical to Module.dumpSystemVerilog.
latefinal
outputBaseName → String
Filename stem used for primary artifacts.
finalinherited
outputDirectory → String
Directory receiving filesystem artifacts when this service writes them.
finalinherited
outputPath → String
The configured output path, or the path used by the most recent successful write.
no setter
perModuleSvLineMaps → Map<String, Map<String, List<String>>>
Returns per-module SystemVerilog line maps keyed by generated implementation name.
no setter
perModuleSvLineMapsByModule → Map<Module, Map<String, List<String>>>
Returns per-source-module line maps for the generated implementation associated with each occurrence.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
singleFileSvLineMaps → Map<String, Map<String, List<String>>>
Returns line maps adjusted to positions within single-file output, keyed by generated implementation name.
no setter
singleFileSvLineMapsByModule → Map<Module, Map<String, List<String>>>
Returns single-file line maps for the generated implementation associated with each source module occurrence.
no setter
svFileMapByInstanceType → Map<String, String>
Maps generated implementation names to their split-file artifacts.
no setter
svFileMapByModule → Map<Module, String>
Maps each source module occurrence to its split-file artifact.
no setter
synthBuilder ↔ SynthBuilder
The underlying SynthBuilder that drove synthesis.
latefinal
synthesisResults → Set<SynthesisResult>
All SynthesisResults produced by synthesis.
no setter
synthHeader → String
The ROHD generation header prepended to single-file output.
no setter
synthOutput → String
Backwards-compatible alias for output.
no setter

Methods

instanceTypeOutput(String instanceTypeName) → String?
Returns SV output for a generated module instanceTypeName, or null when that instance type was not generated.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
singleFileSvFileMapByModule(String filename) → Map<Module, String>
Maps each source module occurrence to filename for a concatenated single-file artifact.
toJson() → Map<String, Object>
Returns a JSON-serialisable summary of the SV synthesis.
override
toString() → String
A string representation of this object.
inherited
write([String? path]) → void
Writes concatenated output to path, or to outputPath when omitted.
writeFiles([String? directory]) → void
Writes each generated module to its own file.
writeLegacyOutputPath(String outputPath) → void
Writes the single-file output to an exact legacy outputPath.
writeOutputs() → void
Writes this service's artifacts to outputDirectory.

Operators

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

Static Properties

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

Constants

moduleSeparator → const String
The separator inserted between module definitions in the concatenated single-file output from allContents.