diff --git a/include/verilated_profiler.h b/include/verilated_profiler.h index 1d8a2c5d4..188e3604d 100644 --- a/include/verilated_profiler.h +++ b/include/verilated_profiler.h @@ -290,7 +290,7 @@ void VlPgoProfiler::write(const char* modelp, const std::string& file VL_DEBUG_IF(VL_DBG_MSGF("+prof+vlt+file writing to '%s'\n", filename.c_str());); if (m_currentHierBlockCost) { - fprintf(fp, "profile_data -hier-dpi \"%s\" -cost 64'd%lu\n", modelp, + fprintf(fp, "profile_data -hier-dpi \"%s\" -cost 64'd%" PRIu64 "\n", modelp, m_currentHierBlockCost); } diff --git a/test_regress/driver.py b/test_regress/driver.py index d43f4830c..b6f440fea 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -2863,6 +2863,10 @@ def run_them() -> None: if __name__ == '__main__': os.environ['PYTHONUNBUFFERED'] = "1" + # GDB is broken on macOS + if platform.system() == "Darwin": + os.environ['VERILATOR_TEST_NO_GDB'] = "1" + if ('VERILATOR_ROOT' not in os.environ) and os.path.isfile('../bin/verilator'): os.environ['VERILATOR_ROOT'] = os.getcwd() + "/.." if 'MAKE' not in os.environ: diff --git a/test_regress/t/t_flag_ldflags.py b/test_regress/t/t_flag_ldflags.py index 661f2b1af..276038a94 100755 --- a/test_regress/t/t_flag_ldflags.py +++ b/test_regress/t/t_flag_ldflags.py @@ -38,21 +38,11 @@ test.compile( "t_flag_ldflags_a.a", "t_flag_ldflags_so.so" ]) -# On OS X, LD_LIBRARY_PATH is ignored, so set rpath of the exe to find the .so if sys.platform == "darwin": - test.run(cmd=[ - "cd " + test.obj_dir + " && install_name_tool -add_rpath @executable_path/.", - test.vm_prefix - ], - check_finished=False) - - test.run(cmd=[ - "cd " + test.obj_dir + " && install_name_tool -change t_flag_ldflags_so.so" + - " @rpath/t_flag_ldflags_so.so", test.vm_prefix - ], - check_finished=False) - -test.execute(run_env="LD_LIBRARY_PATH=" + test.obj_dir + ":" + - test.getenv_def("LD_LIBRARY_PATH", "")) + test.execute(run_env="DYLD_LIBRARY_PATH=" + test.obj_dir + ":" + + test.getenv_def("DYLD_LIBRARY_PATH", "")) +else: + test.execute(run_env="LD_LIBRARY_PATH=" + test.obj_dir + ":" + + test.getenv_def("LD_LIBRARY_PATH", "")) test.passes() diff --git a/test_regress/t/t_gantt_numa.py b/test_regress/t/t_gantt_numa.py index 7828e3e1f..a58c53bda 100755 --- a/test_regress/t/t_gantt_numa.py +++ b/test_regress/t/t_gantt_numa.py @@ -10,6 +10,7 @@ # Test for bin/verilator_gantt, import vltest_bootstrap +import sys test.scenarios('vltmt') test.top_filename = "t/t_gantt.v" @@ -38,9 +39,10 @@ for trial in range(0, trials): "/profile_exec.dat", "| tee " + gantt_log ]) - test.file_grep(gantt_log, r'CPU info:') - test.file_grep(gantt_log, r'NUMA status += (assigned|%Warning: no /proc/cpuinfo)') - # False fails occasionally - # test.file_grep_not(gantt_log, r'%Warning:') # e.g. There were fewer CPUs (1) than threads (3). + if sys.platform != "darwin": + test.file_grep(gantt_log, r'CPU info:') + test.file_grep(gantt_log, r'NUMA status += (assigned|%Warning: no /proc/cpuinfo)') + # False fails occasionally + # test.file_grep_not(gantt_log, r'%Warning:') # e.g. There were fewer CPUs (1) than threads (3). test.passes() diff --git a/test_regress/t/t_vpi_multidim.cpp b/test_regress/t/t_vpi_multidim.cpp index 79fbb3bf3..016054d6c 100644 --- a/test_regress/t/t_vpi_multidim.cpp +++ b/test_regress/t/t_vpi_multidim.cpp @@ -259,13 +259,13 @@ void _arr_access_format_check(TestVpiHandle& reg_h, int wordSize, const int* low strVal_s[spanSize] = '\0'; value_in.value.str = strVal_s; } else if (format == vpiDecStrVal) { - sprintf(strVal_s, "%" PRIu64, intVal); + snprintf(strVal_s, MAX_SPANSIZE + 1, "%" PRIu64, intVal); value_in.value.str = strVal_s; } else if (format == vpiHexStrVal) { - sprintf(strVal_s, "%0*" PRIx64, (spanSize + 3) / 4, intVal); + snprintf(strVal_s, MAX_SPANSIZE + 1, "%0*" PRIx64, (spanSize + 3) / 4, intVal); value_in.value.str = strVal_s; } else if (format == vpiOctStrVal) { - sprintf(strVal_s, "%0*" PRIo64, (spanSize + 2) / 3, intVal); + snprintf(strVal_s, MAX_SPANSIZE + 1, "%0*" PRIo64, (spanSize + 2) / 3, intVal); value_in.value.str = strVal_s; } else if (format == vpiStringVal) { const int byteCount = (spanSize + 7) / 8;