Restore testbench_fp to load from vectors directory

This commit is contained in:
Jordan Carlin 2024-09-29 00:57:41 -07:00
parent a3214e1682
commit 716bee3d26
No known key found for this signature in database
2 changed files with 4 additions and 17 deletions

View File

@ -33,22 +33,7 @@ module testbench_fp;
parameter string TEST="none"; // choices are cvtint, cvtfp, cmp, add, sub, mul, div, sqrt, fma; all does not check properly
parameter string TEST_SIZE="all";
`include "parameter-defs.vh"
`ifdef VERILATOR
import "DPI-C" function string getenvval(input string env_name);
string WALLY_DIR = getenvval("WALLY");
`elsif VCS
import "DPI-C" function string getenv(input string env_name);
string WALLY_DIR = getenv("WALLY");
`else
string WALLY_DIR = "$WALLY";
`endif
string FP_TESTS = {WALLY_DIR, "/tests/fp/vectors"};
string pp;
if (P.IEEE754) assign pp = {FP_TESTS, "/ieee/"};
else assign pp = {FP_TESTS, "/riscv/"};
`include "parameter-defs.vh"
parameter MAXVECTORS = 8388610;
@ -671,6 +656,7 @@ module testbench_fp;
// Read the first test
initial begin
static string pp = `PATH;
string testname;
string tt0;
tt0 = $sformatf("%s", Tests[TestNum]);
@ -1009,7 +995,7 @@ module testbench_fp;
// clear the vectors
for(int i=0; i<MAXVECTORS; i++) TestVectors[i] = '1;
// read next files
$readmemh({pp, Tests[TestNum]}, TestVectors);
$readmemh({`PATH, Tests[TestNum]}, TestVectors);
// set the vector index back to 0
VectorNum = 0;
// incemet the operation if all the rounding modes have been tested

View File

@ -24,6 +24,7 @@
// and limitations under the License.
////////////////////////////////////////////////////////////////////////////////////////////////
`define PATH "../../tests/fp/vectors/"
`define ADD_OPCTRL 3'b110
`define MUL_OPCTRL 3'b100
`define SUB_OPCTRL 3'b111