Compute matmul CRC before result store

This commit is contained in:
2026-07-04 19:45:22 +08:00
parent bf6051c8c6
commit c37f493bcb
5 changed files with 64 additions and 35 deletions

View File

@@ -40,6 +40,10 @@ static void uart_puthex(unsigned int val)
#define MATMUL_GROUP_NUM 5000
#endif
#ifndef MATMUL_WRITEBACK_RESULTS
#define MATMUL_WRITEBACK_RESULTS 1
#endif
unsigned long UART_BASE = 0xbf000000;
#define EXTRAM_BASE_PHYS 0x1c400000u
@@ -55,6 +59,7 @@ unsigned long UART_BASE = 0xbf000000;
int main(void)
{
unsigned int crc;
unsigned int seq_ctrl;
if (MATMUL_GROUP_NUM <= 0) {
return 0;
@@ -69,7 +74,11 @@ int main(void)
DMA_SEQ->MAT_BASE = 0x1f500000u;
DMA_SEQ->SRC_STRIDE = 128u;
DMA_SEQ->DST_STRIDE = 192u;
DMA_SEQ->CTRL = SEQ_START_BIT;
seq_ctrl = SEQ_START_BIT;
#if MATMUL_WRITEBACK_RESULTS == 0
seq_ctrl |= SEQ_SKIP_STORE_BIT;
#endif
DMA_SEQ->CTRL = seq_ctrl;
while ((DMA_SEQ->STATUS & SEQ_DONE_BIT) == 0u) {
}