This application claims the priority benefit of Taiwan application serial no. 111131565, filed on Aug. 22, 2022. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
The disclosure relates to an electronic device, and more particularly to a computing device and a data access method therefor.
Artificial intelligence (AI) computing requires an efficient and high-speed circuit. The computing circuit of an AI device, such as a matrix engine and a vector engine, are generally equipped with an internal memory to accelerate computations and perform a large number of parallel computations. When the ideal data sequence of the internal memory is inconsistent with the original data sequence, the central processing unit (CPU) or the direct memory access (DMA) controller must handle inconsecutive sequential read and write requirements, thereby increasing the amount of traffic of the bus and reducing resource efficiency.
The application scenario shown in
The application scenario shown in
Compared with
It should be noted that the content of the “Description of Related Art” section is used to help understand the disclosure. Some content (or all of the content) disclosed in the “Description of Related Art” section may not be known by persons skilled in the art. The content disclosed in the “Description of Related Art” section does not mean that the content has been known to persons skilled in the art before the application of the disclosure.
The disclosure provides a computing device and a data access method therefor to improve bus efficiency.
In an embodiment of the disclosure, the computing device includes a bus, a destination memory circuit, and a source memory circuit. The destination memory circuit and the source memory circuit are coupled to the bus. The source memory circuit is used to provide multiple pieces of data to the destination memory circuit through the bus based on a burst access instruction. A source address in the burst access instruction is a representative address among multiple consecutive addresses corresponding to the pieces of data in the source memory circuit, a destination address in the burst access instruction is a virtual address, the destination memory circuit remaps the virtual address to multiple discrete addresses, and the destination memory circuit stores the pieces of data from the bus to the discrete addresses in the destination memory circuit. Alternatively, a source address in the burst access instruction is a virtual address, the source memory circuit remaps the virtual address to multiple discrete addresses, the source memory circuit extracts the pieces of data from the discrete addresses in the source memory circuit to the bus, a destination address in the burst access instruction is a representative address among multiple consecutive addresses in the destination memory circuit, and the destination memory circuit stores the pieces of data from the bus to the consecutive addresses in the destination memory circuit. Alternatively, a source address in the burst access instruction is a first virtual address, the source memory circuit remaps the first virtual address to multiple first discrete addresses, the source memory circuit extracts the pieces of data from the first discrete addresses in the source memory circuit to the bus, a destination address in the burst access instruction is a second virtual address, the destination memory circuit remaps the second virtual address to multiple second discrete addresses, and the destination memory circuit stores the pieces of data from the bus to the second discrete addresses in the destination memory circuit.
In an embodiment of the disclosure, the data access method includes the following steps. Multiple pieces of data are provided to a destination memory circuit of a computing device through a bus of the computing device based on a burst access instruction by a source memory circuit of the computing device. A source address in the burst access instruction is a representative address among multiple consecutive addresses corresponding to the pieces of data in the source memory circuit, and a destination address in the burst access instruction is a virtual address. The virtual address is remapped to multiple discrete addresses by the destination memory circuit. The pieces of data from the bus are stored to the discrete addresses in the destination memory circuit by the destination memory circuit.
In an embodiment of the disclosure, the data access method includes the following steps. A virtual address is remapped to multiple discrete addresses by a source memory circuit of a computing device. Multiple pieces of data are extracted from the discrete addresses in the source memory circuit by the source memory circuit. The pieces of data are provided to a destination memory circuit of the computing device through a bus of the computing device based on a burst access instruction by the source memory circuit. A source address in the burst access instruction is a virtual address, and a destination address in the burst access instruction is a representative address among multiple consecutive addresses in the destination memory circuit. The pieces of data from the bus are stored to the consecutive addresses in the destination memory circuit by the destination memory circuit.
In an embodiment of the disclosure, the data access method includes the following steps. A first virtual address is remapped to multiple first discrete addresses by a source memory circuit of a computing device. Multiple pieces of data are extracted from the first discrete addresses in the source memory circuit by the source memory circuit. The pieces of data are provided to a destination memory circuit of the computing device through a bus of the computing device based on a burst access instruction by the source memory circuit. A source address in the burst access instruction is the first virtual address, and a destination address in the burst access instruction is a second virtual address. The second virtual address is remapped to multiple second discrete addresses by the destination memory circuit. The pieces of data from the bus are stored to the second discrete addresses in the destination memory circuit by the destination memory circuit.
Based on the above, the computing device and the data access method therefor according to the embodiments of the disclosure may be applicable to the situation where the source address and/or the destination address are inconsecutive. In the case where multiple access addresses in the source memory circuit are multiple discrete addresses, the source address in the burst access instruction is the virtual address. The source memory circuit may remap the virtual address to the discrete addresses in the source memory circuit, so as to correctly extract the pieces of data to the bus. For the bus, the source address (virtual address) in the burst access instruction is the representative address among the consecutive source addresses. In the case where multiple access addresses in the destination memory circuit are multiple discrete addresses, the destination address in the burst access instruction is another virtual address. The destination memory circuit may remap the virtual address to the discrete addresses in the destination memory circuit, so as to store the pieces of data from the bus to the correct addresses in the destination memory circuit. For the bus, the destination address (virtual address) in the burst access instruction is the representative address among the consecutive destination addresses. Therefore, regardless of whether the source addresses are inconsecutive and/or the destination addresses are inconsecutive, the bus may operate in a burst mode to reduce bus traffic and improve bus efficiency.
In order for the features and advantages of the disclosure to be more comprehensible, the following specific embodiments are described in detail in conjunction with the drawings.
The term “coupling (or connection)” used in the entire specification (including the claims) of the disclosure may refer to any direct or indirect connection means. For example, if a first device is described as being coupled (or connected) to a second device, it should be interpreted that the first device may be directly connected to the second device or the first device may be indirectly connected to the second device through another device or certain connection means. Terms such as “first” and “second” mentioned in the entire specification (including the claims) of the disclosure are used to name the elements or to distinguish between different embodiments or ranges, but not to limit the upper limit or the lower limit of the number of elements or to limit the sequence of the elements. In addition, wherever possible, elements/components/steps using the same reference numerals in the drawings and the embodiments represent the same or similar parts. Related descriptions of the elements/components/steps using the same reference numerals or using the same terminologies in different embodiments may be cross-referenced.
Based on the current operating scenario, one of the memory circuit 330 and the memory circuit 340 may be a source memory circuit for data transmission, and the other one of the memory circuit 330 and the memory circuit 340 may be a destination memory circuit for data transmission. The DMA controller 320 may issue a burst access instruction to control the source memory circuit to provide multiple pieces of data, and control the destination memory circuit to store the pieces of data.
For example, based on an access instruction (for example, the burst access instruction) of the CPU 310 or the DMA controller 320, the memory circuit 330 (source memory circuit) may provide the pieces of data to the memory circuit 340 (destination memory circuit) through the bus BUS31. Alternatively, the memory circuit 340 (source memory circuit) may provide the pieces of data to the memory circuit 330 (destination memory circuit) through the bus BUS31. When multiple access addresses in the source memory circuit are multiple discrete addresses, a source address in the burst access instruction is a virtual address. When multiple access addresses in the destination memory circuit are multiple discrete addresses, a destination address in the burst access instruction is a virtual address.
According to the actual design, in some embodiments, the memory circuit 330 and the memory circuit 340 may be different main memories. In other embodiments, one of the memory circuits 330 and 340 may be the main memory, and the other one of the memory circuits 330 and 340 may be an internal memory in a computing circuit. Based on practical applications, the computing circuit may be a computing circuit of an AI device, such as a matrix engine and a vector engine.
For example,
The application scenario shown in
The remapping circuit RM51 may remap the virtual address V0 of the burst access instruction to the discrete addresses B1, B3, B5, and B7 of the destination memory RAM52 (Step S420). The destination memory RAM52 may store the pieces of data from the bus BUS31 to the discrete addresses B1, B3, B5, and B7 of the destination memory RAM52 (Step S430). For the bus BUS31, the virtual address V0 in the burst access instruction “Move(A0, V0, 4)” is a representative address among multiple consecutive destination addresses. Based on this, the bus BUS31 may operate in a burst mode. Based on burst characteristics, the bus BUS31 can efficiently transmit multiple pieces of data with consecutive addresses. Therefore, the bus BUS31 operating in the burst mode can reduce bus traffic and improve bus efficiency.
For example,
The application scenario shown in
The remapping circuit RM71 remaps the virtual address V0 to the discrete addresses A0, A2, A4, and A6 of the source memory RAM71 (Step S610). The source memory RAM71 extracts multiple pieces of data from the discrete addresses A0, A2, A4, and A6 of the source memory RAM71 to the bus BUS31 (Step S620). The destination memory RAM72 stores the pieces of data from the bus BUS31 to the consecutive addresses B0 to B3 of the destination memory RAM72 (Step S640). For the bus BUS31, the virtual address V0 in the burst access instruction “Move(V0, B0, 4)” is a representative address among multiple consecutive destination addresses. Based on this, the bus BUS31 may operate in a burst mode. Based on burst characteristics, the bus BUS31 can efficiently transmit multiple pieces of data with consecutive addresses. Therefore, the bus BUS31 operating in the burst mode can reduce bus traffic and improve bus efficiency.
For example,
The application scenario shown in
The remapping circuit RM91 remaps the first virtual address V0 to the first discrete addresses A0, A2, A4, and A6 of the source memory RAM91 (Step S810). The source memory RAM91 extracts multiple pieces of data from the first discrete addresses A0, A2, A4, and A6 of the source memory RAM91 to the bus BUS31 (Step S820). The remapping circuit RM92 may remap the second virtual address V′0 of the burst access instruction to the second discrete addresses B1, B3, B5, and B7 of the destination memory RAM92 (Step S840). The destination memory RAM52 may store the pieces of data from the bus BUS31 to the second discrete addresses B1, B3, B5, and B7 of the destination memory RAM52 (Step S850). For the bus BUS31, the virtual address V0 in the burst access instruction “Move(V0, V′0, 4)” is a representative address among multiple consecutive source addresses, and the virtual address V′0 is a representative address among multiple consecutive destination addresses. Based on this, the bus BUS31 may operate in a burst mode. Based on burst characteristics, the bus BUS31 can efficiently transmit multiple pieces of data with consecutive addresses. Therefore, the bus BUS31 operating in the burst mode can reduce bus traffic and improve bus efficiency.
According to different design requirements, in some embodiments, the implementation of the remapping circuits RM51, RM71, RM91, and/or RM92 may be hardware circuits. In other embodiments, the implementation of the remapping circuits RM51, RM71, RM91, and/or RM92 may be firmware, software (that is, programs), or a combined form of the two. In still other embodiments, the implementation of the remapping circuits RM51, RM71, RM91, and/or RM92 may be a combined form of multiple of hardware, firmware, and software.
In terms of the form of hardware, the remapping circuits RM51, RM71, RM91, and/or RM92 may be implemented as logic circuits on integrated circuits. For example, the related functions of the remapping circuits RM51, RM71, RM91, and/or RM92 may be implemented in one or more controllers, microcontrollers, microprocessors, application-specific integrated circuits (ASICs), digital signal processors (DSPs), field programmable gate arrays (FPGAs), and/or various logic blocks, modules, and circuits in other processing units. The related functions of the remapping circuits RM51, RM71, RM91, and/or RM92 may be implemented in hardware circuits, such as various logic blocks, modules, and circuits in integrated circuits, using hardware description languages (for example, Verilog HDL or VHDL) or other suitable programming languages. The remapping circuits RM51, RM71, RM91, and/or RM92 may include a look-up table or a conversion function (computing formula).
In terms of the form of software and/or firmware, the related functions of the remapping circuits RM51, RM71, RM91, and/or RM92 may be implemented by programming codes. For example, the remapping circuits RM51, RM71, RM91, and/or RM92 are implemented using general programming languages (for example, C, C++, or assembly language) or other suitable programming languages. The programming codes may be recorded/stored in a “non-transitory computer readable medium”. In some embodiments, the non-transitory computer readable medium includes, for example, a semiconductor memory and/or a storage device. The semiconductor memory includes a memory card, a read only memory (ROM), a flash memory, a programmable logic circuit, or other semiconductor memories. The storage device includes a tape, a disk, a hard disk drive (HDD), a solid-state drive (SSD), or other storage devices. An electronic equipment (for example, a central processing unit (CPU), a controller, a microcontroller, or a microprocessor) may read and execute the programming codes from the non-transitory computer readable medium, thereby implementing the related functions of the remapping circuits RM51, RM71, RM91, and/or RM92.
In summary, the computing device and the data access method therefor described in the above embodiments may be applicable to the situation where the source addresses and/or the destination addresses are inconsecutive. In the case where multiple access addresses of the source memory RAM91 are multiple discrete addresses, the source address in the burst access instruction is the virtual address V0. The source memory circuit 910 may remap the virtual address V0 to the discrete addresses of the source memory RAM91, so as to correctly extract the pieces of data to the bus BUS31. For the bus BUS31, the source address (virtual address V0) in the burst access instruction is a representative address among multiple consecutive source addresses. In the case where multiple access addresses of the destination memory RAM92 are multiple discrete addresses, the destination address in the burst access instruction is another virtual address V′0. The destination memory circuit 920 may remap the virtual address V′0 to multiple discrete addresses of the destination memory RAM92, so as to store the pieces of data from the bus BUS31 to the correct addresses of the destination memory RAM92. For the bus BUS31, the destination address (virtual address V′0) in the burst access instruction is a representative address among multiple consecutive destination addresses. Therefore, regardless of whether the source addresses are inconsecutive and/or the destination addresses are inconsecutive, the bus BUS31 may operate in the burst mode to reduce bus traffic and improve bus efficiency.
Although the disclosure has been disclosed in the above embodiments, the embodiments are not intended to limit the disclosure. Persons skilled in the art may make some changes and modifications without departing from the spirit and scope of the disclosure. Therefore, the protection scope of the disclosure shall be defined by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
111131565 | Aug 2022 | TW | national |