Load fp vectors from ieee or riscv subdirectory

This commit is contained in:
Jordan Carlin 2024-09-16 14:49:52 -07:00
parent 4c78cfd0aa
commit 5abe709dcb
No known key found for this signature in database
3 changed files with 18 additions and 6 deletions

4
.gitignore vendored
View File

@ -26,8 +26,8 @@ tests/riscof/config32e.ini
tests/riscof/config64.ini
tests/riscof/riscof_work/
tests/wally-riscv-arch-test/riscv-test-suite/*/I/*/**
tests/fp/vectors/*.tv
tests/fp/vectors/sed*
tests/fp/vectors/**/*.tv
tests/fp/vectors/**/sed*
tests/fp/combined_IF_vectors/IF_vectors/*.tv
tests/custom/*/*/
tests/custom/*/*/*.memfile

View File

@ -35,6 +35,21 @@ module testbench_fp;
`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/"};
parameter MAXVECTORS = 8388610;
// FIXME: needs cleaning of unused variables (jes)
@ -657,8 +672,6 @@ module testbench_fp;
// Read the first test
initial begin
//string testname = {`PATH, Tests[TestNum]};
static string pp = `PATH;
string testname;
string tt0;
tt0 = $sformatf("%s", Tests[TestNum]);
@ -1004,7 +1017,7 @@ module testbench_fp;
// clear the vectors
for(int i=0; i<MAXVECTORS; i++) TestVectors[i] = '1;
// read next files
$readmemh({`PATH, Tests[TestNum]}, TestVectors);
$readmemh({pp, 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,7 +24,6 @@
// 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