#ifndef IVL_vpi_utils_H #define IVL_vpi_utils_H #include #include static inline uint64_t vlg_round_to_u64(double rval) { // Directly casting a negative double to an unsigned integer types is // undefined behavior and behaves differently on different architectures. // Cast to signed integer first to get the behavior we want. return static_cast(static_cast(std::llround(rval))); } #endif