SystemVerilogService constructor

SystemVerilogService(
  1. Module module, {
  2. String outputDirectory = '.',
  3. String? outputBaseName,
  4. bool multiFile = false,
  5. bool? includeHeader,
  6. bool embedSourceTraceComments = true,
  7. SystemVerilogSynthesizerConfiguration configuration = const SystemVerilogSynthesizerConfiguration(),
  8. bool register = true,
})

Creates a SystemVerilogService for module.

module must already be built.

outputDirectory defaults to the current directory and outputBaseName defaults to Module.definitionName. includeHeader defaults to !multiFile to preserve the historical layout. Set register to false to keep this service out of ModuleServices.

Implementation

SystemVerilogService(
  Module module, {
  super.outputDirectory,
  super.outputBaseName,
  this.multiFile = false,
  bool? includeHeader,
  this.embedSourceTraceComments = true,
  this.configuration = const SystemVerilogSynthesizerConfiguration(),
  bool register = true,
})  : includeHeader = includeHeader ?? !multiFile,
      super(module) {
  if (!module.hasBuilt) {
    throw ModuleNotBuiltException(module);
  }

  synthBuilder = SynthBuilder(
      module,
      SystemVerilogSynthesizer(
        configuration: configuration,
        embedSourceTraceComments: embedSourceTraceComments,
      ));
  fileContents = synthBuilder.getSynthFileContents();

  if (register) {
    ModuleServices.instance.register<SystemVerilogService>(this);
  }
}