Minimal debug: CRC32 self-test + group 0 rdback in one line

This commit is contained in:
2026-06-24 22:49:06 +08:00
parent e39a655861
commit f6146bd467

View File

@@ -172,16 +172,12 @@ int main(void)
/* ── Start marker (must be first output) ──────────────────── */
printf("MATMUL_START\n");
/* ── CRC32 self-test ──────────────────────────────────────── */
{
const char *test = "123456789";
uint32_t tcrc = 0xFFFFFFFF;
for (int ti = 0; test[ti]; ti++)
tcrc = crc32_table[(tcrc ^ test[ti]) & 0xFF] ^ (tcrc >> 8);
tcrc ^= 0xFFFFFFFF;
printf("DBG CRC32(\"123456789\")=0x%08lx (expect 0xcbf43926)\n",
(unsigned long)tcrc);
}
/* ── CRC32 self-test (printed inline later) ───────────────── */
const char *test = \"123456789\";
uint32_t tcrc = 0xFFFFFFFF;
for (int ti = 0; test[ti]; ti++)
tcrc = crc32_table[(tcrc ^ test[ti]) & 0xFF] ^ (tcrc >> 8);
tcrc ^= 0xFFFFFFFF;
/* ── Process all groups ───────────────────────────────────── */
for (g = 0; g < MATMUL_GROUP_NUM; g++) {
@@ -197,11 +193,10 @@ int main(void)
read_ip(MATMUL_C_BASE, c_buf, 48);
for (i = 0; i < 48; i++)
extram[DST_BASE + g * 48 + i] = c_buf[i];
if (g == 0 || g == 1 || g == (MATMUL_GROUP_NUM-2) || g == (MATMUL_GROUP_NUM-1)) {
printf("DBG g=%d C[0..2]=%08lx %08lx %08lx ExtRAM rdback=%08lx\n",
g, (unsigned long)c_buf[0], (unsigned long)c_buf[1],
(unsigned long)c_buf[2],
(unsigned long)extram[DST_BASE + g * 48]);
if (g == 0) {
printf(\"DBG CRCtest=0x%08lx g=0 rdback=%08lx\\n\",
(unsigned long)tcrc,
(unsigned long)extram[DST_BASE]);
}
}