1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 extern DEVICE scu_dev;
23
24 #ifdef SPEED
25 # define if_sim_debug(dbits, dptr) if ((0))
26 #else
27 # define if_sim_debug(dbits, dptr) \
28 if ( \
29 sim_deb && \
30 (((dptr)->dctrl & (dbits)) || (dbits) == 0) && \
31 ((dptr != & cpu_dev) || ((1 << current_running_cpu_idx) & dbgCPUMask)) && \
32 ((dptr != & cpu_dev) || (((dptr)->dctrl & (DBG_INTR | DBG_FAULT))) || (! sim_deb_segno_on) || sim_deb_segno[cpu.PPR.PSR & (DEBUG_SEGNO_LIMIT - 1)]) && \
33 ((dptr != & cpu_dev) || sim_deb_ringno == NO_SUCH_RINGNO || sim_deb_ringno == cpu . PPR. PRR) && \
34 ((dptr != & cpu_dev) || (! sim_deb_bar) || (! TST_I_NBAR)) && \
35 cpu.cycleCnt >= sim_deb_start && \
36 (sim_deb_stop == 0 || cpu.cycleCnt < sim_deb_stop) && \
37 (sim_deb_mme_cntdwn == 0) && \
38 ((dptr != & cpu_dev) | (((dbits) & DBG_TRACE) ? (sim_deb_skip_cnt ++ >= sim_deb_skip_limit) : (sim_deb_skip_cnt >= sim_deb_skip_limit))) \
39 )
40 #endif
41
42 #if !defined(THREADZ) && !defined(LOCKLESS)
43 # define dps8_sim_debug _sim_debug
44 #endif
45
46 #undef sim_debug
47 #if defined(THREADZ) || defined(LOCKLESS)
48 # define sim_debug(dbits, dptr, ...) \
49 if_sim_debug((dbits), dptr) \
50 dps8_sim_debug ((dbits), dptr, DBG_CTR, __VA_ARGS__); \
51 else \
52 (void) 0
53 #else
54 # define sim_debug(dbits, dptr, ...) \
55 if_sim_debug((dbits), dptr) \
56 dps8_sim_debug ((dbits), dptr, __VA_ARGS__); \
57 else \
58 (void) 0
59 #endif
60
61
62
63 #define DBG_TRACE (1U << 0)
64 #define DBG_MSG (1U << 1)
65
66 #define DBG_REGDUMPAQI (1U << 2)
67 #define DBG_REGDUMPIDX (1U << 3)
68 #define DBG_REGDUMPPR (1U << 4)
69
70 #define DBG_REGDUMPPPR (1U << 6)
71 #define DBG_REGDUMPDSBR (1U << 7)
72 #define DBG_REGDUMPFLT (1U << 8)
73
74
75
76 #define DBG_REGDUMP (DBG_REGDUMPAQI | DBG_REGDUMPIDX | DBG_REGDUMPPR | \
77 DBG_REGDUMPPPR | DBG_REGDUMPDSBR | DBG_REGDUMPFLT)
78
79 #define DBG_ADDRMOD (1U << 9)
80 #define DBG_APPENDING (1U << 10)
81 #define DBG_TRACEEXT (1U << 11)
82 #define DBG_WARN (1U << 12)
83 #define DBG_DEBUG (1U << 13)
84 #define DBG_INFO (1U << 14)
85 #define DBG_NOTIFY (1U << 15)
86 #define DBG_SIM_USES_16 (1U << 16)
87 #define DBG_SIM_USES_17 (1U << 17)
88 #define DBG_SIM_USES_18 (1U << 18)
89 #define DBG_ERR (1U << 19)
90 #define DBG_ALL (DBG_NOTIFY | DBG_INFO | DBG_ERR | DBG_DEBUG | DBG_WARN | \
91 DBG_ERR | DBG_TRACE )
92 #define DBG_FAULT (1U << 20)
93 #define DBG_INTR (1U << 21)
94 #define DBG_CORE (1U << 22)
95 #define DBG_CYCLE (1U << 23)
96 #define DBG_CAC (1U << 24)
97 #define DBG_FINAL (1U << 25)
98 #define DBG_AVC (1U << 26)
99
100
101
102
103
104
105
106
107
108 #define STOP_STOP 1
109 #define STOP_BKPT 2
110
111
112 #define CONT_TRA -1
113 #define CONT_DIS -2
114 #define CONT_XEC -3
115 #define CONT_RET -5
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 #define MTAB_unit_value MTAB_XTD | MTAB_VUN | MTAB_VDV | MTAB_NMO | MTAB_VALR
131
132 #define MTAB_unitonly_value MTAB_XTD | MTAB_VUN | MTAB_NMO | MTAB_VALR
133
134 #define MTAB_unit_value_show MTAB_XTD | MTAB_VUN | MTAB_VDV | MTAB_VALR
135
136 #define MTAB_dev_valr_noshow MTAB_XTD | MTAB_VDV | MTAB_NMO | MTAB_VALR
137
138 #define MTAB_dev_valr_nouc MTAB_XTD | MTAB_VDV | MTAB_NMO | MTAB_VALR | MTAB_NC
139
140 #define MTAB_dev_value MTAB_XTD | MTAB_VDV | MTAB_NMO | MTAB_VALR
141
142 #define MTAB_dev_novalue MTAB_XTD | MTAB_VDV
143
144 #define MTAB_unit_valr_nouc MTAB_XTD | MTAB_VUN | MTAB_VALR | MTAB_NC
145
146 #define MTAB_unit_nouc MTAB_XTD | MTAB_VUN | MTAB_NC
147
148 #define MTAB_unit_uc MTAB_XTD | MTAB_VUN
149
150 #define MTAB_dev_valr MTAB_XTD | MTAB_VDV | MTAB_VALR
151
152 #define MTAB_eol { 0, 0, NULL, NULL, 0, 0, NULL, NULL }
153
154 extern uint32 sim_brk_summ, sim_brk_types, sim_brk_dflt;
155 extern FILE *sim_deb;
156 void sim_printf( const char * format, ... );
157
158 #if defined(THREADZ) || defined(LOCKLESS)
159 void dps8_sim_debug (uint32 dbits, DEVICE* dptr, unsigned long long cnt, const char* fmt, ...);
160
161 #endif
162 #define sim_msg sim_printf
163 #define sim_warn sim_printf
164 #define sim_print sim_printf