Merge from master

This commit is contained in:
Wilson Snyder 2018-05-24 22:18:09 -04:00
commit e4e3294363
4 changed files with 17 additions and 8 deletions

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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.
######################################################################