mirror of
https://github.com/verilator/verilator.git
synced 2026-10-05 17:43:31 +02:00
PR #7902 uncovered a pre-existing bug in multi-threaded scheduling, where we can end up with an un-ordered R-W hazard in the MTask graph, resulting in non-deterministic runtime behaviour. This is extremely hard to actually trigger on a small example, so using ThreadSanitizer to flag it, which can identify the race reliably. In this patch: - Add configure and `verilator --get-supported TSAN` to check if the configured compiler supports ThreadSanitizer - Add a --tsan option to the test driver.py which builds the test with thread sanitizer (similar idea to --gdbsim). - Add a tests.enable_tsan() method to allow turning on TSan in the test Python file. - Add a suppressions file that waives TSan errors in the runtime library - Finally add `t_sched_hybrid_hazard` that demonstrates the data race triggered after #7902. This is currently expected failing, fix later. With the suppression, there are 17 vltmt tests failing due races in the generated code. (Using `driver.py --vltmt --tsan --quiet -j0`)
58 lines
1.8 KiB
C
58 lines
1.8 KiB
C
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
|
|
|
// DESCRIPTION: Verilator: Configure source; system configuration
|
|
//
|
|
// This file is part of Verilator.
|
|
//
|
|
// Code available from: https://verilator.org
|
|
//
|
|
// This program is free software; you can redistribute it and/or modify it
|
|
// under the terms of either the GNU Lesser General Public License Version 3
|
|
// or the Perl Artistic License Version 2.0.
|
|
// SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
|
|
|
|
// Autoconf substitutes this with the strings from AC_INIT.
|
|
#define PACKAGE_STRING ""
|
|
#define PACKAGE_VERSION_NUMBER_STRING "0.000"
|
|
// Otherwise Autoheader generates it (with all the same macros and more)
|
|
|
|
// Force ccache recompilation on PACKAGE_STRING change
|
|
#ifndef VL_CPPCHECK
|
|
#ifndef PACKAGE_VERSION_STRING_CHAR
|
|
#define PACKAGE_VERSION_STRING_CHAR
|
|
PACKAGE_VERSION_STRING_CHAR
|
|
#endif
|
|
#endif
|
|
|
|
//**********************************************************************
|
|
//**** Configure-discovered library options
|
|
|
|
// Define if struct stat has st_mtim.tv_nsec (from configure)
|
|
#undef HAVE_STAT_NSEC
|
|
|
|
// Define if SystemC found
|
|
// - If defined, the default search path has it, so support is always enabled.
|
|
// - If undef, not system-wide, user can set SYSTEMC_INCLUDE.
|
|
#undef HAVE_SYSTEMC
|
|
|
|
// Define if coroutines are supported on this platform
|
|
#undef HAVE_COROUTINES
|
|
|
|
// Define if ThreadSanitizer is supported on this platform
|
|
#undef HAVE_TSAN
|
|
|
|
// Define if compiled with tcmalloc
|
|
#undef HAVE_TCMALLOC
|
|
|
|
// Define if compiled with AddressSanitizer
|
|
#undef HAVE_DEV_ASAN
|
|
|
|
// Define if compiled with code coverage collection
|
|
#undef HAVE_DEV_GCOV
|
|
|
|
//**********************************************************************
|
|
//**** This file sometimes gets truncated, so check in consumers
|
|
#define HAVE_CONFIG_PACKAGE
|