opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[dv/common] incorrect `has_unmapped_addr` calculation

Open udinator opened this issue 5 years ago • 1 comments

This is a followup issue to #6594.

Currently inside of cip_base_vseq__tl_errors.svh, we determine whether a given RAL model has unmapped addresses by doing the following calculation:

has_unmapped_addr = csr_addr_mask[ral_name] > cfg.ral_models[ral_name].get_max_offset();

This calculation assumes that the CSRs and memories inside of the RAL model are all contiguous (which is incorrect) and does not take internal address "holes" into account. e.g. KMAC has two memory address ranges of 0x400-0x5ff and 0x800-0xfff with an address mask of 0xfff, but the above calculation will indicate that KMAC does not have any unmapped addresses, which is clearly incorrect.

Proposed solution is as follows:

  • Make has_unmapped_addr a field inside of dv_base_reg_block, which is a more sensible place for this sort of information
  • Perform a one-time calculation as the reg block is being built to create a queue of addr_range_t structs that contain information about all unmapped address ranges in the reg block (if any even exist), and use this information to set has_unmapped_addr

udinator avatar May 18 '21 17:05 udinator

This issue is resolved by #6626, closing.

udinator avatar Jun 22 '21 02:06 udinator