Skip to content

Commit feeb15c

Browse files
author
wangyanwen
committed
src/riscv:Update batch debug msg
Change-Id: Ic40f17054c3bc9503fa4e550c561c44b0fed74a1 Signed-off-by: wangyanwen <[email protected]>
1 parent 494eca1 commit feeb15c

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

src/target/riscv/batch.c

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,26 @@ static void log_batch(const struct riscv_batch *batch, size_t start_idx,
223223

224224
/* Decode and log every executed scan */
225225
for (size_t i = start_idx; i < batch->used_scans; ++i) {
226-
static const char * const op_string[] = {"-", "r", "w", "?"};
226+
static const char * const dmr_string[] = {
227+
"nop", "nop", "nop", "nop",
228+
"data0", "data1", "data2", "data3",
229+
"data4", "data5", "data6", "data7",
230+
"data8", "data9", "data10", "data11",
231+
"dmcontrol", "dmstatus", "hartinfo", "haltsum1",
232+
"hawindowsel", "hawindow", "abstractcs", "command",
233+
"abstractauto", "confstrptr0", "confstrptr1", "confstrptr2",
234+
"confstrptr3", "nextdm", "nop", "nop",
235+
"progbuf0", "progbuf1", "progbuf2", "progbuf3",
236+
"progbuf4", "progbuf5", "progbuf6", "progbuf7",
237+
"progbuf8", "progbuf9", "progbuf10", "progbuf11",
238+
"progbuf12", "progbuf13", "progbuf14", "progbuf15",
239+
"authdata0", "authdata1", "nop", "nop",
240+
"haltsum2", "haltsum3", "nop", "sbaddress3",
241+
"sbcs", "sbaddress0", "sbaddress1", "sbaddress2",
242+
"sbdata0", "sbdata1", "sbdata2", "sbdata3",
243+
"haltsum0"
244+
};
245+
static const char * const op_string[] = {"nop", "read", "write", "reserved"};
227246
const int delay = get_delay(batch, i, delays, resets_delays,
228247
reset_delays_after);
229248
const struct scan_field * const field = &batch->fields[i];
@@ -237,7 +256,7 @@ static void log_batch(const struct riscv_batch *batch, size_t start_idx,
237256
DTM_DMI_ADDRESS_OFFSET, abits);
238257
if (field->in_value) {
239258
static const char * const status_string[] = {
240-
"+", "?", "F", "b"
259+
"success", "reserved", "failed", "busy"
241260
};
242261
const unsigned int in_op = buf_get_u32(field->in_value,
243262
DTM_DMI_OP_OFFSET, DTM_DMI_OP_LENGTH);
@@ -246,17 +265,16 @@ static void log_batch(const struct riscv_batch *batch, size_t start_idx,
246265
const uint32_t in_address = buf_get_u32(field->in_value,
247266
DTM_DMI_ADDRESS_OFFSET, abits);
248267

249-
LOG_DEBUG("%db %s %08" PRIx32 " @%02" PRIx32
250-
" -> %s %08" PRIx32 " @%02" PRIx32 "; %di",
251-
field->num_bits, op_string[out_op], out_data, out_address,
252-
status_string[in_op], in_data, in_address, delay);
268+
LOG_DEBUG("%db %s 0x%08" PRIx32 " @%s -> %s 0x%08" PRIx32 " @%s; %di",
269+
field->num_bits, op_string[out_op], out_data, dmr_string[out_address],
270+
status_string[in_op], in_data, dmr_string[in_address], delay);
253271

254272
if (last_scan_was_read && in_op == DTM_DMI_OP_SUCCESS)
255273
log_dmi_decoded(batch, /*write*/ false,
256274
last_scan_address, in_data);
257275
} else {
258-
LOG_DEBUG("%db %s %08" PRIx32 " @%02" PRIx32 " -> ?; %di",
259-
field->num_bits, op_string[out_op], out_data, out_address,
276+
LOG_DEBUG("%db %s 0x%08" PRIx32 " @%s -> ?; %di",
277+
field->num_bits, op_string[out_op], out_data, dmr_string[out_address],
260278
delay);
261279
}
262280

0 commit comments

Comments
 (0)