more optimized check on Issue #546

This commit is contained in:
James E. Stine 2024-01-09 09:22:39 -06:00
parent cfb27de8a3
commit 828d6bc619

View File

@ -962,12 +962,11 @@ 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)
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]);