[Feature] Implement DMA support#293
Conversation
| DMA_MVIN = 0 | ||
| DMA_MVOUT = 1 |
There was a problem hiding this comment.
| external DRAM-like memory and the on-chip Scratchpad Memory (dataSPM). | ||
|
|
||
| It supports two main operations: | ||
| - DMA_MVIN: DRAM -> DMA Engine -> SPM |
There was a problem hiding this comment.
Rename to DMA_INFEED and DMA_OUTFEED?
| DMA_MVOUT = 1 | ||
|
|
||
|
|
||
| class DmaEngineRTL( Component ): |
There was a problem hiding this comment.
Would this also handle instructions/control signals delivery besides data?
| SpmDataType = mk_bits( spm_data_nbits ) | ||
| MemDataType = mk_bits( mem_data_nbits ) | ||
| # Byte mask for SPM write; 1 byte = 8 bits | ||
| SpmMaskType = mk_bits( spm_data_nbits // 8 ) |
There was a problem hiding this comment.
Define CHAR_BIT = 8 inside https://github.com/tancheng/VectorCGRA/blob/master/lib/util/common.py and use it here: // CHAR_BIT
|
|
||
| # Abstract external memory interface | ||
| # Request to read from DRAM | ||
| s.mem_rd_req_val = OutPort() |
There was a problem hiding this comment.
change all mem to dram, to distinguish it from sram?
| s.spm_dma_rresp_data = InPort( SpmDataType ) | ||
|
|
||
| # State machine definitions | ||
| StateType = mk_bits( 4 ) |
There was a problem hiding this comment.
4 status needs to be defined inside https://github.com/tancheng/VectorCGRA/blob/master/lib/util/common.py
| s.mem_rd_req_val = OutPort() # dma_read_request_valid | ||
| s.mem_rd_req_rdy = InPort() # dma_read_request_ready | ||
| s.mem_rd_req_addr = OutPort(DmaDramAddrType) |
There was a problem hiding this comment.
Why can't we use the RecvIfcRTL and SendIfcRTL interfaces to connect the DmaRTL?
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.