From 828d6bc619231fedb31dceb5c574defaa99654e1 Mon Sep 17 00:00:00 2001 From: "James E. Stine" Date: Tue, 9 Jan 2024 09:22:39 -0600 Subject: [PATCH] more optimized check on Issue #546 --- testbench/testbench-fp.sv | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testbench/testbench-fp.sv b/testbench/testbench-fp.sv index 247ac979e..53001a4bc 100644 --- a/testbench/testbench-fp.sv +++ b/testbench/testbench-fp.sv @@ -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]);