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

isa string checks for crypto fixed #84

Merged
merged 5 commits into from
Jul 20, 2022
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## [2.16.0] - 2022-07-20

- fixed overlap checks for crypto extensions
- removing K and P extension strings from regex

## [2.15.1] - 2022-06-18

- added missing Z extensions from Kcrypto
Expand Down
67 changes: 67 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. See LICENSE.incore for details

.. highlight:: shell

============
Contributing
============

Contributions are welcome, and they are greatly appreciated and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/riscv-software-src/riscv-config/issues/ .

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/riscv-software-src/riscv-config/issues/.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `riscv_config` for local development.

1. Fork the `riscv_config` repo on GitHub.
2. Clone your fork locally::

$ git clone https://github.com/riscv-software-src/riscv-config.git

3. Create an issue and WIP merge request that creates a working branch for you::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.


5. Commit your changes and push your branch to GitLab::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

6. Submit a merge request through the GitHub website.

Deploying
---------

A reminder for the maintainers on how to deploy.
Make sure all your changes are committed.
Then run::

$ bumpversion --no-tag --config-file setup.cfg patch # possible: major / minor / patch
$ git push origin name-of-your-branch

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.15.1'
__version__ = '2.16.0'
2 changes: 1 addition & 1 deletion riscv_config/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
debug_schema = os.path.join(root, 'schemas/schema_debug.yaml')
platform_schema = os.path.join(root, 'schemas/schema_platform.yaml')
isa_regex = \
re.compile("^RV(32|64|128)[IE]+[ABCDEFGHJKLMNPQSTUVX]*(Zicbom|Zicbop|Zicboz|Zicsr|Zifencei|Zihintpause|Zam|Ztso|Zba|Zbb|Zbc|Zbe|Zbf|Zbkb|Zbkc|Zbkx|Zbm|Zbp|Zbr|Zbs|Zbt|Zk|Zkn|Zknd|Zkne|Zknh|Zkr|Zks|Zksed|Zksh|Zkt|Zmmul|Svnapot){,1}(_Zicbom){,1}(_Zicbop){,1}(_Zicboz){,1}(_Zicsr){,1}(_Zifencei){,1}(_Zihintpause){,1}(_Zmmul){,1}(_Zam){,1}(_Zba){,1}(_Zbb){,1}(_Zbc){,1}(_Zbe){,1}(_Zbf){,1}(_Zbkb){,1}(_Zbkc){,1}(_Zbkx){,1}(_Zbm){,1}(_Zbp){,1}(_Zbr){,1}(_Zbs){,1}(_Zbt){,1}(Zk){,1}(_Zkn){,1}(_Zknd){,1}(_Zkne){,1}(Zknh){,1}(_Zkr){,1}(_Zks){,1}(_Zksed){,1}(_Zksh){,1}(_Zkt){,1}(_Ztso){,1}(_Svnapot){,1}$")
re.compile("^RV(32|64|128)[IE]+[ACDEFGHJLMNPQSTUVX]*(Zicbom|Zicbop|Zicboz|Zicsr|Zifencei|Zihintpause|Zam|Ztso|Zba|Zbb|Zbc|Zbe|Zbf|Zbkb|Zbkc|Zbkx|Zbm|Zbp|Zbr|Zbs|Zbt|Zk|Zkn|Zknd|Zkne|Zknh|Zkr|Zks|Zksed|Zksh|Zkt|Zmmul|Svnapot){,1}(_Zicbom){,1}(_Zicbop){,1}(_Zicboz){,1}(_Zicsr){,1}(_Zifencei){,1}(_Zihintpause){,1}(_Zmmul){,1}(_Zam){,1}(_Zba){,1}(_Zbb){,1}(_Zbc){,1}(_Zbe){,1}(_Zbf){,1}(_Zbkb){,1}(_Zbkc){,1}(_Zbkx){,1}(_Zbm){,1}(_Zbp){,1}(_Zbr){,1}(_Zbs){,1}(_Zbt){,1}(Zk){,1}(_Zkn){,1}(_Zknd){,1}(_Zkne){,1}(Zknh){,1}(_Zkr){,1}(_Zks){,1}(_Zksed){,1}(_Zksh){,1}(_Zkt){,1}(_Ztso){,1}(_Svnapot){,1}$")
19 changes: 7 additions & 12 deletions riscv_config/isa_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,15 @@ def get_extension_list(isa):
if 'S' in extension_list and not 'U' in extension_list:
err_list.append( "S cannot exist without U.")
err = True
if 'Zkg' in extension_list and 'Zbc' in extension_list:
err_list.append( "Zkg being a proper subset of Zbc (from B extension) should be ommitted from the ISA string")
if 'Zkn' in extension_list and ( set(['Zbkb', 'Zbkc', 'Zbkx', 'Zkne', 'Zknd', 'Zknh']) & set(extension_list)):
err_list.append( "Zkn is a superset of Zbkb, Zbkc, Zbkx, Zkne, Zknd, Zknh. In presence of Zkn the subsets must be ignored in the ISA string.")
err = True
if 'Zkb' in extension_list and 'Zbp' in extension_list :
err_list.append( "Zkb being a proper subset of Zbp (from B extension) should be ommitted from the ISA string")
if 'Zks' in extension_list and ( set(['Zbkb', 'Zbkc', 'Zbkx', 'Zksed', 'Zksh']) & set(extension_list) ):
err_list.append( "Zks is a superset of Zbkb, Zbkc, Zbkx, Zksed, Zksh. In presence of Zks the subsets must be ignored in the ISA string.")
err = True
if 'Zks' in extension_list and ( set(['Zkse', 'Zksh','Zkg','Zkb']) & set(extension_list) ):
err_list.append( "Zks is a superset of Zkse, Zksh, Zkg and Zkb. In presence of Zks the subsets must be ignored in the ISA string.")
err = True
if 'Zkn' in extension_list and ( set(['Zkne','Zknd','Zknh','Zkg','Zkb']) & set(extension_list) ):
err_list.append( "Zkn is a superset of Zkne, Zknd, Zknh, Zkg and Zkb, In presence of Zkn the subsets must be ignored in the ISA string")
err = True
if 'K' in extension_list and ( set(['Zkn','Zkr','Zkne','Zknd','Zknh','Zkg','Zkb']) & set(extension_list) ) :
err_list.append( "K is a superset of Zkn and Zkr , In presence of K the subsets must be ignored in the ISA string")
if 'Zk' in extension_list and ( set(['Zbkb', 'Zbkc', 'Zbkx', 'Zkne', 'Zknd',
'Zknh', 'Zkn','Zkr','Zkt']) & set(extension_list)):
err_list.append( "Zkn is a superset of Zbkb, Zbkc, Zbkx, Zkne, Zknd, Zknh, Zkn, Zkt, Zkr. In presence of Zkn the subsets must be ignored in the ISA string.")
err = True
return (extension_list, err, err_list)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.15.1
current_version = 2.16.0
commit = True
tag = True

Expand Down