Compute matmul CRC before result store
This commit is contained in:
@@ -47,6 +47,7 @@ typedef struct {
|
||||
#define STATUS_DONE_BIT (1 << 1)
|
||||
|
||||
#define SEQ_START_BIT (1 << 0)
|
||||
#define SEQ_SKIP_STORE_BIT (1 << 1)
|
||||
#define SEQ_BUSY_BIT (1 << 0)
|
||||
#define SEQ_DONE_BIT (1 << 1)
|
||||
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user