Internals: Move vl_timescaled_double to verilated_funcs.h. No functional change intended

This commit is contained in:
Wilson Snyder
2024-03-10 22:34:32 -04:00
parent 2c27f22900
commit ba47da6587
4 changed files with 24 additions and 20 deletions
+4 -2
View File
@@ -372,7 +372,9 @@ string V3Os::trueRandom(size_t size) VL_MT_SAFE {
#if defined(_WIN32) || defined(__MINGW32__)
const NTSTATUS hr = BCryptGenRandom(nullptr, reinterpret_cast<BYTE*>(data), size,
BCRYPT_USE_SYSTEM_PREFERRED_RNG);
if (!BCRYPT_SUCCESS(hr)) v3fatal("Could not acquire random data.");
if (VL_UNCOVERABLE(!BCRYPT_SUCCESS(hr))) {
v3fatal("Could not acquire random data. Try specifying a key instead."); // LCOV_EXCL_LINE
}
#else
std::ifstream is{"/dev/urandom", std::ios::in | std::ios::binary};
// This read uses the size of the buffer.
@@ -418,7 +420,7 @@ uint64_t V3Os::memUsageBytes() {
#else
// Highly unportable. Sorry
const char* const statmFilename = "/proc/self/statm";
FILE* fp = fopen(statmFilename, "r");
FILE* const fp = fopen(statmFilename, "r");
if (!fp) return 0;
uint64_t size, resident, share, text, lib, data, dt; // All in pages
const int items = fscanf(