Commit 5d903309 authored by Tristan Gingold's avatar Tristan Gingold

tb/isa-testsuite: improve handling of urv specific tests

parent ceff473f
...@@ -314,13 +314,14 @@ class ISATestRunner extends LoggerClient; ...@@ -314,13 +314,14 @@ class ISATestRunner extends LoggerClient;
status = R_OK; status = R_OK;
endtask // runTest endtask // runTest
task automatic runAllTests( string test_dir, string list_file ); task automatic runAllTests( string test_dir, string list_file, inout int failCount);
automatic string tests[$]; automatic string tests[$];
automatic int n, i, f, failCount = 0; automatic int n, i, f;
automatic string failedTests = ""; automatic string failedTests = "";
f = $fopen( $sformatf("%s/%s", test_dir, list_file ) ,"r"); f = $fopen( $sformatf("%s/%s", test_dir, list_file ) ,"r");
if (f == 0)
$fatal;
while(!$feof(f)) while(!$feof(f))
begin begin
...@@ -328,6 +329,9 @@ class ISATestRunner extends LoggerClient; ...@@ -328,6 +329,9 @@ class ISATestRunner extends LoggerClient;
void'($fscanf(f,"%s", fname)); void'($fscanf(f,"%s", fname));
if (fname[0] == "#" || fname == "")
continue;
tests.push_back(fname); tests.push_back(fname);
end end
...@@ -337,9 +341,6 @@ class ISATestRunner extends LoggerClient; ...@@ -337,9 +341,6 @@ class ISATestRunner extends LoggerClient;
automatic TestStatus status; automatic TestStatus status;
automatic string s; automatic string s;
if (tests[i][0] == "#" || tests[i] == "")
continue;
// $display("Run %s", tests[i]); // $display("Run %s", tests[i]);
runTest({test_dir,"/",tests[i]}, status, failedTest ); runTest({test_dir,"/",tests[i]}, status, failedTest );
...@@ -360,12 +361,14 @@ class ISATestRunner extends LoggerClient; ...@@ -360,12 +361,14 @@ class ISATestRunner extends LoggerClient;
end end
endtask // runAllTests
task automatic testsResult(int failCount);
if(failCount) if(failCount)
fail ( $sformatf( "%d tests FAILED", failCount ) ); fail ( $sformatf( "%d tests FAILED", failCount ) );
else else
pass(); pass();
endtask
endtask // runAllTests
endclass // ISATestRunner endclass // ISATestRunner
...@@ -373,6 +376,7 @@ endclass // ISATestRunner ...@@ -373,6 +376,7 @@ endclass // ISATestRunner
automatic int i; automatic int i;
automatic ISATestRunner testRunner = new; automatic ISATestRunner testRunner = new;
automatic Logger l = Logger::get(); automatic Logger l = Logger::get();
automatic int failCount;
for(i=0;i<n_configs;i++) for(i=0;i<n_configs;i++)
begin begin
...@@ -380,9 +384,11 @@ endclass // ISATestRunner ...@@ -380,9 +384,11 @@ endclass // ISATestRunner
l.startTest($sformatf( "Full ISA Test for feature set:%s", DUT.getConfigurationString() ) ); l.startTest($sformatf( "Full ISA Test for feature set:%s", DUT.getConfigurationString() ) );
testRunner.runAllTests("../../sw/testsuite/isa", "tests.lst" ); failCount = 0;
testRunner.runAllTests("../../sw/testsuite/isa", "tests.lst", failCount );
if (configs[i].ecc) if (configs[i].ecc)
testRunner.runAllTests("../../sw/testsuite/isa", "tests-urv.lst" ); testRunner.runAllTests("../../sw/testsuite/isa", "tests-urv.lst", failCount );
testRunner.testsResult(failCount);
end end
l.writeTestReport("report.txt"); l.writeTestReport("report.txt");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment