SPRUJ17H March 2022 – October 2024 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
The following steps are performed by the PRU firmware for multiply and accumulate mode:
1. Enable multiply and accumulate MAC_MODE.
(a) Set R25[1-0] = 1 for accumulate mode.
(b) Store MAC_MODE to MAC using XOUT instruction with the following parameters:
- Device ID = 0
- Base register = R25
- Size = 1
2. Clear accumulator and carry flag.
(a) Set R25[1-0] = 3 to clear accumulator (R25[1]=1) and preserve accumulate mode (R25[0]=1).
(b) Store accumulator to MAC using XOUT instruction on R25.
3. Load operands into R28 and R29.
4. Multiply and accumulate, XOUT R25[1-0] = 1
Repeat step 4 for each multiply and accumulate using same operands.
Repeat step 3 and 4 for each multiply and accumulate for new operands.
5. Load the accumulated product into R26, R27, and the ACC_CARRY status into R25 using the XIN instruction.
Steps one and two are required to set the accumulator mode and clear the accumulator and carry flag.