@@ -432,33 +432,36 @@ This chapter gives a brief overview of all available ISA extensions.
432
432
[options="header",grid="rows"]
433
433
|=======================
434
434
| Name | Description | <<_processor_top_entity_generics, Enabled by Generic>>
435
- | <<_a_isa_extension,`A`>> | Atomic memory access instructions | `CPU_EXTENSION_RISCV_A`
436
- | <<_b_isa_extension,`B`>> | Bit-manipulation instructions | `CPU_EXTENSION_RISCV_B`
437
- | <<_c_isa_extension,`C`>> | Compressed (16-bit) instructions | `CPU_EXTENSION_RISCV_C`
438
- | <<_e_isa_extension,`E`>> | Embedded CPU extension (reduced register file size) | `CPU_EXTENSION_RISCV_E`
439
- | <<_i_isa_extension,`I`>> | Integer base ISA | Enabled if `CPU_EXTENSION_RISCV_E` is **not** enabled
440
- | <<_m_isa_extension,`M`>> | Integer multiplication and division instructions | `CPU_EXTENSION_RISCV_M`
441
- | <<_u_isa_extension,`U`>> | Less-privileged _user_ mode extension | `CPU_EXTENSION_RISCV_U`
442
- | <<_x_isa_extension,`X`>> | Platform-specific / NEORV32-specific extension | Always enabled
443
- | <<_zbkb_isa_extension,`Zbkb`>> | Scalar cryptographic bit manipulation instructions | `CPU_EXTENSION_RISCV_Zbkb`
444
- | <<_zbkc_isa_extension,`Zbkc`>> | Scalar cryptographic carry-less multiplication instructions | `CPU_EXTENSION_RISCV_Zbkc`
445
- | <<_zbkx_isa_extension,`Zbkx`>> | Scalar cryptographic crossbar permutation instructions | `CPU_EXTENSION_RISCV_Zbkx`
446
- | <<_zfinx_isa_extension,`Zfinx`>> | Floating-point instructions using integer registers | `CPU_EXTENSION_RISCV_Zfinx`
447
- | <<_zifencei_isa_extension,`Zifencei`>> | Instruction stream synchronization instruction | Always enabled
448
- | <<_zicntr_isa_extension,`Zicntr`>> | Base counters extension | `CPU_EXTENSION_RISCV_Zicntr`
449
- | <<_zicond_isa_extension,`Zicond`>> | Integer conditional operations | `CPU_EXTENSION_RISCV_Zicond`
450
- | <<_zicsr_isa_extension,`Zicsr`>> | Control and status register access instructions | Always enabled
451
- | <<_zihpm_isa_extension,`Zihpm`>> | Hardware performance monitors extension | `CPU_EXTENSION_RISCV_Zihpm`
452
- | <<_zkn_isa_extension,`Zkn`>> | Scalar cryptographic NIST algorithm suite | _Implicitly_ enabled
453
- | <<_zknd_isa_extension,`Zknd`>> | Scalar cryptographic NIST AES decryption instructions | `CPU_EXTENSION_RISCV_Zknd`
454
- | <<_zkne_isa_extension,`Zkne`>> | Scalar cryptographic NIST AES encryption instructions | `CPU_EXTENSION_RISCV_Zkne`
455
- | <<_zknh_isa_extension,`Zknh`>> | Scalar cryptographic NIST hash function instructions | `CPU_EXTENSION_RISCV_Zknh`
456
- | <<_zknt_isa_extension,`Zknt`>> | Data independent execution time (of cryptographic operations) | _Implicitly_ enabled
457
- | <<_zmmul_isa_extension,`Zmmul`>> | Integer multiplication-only instructions | `CPU_EXTENSION_RISCV_Zmmul`
458
- | <<_zxcfu_isa_extension,`Zcfu`>> | Custom / user-defined instructions | `CPU_EXTENSION_RISCV_Zxcfu`
459
- | <<_smpmp_isa_extension,`Smpmp`>> | Physical memory protection (PMP) extension | `CPU_EXTENSION_RISCV_Smpmp`
460
- | <<_sdext_isa_extension,`Sdext`>> | External debug support extension | `ON_CHIP_DEBUGGER_EN`
461
- | <<_sdtrig_isa_extension,`Sdtrig`>> | Trigger module extension | `ON_CHIP_DEBUGGER_EN`
435
+ | <<_a_isa_extension,`A`>> | Atomic memory access instructions | `CPU_EXTENSION_RISCV_A`
436
+ | <<_b_isa_extension,`B`>> | Bit-manipulation instructions | `CPU_EXTENSION_RISCV_B`
437
+ | <<_c_isa_extension,`C`>> | Compressed (16-bit) instructions | `CPU_EXTENSION_RISCV_C`
438
+ | <<_e_isa_extension,`E`>> | Embedded CPU extension (reduced register file size) | `CPU_EXTENSION_RISCV_E`
439
+ | <<_i_isa_extension,`I`>> | Integer base ISA | Enabled if `CPU_EXTENSION_RISCV_E` is **not** enabled
440
+ | <<_m_isa_extension,`M`>> | Integer multiplication and division instructions | `CPU_EXTENSION_RISCV_M`
441
+ | <<_u_isa_extension,`U`>> | Less-privileged _user_ mode extension | `CPU_EXTENSION_RISCV_U`
442
+ | <<_x_isa_extension,`X`>> | Platform-specific / NEORV32-specific extension | Always enabled
443
+ | <<_zbkb_isa_extension,`Zbkb`>> | Scalar cryptographic bit manipulation instructions | `CPU_EXTENSION_RISCV_Zbkb`
444
+ | <<_zbkc_isa_extension,`Zbkc`>> | Scalar cryptographic carry-less multiplication instructions | `CPU_EXTENSION_RISCV_Zbkc`
445
+ | <<_zbkx_isa_extension,`Zbkx`>> | Scalar cryptographic crossbar permutation instructions | `CPU_EXTENSION_RISCV_Zbkx`
446
+ | <<_zfinx_isa_extension,`Zfinx`>> | Floating-point instructions using integer registers | `CPU_EXTENSION_RISCV_Zfinx`
447
+ | <<_zifencei_isa_extension,`Zifencei`>> | Instruction stream synchronization instruction | Always enabled
448
+ | <<_zicntr_isa_extension,`Zicntr`>> | Base counters extension | `CPU_EXTENSION_RISCV_Zicntr`
449
+ | <<_zicond_isa_extension,`Zicond`>> | Integer conditional operations | `CPU_EXTENSION_RISCV_Zicond`
450
+ | <<_zicsr_isa_extension,`Zicsr`>> | Control and status register access instructions | Always enabled
451
+ | <<_zihpm_isa_extension,`Zihpm`>> | Hardware performance monitors extension | `CPU_EXTENSION_RISCV_Zihpm`
452
+ | <<_zkn_isa_extension,`Zkn`>> | Scalar cryptographic NIST algorithm suite | _Implicitly_ enabled
453
+ | <<_zknd_isa_extension,`Zknd`>> | Scalar cryptographic NIST AES decryption instructions | `CPU_EXTENSION_RISCV_Zknd`
454
+ | <<_zkne_isa_extension,`Zkne`>> | Scalar cryptographic NIST AES encryption instructions | `CPU_EXTENSION_RISCV_Zkne`
455
+ | <<_zknh_isa_extension,`Zknh`>> | Scalar cryptographic NIST hash function instructions | `CPU_EXTENSION_RISCV_Zknh`
456
+ | <<_zkt_isa_extension,`Zkt`>> | Data independent execution time (of cryptographic operations) | _Implicitly_ enabled
457
+ | <<_zks_isa_extension,`Zks`>> | Scalar cryptographic ShangMi algorithm suite | _Implicitly_ enabled
458
+ | <<_zksed_isa_extension,`Zksed`>> | Scalar cryptographic ShangMi block cypher instructions | `CPU_EXTENSION_RISCV_Zksed`
459
+ | <<_zksh_isa_extension,`Zksh`>> | Scalar cryptographic ShangMi hash instructions | `CPU_EXTENSION_RISCV_Zksh`
460
+ | <<_zmmul_isa_extension,`Zmmul`>> | Integer multiplication-only instructions | `CPU_EXTENSION_RISCV_Zmmul`
461
+ | <<_zxcfu_isa_extension,`Zcfu`>> | Custom / user-defined instructions | `CPU_EXTENSION_RISCV_Zxcfu`
462
+ | <<_smpmp_isa_extension,`Smpmp`>> | Physical memory protection (PMP) extension | `CPU_EXTENSION_RISCV_Smpmp`
463
+ | <<_sdext_isa_extension,`Sdext`>> | External debug support extension | `ON_CHIP_DEBUGGER_EN`
464
+ | <<_sdtrig_isa_extension,`Sdtrig`>> | Trigger module extension | `ON_CHIP_DEBUGGER_EN`
462
465
|=======================
463
466
464
467
.RISC-V ISA Specification
@@ -799,24 +802,6 @@ Accessing any user-mode HPM CSR (`hpmcounter*[h]`) will raise an illegal instruc
799
802
The event-driven increment of the HPMs can be deactivated individually via the <<_mcountinhibit>> CSR.
800
803
801
804
802
- ==== `Zbn` ISA Extension
803
-
804
- The `Zkn` ISA extension is part of the _RISC-V scalar cryptography_ ISA specification and defines the "NIST algorithm suite".
805
- This ISA extension cannot be enabled by a specific generic. Instead, it is enabled if a specific set of cryptography-related
806
- sub-extensions is enabled.
807
-
808
- The `Zkn` extension is shorthand for the following set of other extensions:
809
-
810
- * <<_zbkb_isa_extension>> - Bit manipulation instructions for cryptography.
811
- * <<_zbkc_isa_extension>> - Carry-less multiply instructions.
812
- * <<_zbkx_isa_extension>> - Cross-bar permutation instructions.
813
- * <<_zbne_isa_extension>> - AES encryption instructions.
814
- * <<_zbnd_isa_extension>> - AES decryption instructions.
815
- * <<_zbnh_isa_extension>> - SHA2 hash function instructions.
816
-
817
- A processor configuration which implements `Zkn` must implement all of the above extensions.
818
-
819
-
820
805
==== `Zbkb` ISA Extension
821
806
822
807
The `Zbkb` sub-extension is part of the _RISC-V scalar cryptography_ ISA specification and extends the _RISC-V bit manipulation_
@@ -865,6 +850,24 @@ This ISA extension is implemented as multi-cycle ALU co-processor (`rtl/core/neo
865
850
|=======================
866
851
867
852
853
+ ==== `Zkn` ISA Extension
854
+
855
+ The `Zkn` ISA extension is part of the _RISC-V scalar cryptography_ ISA specification and defines the "NIST algorithm suite".
856
+ This ISA extension cannot be enabled by a specific generic. Instead, it is enabled if a specific set of cryptography-related
857
+ sub-extensions is enabled.
858
+
859
+ The `Zkn` extension is shorthand for the following set of other extensions:
860
+
861
+ * <<_zbkb_isa_extension>> - Bit manipulation instructions for cryptography.
862
+ * <<_zbkc_isa_extension>> - Carry-less multiply instructions.
863
+ * <<_zbkx_isa_extension>> - Cross-bar permutation instructions.
864
+ * <<_zkne_isa_extension>> - AES encryption instructions.
865
+ * <<_zknd_isa_extension>> - AES decryption instructions.
866
+ * <<_zknh_isa_extension>> - SHA2 hash function instructions.
867
+
868
+ A processor configuration which implements `Zkn` must implement all of the above extensions.
869
+
870
+
868
871
==== `Zknd` ISA Extension
869
872
870
873
The `Zknd` sub-extension is part of the _RISC-V scalar cryptography_ ISA specification and adds NIST AES decryption instructions.
@@ -911,17 +914,65 @@ This ISA extension is implemented as multi-cycle ALU co-processor (`rtl/core/neo
911
914
|=======================
912
915
913
916
914
- ==== `Zknt` ISA Extension
917
+ ==== `Zks` ISA Extension
918
+
919
+ The `Zks` ISA extension is part of the _RISC-V scalar cryptography_ ISA specification and defines the "ShangMi algorithm suite".
920
+ This ISA extension cannot be enabled by a specific generic. Instead, it is enabled if a specific set of cryptography-related
921
+ sub-extensions is enabled.
922
+
923
+ The `Zks` extension is shorthand for the following set of other extensions:
924
+
925
+ * <<_zbkb_isa_extension>> - Bit manipulation instructions for cryptography.
926
+ * <<_zbkc_isa_extension>> - Carry-less multiply instructions.
927
+ * <<_zbkx_isa_extension>> - Cross-bar permutation instructions.
928
+ * <<_zksed_isa_extension>> - SM4 block cipher instructions.
929
+ * <<_zksh_isa_extension>> - SM3 hash function instructions.
930
+
931
+ A processor configuration which implements `Zks` must implement all of the above extensions.
932
+
933
+
934
+ ==== `Zksed` ISA Extension
935
+
936
+ The `Zksed` sub-extension is part of the _RISC-V scalar cryptography_ ISA specification and adds ShangMi block cypher
937
+ and key schedule instructions. It is enabled by the top's `CPU_EXTENSION_RISCV_Zksed` generic.
938
+ This ISA extension is implemented as multi-cycle ALU co-processor (`rtl/core/neorv32_cpu_cp_crypto.vhd`).
939
+
940
+ .Instructions and Timing
941
+ [cols="<2,<4,<3"]
942
+ [options="header", grid="rows"]
943
+ |=======================
944
+ | Class | Instructions | Execution cycles
945
+ | Block cyphers | `sm4ed` | 6
946
+ | Key schedule | `sm4ks` | 6
947
+ |=======================
948
+
949
+
950
+ ==== `Zksh` ISA Extension
951
+
952
+ The `Zksh` sub-extension is part of the _RISC-V scalar cryptography_ ISA specification and adds ShangMi hash function instructions.
953
+ It is enabled by the top's `CPU_EXTENSION_RISCV_Zksh` generic.
954
+ This ISA extension is implemented as multi-cycle ALU co-processor (`rtl/core/neorv32_cpu_cp_crypto.vhd`).
955
+
956
+ .Instructions and Timing
957
+ [cols="<2,<4,<3"]
958
+ [options="header", grid="rows"]
959
+ |=======================
960
+ | Class | Instructions | Execution cycles
961
+ | Hash | `sm3p0` `sm3p1` | 6
962
+ |=======================
963
+
964
+
965
+ ==== `Zkt` ISA Extension
915
966
916
- The `Zknt ` sub-extension is part of the _RISC-V scalar cryptography_ ISA specification and guarantees data independent execution
967
+ The `Zkt ` sub-extension is part of the _RISC-V scalar cryptography_ ISA specification and guarantees data independent execution
917
968
times of cryptographic and cryptography-related instructions. The ISA extension cannot be enabled by a specific generic.
918
969
Instead, it is enabled implicitly by certain CPU configurations.
919
970
920
- The RISC-V `Zknt ` specifications provides a list of instructions that are included within this specification.
971
+ The RISC-V `Zkt ` specifications provides a list of instructions that are included within this specification.
921
972
However, not all instructions are required to be implemented. Rather, every one of these instructions that the
922
- core does implement must adhere to the requirements of `Zknt `.
973
+ core does implement must adhere to the requirements of `Zkt `.
923
974
924
- .`Zknt ` instruction listing
975
+ .`Zkt ` instruction listing
925
976
[cols="<1,<6,<3"]
926
977
[options="header", grid="rows"]
927
978
|=======================
@@ -931,7 +982,7 @@ core does implement must adhere to the requirements of `Zknt`.
931
982
| `RVM` | `mul[h]` `mulh[s]u` | yes
932
983
.2+<| `RVC` <| `c.nop` `c.addi` `c.lui` `c.andi` `c.sub` `c.xor` `c.and` `c.mv` `c.add` <| yes
933
984
<| `c.srli` `c.srai` `c.slli` <| yes if `FAST_SHIFT_EN` enabled
934
- | `RVK` | `aes32ds[m]i` `aes32es[m]i` `sha256sig*` `sha512sig*` `sha512sum*` | yes
985
+ | `RVK` | `aes32ds[m]i` `aes32es[m]i` `sha256sig*` `sha512sig*` `sha512sum*` `sm3p0` `sm3p1` `sm4ed` `sm4ks` | yes
935
986
.2+<| `RVB` <| `xperm4` `xperm8` `andn` `orn` `xnor` `pack[h]` `brev8` `rev8` <| yes
936
987
<| `ror[i]` `rol` <| yes if `FAST_SHIFT_EN` enabled
937
988
|=======================
0 commit comments