blob: 4d93e669f5f9792ce576f3baaae03b46489ac940 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
// license:GPL-2.0+
// copyright-holders:Couriersud
/*
* nlconfig.h
*
*/
#ifndef NLCONFIG_H_
#define NLCONFIG_H_
/* FIXME: at some time, make it compile on it's own */
#include "emu.h"
//============================================================
// SETUP
//============================================================
/*
* The next options needs -Wno-pmf-conversions to compile and gcc
* This is intended for non-mame usage.
*
*/
#define USE_PMFDELEGATES (0)
// This used to add 20% performance ... but is not guaranteed to be absolutely timing correct.
// Update 01.01.2014: Currently, enabling this has no observable impact on performance.
#define USE_DEACTIVE_DEVICE (0)
#define USE_OPENMP (0)
// Use nano-second resolution - Sufficient for now
#define NETLIST_INTERNAL_RES (U64(1000000000))
//#define NETLIST_INTERNAL_RES (U64(1000000000000))
#define NETLIST_CLOCK (NETLIST_INTERNAL_RES)
#define NETLIST_GMIN (1e-9)
typedef UINT8 netlist_sig_t;
//============================================================
// DEBUGGING
//============================================================
//#define fatalerror xxbreakme
#define NL_VERBOSE (0)
#define NL_KEEP_STATISTICS (0)
#define FATAL_ERROR_AFTER_NS (0) //(1000)
#if (NL_VERBOSE)
#define NL_VERBOSE_OUT(x) printf x
#else
#define NL_VERBOSE_OUT(x) do { } while (0)
#endif
//============================================================
// General Macros
//============================================================
#define HAS_OPENMP ( _OPENMP >= 200805 )
// prevent implicit copying
#define NETLIST_PREVENT_COPYING(_name) \
private: \
_name(const _name &); \
_name &operator=(const _name &);
#if defined(__GNUC__) && (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
#if !defined(__ppc__) && !defined (__PPC__) && !defined(__ppc64__) && !defined(__PPC64__)
#define ATTR_ALIGN __attribute__ ((aligned(128)))
#else
#define ATTR_ALIGN
#endif
#else
#define ATTR_ALIGN
#endif
//============================================================
// Performance tracking
//============================================================
#if NL_KEEP_STATISTICS
#define add_to_stat(v,x) do { v += (x); } while (0)
#define inc_stat(v) add_to_stat(v, 1)
#define begin_timing(v) do { (v) -= get_profile_ticks(); } while (0)
#define end_timing(v) do { (v) += get_profile_ticks(); } while (0)
#else
#define add_to_stat(v,x) do { } while (0)
#define inc_stat(v) add_to_stat(v, 1)
#define begin_timing(v) do { } while (0)
#define end_timing(v) do { } while (0)
#endif
//============================================================
// Performance tracking
//============================================================
// Compiling without mame ?
#ifndef ATTR_HOT
#warning ATTR_HOT not defined
#define ATTR_HOT
#endif
#ifndef ATTR_COLD
#define ATTR_COLD
#endif
//============================================================
// WARNINGS
//============================================================
#if (USE_OPENMP)
#if (!HAS_OPEN_MP)
#warning To use openmp compile and link with "-fopenmp"
#endif
#endif
#endif /* NLCONFIG_H_ */
|