diff --git a/include/verilated.cpp b/include/verilated.cpp index b7eb36dce..2c6979a1a 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -39,6 +39,16 @@ #define VL_VALUE_STRING_MAX_WIDTH 8192 ///< Max static char array for VL_VALUE_STRING +//=========================================================================== +// Static sanity checks (when get C++11 can use static_assert) + +typedef union { + char vluint8_incorrect[(sizeof(vluint8_t) == 1) ? 1:-1]; + char vluint16_incorrect[(sizeof(vluint16_t) == 2) ? 1:-1]; + char vluint32_incorrect[(sizeof(vluint32_t) == 4) ? 1:-1]; + char vluint64_incorrect[(sizeof(vluint64_t) == 8) ? 1:-1]; +} vl_static_checks_t; + //=========================================================================== // Global variables