Merge pull request #557 from stineje/main

Update fix on missing FlagMatch
This commit is contained in:
David Harris 2024-01-09 07:31:40 -08:00 committed by GitHub
commit 5ef90da56c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -962,13 +962,12 @@ module testbenchfp;
// http://www.jhauser.us/arithmetic/TestFloat-3/doc/TestFloat-general.html it says
// for an unsigned integer result 0 is also okay
// Testfloat outputs 800... for both the largest integer values for both positive and negitive numbers but
// TestFloat outputs 800... for both the largest integer values for both positive and negitive numbers but
// the riscv spec specifies 2^31-1 for positive values out of range and NaNs ie 7fff...
else if ( ((UnitVal === `CVTINTUNIT) | (UnitVal === `CMPUNIT)) &
~((ResFlg === AnsFlg | AnsFlg === 5'bx)) ) begin
// ResMatch checks the result as well. It is checked within the
// test to avoid issues related when the values change tests (e.g., f16_eq_rne -> f16_eq_rz)
if (~(ResMatch)) begin
else if ( ((UnitVal === `CVTINTUNIT) | (UnitVal === `CMPUNIT)) & ~FlagMatch ) begin
// ResMatch & FlagMatch checks the result again. It is checked within the
// test again to avoid issues related when the values change tests (e.g., f16_eq_rne -> f16_eq_rz)
if (~(ResMatch & FlagMatch)) begin
errors += 1;
$display("\nError in %s", Tests[TestNum]);
$display("TestNum %d OpCtrl %d", TestNum, OpCtrl[TestNum]);