Device for realizing high-efficiency direct memory access transmission
Through the combination of the register module, the address conversion circuit, the request response circuit and the read and write shielding circuit, the problems of complex direct memory access design and low efficiency in the existing technology are solved, and efficient direct memory access transmission is achieved.
Patent Information
- Application Number
- CN202323544575.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2033-12-25
AI Technical Summary
The existing direct memory access (DMA) continuous transmission scheme is complex in design and requires peripherals to generate events multiple times or the address to be incremented and decremented after each access, resulting in low efficiency.
Using a device including a register module, an address conversion circuit, a request response circuit and a read-write shielding circuit, the base address, total number and target address are sent through the register module, the address conversion circuit generates the actual address, the request response circuit processes the DMA control bus signal, reads and writes Shielding circuitry manages read and write operations for efficient direct memory access.
The direct memory access process is simplified. The device only needs one trigger to complete large batch transmission without changing the address, which improves the transmission efficiency.
Smart Images

Figure CN221884300U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to a device for realizing high-efficiency direct memory access transmission, belonging to the technical field of digital circuits. Background Art
[0002] Existing direct memory access (DMA) continuous transmission generally includes two solutions:
[0003] like Figure 1 As shown, the first solution requires the peripheral to generate multiple events. If continuous transmission of direct memory access to the peripheral address is required, a continuous transmission function is required, and the address is incremented or decremented according to a certain rule after each peripheral request. This solution has relatively high requirements for the complexity of direct memory access design, and requires the peripheral to generate multiple events for cooperation.
[0004] like Figure 2 As shown, the second solution does not require the peripheral to generate multiple requests, but requires direct memory access to configure the total number of transmissions. After each access, the address needs to be incremented or decremented according to a certain rule. Summary of the invention
[0005] The technical problem to be solved by the utility model is to provide a device for realizing high-efficiency direct memory access transmission.
[0006] In order to achieve the above technical objectives, the utility model adopts the following technical solutions:
[0007] According to a first aspect of an embodiment of the utility model, there is provided a device for implementing high-efficiency direct memory access transmission, comprising: a register module, an address conversion circuit, a request response circuit and a read-write mask circuit;
[0008] Among them, the register module sends base address data, total data and target address data to the address conversion circuit, and sends a read-write signal to the request response circuit; the address conversion circuit sends the actual address and transfer register read-write signal to the register module, sends a reset pulse signal to the read-write masking circuit, and receives the bus read-write signal and bus access address sent by the DMA control bus; the read-write masking circuit sends a read-write masking signal to the request response circuit; the request response circuit receives the response signal sent by the DMA control bus, and sends a request signal to the DMA control bus.
[0009] Preferably, the register module includes a first register, a second register, a third register, a fourth register, a fifth register, a sixth register, a seventh register, an eighth register, a DMA control register and a transfer register.
[0010] Preferably, the bit width of the first to eighth registers is 32 bits, and the addresses increase in multiples of 4.
[0011] Preferably, the DMA control register includes: a base address register, a total transfer count register and a continuous transfer enable register.
[0012] Preferably, the bit width of the base address register is 3 bits, and the default value of the base address register is 0.
[0013] Preferably, the bit width of the total number of transfers register is 3 bits, and the default value of the total number of transfers register is 0.
[0014] Preferably, the address conversion circuit comprises: a first comparator, a first AND gate, an access times counter, a second comparator and an adder;
[0015] Among them, the first comparator receives the DMA control bus access address and the target address, and sends a high-level signal to the first AND gate; the first AND gate receives the high-level signal and the DMA control bus read-write signal, sends a pulse signal to the access times counter, and sends a read-write signal to the transfer register; the access times counter sends counting data to the second comparator and the adder respectively; the second comparator receives the total number data of the total number register and the counting data sent by the access times counter, and when the counting data and the total number data are consistent, sends a reset pulse signal to the access times counter and the read-write masking circuit respectively; the adder receives the counting data sent by the access times counter and the base address data sent by the base address register, and sends the actual address data to the register module.
[0016] Preferably, the request response circuit comprises: a second AND gate, a first OR gate and a first D flip-flop;
[0017] The second AND gate receives the read / write signal sent by the transfer register and the read / write mask signal sent by the read / write mask circuit, and sends a read / write valid signal to the first OR gate. The first OR gate receives the read / write valid signal sent by the second AND gate, the reception completion signal sent by the preceding module, and the transmission completion signal sent by the preceding module, and sends a signal to the D interface of the first D flip-flop; the CLR interface of the first D flip-flop receives the response signal sent by the DMA control bus, the CLK interface of the first D flip-flop receives the clock reset signal, and the Q interface of the first D flip-flop sends a request signal to the DMA control bus.
[0018] Preferably, the read-write shielding circuit comprises: a second D flip-flop and a second OR gate;
[0019] Among them, the D interface of the second D flip-flop receives the reset pulse signal sent by the second comparator, the CLK interface of the second D flip-flop receives the clock reset signal, the CLR interface of the second D flip-flop receives the signal sent by the second OR gate, and the Q NOT interface of the second D flip-flop sends a read-write mask signal to the request response circuit; the second OR gate receives the receive completion signal and the send completion signal sent by the preceding module.
[0020] Compared with the prior art, the utility model simplifies the use of direct memory access. When large-scale transmission is required, the slave device only needs to trigger once and the direct memory access address does not need to change to complete the purpose of bulk data transmission to the peripheral address. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a working timing diagram of a conventional direct memory access continuous transfer;
[0022] Figure 2 It is another working timing diagram of traditional direct memory access continuous transfer;
[0023] Figure 3 A structural diagram of a device for realizing high-efficiency direct memory access transmission provided by the utility model;
[0024] Figure 4 A schematic diagram of the register sequence of a device for realizing high-efficiency direct memory access transmission provided by the utility model;
[0025] Figure 5 A schematic diagram of the structure of an address conversion circuit of a device for realizing high-efficiency direct memory access transmission provided by the utility model;
[0026] Figure 6 A schematic diagram of a request response circuit structure of a device for realizing high-efficiency direct memory access transmission provided by the utility model;
[0027] Figure 7 A schematic diagram of the structure of a read-write shielding circuit of a device for realizing high-efficiency direct memory access transmission provided by the utility model;
[0028] Figure 8 The utility model provides a working timing diagram of a device for realizing high-efficiency direct memory access transmission. DETAILED DESCRIPTION
[0029] The technical content of the present utility model is described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] First embodiment
[0031] like Figure 3 As shown, the first embodiment of the utility model provides a device for implementing high-efficiency direct memory access transmission, including: a register module, an address conversion circuit, a request response circuit and a read-write mask circuit.
[0032] The register module sends base address data, total number data and target address data to the address conversion circuit, and sends a read / write signal to the request response circuit. The address conversion circuit sends the actual address and transfer register read / write signal to the register module, sends a reset pulse signal to the read / write mask circuit, and receives the bus read / write signal and bus access address sent by the DMA control bus. The read / write mask circuit sends a read / write mask signal to the request response circuit. The request response circuit receives the response signal sent by the DMA control bus and sends a request signal to the DMA control bus.
[0033] like Figure 4 As shown, in one embodiment of the present utility model, the register module includes a first register 0, a second register 1, a third register 2, a fourth register 3, a fifth register 4, a sixth register 5, a seventh register 6, an eighth register 7, a DMA control register and a transfer register.
[0034] The first to eighth registers are used to store peripheral configuration information, the bit width of each register is 32 bits, and the address increases by multiples of 4.
[0035] The DMA control register includes: a base address register, a total transfer count register and a continuous transfer enable register.
[0036] The bit widths of the base address register and the transfer total number register are both 3 bits, which can express 0 to 7. The default values of the base address register and the transfer total number register are both 0.
[0037] like Figure 5 As shown, in one embodiment of the present utility model, the address conversion circuit includes: a first comparator, a first AND gate, an access times counter, a second comparator and an adder.
[0038] Among them, the first comparator receives the DMA control bus access address and the target address, and sends a high level signal to the first AND gate. The first AND gate receives the high level signal and the DMA control bus read / write signal, sends a pulse signal to the access counter, and sends a read / write signal to the transfer register. The access counter sends counting data to the second comparator and the adder respectively. The second comparator receives the total number data of the total number register and the counting data sent by the access counter, and sends a reset pulse signal to the access counter and the read / write masking circuit respectively when the counting data and the total number data are consistent. The adder receives the counting data sent by the access counter and the base address data sent by the base address register, and sends the actual address data to the register module.
[0039] The function of the address conversion circuit is to convert the access to the address of the transfer register into a circuit for the actual address when the DMA control bus accesses the peripheral.
[0040] The adder is used to generate an actual access address.
[0041] The actual access address is obtained by adding the value of the base address register and the value of the access count counter.
[0042] like Figure 6 As shown, in one embodiment of the present utility model, the request response circuit includes: a second AND gate, a first OR gate and a first D flip-flop.
[0043] Among them, the second AND gate receives the read-write signal sent by the transfer register and the read-write mask signal sent by the read-write mask circuit, and sends a read-write valid signal to the first OR gate. The first OR gate receives the read-write valid signal sent by the second AND gate, the reception completion signal sent by the preceding module, and the transmission completion signal sent by the preceding module, and sends a signal to the D interface of the first D flip-flop. The CLR interface of the first D flip-flop receives the acknowledgment (ACK) signal sent by the DMA control bus, the CLK interface of the first D flip-flop receives the clock reset signal, and the Q interface of the first D flip-flop sends a request (REQ) signal to the DMA control bus.
[0044] The function of the request response circuit is to generate a request signal for the DMA control bus and respond to a response signal sent by the DMA control bus.
[0045] like Figure 7 As shown, in one embodiment of the present utility model, the read-write shielding circuit includes: a second D flip-flop and a second OR gate.
[0046] The D interface of the second D flip-flop receives the reset pulse signal sent by the second comparator, the CLK interface of the second D flip-flop receives the clock reset signal, the CLR interface of the second D flip-flop receives the signal sent by the second OR gate, and the Q NOT interface of the second D flip-flop sends a read-write mask signal to the request response circuit. The second OR gate receives the reception completion signal and the transmission completion signal sent by the preceding module.
[0047] like Figure 8 As shown, the working sequence of a device for realizing high-efficiency direct memory access transmission provided by the utility model is described as follows:
[0048] S1: An event is generated by the peripheral, and after the event is generated, the peripheral pulls up the first request signal.
[0049] S2: The DMA control bus receives the first request signal and sends a first response signal to the peripheral device, that is, pulls up the first response signal.
[0050] S3: The peripheral receives the first response signal, and pulls the first request signal high and then low.
[0051] S4: The peripheral transfer register sends a read / write signal to the request response circuit.
[0052] S5: After reading and writing the target register, the DMA control bus pulls down the first response signal.
[0053] S6: Read and write accesses to the target register are delayed by the bus to reach the peripheral.
[0054] S7: The peripheral receives read and write accesses, and performs read and write accesses to the transfer register address. After decoding, it performs read and write accesses to the actual register address. The base address register, the total number of transfers register, and the current number of times are used in the decoding process. If the current number of times is less than the total number of times, the peripheral automatically sends the next request signal to the DMA control bus.
[0055] It should be noted that the above-mentioned multiple embodiments are only examples, and the technical solutions of the various embodiments can be combined, all of which are within the protection scope of the present utility model.
[0056] It should be noted that the term “formed” in the present invention means that it can be obtained by one of a variety of processes and is not limited to the processes listed in the embodiments.
[0057] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present utility model, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0058] The utility model is described in detail above. For those skilled in the art, any obvious changes made to the utility model without departing from the essence of the utility model will constitute an infringement of the patent right of the utility model and will bear corresponding legal responsibilities.
Claims
1. A device for realizing high-efficiency direct memory access transmission, characterized in that: include: Register module, address conversion circuit, request response circuit and read-write mask circuit; The register module sends base address data, total number data and target address data to the address conversion circuit, and sends a read / write signal to the request response circuit; the address conversion circuit sends an actual address and a transfer register read / write signal to the register module, sends a reset pulse signal to the read / write mask circuit, and receives a bus read / write signal and a bus access address sent by a DMA control bus; the read / write mask circuit sends a read / write mask signal to the request response circuit; The request response circuit receives a response signal sent by the DMA control bus and sends a request signal to the DMA control bus.
2. The device according to claim 1, characterized in that The register module includes a first register, a second register, a third register, a fourth register, a fifth register, a sixth register, a seventh register, an eighth register, a DMA control register and a transfer register.
3. The device according to claim 2, characterized in that The bit width of the first to eighth registers is 32 bits, and the addresses increase in multiples of 4.
4. The device according to claim 2, characterized in that The DMA control register includes: a base address register, a total transfer count register and a continuous transfer enable register.
5. The device according to claim 4, characterized in that The bit width of the base address register is 3 bits, and the default value of the base address register is 0.
6. The device according to claim 4, characterized in that The bit width of the total number of transfers register is 3 bits, and the default value of the total number of transfers register is 0.
7. The device according to claim 6, characterized in that The address conversion circuit comprises: a first comparator, a first AND gate, an access times counter, a second comparator and an adder; Among them, the first comparator receives the DMA control bus access address and the target address, and sends a high-level signal to the first AND gate; the first AND gate receives the high-level signal and the DMA control bus read-write signal, sends a pulse signal to the access times counter, and sends a read-write signal to the transfer register; the access times counter sends counting data to the second comparator and the adder respectively; the second comparator receives the total number data of the total number register and the counting data sent by the access times counter, and when the counting data and the total number data are consistent, sends a reset pulse signal to the access times counter and the read-write masking circuit respectively; the adder receives the counting data sent by the access times counter and the base address data sent by the base address register, and sends the actual address data to the register module.
8. The device according to claim 1, characterized in that The request response circuit includes: a second AND gate, a first OR gate and a first D flip-flop; Among them, the second AND gate receives the read-write signal sent by the transfer register and the read-write mask signal sent by the read-write mask circuit, and sends a read-write valid signal to the first OR gate; the first OR gate receives the read-write valid signal sent by the second AND gate, the receive completion signal sent by the preceding module and the send completion signal sent by the preceding module, and sends a signal to the D interface of the first D flip-flop; the CLR interface of the first D flip-flop receives the response signal sent by the DMA control bus, the CLK interface of the first D flip-flop receives the clock reset signal, and the Q interface of the first D flip-flop sends a request signal to the DMA control bus.
9. The device according to claim 1, characterized in that The read-write shielding circuit comprises: a second D flip-flop and a second OR gate; Among them, the D interface of the second D flip-flop receives the reset pulse signal sent by the second comparator, the CLK interface of the second D flip-flop receives the clock reset signal, the CLR interface of the second D flip-flop receives the signal sent by the second OR gate, and the Q NOT interface of the second D flip-flop sends a read-write mask signal to the request response circuit; the second OR gate receives the receive completion signal and the send completion signal sent by the preceding module.
