diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a18e0..7406901 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.13.2] - 2023-09-20 + - Perform satp checks only when the CSR is accessible. + ## [3.13.1] - 2023-08-21 - Add support for Code Size Reduction (Zce) extension diff --git a/riscv_config/__init__.py b/riscv_config/__init__.py index 158bf7d..ff5baad 100644 --- a/riscv_config/__init__.py +++ b/riscv_config/__init__.py @@ -1,3 +1,3 @@ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) -__version__ = '3.13.1' \ No newline at end of file +__version__ = '3.13.2' \ No newline at end of file diff --git a/riscv_config/checker.py b/riscv_config/checker.py index 20b488e..e7ce76a 100644 --- a/riscv_config/checker.py +++ b/riscv_config/checker.py @@ -1367,29 +1367,30 @@ def check_supervisor(spec, logging=False): msb = 63 if xlen == 64 else 31 lsb = 60 if xlen == 64 else 31 virt_modes = [1] if xlen == 32 else [8,9,10,11] - satp_mode_impl = spec['satp'][f'rv{xlen}']['mode']['implemented'] - satp_mode_type = spec['satp'][f'rv{xlen}']['mode']['type'] - virtualization_possible = False - if 'ro_constant' in satp_mode_type: - if satp_mode_type['ro_constant'] == 0: - virtualization_possible = False - else: - virtualization_possible = True - elif 'warl' in satp_mode_type: - # these are the checks from _check_with_satp_modes64 - if xlen == 64: - warl_inst = warl_class(satp_mode_type['warl'], 'satp::mode',63, 60) - for x in [1,2,3,4,5,6,7,11,12,13]: + if spec['satp'][f'rv{xlen}']['accessible']: # perform satp checks only if it is accessible + satp_mode_impl = spec['satp'][f'rv{xlen}']['mode']['implemented'] + satp_mode_type = spec['satp'][f'rv{xlen}']['mode']['type'] + virtualization_possible = False + if 'ro_constant' in satp_mode_type: + if satp_mode_type['ro_constant'] == 0: + virtualization_possible = False + else: + virtualization_possible = True + elif 'warl' in satp_mode_type: + # these are the checks from _check_with_satp_modes64 + if xlen == 64: + warl_inst = warl_class(satp_mode_type['warl'], 'satp::mode',63, 60) + for x in [1,2,3,4,5,6,7,11,12,13]: + err = warl_inst.islegal(x) + if not err: + errors['satp_mode_checks'] = f'warl function for satp::mode accepts \ + "{x}" as a legal value - which is incorrect' + warl_inst = warl_class(satp_mode_type['warl'], 'satp::mode', msb, lsb, spec) + for x in virt_modes: err = warl_inst.islegal(x) if not err: - errors['satp_mode_checks'] = f'warl function for satp::mode accepts \ - "{x}" as a legal value - which is incorrect' - warl_inst = warl_class(satp_mode_type['warl'], 'satp::mode', msb, lsb, spec) - for x in virt_modes: - err = warl_inst.islegal(x) - if not err: - virtualization_possible = True - break + virtualization_possible = True + break if pte_ad_hw_update and not virtualization_possible: errors['pte_ad_hw_update'] = ['pte_ad_hw_update should be True only if satp.mode can be \ diff --git a/setup.cfg b/setup.cfg index 4a2ea57..b45ae17 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.13.1 +current_version = 3.13.2 commit = True tag = True