includes: Fix VL_RDTSC & misc stuff.
This commit is contained in:
parent
0efe343494
commit
92649ba494
|
|
@ -40,7 +40,7 @@ VerilatedVoidCb Verilated::s_flushCb = NULL;
|
||||||
Verilated::Serialized Verilated::s_s;
|
Verilated::Serialized Verilated::s_s;
|
||||||
VL_THREAD_LOCAL Verilated::ThreadLocal Verilated::t_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;
|
VerilatedImp VerilatedImp::s_s;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -332,15 +332,16 @@ class Verilated {
|
||||||
static VerilatedVoidCb s_flushCb; ///< Flush callback function
|
static VerilatedVoidCb s_flushCb; ///< Flush callback function
|
||||||
|
|
||||||
static struct Serialized { // All these members serialized/deserialized
|
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
|
// Fast path
|
||||||
int s_debug; ///< See accessors... only when VL_DEBUG set
|
int s_debug; ///< See accessors... only when VL_DEBUG set
|
||||||
bool s_calcUnusedSigs; ///< Waves file on, need all signals calculated
|
bool s_calcUnusedSigs; ///< Waves file on, need all signals calculated
|
||||||
bool s_gotFinish; ///< A $finish statement executed
|
bool s_gotFinish; ///< A $finish statement executed
|
||||||
bool s_assertOn; ///< Assertions are enabled
|
bool s_assertOn; ///< Assertions are enabled
|
||||||
bool s_fatalOnVpiError; ///< Stop on vpi error/unsupported
|
bool s_fatalOnVpiError; ///< Stop on vpi error/unsupported
|
||||||
|
// Slow path
|
||||||
|
int s_randReset; ///< Random reset: 0=all 0s, 1=all 1s, 2=random
|
||||||
Serialized();
|
Serialized();
|
||||||
|
~Serialized() {}
|
||||||
} s_s;
|
} s_s;
|
||||||
|
|
||||||
// no need to be save-restored (serialized) the
|
// no need to be save-restored (serialized) the
|
||||||
|
|
@ -348,6 +349,8 @@ class Verilated {
|
||||||
static struct CommandArgValues {
|
static struct CommandArgValues {
|
||||||
int argc;
|
int argc;
|
||||||
const char** argv;
|
const char** argv;
|
||||||
|
CommandArgValues() : argc(0), argv(NULL) {}
|
||||||
|
~CommandArgValues() {}
|
||||||
} s_args;
|
} s_args;
|
||||||
|
|
||||||
// Not covered by mutex, as per-thread
|
// Not covered by mutex, as per-thread
|
||||||
|
|
|
||||||
|
|
@ -357,13 +357,17 @@ typedef unsigned long long vluint64_t; ///< 64-bit unsigned type
|
||||||
// Performance counters
|
// Performance counters
|
||||||
|
|
||||||
#if VL_THREADED
|
#if VL_THREADED
|
||||||
# if defined(__i386__) || defined(__x86_64__)
|
|
||||||
/// The vluint64_t argument is loaded with a high-performance counter for profiling
|
/// The vluint64_t argument is loaded with a high-performance counter for profiling
|
||||||
/// or 0x0 if not implemeted on this platform
|
/// 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__)
|
# elif defined(__aarch64__)
|
||||||
# define VL_RDTSC(val) asm volatile("mrs %[rt],PMCCNTR_EL0" : [rt] "=r" (val));
|
# 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
|
// We just silently ignore unknown OSes, as only leads to missing statistics
|
||||||
# define VL_RDTSC(val) (val) = 0;
|
# define VL_RDTSC(val) (val) = 0;
|
||||||
# endif
|
# endif
|
||||||
|
|
|
||||||
|
|
@ -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.
|
# See copyright, etc in below POD section.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue