mirror of
https://github.com/verilator/verilator.git
synced 2025-01-05 22:27:35 +00:00
Fix mkdir on MSYS2, msg2614.
This commit is contained in:
parent
15abb4d590
commit
c93d28050e
@ -7,8 +7,6 @@
|
|||||||
// Include common routines
|
// Include common routines
|
||||||
#include <verilated.h>
|
#include <verilated.h>
|
||||||
|
|
||||||
#include <sys/stat.h> // mkdir
|
|
||||||
|
|
||||||
// Include model header, generated from Verilating "top.v"
|
// Include model header, generated from Verilating "top.v"
|
||||||
#include "Vtop.h"
|
#include "Vtop.h"
|
||||||
|
|
||||||
@ -51,7 +49,7 @@ int main(int argc, char** argv, char** env) {
|
|||||||
VL_PRINTF("Enabling waves into logs/vlt_dump.vcd...\n");
|
VL_PRINTF("Enabling waves into logs/vlt_dump.vcd...\n");
|
||||||
tfp = new VerilatedVcdC;
|
tfp = new VerilatedVcdC;
|
||||||
top->trace(tfp, 99); // Trace 99 levels of hierarchy
|
top->trace(tfp, 99); // Trace 99 levels of hierarchy
|
||||||
mkdir("logs", 0777);
|
Verilated::mkdir("logs");
|
||||||
tfp->open("logs/vlt_dump.vcd"); // Open the dump file
|
tfp->open("logs/vlt_dump.vcd"); // Open the dump file
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -112,7 +110,7 @@ int main(int argc, char** argv, char** env) {
|
|||||||
|
|
||||||
// Coverage analysis (since test passed)
|
// Coverage analysis (since test passed)
|
||||||
#if VM_COVERAGE
|
#if VM_COVERAGE
|
||||||
mkdir("logs", 0777);
|
Verilated::mkdir("logs");
|
||||||
VerilatedCov::write("logs/coverage.dat");
|
VerilatedCov::write("logs/coverage.dat");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
cout << "Enabling waves into logs/vlt_dump.vcd...\n";
|
cout << "Enabling waves into logs/vlt_dump.vcd...\n";
|
||||||
tfp = new VerilatedVcdSc;
|
tfp = new VerilatedVcdSc;
|
||||||
top->trace(tfp, 99);
|
top->trace(tfp, 99);
|
||||||
mkdir("logs", 0777);
|
Verilated::mkdir("logs");
|
||||||
tfp->open("logs/vlt_dump.vcd");
|
tfp->open("logs/vlt_dump.vcd");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -134,7 +134,7 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
// Coverage analysis (since test passed)
|
// Coverage analysis (since test passed)
|
||||||
#if VM_COVERAGE
|
#if VM_COVERAGE
|
||||||
mkdir("logs", 0777);
|
Verilated::mkdir("logs");
|
||||||
VerilatedCov::write("logs/coverage.dat");
|
VerilatedCov::write("logs/coverage.dat");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -26,6 +26,11 @@
|
|||||||
#define _VERILATED_CPP_
|
#define _VERILATED_CPP_
|
||||||
#include "verilated_imp.h"
|
#include "verilated_imp.h"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <sys/stat.h> // mkdir
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(__MINGW32__)
|
||||||
|
# include <direct.h> // mkdir
|
||||||
|
#endif
|
||||||
|
|
||||||
#define VL_VALUE_STRING_MAX_WIDTH 8192 ///< Max static char array for VL_VALUE_STRING
|
#define VL_VALUE_STRING_MAX_WIDTH 8192 ///< Max static char array for VL_VALUE_STRING
|
||||||
|
|
||||||
@ -1741,6 +1746,14 @@ void Verilated::overWidthError(const char* signame) VL_MT_SAFE {
|
|||||||
VL_FATAL_MT("unknown",0,"", msg.c_str());
|
VL_FATAL_MT("unknown",0,"", msg.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Verilated::mkdir(const char* dirname) VL_MT_UNSAFE {
|
||||||
|
#if defined(_WIN32) || defined(__MINGW32__)
|
||||||
|
::mkdir(dirname);
|
||||||
|
#else
|
||||||
|
::mkdir(dirname, 0777);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void Verilated::quiesce() VL_MT_SAFE {
|
void Verilated::quiesce() VL_MT_SAFE {
|
||||||
#ifdef VL_THREADED
|
#ifdef VL_THREADED
|
||||||
// Wait until all threads under this evaluation are quiet
|
// Wait until all threads under this evaluation are quiet
|
||||||
|
@ -445,6 +445,9 @@ public:
|
|||||||
static const char* productName() VL_PURE { return VERILATOR_PRODUCT; }
|
static const char* productName() VL_PURE { return VERILATOR_PRODUCT; }
|
||||||
static const char* productVersion() VL_PURE { return VERILATOR_VERSION; }
|
static const char* productVersion() VL_PURE { return VERILATOR_VERSION; }
|
||||||
|
|
||||||
|
/// Convenience OS utilities
|
||||||
|
static void mkdir(const char* dirname) VL_MT_UNSAFE;
|
||||||
|
|
||||||
/// When multithreaded, quiesce the model to prepare for trace/saves/coverage
|
/// When multithreaded, quiesce the model to prepare for trace/saves/coverage
|
||||||
/// This may only be called when no locks are held.
|
/// This may only be called when no locks are held.
|
||||||
static void quiesce() VL_MT_SAFE;
|
static void quiesce() VL_MT_SAFE;
|
||||||
|
@ -196,7 +196,7 @@ public:
|
|||||||
#if defined(__linux)
|
#if defined(__linux)
|
||||||
return sched_getcpu();
|
return sched_getcpu();
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
uint32_t info[4];
|
vluint32_t info[4];
|
||||||
__cpuid_count(1, 0, info[0], info[1], info[2], info[3]);
|
__cpuid_count(1, 0, info[0], info[1], info[2], info[3]);
|
||||||
/* info[1] is EBX, bits 24-31 are APIC ID */
|
/* info[1] is EBX, bits 24-31 are APIC ID */
|
||||||
if ((info[3] & (1 << 9)) == 0) {
|
if ((info[3] & (1 << 9)) == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user