STDA045 November   2026 MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0G3518 , MSPM0G3519

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2ED25519PH Algorithm Introduction
  6. 3MSPM0G Math Accelerator (MATHACL)
    1. 3.1 MATHACL Module
    2. 3.2 Multiply-Accumulate (MAC) Operation
  7. 4Accelerate the ED25519PH Algorithm by Using MATHACL
    1. 4.1 Loop Unrolled Implementation
      1. 4.1.1 Non-MATHACL Optimization
      2. 4.1.2 MATHACL Optimization
    2. 4.2 Loop Rolled Implementation
      1. 4.2.1 Non-MATHACL Optimization
      2. 4.2.2 MATHACL Optimization
    3. 4.3 Benchmark
  8. 5Summary
  9. 6References

Multiply-Accumulate (MAC) Operation

The multiply-accumulate (MAC) function accumulates the results of the product of OP1 and OP2 inside result registers RES1 and RES2 over multiple iterations until the MATHACL is reprogrammed for another function. The MATHACL supports only a 32-bit multiplier and multiplicand operand size, and a 64-bit accumulated result size. Figure 3-1 shows the operation of the MATHACL in MAC mode.

MSPM0G MSPM0G350x, MSPM0G150x, MSPM0G351x, ,MSPM0G151x MATHACL MAC Operation Figure 3-1 MATHACL MAC Operation
Note: Users must write 0 into RES1 and RES2 before starting a MAC operation to get the correct result, and wait for two cycles after writing OP2 before getting the final result of the MAC operation.

By using the MAC (multiply-accumulate) operation in MATHACL, the CPU can continuously stream 32-bit input data into the OP1 and OP2 registers. The final result is then retrieved directly from the RES1 and RES2 registers once data loading is complete. This approach reduces the total MAC execution time to nearly the duration of the input loading period, offering significant performance improvement over a standard operation based on a CPU.