CosimWrapConfig constructor
Generates a SystemVerilog wrapper and a Makefile to be called by default.
Generated files will be dumped into directory
. Note that if your
references in Cosims to file paths are relative, they will need to
account for the fact that they will be run from directory
.
To dump waves from the SystemVerilog simulator, set dumpWaves
to true
.
To pass environment variables to the process running the SystemVerilog
simulator, place them in environment
.
Implementation
CosimWrapConfig(
this.systemVerilogSimulator, {
super.directory,
super.enableLogging,
this.dumpWaves = false,
this.environment,
super.throwOnUnexpectedEnd,
}) {
Cosim.generateConnector(directory: directory, enableLogging: enableLogging);
String? dumpWavesString;
if (dumpWaves) {
if (systemVerilogSimulator == SystemVerilogSimulator.vcs) {
dumpWavesString =
_SystemVerilogSimulatorWaveDumpConfiguration.vcsFsdbDump(
top: _wrapperName);
} else if (systemVerilogSimulator == SystemVerilogSimulator.icarus) {
dumpWavesString =
_SystemVerilogSimulatorWaveDumpConfiguration.icarusVcdDump(
top: _wrapperName);
} else {
throw Exception('Not sure how to dump waves for simulator'
' "${systemVerilogSimulator.name}".');
}
}
_createSVWrapper(
directory,
Cosim.registrees,
dumpWavesString: dumpWavesString,
);
_createMakefile(
directory: directory,
simulator: systemVerilogSimulator,
registrees: Cosim.registrees,
);
}