Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 10/10/2025
Public
Document Table of Contents

5.2.6.1. Programming Flow for Shadow-Register-Based Multi-Block Transfer

  1. The software reads the DMAC channel enable register (DMAC_CHENREG) to select an available (unused) channel.
  2. The software programs the CHx_CFG2 (x = NUM_CHANNEL) register with appropriate values for the DMA transfer. The SRC_MLTBLK_TYPE and/or DST_MLTBLK_TYPE bits must be set to 2’b10.
  3. The software programs the CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS, and CHx_CTL registers with appropriate values for the first block. DMAC loads the corresponding shadow registers with these values. The CHx_CTL register must be the last register to be programmed with the SHADOWREG_OR_LLI_LAST bit set to 1 to indicate that the shadow register contents are valid. If the slave interface data bus width or transfer size is less than 64 bits, CHx_CTL[63:56] must be updated last.
  4. The software enables the channel by writing 1 to the appropriate bit location in the DMAC_CHENREG register.
  5. DMAC initiates the DMA block transfer operation based on the settings for the block transfer.
    1. DMAC checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as '0', DMAC waits till the software writes (any value) to CHx_BLK_TFR_RESUMEREQREG to indicate valid LLI availability, before attempting another Shadow Register fetch operation. DMAC might generate 'ShadowReg_Or_LLI_Invalid_ERR' Interrupt in this case.
    2. DMAC checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as '1', DMAC copies the shadow register contents to the registers used for executing the DMA block transfer (CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS and CHx_CTL registers) and clears the SHADOWREG_OR_LLI_LAST bit in CHx_CTL and CHx_CTL_ShadowReg registers to 0.
    3. DMAC checks CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as '1'’ DMAC copies the shadow register contents to the registers used for executing the DMA block transfer (CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS, and CHx_CTL registers) and clears the SHADOWREG_OR_LLI_LAST bit in CHx_CTL and CHx_CTL_ShadowReg registers to 0.
      1. If DMAC sees the CHx_CTL.SHADOWREG_OR_LLI_LAST bit of the copied Shadow Register as 1, it understands that the current block is the final block in the transfer and completes the DMA transfer operation at the end of current block transfer.
      2. If DMAC sees the CHx_CTL.SHADOWREG_OR_LLI_LAST bit of the copied Shadow Register as 0, it understands that there are one or more blocks to be transferred and checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit again at the end of current block transfer.
  6. The software polls the SHADOWREG_OR_LLI_LAST bit in the CHx_CTL register till it is 0.
    1. DMAC clears this bit to 0 only after copying the shadow register contents to the registers used for executing the DMA block transfer (that is, the CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS, and CHx_CTL registers).
    2. The software must program the shadow registers with a new set of values only after the SHADOWREG_OR_LLI_LAST bit is set to 0.
    3. If the software tries to program the shadow registers when the SHADOWREG_OR_LLI_LAST bit is set to 1, DMAC ignores this write operation, sets the SLVIF_ShadowReg_WrOnValid_ERR bit of the CHx_INTSTATUS register to 1, and generates an interrupt (if the corresponding interrupt generation is not masked off).
  7. The software programs the CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS, and CHx_CTL registers with appropriate values for the next block.
    1. The CHx_CTL register must be the last register to be programmed with the SHADOWREG_OR_LLI_LAST bit set to 1 to indicate that the shadow register contents are valid.
    2. If the current block is the final block in the transfer, the software must set the CHx_CTL.SHADOWREG_OR_LLI_LAST bit to 1.
    3. The DMA block transfer corresponding to the previous shadow register contents may be in progress during this time.
    4. DMAC loads the corresponding shadow registers with these new values.
  8. DMAC initiates the DMA block transfer operation based on the settings for the block transfer.
    1. Based on the settings of the TT_FC field in the CHx_CFG2 register, the block transfer might start immediately or after the hardware/software handshaking request.
    2. DMAC checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as 0, DMAC waits until the software writes (any value) to CHx_BLK_TFR_RESUMEREQREG to indicate valid LLI availability, before attempting another Shadow Register fetch operation. DMAC might generate a ShadowReg_Or_LLI_Invalid_ERR interrupt in this case.
    3. DMAC checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as 1, DMAC copies the shadow register contents to the registers used for executing the DMA block transfer (CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS, and CHx_CTL registers) and clears the SHADOWREG_OR_LLI_LAST bit in CHx_CTL and CHx_CTL_ShadowReg registers to 0.
    4. If DMAC sees the CHx_CTL.SHADOWREG_OR_LLI_LAST bit of the copied Shadow Register as 1, it understands that the current block is the final block in the transfer and completes the DMA transfer operation at the end of current block transfer.
    5. If DMAC sees the CHx_CTL.SHADOWREG_OR_LLI_LAST bit of the copied Shadow Register as 0, it understands that there are one or more blocks to be transferred and checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit again at the end of current block transfer.
  9. The software waits for the block transfer completion interrupt or polls the block transfer completion indication bit (BLOCK_TFR_DONE) of the CHx_INTSTATUS register until it is set to 1.
  10. On the block transfer completion:
    1. DMAC checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as 0, DMAC waits until the software writes (any value) to CHx_BLK_TFR_RESUMEREQREG to indicate valid LLI availability, before attempting another Shadow Register fetch operation. DMAC might generate a ShadowReg_Or_LLI_Invalid_ERR interrupt in this case.
    2. DMAC checks the CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit and if it is seen as 1, DMAC copies the shadow register contents to the registers used for executing the DMA block transfer (CHx_SAR and/or CHx_DAR, CHx_BLOCK_TS, and CHx_CTL registers) and clears the SHADOWREG_OR_LLI_LAST bit in CHx_CTL and CHx_CTL_ShadowReg registers to 0.
      • If the CHx_CTL.SHADOWREG_OR_LLI_LAST bit of the copied Shadow Register is 1, it understands that the current block is the final block in the transfer and completes the DMA transfer operation.
      • If the CHx_CTL.SHADOWREG_OR_LLI_LAST bit of the copied Shadow Register is 0, it understands that there are one or more blocks to be transferred and checks thhe CHx_CTL_ShadowReg.SHADOWREG_OR_LLI_LAST bit again at the end of current block transfer.
    3. If there are one or more blocks to be transferred, the software polls the CHx_CTL.SHADOWREG_OR_LLI_LAST bit until it is seen as 0 and go to step 7. One read operation is enough as DMAC should have already copied the shadow register contents and cleared this bit to 0.