Access memory directly
Network Management - In this article, I will show you some of the typical architectures used to implement direct memory access.
Direct memory access (Direct Memory Access or DMA for short) is an important component in any modern computer architecture. DMA allows CPUs to load offload memory stacks increasingly to other components. This method frees the CPU from errands and provides more cycles to solve more complex tasks.
For example, perhaps some of you would like to save this article to your hard drive so you can read the reference later. When you choose to do this, you will need to select a location to store the article. Now the data is retrieved by the network card and then routed to the desired location on your hard drive. A very simple task and the ability of the CPU to inherit such types of operations.
Although the main idea of direct memory access techniques is quite simple, direct memory access operations are complex. As you can imagine, when there are multiple devices (or peripherals) that want access to memory locations, the problem will occur. This is the reason or request for a DMA controller. DMA controller is essentially a device that controls all DMA operations.
In order to control DMA activities, DMA controllers need to have information related to upcoming activities. This information includes things like source and destination addresses, mode, and data size that are transmitted. DMA controllers also need to be knowledgeable about what it will transmit, how it will be delivered and how it will be delivered, how long it will take to do it. With this knowledge, DMA controllers can require memory bus control from the CPU. When the CPU is ready to yield the memory bus control, it sends an ACK response signal in response to the DMA controller's required signal.
Figure 1: Direct Memory Access interaction
Burst or Single-cycle
What happens after the DMA controller increases the control of the memory bus completely depends on the previous DMA controller mode specified. There are two general modes of DMA controller operation. The first is burst . When the DMA controller operates in burst mode, it maintains the control of the memory bus during the memory transfer period. The downside in burst mode is that the CPU cannot access the memory bus until the DMA controller completes the memory transfer. At this time, the CPU can still access its L1 and L2 caches but cannot access other memory; This has limited the CPU to perform the task and may cause it to wait until the DMA controller completes the memory transfer and then returns the bus control back to itself.
To avoid the situation where the CPU is forced to wait for the complete memory transfer, the DMA controller can operate in another mode with a single-cycle name. The way it works in the single-cycle mode is as follows, the DMA controller will return the memory bus control after each memory block has been transferred. The size of each memory block usually falls into 256 or 512 bytes. This allows the CPU to have more opportunities to use the memory bus for private purposes without having to wait for a sizable amount of time to complete the memory transfer as in b urst mode. However, there is a downside to DMA operation in this single-cycle mode. When the DMA controller returns bus control, it must send a request to the CPU to increase bus control, then wait for the ACK response from the CPU before it can increase bus control to perform the transmission. Other memory blocks. Thus, repeated repetition of the request / response string will consume time to complete the memory transfer process.
Single-cycle operation mode is most commonly used, although most DMA controllers are available for both modes. The optimal length of each block that DMA will transmit before returning bus control and requiring control is a rather complex issue. A key factor in determining the optimal size of a block is the observed error rate. When there is a high error rate, the smaller the length of the block, the better. However, it is important to know that, when there are fewer errors due to reducing the block length, we will suffer losses in increasing the request / response process between DMA controller and CPU. The decision to implement is dependent on each DMA controller manufacturer (especially the engineers who designed it!). If you want to turn this way on how to define a specific DMA controller, you can search for it somewhere in the document, otherwise you can request it from the company.
When the DMA controller has completed the transmission of a block and returns the memory bus control to the CPU, the CPU will now be able to access the bus to perform its own purposes. In the example we used above and in many other examples have provided the CPU with an opportunity to update progress indicators and update new information relevant to the DMA activity being performed for the system. file system.
Cache Coherency
Another problem that arises during DMA operation is cache coherency . When the CPU accesses a memory location, the value of that location is stored in the memory cache of the CPU. If the DMA operation is related to this memory location, the value in the memory cache of the CPU may not match the value at the actual memory location.
To overcome this problem, there are two solutions given. The entire cache consolidation system needs to implement a hardware solution in which the DMA controller sends a signal to the cache controller when it wishes to access the memory location. If DMA wants to write to that location, the cache controller will invalidate the CPU cache memory value. If the DMA wants to read the memory location, the cache controller will clear the CPU cache to ensure that the memory location contains the latest value (CPU cache value). This method of operation requires some extra overhead but ensures CPU cache tightness.
In incomplete cache consolidation systems, memory cache maintenance is left to the operating system. The operating system will receive a request to decide whether the cache will be deleted first for DMA activity or invalidate later. Which method is better? We are not sure if there is an exact answer because both methods are satisfactory. However, the way we choose and recommend that you implement hardware in the entire cache consolidation systems.
You should read it
- 'Remember your face and forget your name', remedy and method for practicing super memory
- How to test iPhone 6/6 Plus using MLC or TLC memory
- Android phone full of memory, what to do to fix?
- How to turn the memory card into internal memory on Android 6.0
- How many GB of RAM does your computer need?
- 5 Misconceptions about RAM (Random Access Memory)
- How to handle a computer error message Your computer is low on memory on Windows
- How to fix memory leaks on Android
May be interested
- Samsung achieves breakthrough in MRAM technology that 'mimics the brain'mram (short for magnetoresistive random access memory - resistive random access memory or resistive ram), is basically a type of non-self erasing ram that stores data based on the principle of magnetic effects. huge resistance (or rather, the effect of tunneling resistance).
- 'Remember your face and forget your name', remedy and method for practicing super memoryanyone can have super memory if they know how to practice.
- Windows Phone 8 has allowed to install applications from memory cardsthis new feature allows users to directly install the software on the device without being dependent on having to use the network to finance the application.
- What is the function of memory card? How to choose the best memory cardwhat is a memory card and what does a memory card do? how to choose a memory card that suits your needs is a difficult question. let's learn about the effects of memory cards, external memory cards for laptops
- Learn how cache worksmemory cache is the type of high-speed memory available inside the cpu to speed up access to data and instructions stored in ram. in this tutorial, we will show you how this memory works in the most understandable way.
- How to test iPhone 6/6 Plus using MLC or TLC memorycurrently, the iphone 6 duo is being used by apple using two different memory chips, mlc and tlc. however, according to the reflection of many users, the model using tlc memory chips often hangs unexpectedly and automatically reboots.
- Android phone full of memory, what to do to fix?android phones are full of memory, a phenomenon that often occurs with smartphones with low internal memory, or users who store too many applications on their mobile devices. if you do not want this situation to occur, apply 4 small tips below.
- How to Use USB as RAMnowadays, some programs consume a lot of memory when running and this is a nightmare for computers with low random access memory (ram). to limit this, you can turn a large usb flash drive into ram and help the system handle multitasking and more tasks. please follow the steps below to do it.
- How to turn the memory card into internal memory on Android 6.0turning the memory card into internal memory on android 6.0 will give you more space to store data and increase device memory.
- 4 Security Steps to Follow When Using Remote Access Applicationsremote access applications are great for controlling your pc when you're not sitting directly in front of it. however, remote access applications are often a prime target for hackers, but you can thwart their attempts by making a few security adjustments.