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

Add support for the Zvknh[ab] extensions #235

Open
wants to merge 12 commits into
base: vector-dev
Choose a base branch
from

Conversation

charmitro
Copy link

@charmitro charmitro commented Mar 23, 2023

Implements the Zvknh[ab] (NIST Suite: Vector SHA-2 Secure Hash) extension, as of version Draft: 20230303

The following instructions are included:

  • vsha2ms.vv
  • vsha2c[hl].vv

All instructions were tested with VLEN=128(SHA-256) & VLEN=256(SHA-512) and results were compared with QEMU results of each instruction.

Current revision is rebased with the latest changes of vector-dev branch.

XinlaiWan and others added 3 commits March 22, 2023 09:01
…iscv#191)

* V extension general framework and configuration setting instructions

* Update model/riscv_insts_vext_utils.sail

fix a typo

Co-authored-by: Nicolas Brunie <[email protected]>
Signed-off-by: BrighterW <[email protected]>

* Update model/riscv_insts_vext_vset.sail

* Revisions after Nov 22 meeting

* Update effect matching for functions in riscv_vlen.sail

* Fix code formatting issues

* Update model/riscv_insts_vext_utils.sail

Co-authored-by: Jessica Clarke <[email protected]>
Signed-off-by: Xinlai Wan <[email protected]>

* Fix coding style issues

* Update vset instructions

Signed-off-by: BrighterW <[email protected]>
Signed-off-by: Xinlai Wan <[email protected]>
Co-authored-by: Nicolas Brunie <[email protected]>
Co-authored-by: Jessica Clarke <[email protected]>
* Add vector load / store instructions

* Modify the implementation of SEW, LMUL, VLEN and avoid real numbers in the code

* Update vstart setting in vector load / store instructions

* Remove unnecessary assert statements in vector instructions

* Fix bugs in vleff instructions and revise coding styles

* Add guards for vector encdec clauses, Avoid redundant memory access after vector load/store failure
* Add vector arithmetic & mask instructions

* Update vector EEW and EMUL checking function

* Add vector instruction illegal check functions

* Adjust code formatting for vector instruction illegal check functions

Merge approved by team at tech-golden-model meeting on 2023-03-14.
@charmitro
Copy link
Author

Updated the PR:

  • Correction on iterating based on the specification
  • Correctly Load & Store from/to vector registers

This update is adjusting the implementation to match the Spike implenentation and as a follow-up.

* Add vector floating-point instructions

* Update vector floating-point conversion instructions

* Update copyright headers for vector extension code

---------

Co-authored-by: xwan <[email protected]>
@charmitro
Copy link
Author

Rebased from vector-dev branch.

model/riscv_insts_zvknhab.sail Outdated Show resolved Hide resolved
model/riscv_insts_zvknhab.sail Show resolved Hide resolved
@charmitro charmitro force-pushed the zvknhab branch 2 times, most recently from d4cbe1d to 14aa3b5 Compare May 26, 2023 13:14
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Unit Test Results

712 tests  ±0   712 ✔️ ±0   0s ⏱️ ±0s
    6 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 8001357. ± Comparison against base commit 5872908.

♻️ This comment has been updated with latest results.

XinlaiWan and others added 8 commits June 12, 2023 14:28
* Add vector mask and reduction instructions

* Fix register overlap check in vector mask instructions

---------

Co-authored-by: xwan <[email protected]>
To support the implementation of Zvknh[ab] extensions in SAIL, this
creates the necessary infrastructure(i.e., a file to hold it, and the
extension macro), preparing the tree for the Zvknh[ab] implementation.

Signed-off-by: Charalampos Mitrodimas <[email protected]>
The "vsha2c[hl].vv" instruction performs two rounds
of Vector SHA-2 compression.

* "vsha2cl.vv" uses the two most significant message schedule
  words from the element group in "vs1".
* "vsha2cl.vv" uses the two least significant message schedule
  words from the element group in "vs1"

Reserved encodings:
  * Zvknha: SEW is any value other than 32.
  * Zvknhb: SEW is any value other than 32 or 64.

Signed-off-by: Charalampos Mitrodimas <[email protected]>
The "vsha2ms.vv" instruction performs a Vector SHA-2
message schedule.

Reserved encodings:
  * Zvknha: SEW is any value other than 32.
  * Zvknhb: SEW is any value other than 32 or 64.

Signed-off-by: Charalampos Mitrodimas <[email protected]>
Signed-off-by: Charalampos Mitrodimas <[email protected]>
Signed-off-by: Charalampos Mitrodimas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Adds support for a RISC-V extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants