Internals: Make VL_UNREACHABLE similar to std::unreachable()
This commit is contained in:
parent
c9634695a7
commit
4367e03e46
|
|
@ -2836,7 +2836,7 @@ const char* Verilated::productVersion() VL_PURE { return VERILATOR_VERSION; }
|
|||
void Verilated::nullPointerError(const char* filename, int linenum) VL_MT_SAFE {
|
||||
// Slowpath - Called only on error
|
||||
VL_FATAL_MT(filename, linenum, "", "Null pointer dereferenced");
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
|
||||
void Verilated::overWidthError(const char* signame) VL_MT_SAFE {
|
||||
|
|
@ -2844,7 +2844,7 @@ void Verilated::overWidthError(const char* signame) VL_MT_SAFE {
|
|||
const std::string msg = (std::string{"Testbench C set input '"} + signame
|
||||
+ "' to value that overflows what the signal's width can fit");
|
||||
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
|
||||
void Verilated::mkdir(const char* dirname) VL_MT_UNSAFE {
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@
|
|||
# define VL_EXCLUDES(x) __attribute__((locks_excluded(x)))
|
||||
# define VL_SCOPED_CAPABILITY __attribute__((scoped_lockable))
|
||||
# endif
|
||||
# define VL_LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
# define VL_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
# define VL_UNREACHABLE __builtin_unreachable();
|
||||
# define VL_LIKELY(x) __builtin_expect(!!(x), 1) // Prefer over C++20 [[likely]]
|
||||
# define VL_UNLIKELY(x) __builtin_expect(!!(x), 0) // Prefer over C++20 [[unlikely]]
|
||||
# define VL_UNREACHABLE __builtin_unreachable() // C++23 std::unreachable()
|
||||
# define VL_PREFETCH_RD(p) __builtin_prefetch((p), 0)
|
||||
# define VL_PREFETCH_RW(p) __builtin_prefetch((p), 1)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1187,7 +1187,7 @@ void AstNode::dumpTreeDotFile(const string& filename, bool append, bool doDump)
|
|||
void AstNode::v3errorEndFatal(std::ostringstream& str) const {
|
||||
v3errorEnd(str);
|
||||
assert(0); // LCOV_EXCL_LINE
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
|
||||
string AstNode::instanceStr() const {
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ inline void v3errorEnd(std::ostringstream& sstr) { V3Error::v3errorEnd(sstr); }
|
|||
inline void v3errorEndFatal(std::ostringstream& sstr) {
|
||||
V3Error::v3errorEnd(sstr);
|
||||
assert(0); // LCOV_EXCL_LINE
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
|
||||
// Theses allow errors using << operators: v3error("foo"<<"bar");
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ public:
|
|||
void v3errorEndFatal(std::ostringstream& str) VL_ATTR_NORETURN {
|
||||
v3errorEnd(str);
|
||||
assert(0); // LCOV_EXCL_LINE
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
/// When building an error, prefix for printing continuation lines
|
||||
/// e.g. information referring to the same FileLine as before
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ void V3GraphVertex::v3errorEnd(std::ostringstream& str) const {
|
|||
void V3GraphVertex::v3errorEndFatal(std::ostringstream& str) const {
|
||||
v3errorEnd(str);
|
||||
assert(0); // LCOV_EXCL_LINE
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, V3GraphVertex* vertexp) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void V3Number::v3errorEnd(std::ostringstream& str) const {
|
|||
void V3Number::v3errorEndFatal(std::ostringstream& str) const {
|
||||
v3errorEnd(str);
|
||||
assert(0); // LCOV_EXCL_LINE
|
||||
VL_UNREACHABLE
|
||||
VL_UNREACHABLE;
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
|
|
|||
Loading…
Reference in New Issue