[Feature] Implement DMA support#293
Conversation
|
Hi @tancheng @BenkangPeng , I summarized two direction of DMA design as below:
I prefer the second method but I think there are still some logic should be written in DataMemControllerRTL. WDTY? |
|
Hi @HobbitQia, option 2 looks good to me. Though I am not sure what logic should be additionally in |
I am thinking if we want enable the concurrent running of DMA and traditional load/store, then we need to multiplex the port of Data SPM and I think this logic can be implemented in |
I thought they are the same latency if we can distinguish the Adding logic inside the |
If the DMA data should go through the controller packet path, there may be extra latency of packeting, and there may be competitions between NoC/CPU/tile request to SPM? Or we have two separate paths in Controller? |
Packing can just be combinational logic before putting into a queue.
I was thinking about separate paths, so mentioned |
Got it. I mean the conflict between different paths. Even we have |
Oh, we don't need to distinguish VectorCGRA/controller/ControllerRTL.py Line 207 in eb71842 |
But if we add DMA, there should be another path |
Ah, yes, makes sense. That |
So this |
DMA engine in your figure, or @BenkangPeng's |
|
@BenkangPeng will you update this PR accordingly? |
Yes, sorry for the delay. I will update this PR as soon as possible. |
|
|
||
| return mk_bitstruct(new_name, { | ||
| 'dram_data': DramDataType, | ||
| 'dram_mask': DramMaskType, |
There was a problem hiding this comment.
explain what is dram_mask with comment?
| 'dram_data': DramDataType, | ||
| 'dram_mask': DramMaskType, | ||
| 'spm_data': SpmDataType, | ||
| 'spm_mask': SpmMaskType, |
There was a problem hiding this comment.
explain what is spm_mask with comment?
We should also include the figure 2 into our |
@BenkangPeng, as you introduce |
…interface for enhanced data transfer capabilities.
… then drives types from them
…te requests and adjust related signal handling for clarity and consistency.
…TL by passing DmaDataType and DmaCmdType as parameters, and updating related type definitions for improved clarity and consistency.
…rite requests, enhancing type definitions for DmaCmdType and DmaDataType
…is an integer multiple of 4
…SendRTL to replace them.
…dyRecv/SendIfcRTL for improved clarity and consistency in DMA signal handling.
… with ValRdyRecv/SendIfcRTL
…rite request type and update corresponding tests for consistency
…arity and consistency by renaming signals related to memory requests and responses.
… AST translation limitations and enforce nbytes % 4 check in construct method instead of update block.
…g detailed comments on mask design and data transfer granularity, clarifying the behavior of dram_mask and spm_mask during DMA operations.
…entation regarding the usage of dma_tag in related files.
…between DMA command and CMD_COMPLETE signals in the same clock cycle, with a reference to related discussion.
…tag' instead of 'tag' in DMA-related messages and tests.
| # Send the response of reading from SPM to the DMA. | ||
| s.send_to_dma_spm_rd_resp = SendIfcRTL(DmaSpmReadRespType) | ||
|
|
||
| # Data memory side of the same SPM access path. |
There was a problem hiding this comment.
Data memory side of the same SPM access path.
what do you mean by "same SPM"? And should we change "Data memory side" to "SRAM data memory", it is a bit confusing now.
|
|
||
| # Data memory side of the same SPM access path. | ||
| # Send the request of writing into SPM to the data_mem controller. | ||
| s.send_to_mem_spm_wr_req = SendIfcRTL(DmaSpmWriteReqType) |
There was a problem hiding this comment.
How is this different from above "send_to_mem_store_request"?
There was a problem hiding this comment.
IIRC, this is the isolated and newly introduced ifc to distinguish from legacy inter-cgra store_req. We need to refactor their names, e.g.,
s.send_to_mem_store_request -> s.send_to_sram_store_request_from_noc
s.send_to_mem_spm_rd_req -> s.send_to_sram_store_request_from_dma
How does this sound? Similar to the load and store_response. And leave comment that we prefer to separate the two as dma can perform burst data movement.




Related issue: coredac/CGRA-SoC#2
This PR introduces
CgraDmaRTLwhich integrates the CGRA with a DMA engine, enabling direct memory transfers between external DRAM(don't implement now) and the CGRA's dataSPM.