generateSystemC method
- required String className,
- SystemCModelOptions options = const SystemCModelOptions(),
Generates the supported SystemC implementation.
Requests are sampled at rising clock edges, including zero-latency lookups. Unknown enables and indices are reported as errors. Custom matching is not implemented by this exporter and is rejected.
Implementation
String generateSystemC({
required String className,
SystemCModelOptions options = const SystemCModelOptions(),
}) {
if (!RegExp(r'^[A-Za-z_][A-Za-z0-9_]*$').hasMatch(className)) {
throw ArgumentError.value(
className, 'className', 'Invalid C++ identifier.');
}
final c = configuration;
if (c.matchMode == AssociativeMatchMode.contextQualified ||
c.lookupUpdatePolicy == AssociativeLookupUpdatePolicy.undefined) {
throw UnsupportedError('This associative SystemC configuration is not '
'implemented by the clock-stepped exporter.');
}
if (options.portType == SystemCModelPortType.twoState) {
return _generateTwoStateSystemC(className, options);
}
return _generateFourStateSystemC(className);
}