summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/netlist/nl_config.h
blob: fd729d5c2172f98efba585d80eba60ee52ae153b (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
// 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
//============================================================

#define USE_DELEGATES           (0)
/*
 * The next options needs -Wno-pmf-conversions to compile and gcc
 * This is intended for non-mame usage.
 *
 */
#define USE_PMFDELEGATES        (0)

// Next if enabled adds 20% performance ... but is not guaranteed to be absolutely timing correct.
#define USE_DEACTIVE_DEVICE     (0)

#define OUTPUT_MAX_CONNECTIONS  (48)

// Use nano-second resolution - Sufficient for now
#define NETLIST_INTERNAL_RES        (U64(1000000000))
#define NETLIST_DIV_BITS            (0)
//#define NETLIST_INTERNAL_RES      (U64(1000000000000))
//#define NETLIST_DIV_BITS          (10)
#define NETLIST_DIV                 (U64(1) << NETLIST_DIV_BITS)
#define NETLIST_MASK                (NETLIST_DIV-1)
#define NETLIST_CLOCK               (NETLIST_INTERNAL_RES / NETLIST_DIV)

#define NETLIST_HIGHIMP_V   (1.23456e20)        /* some voltage we should never see */

typedef UINT8 netlist_sig_t;

/* FIXME: We need a different solution to output delegates !
 * More something like a callback object
 */

typedef delegate<void (const double)> netlist_output_delegate;

//============================================================
//  DEBUGGING
//============================================================

#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)
#endif

//============================================================
//  MACROS
//============================================================

#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

// Compiling without mame ?

#ifndef ATTR_HOT
#warning ATTR_HOT not defined
#define ATTR_HOT
#endif

#ifndef ATTR_COLD
#define ATTR_COLD
#endif

#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


#endif /* NLCONFIG_H_ */