diff --git a/include/verilated.cpp b/include/verilated.cpp index cb910e8a0..a56dcf5e0 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -1343,8 +1343,6 @@ void VL_FCLOSE_I(IData fdi) VL_MT_SAFE { VerilatedImp::fdClose(fdi); } -void VL_FFLUSH_ALL() VL_MT_SAFE { fflush(stdout); } - void VL_SFORMAT_X(int obits, CData& destr, const char* formatp, ...) VL_MT_SAFE { static VL_THREAD_LOCAL std::string t_output; // static only for speed t_output = ""; diff --git a/nodist/code_coverage b/nodist/code_coverage index 782bab1a7..eebc34d03 100755 --- a/nodist/code_coverage +++ b/nodist/code_coverage @@ -92,8 +92,8 @@ def test(): if re.search(regexp, dat): # Remove .gcda/.gcno for files we don't care about before we slowly # read them - os.unlink(dat) - os.unlink(gcno) + unlink_ok(dat) + unlink_ok(gcno) del dats[dat] break @@ -315,6 +315,13 @@ def run(command): raise Exception("%Error: Command failed " + command + ", stopped") +def unlink_ok(filename): + try: + os.unlink(filename) + except OSError: + pass + + def ci_fold_start(action): print("::group::" + action, flush=True) diff --git a/test_regress/t/t_dpi_open_c.cpp b/test_regress/t/t_dpi_open_c.cpp index cff5d506a..d75c822a1 100644 --- a/test_regress/t/t_dpi_open_c.cpp +++ b/test_regress/t/t_dpi_open_c.cpp @@ -161,6 +161,22 @@ void _dpii_all(int c, int p, int u, const svOpenArrayHandle i, const svOpenArray CHECK_RESULT_HEX(svSize(i, d), 7); } } +#ifdef VERILATOR + // Check out-of-bounds read doesn't access bad memory (when sanitizer used) + (void)svLeft(i, -1); + (void)svRight(i, -1); + (void)svLow(i, -1); + (void)svHigh(i, -1); + (void)svIncrement(i, -1); + (void)svSize(i, -1); + // + (void)svLeft(i, 99); + (void)svRight(i, 99); + (void)svLow(i, 99); + (void)svHigh(i, 99); + (void)svIncrement(i, 99); + (void)svSize(i, 99); +#endif if (c == 2 && p == 1 && u == 3) { for (int a = svLow(i, 1); a <= svHigh(i, 1); ++a) { diff --git a/test_regress/t/t_enum_public.cpp b/test_regress/t/t_enum_public.cpp index 328140331..e46b8d57d 100644 --- a/test_regress/t/t_enum_public.cpp +++ b/test_regress/t/t_enum_public.cpp @@ -12,6 +12,8 @@ #include "Vt_enum_public_p3.h" #include "Vt_enum_public_p62.h" +double sc_time_stamp() { return 0; } + int main(int argc, char* argv[]) { Vt_enum_public* topp = new Vt_enum_public; diff --git a/test_regress/t/t_string.v b/test_regress/t/t_string.v index 6b8e48e07..758d5744e 100644 --- a/test_regress/t/t_string.v +++ b/test_regress/t/t_string.v @@ -15,6 +15,10 @@ module t (/*AUTOARG*/ integer cyc=0; + reg [1*8:1] vstr1; + reg [2*8:1] vstr2; + reg [6*8:1] vstr6; + reg [4*8:1] vstr; const string s = "a"; // Check static assignment string s2; @@ -29,6 +33,15 @@ module t (/*AUTOARG*/ // a.itoa, a.hextoa, a.octoa, a.bintoa, a.realtoa initial begin + $sformat(vstr1, "%s", s); + `checks(vstr1, "a"); + + $sformat(vstr2, "=%s", s); + `checks(vstr2, "=a"); + + $sformat(vstr6, "--a=%s", s); + `checks(vstr6, "--a=a"); + $sformat(vstr, "s=%s", s); `checks(vstr, "s=a"); `checks(string'(vstr), "s=a"); diff --git a/test_regress/t/t_sys_plusargs.pl b/test_regress/t/t_sys_plusargs.pl index 05eeca761..362a0c53c 100755 --- a/test_regress/t/t_sys_plusargs.pl +++ b/test_regress/t/t_sys_plusargs.pl @@ -16,7 +16,7 @@ compile( execute( check_finished => 1, - all_run_flags => ['+PLUS +INT=1234 +STRSTR +REAL=1.2345'], + all_run_flags => ['+PLUS +INT=1234 +STRSTR +REAL=1.2345 +IP%P101'], ); ok(1); diff --git a/test_regress/t/t_sys_plusargs.v b/test_regress/t/t_sys_plusargs.v index f387b5fa2..015ccfb2c 100644 --- a/test_regress/t/t_sys_plusargs.v +++ b/test_regress/t/t_sys_plusargs.v @@ -89,6 +89,11 @@ module t; $display("str='%s'",sv_str); if (sv_str != "T=1234") $stop; + sv_str = "none"; + if ($value$plusargs("IP%%P%b", p_i)!==1) $stop; + $display("str='%s'",sv_str); + if (p_i != 'b101) $stop; + sv_in = "INT=%d"; `ifdef VERILATOR if ($c1(0)) sv_in = "NEVER"; // Prevent constant propagation