42 {
"r0",
GROUP0 + 1024,
"org.gnu.gdb.or1k.group0",
NULL},
43 {
"r1",
GROUP0 + 1025,
"org.gnu.gdb.or1k.group0",
NULL},
44 {
"r2",
GROUP0 + 1026,
"org.gnu.gdb.or1k.group0",
NULL},
45 {
"r3",
GROUP0 + 1027,
"org.gnu.gdb.or1k.group0",
NULL},
46 {
"r4",
GROUP0 + 1028,
"org.gnu.gdb.or1k.group0",
NULL},
47 {
"r5",
GROUP0 + 1029,
"org.gnu.gdb.or1k.group0",
NULL},
48 {
"r6",
GROUP0 + 1030,
"org.gnu.gdb.or1k.group0",
NULL},
49 {
"r7",
GROUP0 + 1031,
"org.gnu.gdb.or1k.group0",
NULL},
50 {
"r8",
GROUP0 + 1032,
"org.gnu.gdb.or1k.group0",
NULL},
51 {
"r9",
GROUP0 + 1033,
"org.gnu.gdb.or1k.group0",
NULL},
52 {
"r10",
GROUP0 + 1034,
"org.gnu.gdb.or1k.group0",
NULL},
53 {
"r11",
GROUP0 + 1035,
"org.gnu.gdb.or1k.group0",
NULL},
54 {
"r12",
GROUP0 + 1036,
"org.gnu.gdb.or1k.group0",
NULL},
55 {
"r13",
GROUP0 + 1037,
"org.gnu.gdb.or1k.group0",
NULL},
56 {
"r14",
GROUP0 + 1038,
"org.gnu.gdb.or1k.group0",
NULL},
57 {
"r15",
GROUP0 + 1039,
"org.gnu.gdb.or1k.group0",
NULL},
58 {
"r16",
GROUP0 + 1040,
"org.gnu.gdb.or1k.group0",
NULL},
59 {
"r17",
GROUP0 + 1041,
"org.gnu.gdb.or1k.group0",
NULL},
60 {
"r18",
GROUP0 + 1042,
"org.gnu.gdb.or1k.group0",
NULL},
61 {
"r19",
GROUP0 + 1043,
"org.gnu.gdb.or1k.group0",
NULL},
62 {
"r20",
GROUP0 + 1044,
"org.gnu.gdb.or1k.group0",
NULL},
63 {
"r21",
GROUP0 + 1045,
"org.gnu.gdb.or1k.group0",
NULL},
64 {
"r22",
GROUP0 + 1046,
"org.gnu.gdb.or1k.group0",
NULL},
65 {
"r23",
GROUP0 + 1047,
"org.gnu.gdb.or1k.group0",
NULL},
66 {
"r24",
GROUP0 + 1048,
"org.gnu.gdb.or1k.group0",
NULL},
67 {
"r25",
GROUP0 + 1049,
"org.gnu.gdb.or1k.group0",
NULL},
68 {
"r26",
GROUP0 + 1050,
"org.gnu.gdb.or1k.group0",
NULL},
69 {
"r27",
GROUP0 + 1051,
"org.gnu.gdb.or1k.group0",
NULL},
70 {
"r28",
GROUP0 + 1052,
"org.gnu.gdb.or1k.group0",
NULL},
71 {
"r29",
GROUP0 + 1053,
"org.gnu.gdb.or1k.group0",
NULL},
72 {
"r30",
GROUP0 + 1054,
"org.gnu.gdb.or1k.group0",
NULL},
73 {
"r31",
GROUP0 + 1055,
"org.gnu.gdb.or1k.group0",
NULL},
74 {
"ppc",
GROUP0 + 18,
"org.gnu.gdb.or1k.group0",
NULL},
75 {
"npc",
GROUP0 + 16,
"org.gnu.gdb.or1k.group0",
NULL},
76 {
"sr",
GROUP0 + 17,
"org.gnu.gdb.or1k.group0",
NULL},
77 {
"vr",
GROUP0 + 0,
"org.gnu.gdb.or1k.group0",
"system"},
78 {
"upr",
GROUP0 + 1,
"org.gnu.gdb.or1k.group0",
"system"},
79 {
"cpucfgr",
GROUP0 + 2,
"org.gnu.gdb.or1k.group0",
"system"},
80 {
"dmmucfgr",
GROUP0 + 3,
"org.gnu.gdb.or1k.group0",
"system"},
81 {
"immucfgr",
GROUP0 + 4,
"org.gnu.gdb.or1k.group0",
"system"},
82 {
"dccfgr",
GROUP0 + 5,
"org.gnu.gdb.or1k.group0",
"system"},
83 {
"iccfgr",
GROUP0 + 6,
"org.gnu.gdb.or1k.group0",
"system"},
84 {
"dcfgr",
GROUP0 + 7,
"org.gnu.gdb.or1k.group0",
"system"},
85 {
"pccfgr",
GROUP0 + 8,
"org.gnu.gdb.or1k.group0",
"system"},
86 {
"fpcsr",
GROUP0 + 20,
"org.gnu.gdb.or1k.group0",
"system"},
87 {
"epcr0",
GROUP0 + 32,
"org.gnu.gdb.or1k.group0",
"system"},
88 {
"epcr1",
GROUP0 + 33,
"org.gnu.gdb.or1k.group0",
"system"},
89 {
"epcr2",
GROUP0 + 34,
"org.gnu.gdb.or1k.group0",
"system"},
90 {
"epcr3",
GROUP0 + 35,
"org.gnu.gdb.or1k.group0",
"system"},
91 {
"epcr4",
GROUP0 + 36,
"org.gnu.gdb.or1k.group0",
"system"},
92 {
"epcr5",
GROUP0 + 37,
"org.gnu.gdb.or1k.group0",
"system"},
93 {
"epcr6",
GROUP0 + 38,
"org.gnu.gdb.or1k.group0",
"system"},
94 {
"epcr7",
GROUP0 + 39,
"org.gnu.gdb.or1k.group0",
"system"},
95 {
"epcr8",
GROUP0 + 40,
"org.gnu.gdb.or1k.group0",
"system"},
96 {
"epcr9",
GROUP0 + 41,
"org.gnu.gdb.or1k.group0",
"system"},
97 {
"epcr10",
GROUP0 + 42,
"org.gnu.gdb.or1k.group0",
"system"},
98 {
"epcr11",
GROUP0 + 43,
"org.gnu.gdb.or1k.group0",
"system"},
99 {
"epcr12",
GROUP0 + 44,
"org.gnu.gdb.or1k.group0",
"system"},
100 {
"epcr13",
GROUP0 + 45,
"org.gnu.gdb.or1k.group0",
"system"},
101 {
"epcr14",
GROUP0 + 46,
"org.gnu.gdb.or1k.group0",
"system"},
102 {
"epcr15",
GROUP0 + 47,
"org.gnu.gdb.or1k.group0",
"system"},
103 {
"eear0",
GROUP0 + 48,
"org.gnu.gdb.or1k.group0",
"system"},
104 {
"eear1",
GROUP0 + 49,
"org.gnu.gdb.or1k.group0",
"system"},
105 {
"eear2",
GROUP0 + 50,
"org.gnu.gdb.or1k.group0",
"system"},
106 {
"eear3",
GROUP0 + 51,
"org.gnu.gdb.or1k.group0",
"system"},
107 {
"eear4",
GROUP0 + 52,
"org.gnu.gdb.or1k.group0",
"system"},
108 {
"eear5",
GROUP0 + 53,
"org.gnu.gdb.or1k.group0",
"system"},
109 {
"eear6",
GROUP0 + 54,
"org.gnu.gdb.or1k.group0",
"system"},
110 {
"eear7",
GROUP0 + 55,
"org.gnu.gdb.or1k.group0",
"system"},
111 {
"eear8",
GROUP0 + 56,
"org.gnu.gdb.or1k.group0",
"system"},
112 {
"eear9",
GROUP0 + 57,
"org.gnu.gdb.or1k.group0",
"system"},
113 {
"eear10",
GROUP0 + 58,
"org.gnu.gdb.or1k.group0",
"system"},
114 {
"eear11",
GROUP0 + 59,
"org.gnu.gdb.or1k.group0",
"system"},
115 {
"eear12",
GROUP0 + 60,
"org.gnu.gdb.or1k.group0",
"system"},
116 {
"eear13",
GROUP0 + 61,
"org.gnu.gdb.or1k.group0",
"system"},
117 {
"eear14",
GROUP0 + 62,
"org.gnu.gdb.or1k.group0",
"system"},
118 {
"eear15",
GROUP0 + 63,
"org.gnu.gdb.or1k.group0",
"system"},
119 {
"esr0",
GROUP0 + 64,
"org.gnu.gdb.or1k.group0",
"system"},
120 {
"esr1",
GROUP0 + 65,
"org.gnu.gdb.or1k.group0",
"system"},
121 {
"esr2",
GROUP0 + 66,
"org.gnu.gdb.or1k.group0",
"system"},
122 {
"esr3",
GROUP0 + 67,
"org.gnu.gdb.or1k.group0",
"system"},
123 {
"esr4",
GROUP0 + 68,
"org.gnu.gdb.or1k.group0",
"system"},
124 {
"esr5",
GROUP0 + 69,
"org.gnu.gdb.or1k.group0",
"system"},
125 {
"esr6",
GROUP0 + 70,
"org.gnu.gdb.or1k.group0",
"system"},
126 {
"esr7",
GROUP0 + 71,
"org.gnu.gdb.or1k.group0",
"system"},
127 {
"esr8",
GROUP0 + 72,
"org.gnu.gdb.or1k.group0",
"system"},
128 {
"esr9",
GROUP0 + 73,
"org.gnu.gdb.or1k.group0",
"system"},
129 {
"esr10",
GROUP0 + 74,
"org.gnu.gdb.or1k.group0",
"system"},
130 {
"esr11",
GROUP0 + 75,
"org.gnu.gdb.or1k.group0",
"system"},
131 {
"esr12",
GROUP0 + 76,
"org.gnu.gdb.or1k.group0",
"system"},
132 {
"esr13",
GROUP0 + 77,
"org.gnu.gdb.or1k.group0",
"system"},
133 {
"esr14",
GROUP0 + 78,
"org.gnu.gdb.or1k.group0",
"system"},
134 {
"esr15",
GROUP0 + 79,
"org.gnu.gdb.or1k.group0",
"system"},
136 {
"dmmuucr",
GROUP1 + 0,
"org.gnu.gdb.or1k.group1",
"dmmu"},
137 {
"dmmuupr",
GROUP1 + 1,
"org.gnu.gdb.or1k.group1",
"dmmu"},
138 {
"dtlbeir",
GROUP1 + 2,
"org.gnu.gdb.or1k.group1",
"dmmu"},
139 {
"datbmr0",
GROUP1 + 4,
"org.gnu.gdb.or1k.group1",
"dmmu"},
140 {
"datbmr1",
GROUP1 + 5,
"org.gnu.gdb.or1k.group1",
"dmmu"},
141 {
"datbmr2",
GROUP1 + 6,
"org.gnu.gdb.or1k.group1",
"dmmu"},
142 {
"datbmr3",
GROUP1 + 7,
"org.gnu.gdb.or1k.group1",
"dmmu"},
143 {
"datbtr0",
GROUP1 + 8,
"org.gnu.gdb.or1k.group1",
"dmmu"},
144 {
"datbtr1",
GROUP1 + 9,
"org.gnu.gdb.or1k.group1",
"dmmu"},
145 {
"datbtr2",
GROUP1 + 10,
"org.gnu.gdb.or1k.group1",
"dmmu"},
146 {
"datbtr3",
GROUP1 + 11,
"org.gnu.gdb.or1k.group1",
"dmmu"},
148 {
"immucr",
GROUP2 + 0,
"org.gnu.gdb.or1k.group2",
"immu"},
149 {
"immupr",
GROUP2 + 1,
"org.gnu.gdb.or1k.group2",
"immu"},
150 {
"itlbeir",
GROUP2 + 2,
"org.gnu.gdb.or1k.group2",
"immu"},
151 {
"iatbmr0",
GROUP2 + 4,
"org.gnu.gdb.or1k.group2",
"immu"},
152 {
"iatbmr1",
GROUP2 + 5,
"org.gnu.gdb.or1k.group2",
"immu"},
153 {
"iatbmr2",
GROUP2 + 6,
"org.gnu.gdb.or1k.group2",
"immu"},
154 {
"iatbmr3",
GROUP2 + 7,
"org.gnu.gdb.or1k.group2",
"immu"},
155 {
"iatbtr0",
GROUP2 + 8,
"org.gnu.gdb.or1k.group2",
"immu"},
156 {
"iatbtr1",
GROUP2 + 9,
"org.gnu.gdb.or1k.group2",
"immu"},
157 {
"iatbtr2",
GROUP2 + 10,
"org.gnu.gdb.or1k.group2",
"immu"},
158 {
"iatbtr3",
GROUP2 + 11,
"org.gnu.gdb.or1k.group2",
"immu"},
160 {
"dccr",
GROUP3 + 0,
"org.gnu.gdb.or1k.group3",
"dcache"},
161 {
"dcbpr",
GROUP3 + 1,
"org.gnu.gdb.or1k.group3",
"dcache"},
162 {
"dcbfr",
GROUP3 + 2,
"org.gnu.gdb.or1k.group3",
"dcache"},
163 {
"dcbir",
GROUP3 + 3,
"org.gnu.gdb.or1k.group3",
"dcache"},
164 {
"dcbwr",
GROUP3 + 4,
"org.gnu.gdb.or1k.group3",
"dcache"},
165 {
"dcblr",
GROUP3 + 5,
"org.gnu.gdb.or1k.group3",
"dcache"},
167 {
"iccr",
GROUP4 + 0,
"org.gnu.gdb.or1k.group4",
"icache"},
168 {
"icbpr",
GROUP4 + 1,
"org.gnu.gdb.or1k.group4",
"icache"},
169 {
"icbir",
GROUP4 + 2,
"org.gnu.gdb.or1k.group4",
"icache"},
170 {
"icblr",
GROUP4 + 3,
"org.gnu.gdb.or1k.group4",
"icache"},
172 {
"maclo",
GROUP5 + 0,
"org.gnu.gdb.or1k.group5",
"mac"},
173 {
"machi",
GROUP5 + 1,
"org.gnu.gdb.or1k.group5",
"mac"},
175 {
"dvr0",
GROUP6 + 0,
"org.gnu.gdb.or1k.group6",
"debug"},
176 {
"dvr1",
GROUP6 + 1,
"org.gnu.gdb.or1k.group6",
"debug"},
177 {
"dvr2",
GROUP6 + 2,
"org.gnu.gdb.or1k.group6",
"debug"},
178 {
"dvr3",
GROUP6 + 3,
"org.gnu.gdb.or1k.group6",
"debug"},
179 {
"dvr4",
GROUP6 + 4,
"org.gnu.gdb.or1k.group6",
"debug"},
180 {
"dvr5",
GROUP6 + 5,
"org.gnu.gdb.or1k.group6",
"debug"},
181 {
"dvr6",
GROUP6 + 6,
"org.gnu.gdb.or1k.group6",
"debug"},
182 {
"dvr7",
GROUP6 + 7,
"org.gnu.gdb.or1k.group6",
"debug"},
183 {
"dcr0",
GROUP6 + 8,
"org.gnu.gdb.or1k.group6",
"debug"},
184 {
"dcr1",
GROUP6 + 9,
"org.gnu.gdb.or1k.group6",
"debug"},
185 {
"dcr2",
GROUP6 + 10,
"org.gnu.gdb.or1k.group6",
"debug"},
186 {
"dcr3",
GROUP6 + 11,
"org.gnu.gdb.or1k.group6",
"debug"},
187 {
"dcr4",
GROUP6 + 12,
"org.gnu.gdb.or1k.group6",
"debug"},
188 {
"dcr5",
GROUP6 + 13,
"org.gnu.gdb.or1k.group6",
"debug"},
189 {
"dcr6",
GROUP6 + 14,
"org.gnu.gdb.or1k.group6",
"debug"},
190 {
"dcr7",
GROUP6 + 15,
"org.gnu.gdb.or1k.group6",
"debug"},
191 {
"dmr1",
GROUP6 + 16,
"org.gnu.gdb.or1k.group6",
"debug"},
192 {
"dmr2",
GROUP6 + 17,
"org.gnu.gdb.or1k.group6",
"debug"},
193 {
"dcwr0",
GROUP6 + 18,
"org.gnu.gdb.or1k.group6",
"debug"},
194 {
"dcwr1",
GROUP6 + 19,
"org.gnu.gdb.or1k.group6",
"debug"},
195 {
"dsr",
GROUP6 + 20,
"org.gnu.gdb.or1k.group6",
"debug"},
196 {
"drr",
GROUP6 + 21,
"org.gnu.gdb.or1k.group6",
"debug"},
198 {
"pccr0",
GROUP7 + 0,
"org.gnu.gdb.or1k.group7",
"perf"},
199 {
"pccr1",
GROUP7 + 1,
"org.gnu.gdb.or1k.group7",
"perf"},
200 {
"pccr2",
GROUP7 + 2,
"org.gnu.gdb.or1k.group7",
"perf"},
201 {
"pccr3",
GROUP7 + 3,
"org.gnu.gdb.or1k.group7",
"perf"},
202 {
"pccr4",
GROUP7 + 4,
"org.gnu.gdb.or1k.group7",
"perf"},
203 {
"pccr5",
GROUP7 + 5,
"org.gnu.gdb.or1k.group7",
"perf"},
204 {
"pccr6",
GROUP7 + 6,
"org.gnu.gdb.or1k.group7",
"perf"},
205 {
"pccr7",
GROUP7 + 7,
"org.gnu.gdb.or1k.group7",
"perf"},
206 {
"pcmr0",
GROUP7 + 8,
"org.gnu.gdb.or1k.group7",
"perf"},
207 {
"pcmr1",
GROUP7 + 9,
"org.gnu.gdb.or1k.group7",
"perf"},
208 {
"pcmr2",
GROUP7 + 10,
"org.gnu.gdb.or1k.group7",
"perf"},
209 {
"pcmr3",
GROUP7 + 11,
"org.gnu.gdb.or1k.group7",
"perf"},
210 {
"pcmr4",
GROUP7 + 12,
"org.gnu.gdb.or1k.group7",
"perf"},
211 {
"pcmr5",
GROUP7 + 13,
"org.gnu.gdb.or1k.group7",
"perf"},
212 {
"pcmr6",
GROUP7 + 14,
"org.gnu.gdb.or1k.group7",
"perf"},
213 {
"pcmr7",
GROUP7 + 15,
"org.gnu.gdb.or1k.group7",
"perf"},
215 {
"pmr",
GROUP8 + 0,
"org.gnu.gdb.or1k.group8",
"power"},
217 {
"picmr",
GROUP9 + 0,
"org.gnu.gdb.or1k.group9",
"pic"},
218 {
"picsr",
GROUP9 + 2,
"org.gnu.gdb.or1k.group9",
"pic"},
220 {
"ttmr",
GROUP10 + 0,
"org.gnu.gdb.or1k.group10",
"timer"},
221 {
"ttcr",
GROUP10 + 1,
"org.gnu.gdb.or1k.group10",
"timer"},
268 for (
int way = 0; way < 4; way++) {
269 for (
int i = 0; i < 128; i++) {
271 sprintf(
name,
"dtlbw%dmr%d", way, i);
274 new_reg.
feature =
"org.gnu.gdb.or1k.group1";
275 new_reg.
group =
"dmmu";
278 sprintf(
name,
"dtlbw%dtr%d", way, i);
281 new_reg.
feature =
"org.gnu.gdb.or1k.group1";
282 new_reg.
group =
"dmmu";
286 sprintf(
name,
"itlbw%dmr%d", way, i);
289 new_reg.
feature =
"org.gnu.gdb.or1k.group2";
290 new_reg.
group =
"immu";
294 sprintf(
name,
"itlbw%dtr%d", way, i);
297 new_reg.
feature =
"org.gnu.gdb.or1k.group2";
298 new_reg.
group =
"immu";
346 }
else if (!regs_read) {
381 LOG_ERROR(
"Error while restoring context");
393 LOG_ERROR(
"Error while restoring context");
409 if ((num < 0) || (num >= or1k->
nb_regs))
415 LOG_DEBUG(
"Read core reg %i value 0x%08" PRIx32, num, reg_value);
427 LOG_DEBUG(
"Read spr reg %i value 0x%08" PRIx32, num, reg_value);
444 LOG_DEBUG(
"Write core reg %i value 0x%08" PRIx32, num, reg_value);
504 struct reg *reg_list = calloc(or1k->
nb_regs,
sizeof(
struct reg));
512 cache->
name =
"OpenRISC 1000 registers";
520 for (
int i = 0; i < or1k->
nb_regs; i++) {
531 reg_list[i].
size = 32;
532 reg_list[i].
value = calloc(1, 4);
533 reg_list[i].
dirty =
false;
534 reg_list[i].
valid =
false;
538 reg_list[i].
exist =
true;
550 LOG_ERROR(
"Error while calling or1k_save_context");
579 LOG_WARNING(
"Target was in unknown state when halt was requested");
584 LOG_ERROR(
"Can't request a halt while in reset if nSRST pulls nTRST");
594 LOG_ERROR(
"Impossible to stall the CPU");
609 const int RETRIES_MAX = 5;
615 while (tries < RETRIES_MAX) {
621 LOG_WARNING(
"Debug IF CPU control reg read failure.");
624 LOG_WARNING(
"Resetting JTAG TAP state and reconnecting to debug IF.");
627 LOG_WARNING(
"...attempt %d of %d", tries, RETRIES_MAX);
636 LOG_ERROR(
"Could not re-establish communication with target");
647 LOG_ERROR(
"Error while calling or1k_is_cpu_running");
661 LOG_ERROR(
"Error while calling or1k_debug_entry");
672 LOG_ERROR(
"Error while calling or1k_debug_entry");
688 LOG_ERROR(
"Error while calling or1k_halt");
694 LOG_ERROR(
"Error while calling or1k_debug_entry");
718 LOG_ERROR(
"Error while asserting RESET");
734 LOG_ERROR(
"Error while deasserting RESET");
750 LOG_ERROR(
"Error while stalling the CPU");
779 uint32_t
address,
int handle_breakpoints,
780 int debug_execution,
int step)
788 LOG_DEBUG(
"Addr: 0x%" PRIx32
", stepping: %s, handle breakpoints %s\n",
789 address,
step ?
"yes" :
"no", handle_breakpoints ?
"yes" :
"no");
796 if (!debug_execution)
806 LOG_ERROR(
"Error while calling or1k_restore_context");
814 LOG_ERROR(
"Error while reading debug registers");
841 LOG_ERROR(
"Error while writing back debug registers");
849 if (handle_breakpoints) {
863 LOG_ERROR(
"Error while unstalling the CPU");
875 if (!debug_execution) {
878 LOG_DEBUG(
"Target resumed at 0x%08" PRIx32, resume_pc);
882 LOG_DEBUG(
"Target debug resumed at 0x%08" PRIx32, resume_pc);
921 LOG_ERROR(
"HW breakpoints not supported for now. Doing SW breakpoint.");
941 uint8_t or1k_trap_insn[4];
960 LOG_ERROR(
"Error while invalidating the ICACHE");
979 LOG_ERROR(
"HW breakpoints not supported for now. Doing SW breakpoint.");
999 LOG_ERROR(
"Error while invalidating the ICACHE");
1009 LOG_ERROR(
"%s: implement me", __func__);
1016 LOG_ERROR(
"%s: implement me", __func__);
1039 if (((
size == 4) && (address & 0x3u)) || ((
size == 2) && (address & 0x1u))) {
1040 LOG_ERROR(
"Can't handle unaligned memory access");
1066 if (((
size == 4) && (address & 0x3u)) || ((
size == 2) && (address & 0x1u))) {
1067 LOG_ERROR(
"Can't handle unaligned memory access");
1134 LOG_ERROR(
"Couldn't read the CPU state");
1171 LOG_ERROR(
"Error while calling or1k_save_context");
1176 *reg_list = malloc((*reg_list_size) *
sizeof(
struct reg *));
1181 *reg_list_size = or1k->
nb_regs;
1182 *reg_list = malloc((*reg_list_size) *
sizeof(
struct reg *));
1184 for (
int i = 0; i < or1k->
nb_regs; i++)
1198 uint32_t
count, uint32_t *checksum)
1204 uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
1214 LOG_INFO(
"Starting or1k profiling. Sampling npc as fast as we can...");
1222 LOG_ERROR(
"Error while resuming target");
1226 uint32_t sample_count = 0;
1236 samples[sample_count++] = reg_value;
1240 LOG_INFO(
"Profiling completed. %" PRIu32
" samples.", sample_count);
1245 *num_samples = sample_count;
1260 if (or1k_tap->
name) {
1308 LOG_INFO(
"Option %x is passed to %s debug unit"
1357 LOG_DEBUG(
"Add reg \"%s\" @ 0x%08" PRIx32
", group \"%s\", feature \"%s\"",
1365 .
name =
"tap_select",
1366 .handler = or1k_tap_select_command_handler,
1369 .help =
"Select the TAP core to use",
1373 .handler = or1k_tap_list_command_handler,
1376 .help =
"Display available TAP core",
1379 .name =
"du_select",
1380 .handler = or1k_du_select_command_handler,
1383 .help =
"Select the Debug Unit core to use",
1387 .handler = or1k_du_list_command_handler,
1389 .usage =
"select_tap name",
1390 .help =
"Display available Debug Unit core",
1398 .handler = or1k_addreg_command_handler,
1400 .usage =
"name addr feature group",
1401 .help =
"Add a register to the register list",
1423 .target_request_data =
NULL,
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned first, unsigned num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static void buf_set_u32(uint8_t *_buffer, unsigned first, unsigned num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
struct breakpoint * breakpoint_find(struct target *target, target_addr_t address)
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
enum reset_types jtag_get_reset_config(void)
The JTAG interface can be implemented with a software or hardware fifo.
static const struct @101 regs[]
#define list_for_each_entry(pos, head, member)
list_for_each_entry - iterate over list of given type
void alive_sleep(uint64_t ms)
#define LOG_WARNING(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
static int or1k_set_core_reg(struct reg *reg, uint8_t *buf)
static int or1k_arch_state(struct target *target)
static int or1k_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int or1k_save_context(struct target *target)
static int or1k_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
static int or1k_resume_or_step(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution, int step)
static int or1k_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int or1k_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int or1k_jtag_write_regs(struct or1k_common *or1k, uint32_t *regs)
static const struct reg_arch_type or1k_reg_type
static int or1k_jtag_read_regs(struct or1k_common *or1k, uint32_t *regs)
static int or1k_debug_entry(struct target *target)
struct target_type or1k_target
static int or1k_add_reg(struct target *target, struct or1k_core_reg *new_reg)
static int or1k_examine(struct target *target)
static int or1k_soft_reset_halt(struct target *target)
static int or1k_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fileio_info)
static int or1k_get_core_reg(struct reg *reg)
static int or1k_target_create(struct target *target, Jim_Interp *interp)
static int or1k_deassert_reset(struct target *target)
static int or1k_assert_reset(struct target *target)
static const struct command_registration or1k_command_handlers[]
static int or1k_create_reg_list(struct target *target)
static int or1k_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
static int or1k_is_cpu_running(struct target *target, int *running)
static int or1k_poll(struct target *target)
static const struct command_registration or1k_reg_command_handlers[]
static int or1k_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
static const struct or1k_core_reg_init or1k_init_reg_list[]
static struct reg_cache * or1k_build_reg_cache(struct target *target)
static int or1k_halt(struct target *target)
static const struct command_registration or1k_hw_ip_command_handlers[]
static int or1k_read_core_reg(struct target *target, int num)
static int or1k_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int or1k_restore_context(struct target *target)
static struct or1k_core_reg * or1k_core_reg_list_arch_info
static bool is_any_soft_breakpoint(struct target *target)
static int or1k_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
static int or1k_write_core_reg(struct target *target, int num)
COMMAND_HANDLER(or1k_tap_select_command_handler)
static int or1k_init_target(struct command_context *cmd_ctx, struct target *target)
static int or1k_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int or1k_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
static int or1k_profiling(struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
#define OR1K_DMR1_CPU_REG_ADD
#define OR1K_ICBIR_CPU_REG_ADD
static struct or1k_common * target_to_or1k(struct target *target)
static struct or1k_du * or1k_jtag_to_du(struct or1k_jtag *jtag_info)
int or1k_du_adv_register(void)
static struct or1k_du * or1k_to_du(struct or1k_common *or1k)
struct list_head tap_list
int or1k_tap_xilinx_bscan_register(void)
int or1k_tap_mohor_register(void)
int or1k_tap_vjtag_register(void)
struct reg_cache ** register_get_last_cache_p(struct reg_cache **first)
void register_cache_invalidate(struct reg_cache *cache)
Marks the contents of the register cache as invalid (and clean).
int gettimeofday(struct timeval *tv, struct timezone *tz)
static int step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
size_t size
Size of the control block search area.
enum breakpoint_type type
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
uint32_t core_regs[OR1KNUMCOREREGS]
struct or1k_core_reg * arch_info
struct reg_cache * core_cache
struct or1k_common * or1k_common
int(* or1k_jtag_write_cpu)(struct or1k_jtag *jtag_info, uint32_t addr, int count, const uint32_t *value)
int(* or1k_jtag_init)(struct or1k_jtag *jtag_info)
int(* or1k_jtag_read_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size, int count, uint8_t *buffer)
int(* or1k_is_cpu_running)(struct or1k_jtag *jtag_info, int *running)
int(* or1k_jtag_write_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size, int count, const uint8_t *buffer)
int(* or1k_cpu_stall)(struct or1k_jtag *jtag_info, int action)
int(* or1k_jtag_read_cpu)(struct or1k_jtag *jtag_info, uint32_t addr, int count, uint32_t *value)
int(* or1k_cpu_reset)(struct or1k_jtag *jtag_info, int action)
int or1k_jtag_module_selected
struct or1k_tap_ip * tap_ip
int(* get)(struct reg *reg)
struct reg_feature * feature
const struct reg_arch_type * type
This holds methods shared between all instances of a given target type.
const char * name
Name of this type of target.
enum target_debug_reason debug_reason
struct reg_cache * reg_cache
struct breakpoint * breakpoints
int target_call_event_callbacks(struct target *target, enum target_event event)
void target_free_all_working_areas(struct target *target)
const char * target_state_name(struct target *t)
Return the name of this targets current state.
void target_buffer_set_u32(struct target *target, uint8_t *buffer, uint32_t value)
int target_poll(struct target *target)
struct target * get_current_target(struct command_context *cmd_ctx)
int target_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Make the target (re)start executing using its saved execution context (possibly with some modificatio...
#define ERROR_TARGET_NOT_HALTED
#define ERROR_TARGET_UNALIGNED_ACCESS
@ TARGET_EVENT_DEBUG_RESUMED
@ TARGET_EVENT_DEBUG_HALTED
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
static bool target_was_examined(struct target *target)
#define ERROR_TARGET_FAILURE
int timeval_compare(const struct timeval *x, const struct timeval *y)
int timeval_add_time(struct timeval *result, long sec, long usec)
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
#define CPU_RESET
Value to write into CPUCS to put EZ-USB into reset.