SlideShare une entreprise Scribd logo
1  sur  27
Direct Memory Access (DMA)
Application Software Development
Vipin Kizheppatt
PIO Data transfer
2
Processor
System Bus
Memory Peripheral 1 Peripheral 2
• We need to transfer some data from the memory (assume RAM)
to peripheral-1 for processing
PIO Data transfer
3
Processor
System Bus
Memory Peripheral 1 Peripheral 2
• For this system, the only master (one who initializes data transfer)
is the processor
• Hence only processor can read/write from the memory (under s/w
control
PIO Data transfer
4
Processor
System Bus
Memory Peripheral 1 Peripheral 2
• So the processor first reads from a memory location where the,
first data is stored and stores it in an internal register
PIO Data transfer
5
Processor
System Bus
Memory Peripheral 1 Peripheral 2
• Then from internal register, it is transferred to the peripheral (under
s/w control)
• This kind of data transfer is called a programmable input output (PIO)
data transfer
PIO Data transfer
6
• So you can see one data transfer involves one read and write
under processor supervision
• But remember each read/write operation takes several clock cycles
to complete
• So when you have to transfer a huge amount of data between
memory and peripherals, this method is very inefficient
• For example you have a video frames stored in memory and you
need to transfer it to the display controller. If you follow PIO method
to do this most probably you won’t meet the performance
requirement of 30 fps
• Another drawback of PIO is that the processor is wasting its time for
data transfer instead of during some useful processing. A processor
is not an agent for data transfer, it is supposed to do some data
processing
Direct Memory Access (DMA)
7
• As the name indicates, here the idea is the peripheral directly
accesses the memory for data transfer instead of acting under
processor supervision
Processor
System Bus
Memory Peripheral 1 Peripheral 2
Direct Memory Access (DMA)
8
• Generally computer systems will have a dedicated hardware called
the DMA controller which will access the memory and transfer data
to/from the peripherals
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Direct Memory Access (DMA)
9
• Remember only masters can initiate data transfer. Since the DMA
controller is managing data transfer here, needs to be a master
• So now there are two masters in out system, the processor and the
DMA controller
• But at a given point in time, only one master can use the system
bus, otherwise two circuits will try to drive the same wire which will
cause issues
• So there should be some mechanism, which decides which master
gets to use the system bus. This mechanism is called bus arbitration
• Again there will be a separate hardware module, which will act as
the arbitrator and decides which master gets to use the bus
• Whenever a master wants to access the system bus, first it requests
the arbitrator. Once the arbitrator gives the access (bus grant), then
the master starts to use the system bus
Bus Arbitration
10
• Bus arbitration is very common in multi-processor systems also
where a system has multiple processors and they need to access the
same resource (such as memory)
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
ArbitratorReq
Grant
Req Grant
Bus Arbitration
11
• But how does the arbitrator know to which master the bus access
should be given?
• That is based on arbitration policy
• There can be multiple policies, such as fixed time division multiple
access (TDMA), where time is divided into multiple slots of equal
duration and each master is given chance to access the bus for one
time slot
• Bus this could waste time since even if a master doesn’t require to
access the bus, it is given the bus control for a time slot
• Another popular policy is round robin arbitration
• Here only if one master is requesting for the bus, it will be given the
bus access. But if more than one master requests for the bus, the
master who accessed the bus most recently gets the least priority
• There can be other more complex policies such as round robin with
priorities. Here each master is assigned a priority and the master
with highest priority gets the access
DMA advantages
12
• Since DMA happens completely under hardware control, it is much
faster than PIO although here also each transfer includes one read
and one write
• Bus the main advantage is the processor is freed from data transfer
and can do some other useful processing since data transfer is now
managed by the DMA controller.
• In modern system a lot of data is stored in the cache memory
hence the processor doesn’t need to access the memory
frequently. But when it has to, now a bus arbitration should
happen since DMA controller is also trying to access the memory
Faster DMA
13
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Only one operation can happen at a time
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Two operations happen concurrently
Configuring DMA Controller
14
• But how does the DMA controller know it needs to do a data
transfer and from where to where it need to do it?
• That happens under s/w control from the processor!!
• So the DMA controller is a master all other peripherals, but it is
still a slave to the processor
• When the processor finds out it need to transfer large data between
memory and the peripherals, it configures the DMA controller
(configures the internal registers of the DMA controller)
• It basically needs to configure three information
 Starting address from where data has to be transferred
 Starting address where the data has to be stored
 Total length of the data transfer
• Remember the peripheral is also memory mapped. So the address
of the peripheral’s internal register is configured as starting address
for read/write depending on the direction of the data transfer
Configuring DMA Controller
15
• Once these information is configured, the processor configures the
control register of the DMA controller to start the data transfer
• Once the data transfer is over, the processor finds it out either by
reading the status register of the controller or through the interrupt
signal from the controller
Configuring DMA Controller
16
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
• If we are using this configure, notice that the peripheral is not
directly connected to the system bus hence is not address mapped
to the processor
• Hence in this case the processor only configures the starting address
of the memory, transfer length and direction of transfer (peripheral
to memory or memory to peripheral)
DMA on Zynq
17
External DDR
We need to access this
memory
DMA on Zynq
18
External DDR
From a peripheral
Implemented here
DMA on Zynq
19
External DDR
That could be done either through
the AXI GP slave ports (there are 2)
DMA on Zynq
20
External DDR
The multi-port DDR controller acts
as the arbitrator for the DDR
memory. You can see the processor
core and the AMBA interconnect
connected to the HP ports are
connected to this controller
Xilinx DMA IP (Xilinx AXI DMA)
21
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Xilinx DMA IP (Xilinx AXI DMA)
22
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Write interface to
Peripheral. Follows AXI4
Stream master protocol
Xilinx DMA IP (Xilinx AXI DMA)
23
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Read interface to
Peripheral. Follows AXI4
Stream slave protocol
Xilinx DMA IP (Xilinx AXI DMA)
24
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Write interface to
memory. Follows AXI4
full protocol
Xilinx DMA IP (Xilinx AXI DMA)
25
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Read interface to
memory. Follows AXI4
full protocol
Xilinx DMA IP (Xilinx AXI DMA)
26
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Interface for configuring
DMA controller from the
processor. Follows AXI4-
Lite protocol
Xilinx DMA IP (Xilinx AXI DMA)
27
Processor
System Bus
Memory
DMA
Controller
Peripheral 1
Target System architecture
Interrupt signals showing the
completion of data transfer

Contenu connexe

Tendances

ISI and Pulse shaping.ppt
ISI and Pulse shaping.pptISI and Pulse shaping.ppt
ISI and Pulse shaping.pptshashi480250
 
Unit II OFDM.pdf
Unit II OFDM.pdfUnit II OFDM.pdf
Unit II OFDM.pdfvpshinde2
 
MOS as Diode, Switch and Active Resistor
MOS as Diode, Switch and Active ResistorMOS as Diode, Switch and Active Resistor
MOS as Diode, Switch and Active ResistorSudhanshu Janwadkar
 
Mos transistor theory
Mos transistor theoryMos transistor theory
Mos transistor theoryEkta Jolly
 
Real time operating system
Real time operating systemReal time operating system
Real time operating systemBharti Goyal
 
lecture-4_me_v01.pptx
lecture-4_me_v01.pptxlecture-4_me_v01.pptx
lecture-4_me_v01.pptxmsc6272
 
Fan-in and Fan-out.ppt
Fan-in and Fan-out.pptFan-in and Fan-out.ppt
Fan-in and Fan-out.pptvsnishok
 
Unit_1_L1_LPVLSI.ppt
Unit_1_L1_LPVLSI.pptUnit_1_L1_LPVLSI.ppt
Unit_1_L1_LPVLSI.pptRavi Selvaraj
 
Strip lines
Strip linesStrip lines
Strip linesrakeshkk
 
Qudrature Amplitude Modulation by Krishna Teja & Sunil
Qudrature Amplitude Modulation by Krishna Teja & SunilQudrature Amplitude Modulation by Krishna Teja & Sunil
Qudrature Amplitude Modulation by Krishna Teja & Sunilkrishnateja407
 
Discrete fourier transform
Discrete fourier transformDiscrete fourier transform
Discrete fourier transformMOHAMMAD AKRAM
 
junctionless transistors
junctionless transistorsjunctionless transistors
junctionless transistorsdipugovind
 
Channel assignment strategies
Channel assignment strategiesChannel assignment strategies
Channel assignment strategiesNasrullah Khan
 
RIEDEL Communications - Catalogue 2014 (English)
RIEDEL Communications - Catalogue 2014 (English)RIEDEL Communications - Catalogue 2014 (English)
RIEDEL Communications - Catalogue 2014 (English)RIEDEL Communications
 
Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...
Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...
Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...Rupesh Sharma
 

Tendances (20)

ISI and Pulse shaping.ppt
ISI and Pulse shaping.pptISI and Pulse shaping.ppt
ISI and Pulse shaping.ppt
 
VLSI- Unit II
VLSI- Unit IIVLSI- Unit II
VLSI- Unit II
 
Unit II OFDM.pdf
Unit II OFDM.pdfUnit II OFDM.pdf
Unit II OFDM.pdf
 
MOS as Diode, Switch and Active Resistor
MOS as Diode, Switch and Active ResistorMOS as Diode, Switch and Active Resistor
MOS as Diode, Switch and Active Resistor
 
Mos transistor theory
Mos transistor theoryMos transistor theory
Mos transistor theory
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
lecture-4_me_v01.pptx
lecture-4_me_v01.pptxlecture-4_me_v01.pptx
lecture-4_me_v01.pptx
 
Fan-in and Fan-out.ppt
Fan-in and Fan-out.pptFan-in and Fan-out.ppt
Fan-in and Fan-out.ppt
 
Layout
LayoutLayout
Layout
 
Unit_1_L1_LPVLSI.ppt
Unit_1_L1_LPVLSI.pptUnit_1_L1_LPVLSI.ppt
Unit_1_L1_LPVLSI.ppt
 
Strip lines
Strip linesStrip lines
Strip lines
 
Qudrature Amplitude Modulation by Krishna Teja & Sunil
Qudrature Amplitude Modulation by Krishna Teja & SunilQudrature Amplitude Modulation by Krishna Teja & Sunil
Qudrature Amplitude Modulation by Krishna Teja & Sunil
 
Discrete fourier transform
Discrete fourier transformDiscrete fourier transform
Discrete fourier transform
 
3673 mosfet
3673 mosfet3673 mosfet
3673 mosfet
 
junctionless transistors
junctionless transistorsjunctionless transistors
junctionless transistors
 
Channel assignment strategies
Channel assignment strategiesChannel assignment strategies
Channel assignment strategies
 
RIEDEL Communications - Catalogue 2014 (English)
RIEDEL Communications - Catalogue 2014 (English)RIEDEL Communications - Catalogue 2014 (English)
RIEDEL Communications - Catalogue 2014 (English)
 
Short Channel Effect In MOSFET
Short Channel Effect In MOSFETShort Channel Effect In MOSFET
Short Channel Effect In MOSFET
 
Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...
Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...
Design Ofdm System And Remove Nonlinear Distortion In OFDM Signal At Transmit...
 
Combinational Logic
Combinational LogicCombinational Logic
Combinational Logic
 

Similaire à DMA

Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)Zubair Khalid
 
Direct memory access
Direct memory accessDirect memory access
Direct memory accessWBUTTUTORIALS
 
Direct Memory Access (DMA).pptx
Direct Memory Access (DMA).pptxDirect Memory Access (DMA).pptx
Direct Memory Access (DMA).pptxAbidShahriar3
 
CISSP - Chapter 3 - CPU Architecture
CISSP - Chapter 3 - CPU ArchitectureCISSP - Chapter 3 - CPU Architecture
CISSP - Chapter 3 - CPU ArchitectureKarthikeyan Dhayalan
 
A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...rsaravanakumar13
 
Exploring Of System Hardware
Exploring Of System HardwareExploring Of System Hardware
Exploring Of System HardwareMuhammad Nauman
 
Basic Computer Architecture
Basic Computer ArchitectureBasic Computer Architecture
Basic Computer ArchitectureYong Heui Cho
 
DMA_document__1696148675.pdf
DMA_document__1696148675.pdfDMA_document__1696148675.pdf
DMA_document__1696148675.pdfmadhav590273
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationSmit Luvani
 
ARM architcture
ARM architcture ARM architcture
ARM architcture Hossam Adel
 
Chapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.pptChapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.pptShikhaManrai1
 
Memory hierarchy.pdf
Memory hierarchy.pdfMemory hierarchy.pdf
Memory hierarchy.pdfISHAN194169
 
Computer System Overview,
Computer System Overview, Computer System Overview,
Computer System Overview, Sajid Marwat
 
computer system structure
computer system structurecomputer system structure
computer system structureHAMZA AHMED
 

Similaire à DMA (20)

Direct access memory
Direct access memoryDirect access memory
Direct access memory
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Coa presentation3
Coa presentation3Coa presentation3
Coa presentation3
 
Direct Memory Access (DMA).pptx
Direct Memory Access (DMA).pptxDirect Memory Access (DMA).pptx
Direct Memory Access (DMA).pptx
 
DMA operation
DMA operationDMA operation
DMA operation
 
3 computer memory
3   computer memory3   computer memory
3 computer memory
 
CISSP - Chapter 3 - CPU Architecture
CISSP - Chapter 3 - CPU ArchitectureCISSP - Chapter 3 - CPU Architecture
CISSP - Chapter 3 - CPU Architecture
 
A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...
 
Exploring Of System Hardware
Exploring Of System HardwareExploring Of System Hardware
Exploring Of System Hardware
 
Basic Computer Architecture
Basic Computer ArchitectureBasic Computer Architecture
Basic Computer Architecture
 
DMA_document__1696148675.pdf
DMA_document__1696148675.pdfDMA_document__1696148675.pdf
DMA_document__1696148675.pdf
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and Organization
 
ARM architcture
ARM architcture ARM architcture
ARM architcture
 
Chapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.pptChapter1 Computer System Overview Part-1.ppt
Chapter1 Computer System Overview Part-1.ppt
 
Memory hierarchy.pdf
Memory hierarchy.pdfMemory hierarchy.pdf
Memory hierarchy.pdf
 
Dma
DmaDma
Dma
 
Computer hardware ppt1
Computer hardware ppt1Computer hardware ppt1
Computer hardware ppt1
 
Computer System Overview,
Computer System Overview, Computer System Overview,
Computer System Overview,
 
computer system structure
computer system structurecomputer system structure
computer system structure
 

Dernier

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Dernier (20)

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

DMA

  • 1. Direct Memory Access (DMA) Application Software Development Vipin Kizheppatt
  • 2. PIO Data transfer 2 Processor System Bus Memory Peripheral 1 Peripheral 2 • We need to transfer some data from the memory (assume RAM) to peripheral-1 for processing
  • 3. PIO Data transfer 3 Processor System Bus Memory Peripheral 1 Peripheral 2 • For this system, the only master (one who initializes data transfer) is the processor • Hence only processor can read/write from the memory (under s/w control
  • 4. PIO Data transfer 4 Processor System Bus Memory Peripheral 1 Peripheral 2 • So the processor first reads from a memory location where the, first data is stored and stores it in an internal register
  • 5. PIO Data transfer 5 Processor System Bus Memory Peripheral 1 Peripheral 2 • Then from internal register, it is transferred to the peripheral (under s/w control) • This kind of data transfer is called a programmable input output (PIO) data transfer
  • 6. PIO Data transfer 6 • So you can see one data transfer involves one read and write under processor supervision • But remember each read/write operation takes several clock cycles to complete • So when you have to transfer a huge amount of data between memory and peripherals, this method is very inefficient • For example you have a video frames stored in memory and you need to transfer it to the display controller. If you follow PIO method to do this most probably you won’t meet the performance requirement of 30 fps • Another drawback of PIO is that the processor is wasting its time for data transfer instead of during some useful processing. A processor is not an agent for data transfer, it is supposed to do some data processing
  • 7. Direct Memory Access (DMA) 7 • As the name indicates, here the idea is the peripheral directly accesses the memory for data transfer instead of acting under processor supervision Processor System Bus Memory Peripheral 1 Peripheral 2
  • 8. Direct Memory Access (DMA) 8 • Generally computer systems will have a dedicated hardware called the DMA controller which will access the memory and transfer data to/from the peripherals Processor System Bus Memory DMA Controller Peripheral 1
  • 9. Direct Memory Access (DMA) 9 • Remember only masters can initiate data transfer. Since the DMA controller is managing data transfer here, needs to be a master • So now there are two masters in out system, the processor and the DMA controller • But at a given point in time, only one master can use the system bus, otherwise two circuits will try to drive the same wire which will cause issues • So there should be some mechanism, which decides which master gets to use the system bus. This mechanism is called bus arbitration • Again there will be a separate hardware module, which will act as the arbitrator and decides which master gets to use the bus • Whenever a master wants to access the system bus, first it requests the arbitrator. Once the arbitrator gives the access (bus grant), then the master starts to use the system bus
  • 10. Bus Arbitration 10 • Bus arbitration is very common in multi-processor systems also where a system has multiple processors and they need to access the same resource (such as memory) Processor System Bus Memory DMA Controller Peripheral 1 ArbitratorReq Grant Req Grant
  • 11. Bus Arbitration 11 • But how does the arbitrator know to which master the bus access should be given? • That is based on arbitration policy • There can be multiple policies, such as fixed time division multiple access (TDMA), where time is divided into multiple slots of equal duration and each master is given chance to access the bus for one time slot • Bus this could waste time since even if a master doesn’t require to access the bus, it is given the bus control for a time slot • Another popular policy is round robin arbitration • Here only if one master is requesting for the bus, it will be given the bus access. But if more than one master requests for the bus, the master who accessed the bus most recently gets the least priority • There can be other more complex policies such as round robin with priorities. Here each master is assigned a priority and the master with highest priority gets the access
  • 12. DMA advantages 12 • Since DMA happens completely under hardware control, it is much faster than PIO although here also each transfer includes one read and one write • Bus the main advantage is the processor is freed from data transfer and can do some other useful processing since data transfer is now managed by the DMA controller. • In modern system a lot of data is stored in the cache memory hence the processor doesn’t need to access the memory frequently. But when it has to, now a bus arbitration should happen since DMA controller is also trying to access the memory
  • 13. Faster DMA 13 Processor System Bus Memory DMA Controller Peripheral 1 Only one operation can happen at a time Processor System Bus Memory DMA Controller Peripheral 1 Two operations happen concurrently
  • 14. Configuring DMA Controller 14 • But how does the DMA controller know it needs to do a data transfer and from where to where it need to do it? • That happens under s/w control from the processor!! • So the DMA controller is a master all other peripherals, but it is still a slave to the processor • When the processor finds out it need to transfer large data between memory and the peripherals, it configures the DMA controller (configures the internal registers of the DMA controller) • It basically needs to configure three information  Starting address from where data has to be transferred  Starting address where the data has to be stored  Total length of the data transfer • Remember the peripheral is also memory mapped. So the address of the peripheral’s internal register is configured as starting address for read/write depending on the direction of the data transfer
  • 15. Configuring DMA Controller 15 • Once these information is configured, the processor configures the control register of the DMA controller to start the data transfer • Once the data transfer is over, the processor finds it out either by reading the status register of the controller or through the interrupt signal from the controller
  • 16. Configuring DMA Controller 16 Processor System Bus Memory DMA Controller Peripheral 1 • If we are using this configure, notice that the peripheral is not directly connected to the system bus hence is not address mapped to the processor • Hence in this case the processor only configures the starting address of the memory, transfer length and direction of transfer (peripheral to memory or memory to peripheral)
  • 17. DMA on Zynq 17 External DDR We need to access this memory
  • 18. DMA on Zynq 18 External DDR From a peripheral Implemented here
  • 19. DMA on Zynq 19 External DDR That could be done either through the AXI GP slave ports (there are 2)
  • 20. DMA on Zynq 20 External DDR The multi-port DDR controller acts as the arbitrator for the DDR memory. You can see the processor core and the AMBA interconnect connected to the HP ports are connected to this controller
  • 21. Xilinx DMA IP (Xilinx AXI DMA) 21 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture
  • 22. Xilinx DMA IP (Xilinx AXI DMA) 22 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture Write interface to Peripheral. Follows AXI4 Stream master protocol
  • 23. Xilinx DMA IP (Xilinx AXI DMA) 23 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture Read interface to Peripheral. Follows AXI4 Stream slave protocol
  • 24. Xilinx DMA IP (Xilinx AXI DMA) 24 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture Write interface to memory. Follows AXI4 full protocol
  • 25. Xilinx DMA IP (Xilinx AXI DMA) 25 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture Read interface to memory. Follows AXI4 full protocol
  • 26. Xilinx DMA IP (Xilinx AXI DMA) 26 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture Interface for configuring DMA controller from the processor. Follows AXI4- Lite protocol
  • 27. Xilinx DMA IP (Xilinx AXI DMA) 27 Processor System Bus Memory DMA Controller Peripheral 1 Target System architecture Interrupt signals showing the completion of data transfer