getBackdoorPortsByAddr method

CsrBackdoorInterface getBackdoorPortsByAddr(
  1. int addr
)

Accessor to the backdoor ports of a particular register within the block by relative address addr.

Implementation

CsrBackdoorInterface getBackdoorPortsByAddr(int addr) {
  final idx = _config.registers.indexOf(_config.getRegisterByAddr(addr));
  if (_backdoorIndexMap.containsKey(idx)) {
    return backdoorInterfaces[_backdoorIndexMap[idx]!];
  } else {
    throw Exception(
        'Register address $addr not found in block ${_config.name}');
  }
}