]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/tic80/cpu.h
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
5 This file is part of GDB, the GNU debugger.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
30 #define GPR(N) ((CPU)->reg[N])
31 #define ACC(N) ((CPU)->acc[N])
33 #if defined(WITH_TRACE)
34 extern char *tic80_trace_alu3
PARAMS ((int, unsigned32
, unsigned32
, unsigned32
));
35 extern char *tic80_trace_alu2
PARAMS ((int, unsigned32
, unsigned32
));
36 extern char *tic80_trace_nop
PARAMS ((int));
37 extern char *tic80_trace_sink1
PARAMS ((int, unsigned32
));
38 extern char *tic80_trace_sink2
PARAMS ((int, unsigned32
, unsigned32
));
39 extern char *tic80_trace_cond_br
PARAMS ((int, int, unsigned32
, unsigned32
));
40 extern char *tic80_trace_ucond_br
PARAMS ((int, unsigned32
));
41 extern char *tic80_trace_ldst
PARAMS ((int, int, int, int, unsigned32
, unsigned32
, unsigned32
));
43 #define TRACE_ALU3(indx, result, input1, input2) \
45 if (TRACE_ALU_P (CPU)) { \
46 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
47 itable[indx].line_nr, "alu", \
48 tic80_trace_alu3 (indx, result, input1, input2)); \
52 #define TRACE_ALU2(indx, result, input) \
54 if (TRACE_ALU_P (CPU)) { \
55 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
56 itable[indx].line_nr, "alu", \
57 tic80_trace_alu2 (indx, result, input)); \
61 #define TRACE_NOP(indx) \
63 if (TRACE_ALU_P (CPU)) { \
64 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
65 itable[indx].line_nr, "nop", \
66 tic80_trace_nop (indx)); \
70 #define TRACE_SINK1(indx, input) \
72 if (TRACE_ALU_P (CPU)) { \
73 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
74 itable[indx].line_nr, "nop", \
75 tic80_trace_sink1 (indx, input)); \
79 #define TRACE_SINK2(indx, input1, input2) \
81 if (TRACE_ALU_P (CPU)) { \
82 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
83 itable[indx].line_nr, "nop", \
84 tic80_trace_sink2 (indx, input1, input2)); \
88 #define TRACE_COND_BR(indx, jump_p, cond, target) \
90 if (TRACE_BRANCH_P (CPU)) { \
91 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
92 itable[indx].line_nr, "branch", \
93 tic80_trace_cond_br (indx, jump_p, cond, target)); \
97 #define TRACE_UCOND_BR(indx, target) \
99 if (TRACE_ALU_P (CPU)) { \
100 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
101 itable[indx].line_nr, "branch", \
102 tic80_trace_ucond_br (indx, target)); \
106 #define TRACE_LD(indx, result, m, s, addr1, addr2) \
108 if (TRACE_MEMORY_P (CPU)) { \
109 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
110 itable[indx].line_nr, "memory", \
111 tic80_trace_ldst (indx, 0, m, s, result, \
116 #define TRACE_ST(indx, value, m, s, addr1, addr2) \
118 if (TRACE_MEMORY_P (CPU)) { \
119 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
120 itable[indx].line_nr, "memory", \
121 tic80_trace_ldst (indx, 1, m, s, value, \
127 #define TRACE_ALU3(indx, result, input1, input2)
128 #define TRACE_ALU2(indx, result, input)
129 #define TRACE_NOP(indx)
130 #define TRACE_SINK1(indx, input)
131 #define TRACE_SINK2(indx, input1, input2)
132 #define TRACE_COND_BR(indx, jump_p, cond, target)
133 #define TRACE_UCOND_BR(indx, target)
134 #define TRACE_LD(indx, m, s, result, addr1, addr2)
135 #define TRACE_ST(indx, m, s, value, addr1, addr2)