mirror of
https://github.com/verilator/verilator.git
synced 2025-01-19 12:54:02 +00:00
Support Clang 16 (#4592)
This commit is contained in:
parent
83a0085c4d
commit
c7a0613c57
10
configure.ac
10
configure.ac
@ -371,10 +371,9 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_WEXTRA,-Wthread-safety)
|
||||
AC_SUBST(CFG_CXXFLAGS_WEXTRA)
|
||||
|
||||
# Flags for coroutine support for dynamic scheduling
|
||||
_MY_CXX_CHECK_IFELSE(
|
||||
-fcoroutines-ts,
|
||||
[CFG_CXXFLAGS_COROUTINES="-fcoroutines-ts"],
|
||||
[CFG_CXXFLAGS_COROUTINES="-fcoroutines"])
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts)
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines)
|
||||
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts -Wno-deprecated-experimental-coroutine)
|
||||
AC_SUBST(CFG_CXXFLAGS_COROUTINES)
|
||||
|
||||
# HAVE_COROUTINES
|
||||
@ -442,7 +441,10 @@ m4_foreach([cflag],[
|
||||
[-mno-cet],
|
||||
[-Qunused-arguments],
|
||||
[-Wno-bool-operation],
|
||||
[-Wno-c++11-narrowing],
|
||||
[-Wno-constant-logical-operand],
|
||||
[-Wno-non-pod-varargs],
|
||||
[-Wno-overloaded-virtual],
|
||||
[-Wno-parentheses-equality],
|
||||
[-Wno-shadow],
|
||||
[-Wno-sign-compare],
|
||||
|
@ -250,6 +250,16 @@ template <class T_Value, uint64_t T_numValues>
|
||||
class VlRandC final {
|
||||
T_Value m_remaining = 0; // Number of values to pull before re-randomize
|
||||
T_Value m_lfsr = 1; // LFSR state
|
||||
|
||||
public:
|
||||
// CONSTRUCTORS
|
||||
VlRandC() {
|
||||
static_assert(T_numValues >= 1, "");
|
||||
static_assert(sizeof(T_Value) == 8 || (T_numValues < (1ULL << (8 * sizeof(T_Value)))), "");
|
||||
}
|
||||
// METHODS
|
||||
T_Value randomize(VlRNG& rngr) {
|
||||
if (VL_UNLIKELY(!m_remaining)) reseed(rngr);
|
||||
// Polynomials are first listed at https://users.ece.cmu.edu/~koopman/lfsr/
|
||||
static constexpr uint64_t s_polynomials[] = {
|
||||
0x0ULL, // 0 never used (constant, no randomization)
|
||||
@ -264,16 +274,6 @@ class VlRandC final {
|
||||
0x80000057ULL, // 32
|
||||
0x100000029ULL // 33
|
||||
};
|
||||
|
||||
public:
|
||||
// CONSTRUCTORS
|
||||
VlRandC() {
|
||||
static_assert(T_numValues >= 1, "");
|
||||
static_assert(sizeof(T_Value) == 8 || (T_numValues < (1ULL << (8 * sizeof(T_Value)))), "");
|
||||
}
|
||||
// METHODS
|
||||
T_Value randomize(VlRNG& rngr) {
|
||||
if (VL_UNLIKELY(!m_remaining)) reseed(rngr);
|
||||
constexpr uint32_t clogWidth = VL_CLOG2_CE_Q(T_numValues) + 1;
|
||||
constexpr uint32_t lfsrWidth = (clogWidth < 2) ? 2 : clogWidth;
|
||||
constexpr T_Value polynomial = static_cast<T_Value>(s_polynomials[lfsrWidth]);
|
||||
|
Loading…
Reference in New Issue
Block a user