This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmuellner
added a commit
to cmuellner/riscv-arch-test
that referenced
this pull request
Apr 6, 2023
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i} and $FLEN={32,64}): riscv_ctg.py \ --cgf coverage/dataset.cgf \ --cgf coverage/zicond.cgf \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is not frozen at the moment (which is why this patch is RFC) and can be found here: https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex Signed-off-by: Christoph Müllner <[email protected]>
15 tasks
cmuellner
added a commit
to cmuellner/riscv-arch-test
that referenced
this pull request
May 10, 2023
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i} and $FLEN={32,64}): riscv_ctg.py \ --cgf coverage/dataset.cgf \ --cgf coverage/zicond.cgf \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is not frozen at the moment (which is why this patch is RFC) and can be found here: https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex Signed-off-by: Christoph Müllner <[email protected]>
cmuellner
force-pushed
the
zfa
branch
2 times, most recently
from
May 23, 2023 09:56
0aabb82
to
99d3b40
Compare
Updated PR:
|
cmuellner
added a commit
to cmuellner/riscv-arch-test
that referenced
this pull request
May 23, 2023
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i} and $FLEN={32,64}): riscv_ctg.py \ --cgf coverage/dataset.cgf \ --cgf coverage/zicond.cgf \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is not frozen at the moment (which is why this patch is RFC) and can be found here: https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex Signed-off-by: Christoph Müllner <[email protected]>
cmuellner
added a commit
to cmuellner/riscv-arch-test
that referenced
this pull request
May 23, 2023
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i} and $FLEN={32,64}): riscv_ctg.py \ --cgf coverage/dataset.cgf \ --cgf coverage/zicond.cgf \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is not frozen at the moment (which is why this patch is RFC) and can be found here: https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex Signed-off-by: Christoph Müllner <[email protected]>
@cmuellner could you try rebase this PR again, we think the issue riscv-non-isa/riscv-arch-test#331 got fixed already. please use latest riscv-arch-test repo |
I've rebased the PR. |
cmuellner
added a commit
to cmuellner/riscv-arch-test
that referenced
this pull request
Jan 16, 2024
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i} and $FLEN={32,64}): riscv_ctg.py \ --cgf coverage/dataset.cgf \ --cgf coverage/zicond.cgf \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is not frozen at the moment (which is why this patch is RFC) and can be found here: https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex Signed-off-by: Christoph Müllner <[email protected]>
I've rebased the PR and addressed an issue with the generation of tests for the froundnx instruction. |
The recently introduced toint() function does not accept arguments of type int and will trigger an exception in this case. This leads to an always crashing code path in generator.py, where rm_dict[] maps the rounding mode string to an integer, that is then passed to toint(). There are several ways to address this (e.g. mapping to a string, or making toint() more robust), but dropping the call to toint() is obviously the right thing to do. Signed-off-by: Christoph Müllner <[email protected]>
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since riscv-ctg does not support the RISC-V quad-precision floating-point ISA extension (Q) as well as the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include the instructions that depend on these extensions. All other instructions are included in this patch. The instruction descriptions (simple_cgfs/zfa/*) use different instructions as parameter for the coverpoint generator functions (e.g. fleq.s uses "fle.s") to circumvent documented limitations of these generator functions. Technically there is no reason to adjust generator.py. All required information could be extracted from instruction descriptions. However, that is not the case, and the file also includes its own hard-coded assumptions, which have to be adjusted as well. The Zfa specification can be found here: https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex Signed-off-by: Christoph Müllner <[email protected]>
There is not much infrastucture support for the fli* instructions. Let's add a cgf that defines the instruction's covergroup with the existing infrastructure support. Signed-off-by: Christoph Müllner <[email protected]>
The specification of fcvtmod requires a rounding mode of 'rtz'. Let's restrict the generated test cases accordingly. Signed-off-by: Christoph Müllner <[email protected]>
This fixes a typo in the mnemonics name which prevents the creation of froundnx test cases. Signed-off-by: Christoph Müllner <[email protected]>
A typo in the instruction definition prevented the creation of fmvp.d.x test cases. Let's fix that. Signed-off-by: Christoph Müllner <[email protected]>
The specification of fcvtmod requires a rounding mode of 'rtz'. Recently we have added a commit to restrict the rounding modes accoringly. However, that turned out to be unsufficient. Therefore, this patch directly sets the rounding mode to 'rtz'. As a result this patch only generates 'rtz' test cases. Signed-off-by: Christoph Müllner <[email protected]>
Updated PR: Added a commit to make the |
cmuellner
added a commit
to cmuellner/riscv-arch-test
that referenced
this pull request
Apr 2, 2024
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Modular Convert-to-Integer) * fmv* to access high bits of float register bigger than XLEN * Quiet comparison instructions (fleq/fltq) Zfa defines its instructions in combination with the following extensions: * single-precision floating-point (F) * double-precision floating-point (D) * quad-precision floating-point (Q) * half-precision floating-point (Zfh) Since the RISC-V architecture test framework does not support the RISC-V quad-precision floating-point ISA extension (Q) and the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include tests for instructions that depend on these extensions. Given missing infrastructure support, the fli.* instruction tests are hand written and not generated. All other test files are generated using riscv-ctg. The generated test files have been generated using the following command (with $BASEISA={rv32i,rv64i}, $FLEN={32,64}), and CFG=$INSN: riscv_ctg.py \ --cgf sample_cgfs/dataset.cgf \ --cgf sample_cgfs/zfa/$CGF \ --base-isa $BASEISA \ --flen $FLEN \ -d tests_$BASEISA_$FLEN/ Exceptions are: * fcvtmod.w.d.cgf is for FLEN=32 only * fmvh.x.d and fmvp.d.x are for BASEISA=rv32i only The resulting tests have been copied to the target directory. The generation of the Zfa test cases depends on a PR in the riscv-ctg repository: riscv-software-src/riscv-ctg#60 The Zfa specification is ratified and can be found here: https://github.com/riscv/riscv-isa-manual/blob/main/src/zfa.adoc Signed-off-by: Christoph Müllner <[email protected]>
Bump the CTG version to 0.12.2. Signed-off-by: Christoph Müllner <[email protected]>
Updated |
@UmerShahidengr could you review this PR |
UmerShahidengr
approved these changes
May 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks fine to me. We can merge it straightaway
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions:
Zfa defines its instructions in combination with the following extensions:
Since riscv-ctg does not support the RISC-V quad-precision floating-point ISA extension (Q) as well as the RISC-V half-precision floating-point ISA extension (Zfh), this patch does not include the instructions that depend on these extensions. All other instructions are included in this patch.
The instruction descriptions (simple_cgfs/zfa/*) use different instructions as parameter for the coverpoint generator functions (e.g. fleq.s uses "fle.s") to circumvent documented limitations of these generator functions.
Technically there is no reason to adjust generator.py. All required information could be extracted from instruction descriptions. However, that is not the case, and the file also includes its own hard-coded assumptions, which have to be adjusted as well.
The Zfa specification can be found here:
https://github.com/riscv/riscv-isa-manual/blob/master/src/zfa.tex