diff --git a/include/verilated.cpp b/include/verilated.cpp index 9483b3997..e3a847edc 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -40,7 +40,7 @@ VerilatedVoidCb Verilated::s_flushCb = NULL; Verilated::Serialized Verilated::s_s; VL_THREAD_LOCAL Verilated::ThreadLocal Verilated::t_s; -struct Verilated::CommandArgValues Verilated::s_args = {0, NULL}; +Verilated::CommandArgValues Verilated::s_args; VerilatedImp VerilatedImp::s_s; diff --git a/include/verilated.h b/include/verilated.h index ec4628e49..998740bfc 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -332,15 +332,16 @@ class Verilated { static VerilatedVoidCb s_flushCb; ///< Flush callback function static struct Serialized { // All these members serialized/deserialized - // Slow path - int s_randReset; ///< Random reset: 0=all 0s, 1=all 1s, 2=random // Fast path int s_debug; ///< See accessors... only when VL_DEBUG set bool s_calcUnusedSigs; ///< Waves file on, need all signals calculated bool s_gotFinish; ///< A $finish statement executed bool s_assertOn; ///< Assertions are enabled bool s_fatalOnVpiError; ///< Stop on vpi error/unsupported - Serialized(); + // Slow path + int s_randReset; ///< Random reset: 0=all 0s, 1=all 1s, 2=random + Serialized(); + ~Serialized() {} } s_s; // no need to be save-restored (serialized) the @@ -348,6 +349,8 @@ class Verilated { static struct CommandArgValues { int argc; const char** argv; + CommandArgValues() : argc(0), argv(NULL) {} + ~CommandArgValues() {} } s_args; // Not covered by mutex, as per-thread diff --git a/include/verilatedos.h b/include/verilatedos.h index ee10a6983..5e9039b00 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -357,13 +357,17 @@ typedef unsigned long long vluint64_t; ///< 64-bit unsigned type // Performance counters #if VL_THREADED -# if defined(__i386__) || defined(__x86_64__) /// The vluint64_t argument is loaded with a high-performance counter for profiling /// or 0x0 if not implemeted on this platform -# define VL_RDTSC(val) asm volatile("rdtsc" : "=A" (val)) +# if defined(__i386__) || defined(__x86_64__) +# define VL_RDTSC(val) { \ + vluint32_t hi, lo; \ + asm volatile("rdtsc" : "=a" (lo), "=d" (hi)); \ + (val) = ((vluint64_t)lo) | (((vluint64_t)hi)<<32); \ +} # elif defined(__aarch64__) # define VL_RDTSC(val) asm volatile("mrs %[rt],PMCCNTR_EL0" : [rt] "=r" (val)); -# elif +# else // We just silently ignore unknown OSes, as only leads to missing statistics # define VL_RDTSC(val) (val) = 0; # endif diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 4f2bc3496..a99da06d3 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1,4 +1,6 @@ -#!/usr/bin/perl -w +: # -*-Mode: perl;-*- use perl, wherever it is +eval 'exec perl -wS $0 ${1+"$@"}' + if 0; # See copyright, etc in below POD section. ######################################################################