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