Fix verilator_gantt time on Arm.
This commit is contained in:
parent
2560fc867f
commit
55da66164b
|
|
@ -472,7 +472,12 @@ typedef unsigned long long vluint64_t; ///< 64-bit unsigned type
|
||||||
(val) = ((vluint64_t)lo) | (((vluint64_t)hi) << 32); \
|
(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));
|
// 1 GHz virtual system timer on SBSA level 5 compliant systems, else often 100 MHz
|
||||||
|
# define VL_RDTSC(val) \
|
||||||
|
{ \
|
||||||
|
asm volatile("isb" : : : "memory"); \
|
||||||
|
asm volatile("mrs %[rt],CNTVCT_EL0" : [rt] "=r"(val)); \
|
||||||
|
}
|
||||||
#else
|
#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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue