From feeb15cea65ac9bbe7021df0e438655d3e0667b8 Mon Sep 17 00:00:00 2001 From: wangyanwen Date: Wed, 19 Feb 2025 10:10:57 +0800 Subject: [PATCH] src/riscv:Update batch debug msg Change-Id: Ic40f17054c3bc9503fa4e550c561c44b0fed74a1 Signed-off-by: wangyanwen --- src/target/riscv/batch.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/target/riscv/batch.c b/src/target/riscv/batch.c index 4de81a0de..615cbd4bf 100644 --- a/src/target/riscv/batch.c +++ b/src/target/riscv/batch.c @@ -223,7 +223,26 @@ static void log_batch(const struct riscv_batch *batch, size_t start_idx, /* Decode and log every executed scan */ for (size_t i = start_idx; i < batch->used_scans; ++i) { - static const char * const op_string[] = {"-", "r", "w", "?"}; + static const char * const dmr_string[] = { + "nop", "nop", "nop", "nop", + "data0", "data1", "data2", "data3", + "data4", "data5", "data6", "data7", + "data8", "data9", "data10", "data11", + "dmcontrol", "dmstatus", "hartinfo", "haltsum1", + "hawindowsel", "hawindow", "abstractcs", "command", + "abstractauto", "confstrptr0", "confstrptr1", "confstrptr2", + "confstrptr3", "nextdm", "nop", "nop", + "progbuf0", "progbuf1", "progbuf2", "progbuf3", + "progbuf4", "progbuf5", "progbuf6", "progbuf7", + "progbuf8", "progbuf9", "progbuf10", "progbuf11", + "progbuf12", "progbuf13", "progbuf14", "progbuf15", + "authdata0", "authdata1", "nop", "nop", + "haltsum2", "haltsum3", "nop", "sbaddress3", + "sbcs", "sbaddress0", "sbaddress1", "sbaddress2", + "sbdata0", "sbdata1", "sbdata2", "sbdata3", + "haltsum0" + }; + static const char * const op_string[] = {"nop", "read", "write", "reserved"}; const int delay = get_delay(batch, i, delays, resets_delays, reset_delays_after); 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, DTM_DMI_ADDRESS_OFFSET, abits); if (field->in_value) { static const char * const status_string[] = { - "+", "?", "F", "b" + "success", "reserved", "failed", "busy" }; const unsigned int in_op = buf_get_u32(field->in_value, 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, const uint32_t in_address = buf_get_u32(field->in_value, DTM_DMI_ADDRESS_OFFSET, abits); - LOG_DEBUG("%db %s %08" PRIx32 " @%02" PRIx32 - " -> %s %08" PRIx32 " @%02" PRIx32 "; %di", - field->num_bits, op_string[out_op], out_data, out_address, - status_string[in_op], in_data, in_address, delay); + LOG_DEBUG("%db %s 0x%08" PRIx32 " @%s -> %s 0x%08" PRIx32 " @%s; %di", + field->num_bits, op_string[out_op], out_data, dmr_string[out_address], + status_string[in_op], in_data, dmr_string[in_address], delay); if (last_scan_was_read && in_op == DTM_DMI_OP_SUCCESS) log_dmi_decoded(batch, /*write*/ false, last_scan_address, in_data); } else { - LOG_DEBUG("%db %s %08" PRIx32 " @%02" PRIx32 " -> ?; %di", - field->num_bits, op_string[out_op], out_data, out_address, + LOG_DEBUG("%db %s 0x%08" PRIx32 " @%s -> ?; %di", + field->num_bits, op_string[out_op], out_data, dmr_string[out_address], delay); }