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