Direct memory access device and method, electronic equipment and readable storage medium
By designing a direct memory access device in a system-level chip, and using the accelerator consistent port interface to interact with the CPU cache system, the problem of frequent memory access by CPU is solved, and data transmission speed and system performance are improved.
Patent Information
- Application Number
- CN202410918930.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-29
AI Technical Summary
During data processing, the CPU needs to frequently access memory to acquire or store data, resulting in increased system latency. The existing DMA technology still has room for improvement in data transmission efficiency and system performance optimization.
A direct memory access device is designed, including a data interface, a buffer, a command receiving area, a result temporary storage area and a direct memory access controller. It interacts with the CPU cache system through the accelerator consistency port interface to achieve efficient data in the cache. Transfer and manage to reduce the number of CPU accesses to main memory.
Through the direct memory access device, the data transmission speed is significantly improved, the CPU access delay is reduced, the data processing performance and cache hit rate are improved, and the overall efficiency of the system is optimized.
Smart Images

Figure CN119046187A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of SoC (System on Chip), and in particular to a direct memory access device, a direct memory access method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In SoC (System on Chip) design, DMA (Direct Memory Access) is a technology that allows some hardware subsystems to directly access and transfer memory data without going through the central processing unit. The DMA controller can perform memory transfer tasks independently of the CPU, thereby improving the overall efficiency and performance of the system. In modern storage systems, data transmission and processing efficiency are key factors that determine overall performance. For example, DMA (Direct Memory Access) technology is widely used to achieve fast movement of data between storage media. DMA technology allows system memory (such as SRAM and DRAM) to exchange data directly without the intervention of the CPU (Central Processing Unit), thereby reducing the burden on the CPU and improving the efficiency of data transmission. In addition, ARM architecture microprocessors have been widely used in system-level chips, and their high performance and low power consumption make them an ideal choice.
[0003] However, DMA technology still has some limitations. First, traditional DMA operations are mainly focused on moving data between memories, while the interaction with the CPU cache system is relatively limited. This results in the CPU still needing to frequently access the memory to obtain or store data during data processing, increasing system latency. Therefore, the existing commonly used DMA technology still has room for improvement in data transmission efficiency and system performance optimization. Summary of the invention
[0004] The embodiment of the present invention provides a direct memory access device, method, electronic device and computer-readable storage medium to solve the problem that during data processing, the CPU still needs to frequently access the memory to obtain or store data, which increases the system delay.
[0005] A direct memory access device is applied to a system-level chip. The direct memory access device is connected to a central processing unit at high speed. The direct memory access device includes at least one of: a data interface, a buffer, a command receiving area, a result temporary storage area and a direct memory access controller. The device includes:
[0006] The data interface is used for high-speed connection with the system-on-chip and the accelerator consistency port;
[0007] The buffer is used to temporarily store data in the data transmission process;
[0008] The command receiving area is used to receive the command sent by the central processing unit;
[0009] The result temporary storage area is used to store the result after the direct memory access controller executes the command;
[0010] The direct memory access controller is used to parse the command and perform data movement operations, and process data transmission related to the accelerator consistency port interface.
[0011] Optionally, the direct memory access controller's analysis of the command includes a transfer field of the accelerator consistency port;
[0012] Determining whether a transfer field of the accelerator coherence port is enabled for reading or writing in the command;
[0013] If the transfer field of the accelerator coherence port is enabled for reading or writing, the direct memory access controller processes the cache when performing data movement.
[0014] Optionally, the determining whether the command enables reading or writing of a transmission field of the accelerator consistency port includes:
[0015] The command is represented in the form of a command descriptor;
[0016] The command descriptor includes at least two bits, which are respectively used to indicate the enabling attribute of the accelerator consistency port of the source address or the destination address of the data migration;
[0017] If the value of the bit is a first preset value, the data transfer source address in the command descriptor is used normally to issue a read / write command on the bus;
[0018] If the value of the bit is a second preset value, the address is offset and the fields required for the accelerator consistency port transmission are added to the issued read and write commands; the read and write commands are sent to the accelerator consistency port interface through the bus.
[0019] Optionally, if the transmission field of the accelerator consistency port is enabled for reading or writing, the direct memory access controller processes the cache when performing data movement, including:
[0020] When performing the data movement, the direct memory access controller realizes bus connection to the accelerator consistency port interface by offsetting the address; and adds the hardware signal required by the accelerator consistency port;
[0021] Operate the cache to read data from the same perspective as the central processing unit or perform a purposeful pre-fetch operation on the cache of the central processing unit, and preload and write back data in the cache;
[0022] The preloading and writing back of data in the cache includes:
[0023] Determine whether the required data exists in the cache of the central processing unit, and if the required data does not exist, actively update the data to the cache through a direct memory access controller;
[0024] When writing back the data in the cache, the data in the cache of the central processing unit is directly moved to a required address through a direct memory access controller.
[0025] Optionally, the direct memory access device further includes a status register;
[0026] The central processing unit determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem.
[0027] Optionally, the central processing unit determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem, including:
[0028] The central processing unit determines the execution status of the command through the status register, and the status register at least includes a reset register;
[0029] The direct memory access device is controlled to restart operation according to the reset register, and the command is written into the command buffer.
[0030] Optionally, the central processing unit determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem, including:
[0031] The central processing unit determines whether there is an error problem in the operation status of the direct memory access device based on the status register, and reports the error problem.
[0032] The embodiment of the present invention further discloses a direct memory access method, characterized in that it is applied to a direct memory access device, the direct memory access device includes at least one of: a data interface, a buffer, a command receiving area, a result temporary storage area and a direct memory access controller, the method includes:
[0033] High-speed connection with the system-on-chip and the accelerator consistency port through the data interface;
[0034] The buffer temporarily stores data in the process of data transmission;
[0035] The command receiving area is responsible for receiving commands sent by the central processing unit;
[0036] The result temporary storage area is used to store the result after the direct memory access controller executes the command;
[0037] The direct memory access controller parses the command and performs data movement operations, and processes data transmission related to the accelerator consistency port interface.
[0038] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0039] The memory is used to store computer programs;
[0040] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0041] The embodiment of the present invention further discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the embodiment of the present invention.
[0042] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0043] The embodiments of the present invention include the following advantages:
[0044] The embodiment of the present invention is connected to the system-level chip and the accelerator coherence port at high speed through the data interface; the buffer temporarily stores data in the data transmission process; the command receiving area is responsible for receiving the command sent by the central processing unit; the result temporary storage area is used to store the result after the direct memory access controller executes the command; the direct memory access controller parses the command and performs data movement operations, and processes data transmission related to the accelerator coherence port interface. The embodiment of the present invention mainly focuses on the data movement between memories for traditional DMA operations, while the interaction with the CPU cache system is relatively limited, which leads to the CPU still needing to frequently access the memory to obtain or store data during data processing, increasing the system delay problem. By adopting a dedicated DMA device and technology for the system-level chip with an integrated ACP (Accelerator Coherency Port) interface, the data transmission speed in the cache is significantly improved, and the DMA device can directly communicate with the ACP interface of the CPU, reducing the number of CPU accesses to the main memory, thereby reducing the delay of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0046] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] Figure 1 is a structural block diagram of a direct memory access device provided in an embodiment of the present invention;
[0048] Figure 2 It is a schematic flow diagram of a structural block diagram of a direct memory access device provided in an embodiment of the present invention;
[0049] Figure 3 is a flow chart of the steps of a direct memory access method provided in an embodiment of the present invention;
[0050] Figure 4 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention;
[0051] Figure 5 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] In SoC (System on Chip) design, DMA (Direct Memory Access) is a technology that allows some hardware subsystems to directly access and transfer memory data without going through the central processing unit. The DMA controller can perform memory transfer tasks independently of the CPU, thereby improving the overall efficiency and performance of the system.
[0054] DMA technology is widely used in modern storage systems to achieve fast movement of data between storage media. DMA technology allows direct data exchange between system memories (such as SRAM and DRAM) without the intervention of the CPU, thereby reducing the burden on the CPU and improving the efficiency of data transmission. In addition, ARM architecture microprocessors have been widely used in system-level chips, and their high performance and low power consumption make them an ideal choice.
[0055] However, the existing technical solutions have certain shortcomings: traditional DMA operations mainly focus on data movement between memories, while the interaction with the CPU cache system is relatively limited. This results in the CPU still needing to frequently access the memory to obtain or store data during data processing, increasing system latency.
[0056] In view of the problems existing in the prior art, we propose a direct memory access device and method, which combines the ACP (Accelerator Coherency Port) interface of the ARM CPU and the DMA technology to achieve efficient transmission and management of data in the cache. By combining the DMA device with the ACP interface, not only can data be moved between memories, but also data can be read and written directly between the CPU cache and the memory, thereby reducing the number of CPU accesses to the main memory and improving the data processing speed.
[0057] Reference Figure 1 , shows a structural block diagram of a direct memory access device provided in an embodiment of the present invention, which may specifically include:
[0058] The direct memory access device includes at least one of: a data interface, a buffer, a command receiving area, a result temporary storage area, a direct memory access controller and a central processing unit;
[0059] The data interface is used for high-speed connection with the system-on-chip and the accelerator consistency port;
[0060] The buffer is used to temporarily store data in the data transmission process;
[0061] The command receiving area is used to receive the command sent by the central processing unit;
[0062] The result temporary storage area is used to store the result after the direct memory access controller executes the command;
[0063] The direct memory access controller is used to parse the command and perform data movement operations, and process data transmission related to the accelerator consistency port interface.
[0064] In this embodiment, the DMA device includes at least one of: a data interface, a buffer, a command receiving area, a result temporary storage area, a direct memory access controller and a central processing unit, wherein:
[0065] 1) Data interface: The DMA device contains multiple data interfaces, which are used to connect to SRAM, DRAM, ACP interface of ARM CPU, etc. through various buses to achieve high-speed data transmission, and are used to connect to CPU through various buses to receive commands and give command execution results;
[0066] 2) Buffer: The DMA device contains multiple buffers inside, which are responsible for storing the data cache during the transfer process. The read data is cached and sent to the storage of the target address in a reasonable split or combination;
[0067] 3) Command receiving area and result temporary storage area: The DMA device contains multiple command receiving areas and result temporary storage areas. The command receiving area is responsible for receiving the commands sent by the CPU and waiting for the DMA controller to read and execute them. The result temporary storage area is responsible for temporarily storing the execution results of the DMA controller and waiting for the CPU to read the command results.
[0068] 4) DMA controller: The DMA device contains multiple DMA controllers, which are responsible for reading commands in the command receiving area, parsing them, executing the read data command according to the protocol requirements of the data moving source address, temporarily storing the read data in the buffer, and executing the write data command according to the protocol requirements of the data moving destination address. After the command is executed, the command execution result that needs to be fed back is written into the result temporary storage area according to the feedback field in the command, waiting for the CPU to read the command result.
[0069] Reference Figure 2 , shows a schematic flow diagram of a structural block diagram of a direct memory access device provided in an embodiment of the present invention, which may specifically include:
[0070] 1. The CPU controls DMA to perform data movement operations by writing commands into the DMA command receiving area;
[0071] 2. The DMA controller of the DMA device reads the command in the command receiving area, parses the command, issues a read data command that complies with the source address protocol requirements, writes the received data into the buffer, splits or combines the buffer data, issues a write data command that complies with the destination address protocol requirements, receives the command execution result, and writes the execution result into the result temporary storage area according to the command requirements;
[0072] 3. The CPU obtains the command execution result through the DMA result temporary storage area to complete the above process;
[0073] 4. The DMA device can read or write data in the cache, which can change the CPU's operating environment, affect the CPU's operating efficiency, and affect the cache hit rate and data processing performance.
[0074] Through this system-level chip dedicated DMA device and technology with integrated ACP interface, the data flow path in the cache is optimized, the time occupied by the CPU for data movement, cache prefetching and cache flushing is reduced, the efficiency and speed of data transmission are improved, and the cache hit rate and data processing performance are improved.
[0075] In an embodiment of the present invention, the direct memory access controller includes a transfer field of the accelerator coherence port in the analysis of the command;
[0076] Determining whether a transfer field of the accelerator coherence port is enabled for reading or writing in the command;
[0077] If the transfer field of the accelerator coherence port is enabled for reading or writing, the direct memory access controller processes the cache when performing data movement.
[0078] In an embodiment of the present invention, the determining whether the transmission field of the accelerator coherence port is enabled for reading or writing in the command includes:
[0079] The command is represented in the form of a command descriptor;
[0080] The command descriptor includes at least two bits, which are respectively used to indicate the enabling attribute of the accelerator consistency port of the source address or the destination address of the data migration;
[0081] If the value of the bit is a first preset value, the data transfer source address in the command descriptor is used normally to issue a read / write command on the bus;
[0082] If the value of the bit is a second preset value, the address is offset and the fields required for the accelerator consistency port transmission are added to the issued read and write commands; the read and write commands are sent to the accelerator consistency port interface through the bus.
[0083] The command is written into the command receiving area by the CPU in the form of a command descriptor;
[0084] In the embodiment of the present invention, the command descriptor includes at least two bits for indicating the ACP enable attribute of the data movement source address or destination address respectively. If the value of the bit is 0, the address in the command descriptor is used normally to issue a read and write command on the bus; if the value of the bit is 1, the address is offset and the fields required for ACP transmission are added to the issued read and write, so that the issued read and write are sent to the ACP interface through the bus.
[0085] In an embodiment of the present invention, if the transmission field of the accelerator coherence port is enabled for reading or writing, the direct memory access controller processes the cache when performing data movement, including:
[0086] When performing the data movement, the direct memory access controller realizes bus connection to the accelerator consistency port interface by offsetting the address; and adds the hardware signal required by the accelerator consistency port;
[0087] Operate the cache to read data from the same perspective as the central processing unit or perform a purposeful pre-fetch operation on the cache of the central processing unit, and preload and write back data in the cache;
[0088] The preloading and writing back of data in the cache includes:
[0089] Determine whether the required data exists in the cache of the central processing unit, and if the required data does not exist, actively update the data to the cache through a direct memory access controller;
[0090] When writing back the data in the cache, the data in the cache of the central processing unit is directly moved to a required address through a direct memory access controller.
[0091] For storage addresses with cache attributes, the CPU will cache the data at this address in the cache. The CPU reads and writes data from the cache much faster than from the actual storage. This also leads to a problem: the actual data in the storage may be data that has not been updated by the CPU.
[0092] Based on the above problems, if ordinary DMA is used to move data from an address with cache attributes, the cache must be flushed first to ensure that the correct data is moved.
[0093] In the embodiment of the present invention, by integrating the ACP interface, it is possible to achieve the situation where the CPU does not need to actively flush the cache, and the data that is the same as the CPU perspective can be directly moved through the ACP interface, thereby ensuring the correctness of the data and saving CPU time.
[0094] Then, if you want to move data to an open cache address, you may encounter the following problems:
[0095] The data at this address is partially in the cache and partially in the storage. If the CPU does not perform any operation, after the value in the storage is updated by the ordinary DMA, the CPU still reads the original unchanged data. As the CPU updates the cache, the data in the storage may also be overwritten by the data in the cache. Therefore, the CPU needs to invalidate the cache first, then configure the ordinary DMA to move the data, and then re-read the storage to update the cache information.
[0096] The embodiment of the present invention adopts a data preloading algorithm. When the corresponding data we need is not in the CPU cache, the data is actively updated to the cache through DMA, which reduces the time consumed by the CPU to access the data. The CPU does not need to re-read the data from the storage after a cache miss, and can directly move the data to the cache through the ACP interface. The CPU can directly see the changed data, and the cache does not need the CPU to actively control invalid updates.
[0097] It should be emphasized that the ACP interface is used to operate CPU cache-related content; it is not only about reading and writing data between storage and storage, but also includes reading and writing data from storage to cache or from cache to storage; for example:
[0098] If you need to move a piece of data from storage A without cache attributes to storage B with cache, the CPU will perform cache-related reads and writes on storage B. If ordinary DMA is used, you need to first make the CPU clear the cache information of address B, perform cache invalidation operations, and then configure DMA to move data from storage A to storage B. Then the CPU reads data from storage B and updates the cache information.
[0099] Based on the embodiment of the present invention, the data from storage A to storage B is moved by configuring DMA through the CPU, and the address enabling ACP of storage B is configured to move the data seen by the CPU of storage A with cache attribute to storage B without cache attribute;
[0100] If you need to move the data seen by the CPU of storage A with cache attributes to storage B without cache attributes; if you use ordinary DMA, you need to first make the CPU perform cache flush, update the information in the cache to storage A, and then configure DMA to move the data from storage A to storage B;
[0101] In the embodiment of the present invention, a data write-back algorithm is adopted, that is, the data in the CPU cache is directly moved to the required address through DMA, and the data is moved again without the CPU actively flushing the data. The data is moved from storage A to storage B by configuring DMA through the CPU, and the address of storage A is configured to enable ACP.
[0102] The embodiments of the present invention use advanced data preloading and write-back algorithms, which can intelligently adjust the storage location and flow of data in the cache according to real-time data processing requirements and CPU access patterns, thereby improving the cache hit rate and reducing cache miss events, thereby improving the overall data processing performance.
[0103] The data preloading and write-back algorithm in the embodiment of the present invention further includes: intelligently adjusting the storage location and flow of data in the cache based on the access mode and demand of the CPU to reduce cache miss events.
[0104] In an embodiment of the present invention, the direct memory access device further comprises a status register;
[0105] The central processing unit determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem.
[0106] The DMA device provides a series of status registers for the CPU to determine the operating status of the DMA, such as whether the bus is stuck, waiting for hardware processing, etc.
[0107] If an error is found, the CPU can confirm which commands have not been executed through the DMA status register, and then control the DMA to restart working by writing the DMA reset register and writing the commands into the DMA command buffer again.
[0108] In an embodiment of the present invention, the central processor determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem, including:
[0109] The central processing unit determines the execution status of the command through the status register, and the status register at least includes a reset register;
[0110] The direct memory access device is controlled to restart operation according to the reset register, and the command is written into the command buffer.
[0111] Based on the embodiment of the present invention, when data transmission times out or the data transmission signal is abnormal, the DMA controller writes the error into the result temporary storage area, waits for the CPU to obtain the error information, reports the error, and processes the error signal to prevent it from interfering with other commands being executed.
[0112] In the embodiment of the present invention, the central processor determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem, including:
[0113] The central processing unit determines whether there is an error problem in the operation status of the direct memory access device based on the status register, and reports the error problem.
[0114] Based on the embodiment of the present invention, it also supports error detection and processing functions, can monitor in real time during data transmission and promptly handle abnormal situations, improve data security and integrity, enhance system stability and reliability, and ensure that the system-level chip can maintain efficient operation in various working environments.
[0115] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0116] Reference Figure 3 , shows a flow chart of the steps of a direct memory access method provided in an embodiment of the present invention, which may specifically include the following steps:
[0117] S301, high-speed connection with the system-on-chip and the accelerator consistency port through the data interface;
[0118] S302, the buffer temporarily stores data in the data transmission process;
[0119] S303, the command receiving area is responsible for receiving the command sent by the central processing unit;
[0120] S304, the result temporary storage area is used to store the result after the direct memory access controller executes the command;
[0121] S305: The direct memory access controller parses the command and executes a data movement operation, and processes data transmission related to the accelerator consistency port interface.
[0122] As for the method embodiment, since it is basically similar to the device embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0123] In addition, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned flash memory chip management method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0124] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned flash memory chip management method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0125] An embodiment of the present invention also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the flash memory chip management method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0126] Figure 4 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention. The electronic device 400 includes but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, a processor 410, and a power supply 411. Those skilled in the art will appreciate that Figure 5The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0128] It should be understood that in the embodiment of the present invention, the radio frequency unit 401 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 410 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 401 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 401 can also communicate with the network and other devices through a wireless communication system.
[0129] The electronic device provides users with wireless broadband Internet access through the network module 402, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0130] The audio output unit 403 can convert the audio data received by the RF unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output it as sound. Moreover, the audio output unit 403 can also provide audio output related to a specific function performed by the electronic device 400 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, etc.
[0131] The input unit 404 is used to receive audio or video signals. The input unit 404 may include a graphics processor (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 406. The image frame processed by the graphics processor 4041 can be stored in the memory 409 (or other storage medium) or sent via the radio frequency unit 401 or the network module 402. The microphone 4042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 401 in the case of a telephone call mode.
[0132] The electronic device 400 also includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 4061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 4061 and / or the backlight when the electronic device 400 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 405 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0133] The display unit 406 is used to display information input by the user or information provided to the user. The display unit 406 may include a display panel 4061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0134] The user input unit 407 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 4071 or near the touch panel 4071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 4071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 410, receives the command sent by the processor 410 and executes it. In addition, the touch panel 4071 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 4071, the user input unit 407 may also include other input devices 4072. Specifically, other input devices 4072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.
[0135] Furthermore, the touch panel 4071 may be overlaid on the display panel 4061. When the touch panel 4071 detects a touch operation on or near it, it is transmitted to the processor 410 to determine the type of the touch event. Then, the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Figure 5 In the figure, the touch panel 4071 and the display panel 4061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 4071 and the display panel 4061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0136] The interface unit 408 is an interface for connecting an external device to the electronic device 400. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 400 or may be used to transmit data between the electronic device 400 and an external device.
[0137] The memory 409 can be used to store software programs and various data. The memory 409 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 409 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0138] The processor 410 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 409, and calling data stored in the memory 409, so as to monitor the electronic device as a whole. The processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 410.
[0139] The electronic device 400 may also include a power supply 411 (such as a battery) for supplying power to each component. Preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0140] In addition, the electronic device 400 includes some functional modules not shown, which will not be described in detail here.
[0141] like Figure 5 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 901 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the flash memory chip management method described in the above embodiment.
[0142] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0144] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0145] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0147] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0150] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0151] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A direct memory access device, characterized in that: Applied to a system-level chip, the direct memory access device is connected to a central processing unit at high speed, and the direct memory access device includes at least one of: a data interface, a buffer, a command receiving area, a result temporary storage area, and a direct memory access controller; The data interface is used for high-speed connection with the system-on-chip and the accelerator consistency port; The buffer is used to temporarily store data in the data transmission process; The command receiving area is used to receive the command sent by the central processing unit; The result temporary storage area is used to store the result after the direct memory access controller executes the command; The direct memory access controller is used to parse the command and perform data movement operations, and process data transmission related to the accelerator consistency port interface.
2. The device according to claim 1, characterized in that The direct memory access controller analyzes the command to include a transfer field of the accelerator coherence port; Determining whether a transfer field of the accelerator coherence port is enabled for reading or writing in the command; If the transfer field of the accelerator coherence port is enabled for reading or writing, the direct memory access controller processes the cache when performing data movement.
3. The device according to claim 2, characterized in that The determining whether the command enables reading or writing of a transmission field of the accelerator coherence port includes: The command is represented in the form of a command descriptor; The command descriptor includes at least two bits, which are respectively used to indicate the enabling attribute of the accelerator consistency port of the source address or the destination address of the data migration; If the value of the bit is a first preset value, the data transfer source address in the command descriptor is used normally to issue a read / write command on the bus; If the value of the bit is a second preset value, the address is offset and the fields required for the accelerator consistency port transmission are added to the issued read and write commands; the read and write commands are sent to the accelerator consistency port interface through the bus.
4. The device according to claim 3, characterized in that If the transmission field of the accelerator consistency port is enabled for reading or writing, the direct memory access controller processes the cache when moving data, including: When performing the data movement, the direct memory access controller realizes bus connection to the accelerator consistency port interface by offsetting the address; and adds the hardware signal required by the accelerator consistency port; Operate the cache to read data from the same perspective as the central processing unit or perform a purposeful pre-fetch operation on the cache of the central processing unit, and preload and write back data in the cache; The preloading and writing back of data in the cache includes: Determine whether the required data exists in the cache of the central processing unit, and if the required data does not exist, actively update the data to the cache through a direct memory access controller; When writing back the data in the cache, the data in the cache of the central processing unit is directly moved to a required address through a direct memory access controller.
5. The device according to claim 1, characterized in that The direct memory access device also includes a status register; The central processing unit determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem.
6. The device according to claim 5, characterized in that The central processor determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem, including: The central processing unit determines the execution status of the command through the status register, and the status register at least includes a reset register; The direct memory access device is controlled to restart operation according to the reset register, and the command is written into the command buffer.
7. The device according to claim 5, characterized in that The central processing unit determines whether there is an error problem in the operation state of the direct memory access device based on the state register, and processes the error problem, including: The central processing unit determines whether there is an error problem in the operation status of the direct memory access device based on the status register, and reports the error problem.
8. A direct memory access method, characterized in that: Applied to a direct memory access device, the direct memory access device includes at least one of: a data interface, a buffer, a command receiving area, a result temporary storage area and a direct memory access controller, the method includes: High-speed connection with the system-on-chip and the accelerator consistency port through the data interface; The buffer temporarily stores data in the process of data transmission; The command receiving area is responsible for receiving commands sent by the central processing unit; The result temporary storage area is used to store the result after the direct memory access controller executes the command; The direct memory access controller parses the command and performs data movement operations, and processes data transmission related to the accelerator consistency port interface.
9. An electronic device, characterized in that: include: The device according to any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to execute the apparatus according to any one of claims 1 to 7.
Citation Information
Cited By
Data transmission method and device, storage medium and electronic equipment
CN120045507A
