portableSnapshot method

String portableSnapshot()

Encodes all raw register values for exchange with compatible CSR models.

This storage image excludes sampled inputs and other execution state.

Implementation

String portableSnapshot() {
  final addresses = _registers.keys.toList()..sort();
  final result = StringBuffer('RHCL_CSR_STORAGE_V1 ${addresses.length}\n');
  for (final address in addresses) {
    final value = _registers[address]!.value;
    result
        .writeln('$address ${value.width} ${MemoryValueCodec.binary(value)}');
  }
  return result.toString();
}