Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P extension riscv-config release #69

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.11.0] - 2021-10-21
### Added
- Added Zbpbo, Zpn, Zpsfoperand into schema_isa.yaml
- Added vxsat CSR into schema_isa.yaml
- Added ISA string legality checker for P extension into schemaValidator.py

## [2.10.2] - 2021-10-06
### Fixed
- islegal function under the warl_interpreter class fixed. The based and bound values are not
Expand Down
2 changes: 1 addition & 1 deletion riscv_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
__version__ = '2.10.2'
__version__ = '2.11.0'
10 changes: 10 additions & 0 deletions riscv_config/schemaValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ def _check_with_capture_isa_specifics(self, field, value):
self._error(field, "Zkn is a superset of Zkne, Zknd, Zknh, Zkg and Zkb, In presence of Zkn the subsets must be ignored in the ISA string")
if 'K' in extension_list and ( set(['Zkn','Zkr','Zkne','Zknd','Zknh','Zkg','Zkb']) & set(extension_list) ) :
self._error(field, "K is a superset of Zkn and Zkr , In presence of K the subsets must be ignored in the ISA string")
if 'Zpsfoperand' in extension_list and not "Zpn" in extension_list:
self._error(field, "Zpsfoperand cannot exist without Zpn.")
if 'Zbpbo' in extension_list and not "Zpn" in extension_list:
self._error(field, "Zbpbo cannot exist without Zpn.")
if 'Zpn' in extension_list and not "Zbpbo" in extension_list:
self._error(field, "Zpn cannot exist without Zbpbo.")
if xlen == 64 and 'Zpn' in extension_list and not "Zpsfoperand" in extension_list:
self._error(field, "RV64 P extension requires Zpsfoperand.")
if 'Zpn' in extension_list and not ('M' in extension_list or 'Zmmul' in extension_list):
self._error(field, "Zpn requires baseline multiplication extension.")

# if 'Z' in value and not self.document['User_Spec_Version'] == "2.3":
# self._error(
Expand Down
73 changes: 72 additions & 1 deletion riscv_config/schemas/schema_isa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ hart_schema:
# - The ISA string must be specified as per the convention mentioned in the specifications(like subsequent Z extensions must be separated with an '_')

ISA: { type: string, required: true, check_with: capture_isa_specifics,
regex: "^RV(32|64|128)[IE]+[ABCDEFGIJKLMNPQSTUVX]*(Zicsr|Zifencei|Zihintpause|Zam|Ztso|Zkne|Zknd|Zknh|Zkse|Zksh|Zkg|Zkb|Zkr|Zks|Zkn|Zbc|Zbb|Zbp|Zbm|Zbe|Zbf){,1}(_Zicsr){,1}(_Zifencei){,1}(_Zihintpause){,1}(_Zam){,1}(_Ztso){,1}(_Zkne){,1}(_Zknd){,1}(_Zknh){,1}(_Zkse){,1}(_Zksh){,1}(_Zkg){,1}(_Zkb){,1}(_Zkr){,1}(_Zks){,1}(_Zkn){,1}(_Zbc){,1}(_Zbb){,1}(_Zbp){,1}(_Zbm){,1}(_Zbe){,1}(_Zbf){,1}$" }
regex: "^RV(32|64|128)[IE]+[ABCDEFGIJKLMNPQSTUVX]*(Zicsr|Zifencei|Zihintpause|Zam|Ztso|Zkne|Zknd|Zknh|Zkse|Zksh|Zkg|Zkb|Zkr|Zks|Zkn|Zbc|Zbb|Zbp|Zbm|Zbe|Zbf|Zpn|Zpsfoperand|Zbpbo){,1}(_Zicsr){,1}(_Zifencei){,1}(_Zihintpause){,1}(_Zam){,1}(_Ztso){,1}(_Zkne){,1}(_Zknd){,1}(_Zknh){,1}(_Zkse){,1}(_Zksh){,1}(_Zkg){,1}(_Zkb){,1}(_Zkr){,1}(_Zks){,1}(_Zkn){,1}(_Zbc){,1}(_Zbb){,1}(_Zbp){,1}(_Zbm){,1}(_Zbe){,1}(_Zbf){,1}(_Zpn){,1}(_Zpsfoperand){,1}(_Zbpbo){,1}$" }

###
#User_Spec_Version
Expand Down Expand Up @@ -9134,4 +9134,75 @@ hart_schema:
default: true
check_with: rv64_check
default: {accessible: false}
vxsat:
type: dict
schema:
description:
type: string
default: The vxsat register records the overflow saturation condition of P and V instructions.
address: {type: integer, default: 9, allowed: [9]}
priv_mode: {type: string, default: U, allowed: [U]}
reset-val:
type: integer
check_with: max_length
default: 0
rv32:
type: dict
schema:
fields: {type: list, default: []}
ov:
type: dict
schema:
description: {type: string, default: Stores the state of overflow flag.}
shadow: {type: string, default: , nullable: True}
shadow_type: {type: string, default: rw, nullable: True, allowed: ['rw','ro']}
msb: {type: integer, default: 0, allowed: [0]}
lsb: {type: integer, default: 0, allowed: [0]}
implemented: {type: boolean, default: true}
type:
type: dict
check_with: wr_illegal
oneof:
- schema: { warl: *ref_warl }
- schema: {ro_constant: {type: integer, max: 0 , min : 0}}
- schema: { wlrl: *ref_wlrl }
default:
wlrl:
- 0:1
default: {implemented: false}
check_with: n_check
accessible:
type: boolean
default: true
check_with: rv32_check
rv64:
type: dict
schema:
fields: {type: list, default: []}
ov:
type: dict
schema:
description: {type: string, default: Stores the state of overflow flag.}
shadow: {type: string, default: , nullable: True}
shadow_type: {type: string, default: rw, nullable: True, allowed: ['rw','ro']}
msb: {type: integer, default: 0, allowed: [0]}
lsb: {type: integer, default: 0, allowed: [0]}
implemented: {type: boolean, default: true}
type:
type: dict
check_with: wr_illegal
oneof:
- schema: { wlrl: *ref_wlrl }
- schema: { warl: *ref_warl }
- schema: {ro_constant: {type: integer, max: 0 , min : 0}}
default:
wlrl:
- 0:1
default: {implemented: false}
check_with: n_check
accessible:
type: boolean
default: true
check_with: rv64_check
default: {accessible: False}