diff options
author | 2016-06-23 02:04:40 +0200 | |
---|---|---|
committer | 2016-06-23 02:04:51 +0200 | |
commit | c6e6911aed7687b94fba52485d89f0903e102d0e (patch) | |
tree | dac88b6a6e1db607726e90bb7d7d2f5e0913ede1 /src/lib/netlist/plib/pconfig.h | |
parent | 224dbf1cc9fa8a6c49ee9529d3045474194667ef (diff) |
Netlist changes
- Replaced shared_ptr by unique_ptr.
- Better seperation of setup_t and netlist_t.
- Fixed bugs in rdtsc code. Refactored timer code.
- Simplify conditional activation/deactivation.
- Introduced HINT(device, hint) to clarify that hints are inheritent
and not specific to devices.
- Added improved profiling support to netlist. Statistics output now
proposes devices for which whole device activation/deactivation be
disabled. No significant improvement for pong, but breakout
experiences a 10% improvement.
- Moved options code from include to cpp file.
- Minor modifications to 7493 and 9316
- Introduced perftime_t and perfcount_t for gathering statistics. These
templates do not create any code if statistics are not kept.
- Make help2man ./nltool produce usuable output.
- More truthtable refactoring. Removed half-finished code for internal
state support. As implemented, this would have had no support for
timing delays.
[Couriersud]
Diffstat (limited to 'src/lib/netlist/plib/pconfig.h')
-rw-r--r-- | src/lib/netlist/plib/pconfig.h | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h index 48a7e740a8f..5c1582cdec8 100644 --- a/src/lib/netlist/plib/pconfig.h +++ b/src/lib/netlist/plib/pconfig.h @@ -12,9 +12,22 @@ #include <thread> #include <chrono> -#ifndef PSTANDALONE - #define PSTANDALONE (0) -#endif +/* + * Define this for more accurate measurements if you processor supports + * RDTSCP. + */ +#define PHAS_RDTSCP (1) + +/* + * Define this to use accurate timing measurements. Only works + * if PHAS_RDTSCP == 1 + */ +#define PUSE_ACCURATE_STATS (1) + +/* + * Set this to one if you want to use 128 bit int for ptime. + * This is for tests only. + */ #define PHAS_INT128 (0) @@ -75,30 +88,6 @@ typedef __int128_t INT128; namespace plib { -using ticks_t = int64_t; - -static inline ticks_t ticks() -{ - return std::chrono::high_resolution_clock::now().time_since_epoch().count(); -} -static inline ticks_t ticks_per_second() -{ - return std::chrono::high_resolution_clock::period::den / std::chrono::high_resolution_clock::period::num; -} - -#if defined(__x86_64__) && !defined(_clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)) - -static inline ticks_t profile_ticks() -{ - unsigned hi, lo; - __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); - return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); -} - -#else -static inline ticks_t profile_ticks() { return ticks(); } -#endif - /* * The following class was derived from the MAME delegate.h code. * It derives a pointer to a member function. |