Universal memory computing accelerator
By adopting the three-layer architecture of processing unit-storage core-storage array and rich instruction set in the in-memory computing accelerator, the problems of single function and resource waste in the existing technology are solved, and the support and implementation of general computing tasks are realized. Performance improvements.
Patent Information
- Application Number
- CN202410496156.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-08-27
AI Technical Summary
Existing in-memory computing accelerators cannot support general computing tasks. Their single function leads to a waste of resources. They also lack non-volatile storage array design based on in-memory computing technology and cannot effectively perform mixed operations on integer and floating-point data.
A general in-memory computing accelerator is designed, which adopts a three-layer architecture of processing unit-storage and computing core-storage and computing array, supports parallel execution of multiple data types, and uses multiple processing units, storage and computing cores and storage and computing arrays. Parallel work improves instruction execution efficiency and provides a rich instruction set including Boolean logic, arithmetic operations, data movement and branch instructions.
It achieves support for general computing tasks, improves accelerator utilization, avoids resource waste, and significantly improves computing performance and energy utilization efficiency through multi-layer parallel architecture and rich instruction sets.
Smart Images

Figure CN118550870A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of accelerators, in particular, to the field of accelerator design based on in-memory computing, and more particularly, to a general in-memory computing accelerator. Background Art
[0002] In-memory computing (IMC) has achieved significant performance improvements and energy savings in a variety of application areas, such as neural network reasoning and training, scientific computing, and graph processing methods. However, current accelerators based on in-memory computing tend to focus on accelerating applications in a single field and support relatively single functions. These single-function accelerators are difficult to accelerate different applications. For example, several multifunctional in-memory computing accelerators have been proposed in existing research. These in-memory computing accelerators include:
[0003] (1) Plim, a programmable computing architecture based on logic-in-memory (LIM). Plim uses a resistive random-access memory (ReRAM) array based on majority-based operations (MAJ) as a computing unit. However, the use of ReRAM arrays as computing units in Plim results in the in-memory computing accelerator only supporting Boolean logic operations such as AND and OR on integer data, and cannot support arithmetic operations on floating-point data, and therefore cannot support general computing tasks.
[0004] (2) FloatPIM, an in-memory floating-point computing accelerator based on memristor-aided logic (MAGIC). FloatPIM can support arithmetic operations such as multiplication and addition on floating-point data. It uses a MAGIC-based computing method to decompose all floating-point calculations into Boolean logic operations, and then maps the Boolean logic operations to NOR logic primitives. Subsequently, multiple clock cycles are used to calculate NOR operations on the ReRAM array in sequence and store intermediate results to complete floating-point calculations. However, the method of decomposing floating-point calculations into NOR logic primitives requires the use of many devices to store intermediate results, resulting in a waste of storage space and an increase in the number of writes, which in turn affects performance and energy efficiency. At the same time, FloatPIM can only be used for the training of accelerator convolutional neural networks, and the instruction set corresponding to the in-memory computing accelerator only has instructions designed for floating-point data, so that it only supports floating-point data operations and cannot support accelerated general computing tasks.
[0005] (3) Reconfigurable in-memory computing accelerator Liquid Silicon. Among them, Liquid Silicon's ReRAM array can support storage, logical computing, parallel search and binary convolutional neural network acceleration functions. Liquid Silicon uses an FPGA-like working mode, and the array can be configured for any of the above functions. However, Liquid Silicon's storage and computing are essentially separated, that is, the storage array configured to implement storage functions cannot perform computing functions. Similarly, the array configured to implement computing functions itself cannot store data. Therefore, for a piece of data, Liquid Silicon requires twice the storage space to complete the data storage and computing functions respectively, resulting in a waste of storage resources; at the same time, the instruction set corresponding to the in-memory computing accelerator only has integer data instruction designs, so it only supports integer data operations and cannot support general computing tasks.
[0006] In summary, the existing in-memory computing accelerators do not fully utilize the in-memory computing technology, and lack the design of non-volatile storage arrays (also known as storage computing arrays) based on in-memory computing technology, which results in the storage computing arrays in the existing in-memory computing accelerators only supporting integer data operations or only supporting floating-point data operations, making the existing in-memory computing accelerators unable to support general computing tasks; at the same time, the instruction sets corresponding to the existing in-memory computing accelerators only have instruction designs for integer data or only have instruction designs for floating-point data, which also results in the existing in-memory computing accelerators being unable to support general computing tasks like CPUs or GPUs. However, the in-memory computing accelerators that cannot support general computing tasks have low utilization rates in practical applications due to their single functions, resulting in serious waste of resources.
[0007] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention
[0008] Therefore, an object of the present invention is to overcome the above-mentioned defects of the prior art and provide a general-purpose in-memory computing accelerator.
[0009] The objective of the present invention is achieved through the following technical solutions:
[0010] According to a first aspect of the present invention, a general-purpose in-memory computing accelerator is provided, the accelerator comprising: a plurality of instruction caches, each instruction cache being used to cache a plurality of instructions; a plurality of processing units being used to execute the instructions in the plurality of instruction caches in parallel, wherein one processing unit corresponds to one instruction cache, each processing unit being used to execute a plurality of instructions in the corresponding instruction cache, and each processing unit comprising a plurality of memory computing cores and a first peripheral circuit component, wherein: the plurality of memory computing cores are used to execute a plurality of instructions in the instruction cache corresponding to the processing unit in which they are located in parallel; the first peripheral circuit component is used to process a plurality of instructions that the plurality of memory computing cores need to execute so that each memory computing core correctly executes the instructions in the plurality of instruction caches. The second peripheral circuit component is used to process the instructions that need to be executed by the multiple storage and computing arrays in the storage and computing core to obtain the multiple operations required for each storage and computing array to execute the instructions based on its own stored data, as well as to cache and convert the input and output data generated when the multiple storage and computing arrays in the storage and computing core execute the instructions.
[0011] In some embodiments of the present invention, the first peripheral circuit component includes: a first register, used to cache input and output data generated when each storage and computing core executes instructions; a memory-addressable memory, used to perform instruction conflict detection on multiple instructions that need to be executed by multiple storage and computing cores; and a control unit, used to process instruction conflicts detected by the memory-addressable memory to control each storage and computing core to correctly execute the corresponding instructions.
[0012] In some embodiments of the present invention, each instruction and each data has a corresponding address, and the second peripheral circuit component includes: a second register, used to cache input and output data generated when multiple storage and computing arrays in the storage and computing core where it is located execute instructions; an instruction register, used to cache the addresses of data required for multiple storage and computing arrays in the storage and computing core where it is located to execute instructions; an instruction decoder, used to process the instructions that need to be executed by the multiple storage and computing arrays in the storage and computing core where it is located to obtain multiple operations required for each storage and computing array to execute instructions based on its own stored data; a program counter, used to store the addresses of instructions that need to be executed by the multiple storage and computing arrays in the storage and computing core where it is located; and an analog-to-digital converter, used to perform analog-to-digital conversion on the input and output data generated when the multiple storage and computing arrays in the storage and computing core where it is located execute instructions.
[0013] In some embodiments of the present invention, a data is composed of a multi-bit binary number, and each storage and computing array includes a cross switch array and a third peripheral circuit component, wherein: the cross switch array is used to store data and transmit the stored data to the third peripheral circuit component, or perform preprocessing on the stored data required for the instructions to be executed by the storage and computing array where the data is located and then transmit it to the third peripheral circuit component; the third peripheral circuit component is used to perform multiple operations on the data corresponding to the instructions to be executed by the storage and computing array where the data is located to complete the execution of the instructions, and cache the input and output data generated when the storage and computing array where the data is located executes the instructions.
[0014] In some embodiments of the present invention, the cross switch array includes: a plurality of non-volatile storage units, one non-volatile storage unit is used to store a binary number corresponding to a data and transmit it to a third peripheral circuit component, or perform required preprocessing on a binary number corresponding to a stored data and then transmit it to the third peripheral circuit component; a plurality of volatile input units, one volatile input unit is used to transfer a binary number corresponding to an immediate number required to execute an instruction to the third peripheral circuit component, wherein the immediate number is data not stored in the cross switch array.
[0015] In some embodiments of the present invention, each non-volatile storage unit includes: a first transistor and a second transistor, wherein the first transistor is used to control the enabling of the second transistor, and the second transistor is used to store a binary number corresponding to a data and transmit the binary number to a third peripheral circuit component, or perform required preprocessing on the binary number corresponding to the stored data and then transmit it to the third peripheral circuit component; each volatile input unit includes: a first transistor and a resistor, wherein the first transistor is used to transfer a binary number corresponding to an immediate number required to execute an instruction to the third peripheral circuit component; the resistor is used to ensure the correctness of the binary number corresponding to the immediate number required to execute an instruction transmitted from the first transistor to the third peripheral circuit component.
[0016] In some embodiments of the present invention, the third peripheral circuit component performs multiple operations corresponding to the instructions to be executed by the storage and calculation array in which the data is located, including: dynamic floating-point alignment operation, and / or shift operation, and / or accumulation operation, and / or current comparison operation, and / or voltage control operation, and / or negation operation, and / or summation operation, and the third peripheral circuit component includes: a delay unit, which is used to perform a dynamic floating-point alignment operation corresponding to the instruction to be executed by the storage and calculation array in which the data is located so that the correct result is obtained after the execution of the instruction is completed on the data; a shift accumulation unit, which is used to perform a shift operation corresponding to the instruction to be executed by the storage and calculation array in which the data is located so that the correct result is obtained after the execution of the instruction is completed on the data, or perform a shift operation and accumulation operation corresponding to the instruction to be executed by the storage and calculation array in which the data is located to complete the execution of the instruction; multiple current sensing sensitive amplifiers, each current sensing sensitive amplifier is used to perform a current comparison operation corresponding to the instruction to be executed by the storage and calculation array in which the data is located to complete the execution of the instruction; multiple pre-charge sensitive amplifiers, each pre-charge sensitive amplifier is used to perform a current comparison operation corresponding to the instruction to be executed by the storage and calculation array in which the data is located to complete the execution of the instruction; The invention relates to a memory computing array in which the voltage control operation corresponding to the instruction to be executed by the memory computing array is completed to execute the instruction; a plurality of peripheral logic gate circuits, a peripheral logic gate circuit is used to perform an inversion operation and / or a summation operation on the output results of a current sensing sensitive amplifier and a pre-charge sensitive amplifier to complete the execution of the instruction; a third register is used to cache the input and output data generated when the memory computing array in which the input and output data are executed; a circuit line component is used to connect with the cross switch array, the delay unit, the shift accumulation unit, the plurality of current sensing sensitive amplifiers, the plurality of pre-charge sensitive amplifiers, the plurality of peripheral logic gate circuits and the third register in a preset connection mode to control each component to perform the operation corresponding to the instruction to be executed by the memory computing array in which the input and output data are respectively executed by the memory computing array in which the input and output data are respectively executed by the memory computing array in which the input and output data are executed.
[0017] In some embodiments of the present invention, the circuit line component includes: multiple word lines, multiple bit lines, multiple data lines, multiple sensing lines, and multiple immediate data lines. These lines are used to connect with a cross switch array, a delay unit, a shift accumulation unit, multiple current sensing sensitive amplifiers, multiple pre-charged sensitive amplifiers, and multiple peripheral logic gate circuits and a third register in a preset connection method to control each component to perform operations on the data corresponding to the instructions to be executed by the storage array in which it is located.
[0018] In some embodiments of the present invention, the plurality of nonvolatile memory cells and the plurality of volatile input cells in the crossbar switch array are arranged in a multi-row multi-column manner and a row multi-column manner, respectively, wherein the number of nonvolatile memory cells in each row, the number of volatile input cells in a row, the number of current sensing sense amplifiers, the number of precharge sense amplifiers, and the number of peripheral logic gate circuits are all the same, and the preset connection manner is: all nonvolatile memory cells in each row are connected to the same data line and the same word line, each volatile input cell in a row is connected to an immediate data line, all nonvolatile memory cells and one volatile input cell in each column are connected to the same data line and the same word line, A bit line is connected to the same sensing line; a current sensing sensitive amplifier is connected to a bit line commonly connected to all non-volatile storage units in a column and a volatile input unit; a pre-charge sensitive amplifier is connected to a sensing line commonly connected to all non-volatile storage units in a column and a volatile input unit; a peripheral logic gate circuit is connected to a bit line and a sensing line commonly connected to a current sensing sensitive amplifier and a pre-charge sensitive amplifier; the delay unit is connected to each data line; the shift accumulation unit is connected to each bit line and each sensing line; the third register is connected to each data line, each bit line and each sensing line.
[0019] In some embodiments of the present invention, one end of the first transistor and the second transistor each include a gate, and the other end each include a source and a drain, and in each non-volatile storage unit, the gate of the first transistor is connected to the word line, the source is connected to the bit line, and the drain is connected to the source of the second transistor, the gate of the second transistor is connected to the data line, and the drain is connected to the sensing line; in each volatile input unit, one end of the resistor is connected to the bit line, and the other end is connected to the source of the first transistor, the gate of the first transistor is connected to the immediate data line, and the drain is connected to the sensing line.
[0020] In some embodiments of the present invention, instructions include: Boolean logic instructions, arithmetic operation instructions, data movement instructions and branch instructions, wherein the Boolean logic instructions include five instructions for integer data, namely, AND, OR, NOT, XOR and XNOR; the arithmetic operation instructions include eight instructions for integer data, namely, remainder, addition, subtraction, multiplication, division, multiplication and addition, absolute value and set after comparison, and seven instructions for floating-point data, namely, addition, subtraction, multiplication, division, multiplication and addition, absolute value and set after comparison; the data movement instructions include three instructions for integer data, namely, move, read and write, and three instructions for floating-point data, namely, move, read and write; the branch instructions include conditional branch instructions and unconditional branch instructions.
[0021] According to a second aspect of the present invention, there is provided an electronic device, which is configured with the accelerator described in any one of the above embodiments to complete the execution of instructions.
[0022] Compared with the prior art, the advantages of the present invention are:
[0023] The in-memory computing accelerator designed in the above embodiment of the present invention supports general computing tasks, improves the utilization rate of the in-memory computing accelerator in the above embodiment of the present invention in practical applications, and thus avoids serious waste of resources; at the same time, the multiple processing units, multiple memory computing cores, and multiple memory computing arrays in the in-memory computing accelerator designed in the above embodiment of the present invention respectively work in parallel to improve the execution efficiency of instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0025] Figure 1 A schematic diagram of a framework of an in-memory computing accelerator according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of a framework of an in-memory computing accelerator according to another embodiment of the present invention;
[0027] Figure 3 A schematic diagram of a storage and computing array according to an embodiment of the present invention;
[0028] Figure 4 A schematic diagram of a storage and computing array according to another embodiment of the present invention;
[0029] Figure 5 is a structural schematic diagram of a current sensing sense amplifier according to an embodiment of the present invention;
[0030] Figure 6 A schematic diagram of the structure of a pre-charged sense amplifier according to an embodiment of the present invention;
[0031] Figure 7 is a schematic diagram of the structure of a peripheral logic gate circuit according to an embodiment of the present invention;
[0032] Figure 8 A schematic diagram of a working process of an in-memory computing accelerator according to an embodiment of the present invention;
[0033] Fig. 9 A schematic diagram of an instruction format design according to an embodiment of the present invention;
[0034] Fig.10 It is a schematic diagram of experimental results of executing instructions by an in-memory computing accelerator according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail by specific embodiments below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0036] As described in the background technology, existing in-memory computing accelerators do not fully utilize the role of in-memory computing technology and lack the design of non-volatile storage arrays (also known as storage-computing arrays) based on in-memory computing technology. As a result, the storage-computing arrays in existing in-memory computing accelerators only support operations on integer data or only support operations on floating-point data, making the existing in-memory computing accelerators unable to support general computing tasks.
[0037] The inventor has found through research that the defect that the in-memory computing accelerator of the prior art cannot support general computing tasks can be solved by designing a storage computing array that can support operations on different data types. To this end, the present invention proposes a new design scheme for an in-memory computing accelerator. In the scheme of the present invention, the architecture of the in-memory computing accelerator adopts a three-layer storage computing architecture design mode, namely, a three-layer storage computing architecture of a processing element (PE)-storage computing core (core)-storage computing array (Array), wherein the present invention uses the designed storage computing array that can support operations on different data types as a computing unit; further, the different storage computing cores of the present invention are executed in parallel, so that the different storage computing arrays in different storage computing cores can work efficiently and collaboratively, so that the in-memory computing accelerator designed by the present invention can simultaneously support operations on different types of data. At the same time, the storage computing array of the present invention works in accordance with the working mode of single instruction multiple data (SIMD). This architecture using the SIMD mode can use one instruction to operate multiple data and calculate simultaneously, so that multiple storage computing arrays can work efficiently in parallel and improve computing efficiency. Therefore, the in-memory computing accelerator designed by the present invention can support the acceleration of general computing tasks.
[0038] In order to better understand the present invention, the present invention is described in detail below according to the accompanying drawings and specific embodiments.
[0039] According to one embodiment of the present invention, Figure 1As shown, the in-memory computing accelerator of the present invention includes: multiple instruction caches, each instruction cache is used to cache multiple instructions; multiple processing units are used to execute instructions in multiple instruction caches in parallel, wherein one processing unit corresponds to one instruction cache, each processing unit is used to execute multiple instructions in the corresponding instruction cache, and each processing unit includes multiple memory computing cores and a first peripheral circuit component, wherein: the multiple memory computing cores are used to execute multiple instructions in the instruction cache corresponding to the processing unit in which they are located in parallel; the first peripheral circuit component is used to process multiple instructions that need to be executed by the multiple memory computing cores so that each memory computing core correctly executes the corresponding instructions, and the cache The input and output data generated when each storage and computing core executes instructions are stored; wherein, one storage and computing core is used to execute one instruction, and each storage and computing core includes multiple storage and computing arrays and a second peripheral circuit component, wherein: the multiple storage and computing arrays are respectively used to store different types of data, and the multiple storage and computing arrays execute the same instruction in parallel based on the data stored in each of them; the second peripheral circuit component is used to process the instructions that need to be executed by the multiple storage and computing arrays in the storage and computing core where it is located to obtain multiple operations required for each storage and computing array to execute the instructions based on its own stored data, and to cache and convert the input and output data generated when the multiple storage and computing arrays in the storage and computing core where it is located execute instructions.
[0040] Since the in-memory computing accelerator of the present invention is designed according to the three-layer architecture of processing unit-memory computing core-memory computing array, that is, multiple instruction caches and multiple processing units are at the processing unit layer, multiple memory computing cores and the first peripheral circuit components are at the memory computing core layer, and multiple memory computing arrays and the second peripheral circuit components are at the memory computing array layer, the components of each layer of the in-memory computing accelerator designed by the present invention are described in detail below according to the above levels.
[0041] 1. Architecture of the Processing Unit Layer
[0042] In the processing unit layer of the in-memory computing accelerator designed by the present invention, the accelerator includes: multiple instruction caches, each instruction cache is used to cache multiple instructions; multiple processing units are used to execute the instructions in the multiple instruction caches in parallel, wherein one processing unit corresponds to one instruction cache, and each processing unit is used to execute multiple instructions in the corresponding instruction cache. It should be noted that the present invention takes 256 PEs as an example and gives Figure 1 The architecture of the processing unit layer shown in FIG. 1 , where 256 PEs can store 2 GB of data, the number of PEs in the in-memory computing accelerator in the embodiment of the present invention is only an example, and the specific number of PEs can be designed according to the characteristics of the computing task, and is not specifically limited here. Thus, the parallel operation of multiple processing units improves the execution efficiency of instructions.
[0043] 2. Storage and Computing Core Layer Architecture
[0044] In the storage and computing core layer of the in-memory computing accelerator of the present invention, each processing unit includes multiple storage and computing cores and a first peripheral circuit component, wherein: the multiple storage and computing cores are used to execute multiple instructions in the instruction cache corresponding to the processing unit in which they are located in parallel (that is, multiple instructions executed by multiple storage and computing cores in one processing unit are one instruction group), and one storage and computing core is used to execute one instruction; the first peripheral circuit component is used to process multiple instructions that need to be executed by multiple storage and computing cores so that each storage and computing core correctly executes the corresponding instructions, and caches the input and output data generated when each storage and computing core executes the instructions. It should be noted that the present invention takes 32 Cores as an example. Figure 1 The architecture of the storage and computing core layer shown in the figure is only an example of the number of cores in the in-memory computing accelerator in the embodiment of the present invention. The specific number of cores can be designed according to the characteristics of the computing task and is not specifically limited here. Therefore, the parallel operation of multiple storage and computing cores improves the execution efficiency of instructions.
[0045] Furthermore, according to one embodiment of the present invention, Figure 2 As shown, the first peripheral circuit component includes: a first register, a content addressable memory (CAM) and a control unit. Each component in the first peripheral circuit component is described in detail below.
[0046] (I) First register
[0047] The first register is used to cache input and output data generated when each storage and computing core executes instructions. According to one embodiment of the present invention, the first register includes: a first input register, used to cache input data generated when each storage and computing core executes instructions; a first output register, used to cache output data generated when each storage and computing core executes instructions.
[0048] 2. Memory Addressable Storage
[0049] The memory addressable memory is used to perform instruction conflict detection on multiple instructions that need to be executed by multiple storage and computing cores.
[0050] (III) Control unit
[0051] The control unit is used to process the instruction conflicts detected by the memory addressable memory to control each storage and computing core to correctly execute the corresponding instructions.
[0052] 3. Architecture of the Storage and Computing Array Layer
[0053] In the storage and computing array layer of the in-memory computing accelerator of the present invention, each storage and computing core includes multiple storage and computing arrays and a second peripheral circuit component, wherein: the multiple storage and computing arrays are respectively used to store different types of data, and the multiple storage and computing arrays execute the same instruction in parallel based on their respective stored data; the second peripheral circuit component is used to process the instructions that need to be executed by the multiple storage and computing arrays in the storage and computing core where it is located to obtain multiple operations required for each storage and computing array to execute the instructions based on its own stored data, as well as to cache and convert the input and output data generated when the multiple storage and computing arrays in the storage and computing core where it is located execute instructions. It should be noted that the present invention takes 32 Aarry as an example and gives Figure 1 The architecture of the storage computing core layer shown in the figure is only an example. The number of Aarries in the in-memory computing accelerator in the embodiment of the present invention is only an example. The specific number of Aarries can be designed according to the characteristics of the computing task and is not specifically limited here. The size of the crossbar switch array in each Aarry is the same, that is, 256×256. The size of the crossbar switch array in the in-memory computing accelerator of the present invention is only an example. The size of the crossbar switch array can be designed according to the characteristics of the data involved in the calculation and is not specifically limited here.
[0054] The second peripheral circuit component and each storage and computing array are described in detail below.
[0055] (I) Second peripheral circuit assembly
[0056] According to one embodiment of the present invention, still referring to Figure 2 The second peripheral circuit component includes: a second register, an instruction register, an instruction decoder, a program counter (PC) and an analog-to-digital converter (ADC). Each component in the second peripheral circuit component is described below.
[0057] 1. Second register
[0058] The second register is used to cache input and output data generated when multiple storage and computing arrays in the storage and computing core where the second register is located execute instructions. According to one embodiment of the present invention, the second register includes: a second input register, used to cache input data generated when multiple storage and computing arrays in the storage and computing core where the second register is located execute instructions, and a second output register, used to cache output data generated when multiple storage and computing arrays in the storage and computing core where the second register is located execute instructions.
[0059] 2. Instruction Register
[0060] The instruction register is used to cache the addresses of data required for executing instructions by multiple storage and computing arrays in the storage and computing core where the instruction register is located.
[0061] 3. Instruction decoder
[0062] The instruction decoder is used to process instructions that need to be executed by multiple storage and computing arrays in the storage and computing core where it is located to obtain multiple operations required for each storage and computing array to execute the instructions based on the data stored in itself.
[0063] 4. Program Counter
[0064] The program counter is used to store the addresses of instructions that need to be executed by multiple storage and computing arrays in the storage and computing core where the program counter is located.
[0065] 5. Analog-to-digital converter
[0066] The analog-to-digital converter is used to perform analog-to-digital conversion on the input and output data generated when the multiple storage and computing arrays in the storage and computing core execute instructions. It should be noted that the present invention uses 128 ADCs as an example to perform analog-to-digital conversion on the input and output data generated when the multiple storage and computing arrays in the storage and computing core execute instructions. The number of ADCs in the in-memory computing accelerator in the embodiment of the present invention is only an example. The specific number of ADCs can be designed according to the characteristics of the computing task, and is not specifically limited here.
[0067] (II) Each storage and computing array
[0068] According to one embodiment of the present invention, a data is composed of mostly binary numbers, such as Figure 3 As shown, each storage and computing array includes a crossbar and a third peripheral circuit component, wherein: the crossbar is used to store data and transmit the stored data to the third peripheral circuit component, or perform preprocessing on the stored data required by the instruction to be executed by the storage and computing array where it is located and then transmit it to the third peripheral circuit component; the third peripheral circuit component is used to perform multiple operations corresponding to the instruction to be executed by the storage and computing array where it is located on the data to complete the execution of the instruction, and cache the input and output data generated when the storage and computing array where it is located executes the instruction. The following will respectively explain the crossbar, the third peripheral circuit component, and the connection method between the crossbar and the third peripheral circuit component.
[0069] 1. Crossbar switch array
[0070] According to one embodiment of the present invention, Figure 4 As shown, the crossbar switch array includes: a plurality of non-volatile storage units and a plurality of volatile input units. Each non-volatile storage unit and each volatile input unit will be described below.
[0071] (1) Each nonvolatile storage unit
[0072] A non-volatile storage unit is used to store a binary number corresponding to a data and transmit it to a third peripheral circuit component, or perform required preprocessing on a binary number corresponding to a stored data and transmit it to the third peripheral circuit component. According to an embodiment of the present invention, each non-volatile storage unit includes: a first transistor and a second transistor, wherein the first transistor is used to control the enabling of the second transistor, and the second transistor is used to store a binary number corresponding to a data and transmit the binary number to the third peripheral circuit component, or perform required preprocessing on a binary number corresponding to a stored data and transmit it to the third peripheral circuit component.
[0073] (2) Each volatile input unit
[0074] A volatile input unit is used to transfer a binary digit corresponding to an immediate number required to execute an instruction to a third peripheral circuit component, wherein the immediate number is data not stored in the crossbar switch array. According to an embodiment of the present invention, each volatile input unit includes: a first transistor and a resistor, wherein the first transistor is used to transfer a binary digit corresponding to an immediate number required to execute an instruction to the third peripheral circuit component; and the resistor is used to ensure the correctness of the binary digit corresponding to the immediate number required to execute an instruction transferred from the first transistor to the third peripheral circuit component.
[0075] In addition, according to one embodiment of the present invention, the first transistor is an N-type metal-oxide-semiconductor transistor (N-Metal-Oxide-Semiconductor, NMOS), and the second transistor is a ferroelectric field-effect transistor (Ferroelectric Field-Effect Transistor, FeFET). Among them, a multi-bit binary number of data is stored in multiple non-volatile memory cells at adjacent positions in a row of non-volatile memory cells. It should be noted that NMOS and FeFET are only one embodiment of the two transistors. With the continuous development of transistors, transistors with better performance can be selected for replacement, and no specific limitation is made here.
[0076] It can be seen from the above embodiments that the immediate number required to execute the instruction is transmitted through the volatile input unit. When executing the instruction, the crossbar switch array designed in the above embodiments of the present invention can reduce the demand for storage space and reduce the number of times data is written, that is, there is no need to allocate a designated storage space for the input immediate number, and the data can participate in the calculation, thereby increasing the life of the in-memory computing accelerator designed in the above embodiments of the present invention.
[0077] 2. The third peripheral circuit component
[0078] According to one embodiment of the present invention, still referring to Figure 4 As shown, the third peripheral circuit component performs multiple operations corresponding to the instructions to be executed by the storage and calculation array on the data, including: dynamic floating point alignment operation, and / or shift operation, and / or accumulation operation, and / or current comparison operation, and / or voltage control operation, and / or negation operation, and / or summation operation, and the third peripheral circuit component includes: delay unit, shift accumulation unit, multiple current sensing sense amplifiers (CSAs), multiple pre-charge sense amplifiers (PSAs), multiple peripheral logic gate circuits (PLGCs), third register, circuit line component and circuit line component driver. Each component in the third peripheral circuit component is described in detail below.
[0079] (1) Delay unit
[0080] The delay unit is used to perform a dynamic floating point alignment operation on the data corresponding to the instruction to be executed by the storage and calculation array where the data is located, so as to obtain a correct result after the instruction is executed on the data.
[0081] (2) Shift-and-accumulate unit
[0082] The shift-and-accumulate unit is used to perform a shift operation on the data corresponding to the instruction to be executed by the storage and computing array in which the data is located so as to obtain a correct result after the instruction is executed on the data, or to perform a shift operation and an accumulation operation on the data corresponding to the instruction to be executed by the storage and computing array in which the data is located so as to complete the execution of the instruction.
[0083] (3) Multiple current sensing amplifiers
[0084] Each current sensing amplifier is used to perform a current comparison operation on the data corresponding to the instruction to be executed by the storage array where the current sensing amplifier is located, so as to complete the execution of the instruction.
[0085] like Figure 5 As shown, it shows the structure of a current sensing sensitive amplifier, wherein each current sensing sensitive amplifier includes: a plurality of transistors, each transistor is used to control the flow direction of data in the circuit; a plurality of inverters, which are used to perform an inversion operation on the data to complete the execution of the instruction (i.e., the two triangles in the figure); a latch, which is used to cache the result of executing the instruction (Latch), and the workflow of each current sensing sensitive amplifier (CSA) includes two stages: a reset stage (clock signal is 1) and a comparison stage (clock signal is 0), wherein the reset stage is to ensure that the voltage of the comparison node (i.e., the n1 and n2 nodes in the figure) is initialized to a known reference value, so as to accurately reflect the relative size between the subsequent input current and the reference current. If the reset is not performed, there may be residual charge or noise on the comparison node, which will directly affect the accuracy of the comparison result. The workflow of the two stages is described in detail below.
[0086] A. Reset phase
[0087] In the reset phase, since the clock signal (Clk) is 1, the control transistor 1 and transistor 2 are turned on, and the comparison nodes n1 and n2 are reset to the negative power supply voltage (V SS ), at this time, the inverse of the clock signal (Clkn) is 0, and the control transistor 3 and the transistor 4 are turned off, so that the current on the bit line (BL) cannot enter.
[0088] B. Comparison stage
[0089] When CAS is used to perform current comparison operations to obtain the result of executing an AND instruction, in the comparison phase, since the clock signal (Clk) is 0, control transistors 1 and 2 are turned off. At this time, the inverse of the clock signal (Clkn) is 1, and control transistors 3 and 4 are turned on, so that the current on the bit line (BL) and the reference current (I REF ) can enter the middle four transistors (i.e., transistors 5, 6, 7, and 8). The voltages of comparison nodes n1 and n2 will be different according to the comparison results of the current on BL and the reference current. When the current on BL is greater than the reference current (AND result is 1), the voltage of n2 will be pulled to a high value. When the current on BL is less than the reference current (AND result is 0), the voltage of n2 will be pulled to a low value. This voltage difference is further amplified by the four central transistors (i.e., transistors 5, 6, 7, and 8), and finally output to the latch for cache after passing through two inverters. The latch outputs the final calculation result.
[0090] (4) Multiple Pre-charged Sense Amplifiers
[0091] Each pre-charged sense amplifier is used to perform a voltage control operation on the data corresponding to the instruction to be executed by the storage and computing array in which the data is located to complete the execution of the instruction.
[0092] like Figure 6 As shown, it shows a structure of a pre-charged sense amplifier, wherein each current sensing sense amplifier includes: a plurality of transistors, each transistor is used to control the flow of data in the circuit; a plurality of inverters, each inverter is used to perform an inversion operation on the data to complete the execution (i.e. Figure 6 The two triangles in the figure); the latch is used to cache the result of executing the instruction, and the workflow of each precharge sense amplifier (PSA) includes two stages: the precharge stage (clock signal is 0) and the calculation stage (clock signal is 1). The precharge stage mainly performs initialization and precharge operations to ensure that the voltage on SL reaches V DD , in preparation for the subsequent calculation stage. The following is a detailed introduction to the workflow of the two stages.
[0093] A. Pre-charge stage
[0094] In the pre-charge stage, since the clock signal (Clk) is 0, the control transistor M C Open, the voltage on SL passes through transistor M C Precharge to V DD , at this time the voltage on SL is V DD , after passing through the first inverter, it is input to transistor M U In the U Open, it acts as a level restorer, so that the voltage on SL can be kept at V DD , and then the voltage passes through the second inverter and is buffered in the latch, which outputs the final result.
[0095] B. Calculation Phase
[0096] When PSA is used to perform voltage control operation to obtain the result of executing an OR instruction, in the calculation stage, since the clock signal (Clk) is 1, the control transistor M C Open, the voltage on SL will remain at V DD Or discharge to 0, depending on whether there is a path from SL to the ground. When the OR result is 1, at least one of the second transistors in the two non-volatile storage units involved in the OR instruction has a low resistance value (i.e., 1), so that there is a path from SL to the ground, thereby generating a discharge from SL to the ground, and finally the voltage on SL is 0, and the output result after two inverters is 0 (the inverse value of the OR calculation); when the OR result is 0, the second transistors in the two non-volatile storage units involved in the OR instruction are both at a high resistance value (i.e., 0), so that SL has no path to the ground, so that the voltage on SL is maintained at V DD , and finally the output result through two inverters is 1 (the inverse value of OR calculation). At this time, transistor M U The first inverter still forms a level restorer to maintain the voltage on SL. The result is input into the latch for buffering, and finally the latch outputs the result.
[0097] When PSA is used to perform voltage control operations to obtain the result of executing a read instruction, in the calculation phase, when the read data is 0, the second transistor in a non-volatile storage unit involved in the read instruction is in a high resistance value, so that SL has no path to ground, so that the voltage on SL is maintained at V DD , and finally the output result is 1 (the inverse of the read value, that is, NOT) through two inverters. When the read data is 1, the second transistor in a non-volatile storage unit participating in the read instruction is in a low resistance value, so that SL can be connected to the ground, so that the voltage on SL is discharged to 0, and finally the output result is 0 (the inverse of the read value, that is, NOT) through two inverters.
[0098] (5) Multiple peripheral logic gate circuits
[0099] A peripheral logic gate circuit is used for performing an inversion operation and / or a summing operation on the output results of a current sensing sense amplifier and a precharge sense amplifier to complete the execution of the instruction.
[0100] like Figure 7 As shown, it shows the structure of a peripheral logic gate circuit, wherein each peripheral logic gate circuit includes: a plurality of inverters, each inverter is used to perform an inversion operation on data to complete the execution of instructions (i.e. Figure 7 ), full adder, used to perform sum operation on data to complete the execution of instructions (i.e. Figure 7 The full adder includes a carry input module, which is used to input a binary number that is carried after the sum operation is performed on two binary numbers; a sum module, which is used to perform a sum operation on the input binary number and the two binary numbers that need to be summed, and an output carry, which is used to output the binary number obtained by summing the input binary number and the two binary numbers that need to be summed. When the CSA obtains the result of executing the AND instruction, it outputs the result to Figure 7 The PSA obtains the inverse value of the result of executing the read instruction and outputs it to Figure 7 The line where the serial number 5 is located is the result of executing the NOT instruction (because the inverse value is read, it is the result of NOT); after the PSA obtains the inverse value of the result of executing the read instruction, it outputs it to Figure 7 The line where the serial number 4 is located passes through an inverter to obtain the result of executing the read (READ) instruction or the OR (OR) instruction; the inverse value of the execution or instruction result obtained by PSA passes through an inverter and is output to Figure 7 The line where the sequence number 2 is located in the middle obtains the result of executing the exclusive OR (XOR) instruction. After the CSA obtains the result after executing the AND instruction, it outputs it to Figure 7The line where serial number 2 is located is obtained after passing through an inverter to obtain the result of executing the exclusive OR (XOR) instruction. Specifically, when the result of executing the OR instruction is 0 (indicating that both binary numbers are 0 and the XOR result is 0), the result of executing the XOR instruction is 0. When the result of executing the AND instruction is 1 (indicating that at least one of the two binary numbers is 1), the inverse value of the AND instruction is output as the result of executing the XOR instruction (when both binary numbers are 1, the result of executing the AND instruction is 1, and the inverse value of the AND is output as 0. At this time, the XOR result is also 0; when one of the two binary numbers is 1 and the other is 0, the inverse value of the AND is 1, and the result of executing the XOR instruction is 1); since the result of executing the XNOR instruction is the result of negating the result obtained by executing the XOR instruction, Figure 7 The result of executing the XOR instruction obtained on the line where the sequence number 2 is located is output to the line where the sequence number 3 is located and after passing through an inverter, the result of executing the XNOR instruction is obtained.
[0101] In addition, the full adder in each peripheral logic gate circuit can perform a sum operation on the binary numbers at corresponding positions in the two data. Therefore, multiple full adders in multiple peripheral logic gate circuits can be connected to form a serial carry adder, thereby being able to implement addition instructions on two data.
[0102] (6) Third register
[0103] The third register is used to cache input and output data generated when the storage and computing array in which it is located executes instructions. According to one embodiment of the present invention, the third register includes: a third input register, used to cache input data generated when the storage and computing array in which it is located executes instructions, and a third output register, used to cache output data generated when the storage and computing array in which it is located executes instructions.
[0104] (7) Circuit line assembly
[0105] The circuit line component is used to connect with the cross switch array, delay unit, shift accumulation unit, multiple current sensing sensitive amplifiers, multiple pre-charge sensitive amplifiers, multiple peripheral logic gate circuits and the third register in a preset connection mode to control each component to perform operations corresponding to the instructions to be executed by the storage array where it is located, thereby completing the execution of the instructions. According to one embodiment of the present invention, the circuit line component includes: multiple word lines (Wordline, WL), multiple bit lines (Bit line, BL), multiple data lines (Data line, DL), multiple sensing lines (sensingline, SL), and multiple immediate data lines (Immediate data line, IL), which are all used to connect with the cross switch array, delay unit, shift accumulation unit, multiple current sensing sensitive amplifiers, multiple pre-charge sensitive amplifiers, multiple peripheral logic gate circuits and the third register in a preset connection mode to control each component to perform operations corresponding to the instructions to be executed by the storage array where it is located.
[0106] (8) Circuit line component drive
[0107] The circuit line component driver is used to connect with the circuit line component to drive the circuit line component so that it can control the cross switch array, delay unit, shift accumulation unit, multiple current sensing sensitive amplifiers, multiple pre-charged sensitive amplifiers, multiple peripheral logic gate circuits and the third register to respectively perform operations on the data corresponding to the instructions to be executed by the storage array where the data is located. The circuit line component driver includes: a word line driver, which is used to connect with each word line; and a data line driver, which is used to connect with each data line.
[0108] 3. Connection method between the crossbar switch array and the third peripheral circuit component
[0109] According to one embodiment of the present invention, still referring to Figure 4As shown, the plurality of nonvolatile memory cells and the plurality of volatile input cells in the crossbar switch array are arranged in a multi-row multi-column manner and a row multi-column manner, respectively, wherein the number of nonvolatile memory cells in each row, the number of volatile input cells in a row, the number of current sensing sense amplifiers, the number of precharge sense amplifiers, and the number of peripheral logic gate circuits are all the same, and the preset connection manner is: all nonvolatile memory cells in a row are connected to the same data line and the same word line, each volatile input cell in a row is connected to an immediate data line, and all nonvolatile memory cells and one volatile input cell in each column are connected to the same bit line. and the same sensing line; a current sensing sensitive amplifier is connected to a bit line commonly connected to all non-volatile storage units in a column and a volatile input unit; a pre-charge sensitive amplifier is connected to a sensing line commonly connected to all non-volatile storage units in a column and a volatile input unit; a peripheral logic gate circuit is connected to a bit line and a sensing line commonly connected to a current sensing sensitive amplifier and a pre-charge sensitive amplifier; the delay unit is connected to each data line; the shift accumulation unit is connected to each bit line and each sensing line; the third register is connected to each data line, each bit line and each sensing line. According to one embodiment of the present invention, one end of the first transistor and the second transistor both include a gate, and the other end both include a source and a drain, and in each non-volatile storage unit, the gate of the first transistor is connected to the word line, the source is connected to the bit line, and the drain is connected to the source of the second transistor, the gate of the second transistor is connected to the data line, and the drain is connected to the sensing line; in each volatile input unit, one end of the resistor is connected to the bit line, and the other end is connected to the source of the first transistor, the gate of the first transistor is connected to the immediate data line, and the drain is connected to the sensing line.
[0110] In order to more clearly understand the working principle of the in-memory computing accelerator designed in the above embodiment of the present invention, the working principle of the in-memory computing accelerator designed in the above embodiment of the present invention is summarized below from how to obtain instructions to complete the execution of instructions. Figure 8 As shown, the workflow of the in-memory computing accelerator of the present invention includes steps S1-S7, wherein steps S1-S2 are the instruction acquisition stage; steps S3-S4 are the in-memory reading stage; step S5 is the in-memory computing stage; and steps S6-S7 are the in-memory writing stage. Different processing units in the in-memory computing accelerator of the present invention work in parallel, and different memory computing cores in the same processing unit execute four working stages synchronously. The working process of a processing unit in the in-memory computing accelerator at each stage is described in detail below.
[0111] First, instruction reading stage
[0112] Still reference Figure 8As shown, in the instruction acquisition stage, steps S1-S2 are mainly performed. Among them, in step S1, a processing unit reads instructions from its instruction cache, that is, a processing unit obtains a group of instructions consisting of multiple instructions from the instruction cache corresponding to it according to the instruction address stored in the program counter of the internal storage and computing core; in step S2, the memory addressable memory performs instruction conflict detection, and the control unit processes instruction conflicts, that is, a group of instructions will be transmitted to the memory addressable memory for comparison, and the objects of comparison are the read data address and the write data address in each instruction. When two or more instructions have the same read data address or write data address, the control unit controls the need to reserve several clock cycles for data transmission in the corresponding working stage. Specifically, when the read data addresses in the instructions are the same, the control unit controls the reserved cycle in the memory read phase, and when the write data addresses of the instructions are the same, the control unit reserves the cycle in the memory write phase. When the comparison is completed, a calculation instruction and other read and write data requests in the instructions will be sent to each storage and computing core of the processing unit where they are located.
[0113] Second, the in-memory reading stage
[0114] Still reference Figure 8 As shown, in the in-memory reading stage, steps S3-S4 are mainly executed. Among them, in step S3, all the storage and computing arrays of each storage and computing core in a processing unit read data according to the address specified by the instruction and store it in the third output register, that is, all the storage and computing arrays of each storage and computing core in a processing unit read the data specified by the address according to the read data address stored in the instruction register, and the data will be read from the same position of different storage and computing arrays of the storage and computing core where it is located, and stored in the third output register shared by all the storage and computing arrays of the storage and computing core; in step S4, the read data is transferred to the storage and computing core specified by the instruction and stored in the second input register, that is, the data stored in the second output register is transferred to the storage and computing core that executes the instruction through a data transmission path in a processing unit and the data is stored in the second input register.
[0115] Third, in-memory computing stage
[0116] Still reference Figure 8As shown, step S5 is mainly executed in the in-memory calculation stage. In step S5, all the storage and calculation arrays in each storage and calculation core execute multiple operations corresponding to the instruction, and store the results in the third output register, that is, the data involved in the operation has been stored in the second input register of the corresponding storage and calculation core, and different storage and calculation cores will execute different instructions at this stage. If an operation is performed on two data, one data will be input from the second input register of the storage and calculation core where it is located to each storage and calculation array in the storage and calculation core, and the other data has been stored in the storage and calculation array. The result after executing the instruction will be stored in the third output register of each storage and calculation array in the storage and calculation core.
[0117] Fourth, the memory writing stage
[0118] Still referring to FIG8, in the in-memory writing stage, steps S6-S7 are mainly performed. In step S6, the result in the third output register is transferred to the second input register of the storage computing core specified by the instruction, that is, the result after executing the instruction is transferred from the third output register of each storage computing array in the storage computing core to the second input register of the storage computing core to which data needs to be written; in step S7, the result in the second input register is written to the storage computing core specified by the instruction.
[0119] When all stages of the in-memory computing accelerator of the present invention are completed, a processing unit has completed the execution of a set of instructions, and it will start a new four-stage cycle and execute the next set of instructions. It should be noted that the above is a detailed description of the workflow of a processing unit, and the workflow of all processing units is the same.
[0120] It can be seen from the above embodiments that the storage and computing array in the in-memory computing accelerator designed by the present invention can support the storage of different types of data, so that the accelerator of the present invention can support general computing tasks, improve the utilization rate of the accelerator in practical applications, and thus avoid serious waste of resources; at the same time, the design of a volatile input unit in the in-memory computing accelerator reduces the demand for storage space when completing computing tasks, thereby increasing the life of the accelerator; in the in-memory computing accelerator, the parallel operation of multiple processing units, the parallel operation of multiple storage and computing cores, and the parallel operation of multiple storage and computing arrays improves the execution efficiency of instructions.
[0121] In addition, as described in the background technology, the instruction sets corresponding to existing in-memory computing accelerators only have instructions designed for integer data or only have instructions designed for floating-point data, which also results in the existing in-memory computing accelerators being unable to support general computing tasks like CPUs or GPUs.
[0122] After further research, the inventors found that the defect of the in-memory computing accelerators designed in the prior art that they cannot support general computing tasks is also due to the lack of sufficient design of the instruction set of the existing in-memory computing accelerators (these accelerators only consider accelerating a single application, and do not consider how to support the acceleration of general computing tasks), making it difficult for users to use these in-memory computing accelerators to accelerate different applications. For example, as shown in Table 1, it shows the instruction set corresponding to the in-memory computing accelerators in the prior art. It can be seen from Table 1 that the instruction set corresponding to Plim only has designs for AND, OR, XOR, addition, read and write instructions for integer data; the instruction set corresponding to FloatPIM only has designs for multiplication and addition instructions for floating-point data; the instruction set corresponding to Liquid Silicon only has designs for AND and OR instructions for integer data.
[0123] Table 1
[0124]
[0125] In order to solve the above problems, the present invention designs a corresponding instruction set for the in-memory computing accelerator of the above embodiment for integer data and floating-point data. The instruction set supports all instructions for execution by the in-memory computing accelerator designed for the above embodiment of the present invention. The instruction set includes multiple types of instructions, so that the in-memory computing accelerator of the present invention can support the execution of all instructions in the instruction set to accelerate different computing tasks. According to an embodiment of the present invention, as shown in Table 2, it shows the instruction set corresponding to the in-memory computing accelerator of the above embodiment of the present invention. It can be seen from Table 2 that the instructions executed by the in-memory computing accelerator designed in the above embodiment of the present invention include: Boolean logic instructions, arithmetic operation instructions, data movement instructions and branch instructions, wherein the Boolean logic instructions include 5 instructions for integer data, such as AND, OR, NOT, XOR and XNOR; the arithmetic operation instructions include 8 instructions for integer data, such as remainder, addition, subtraction, multiplication, division, multiplication and addition, absolute value and comparison and setting, and 7 instructions for floating-point data, such as addition, subtraction, multiplication, division, multiplication and addition, absolute value and comparison and setting; the data movement instructions include 3 instructions for integer data, such as move, read and write, and 3 instructions for floating-point data, such as move, read and write; the branch instructions include conditional branch instructions and unconditional branch instructions. Among them, the supported data types include 8-bit, 16-bit, 32-bit, 64-bit integer data, and 32-bit, 64-bit floating-point data. Boolean logic instructions can be executed on integer data, arithmetic instructions (except modulo instructions) can be executed on integer and floating-point data, data movement instructions can be executed on integer and floating-point data, and branch instructions are executed as control instructions, regardless of the data type.
[0126] Table 2
[0127]
[0128] However, different instructions have corresponding instruction formats, such as Fig. 9 As shown, it shows the instruction format design diagram of the present invention. Among them, from top to bottom are Boolean logic and arithmetic operation instruction formats, data movement instruction formats and branch instruction formats. The length of all instructions is 64 bits, and Boolean logic instructions and arithmetic operation instructions use the same instruction format. The following is a detailed introduction to the four types of instruction formats.
[0129] First, the instruction format of Boolean logic instructions and arithmetic operations
[0130] The first 5 bits are used as function code (i.e. Opcode); the next two bits are used to specify the data type (i.e. Type); the next 5 bits are used to specify which storage and computing core the instruction is executed on (i.e. Core ID); the next three groups of 13 bits (i.e. Src1 ID, Src2 ID, Des ID) are used to specify the location of two data and the write location of the result of the operation on the two data, respectively, where the location of each data includes a row code and an intra-row position mask; the next 7 bits (i.e. Src / Des Core ID+R / W) are used to specify the ID of another storage and computing core when transmitting data across storage and computing cores and whether to read or write across storage and computing cores; the next two bits are used for optimization purposes. It should be noted that for MAC instructions, the location of the second data is the location where the calculation starts. The MAC instruction is executed in the entire crossbar switch array, that is, from the first row of non-volatile storage cells to the last row of non-volatile storage cells. The write location is not used in the MAC instruction, and the calculation result is written into the third output register.
[0131] Secondly, the data movement instruction format
[0132] The first 5 bits are used as the function code (i.e., Opcode); the next two bits are used to specify the data type (i.e., Type); the next 5 bits are used to specify on which storage and computing core the instruction is executed (i.e., Core ID); the next two groups of 13 bits (i.e., Src1 ID and Src2 ID) are used to specify the locations of two data respectively; the next 9 bits are used to specify the ID of another processing unit when data is transmitted across processing units; the next 6 bits are used to specify the ID of another storage and computing core when data is transmitted across storage and computing cores.
[0133] Finally, the branch instruction format
[0134] The first 5 bits are used as the function code (i.e., Opcode); the next 5 bits are used to specify which memory and computing core the instruction is executed on (i.e., Core ID); the next 5 bits are used to specify which memory and computing array the instruction is executed on (i.e., Array ID); and the next 47 bits are used to specify the address of the instruction.
[0135] It can be seen from the above embodiments that the instruction set corresponding to the in-memory computing accelerator of the present invention includes instruction designs for integer data and instruction designs for floating-point data, which enriches the types of instructions that can be executed by in-memory computing, so that the in-memory computing accelerator designed by the present invention supports general computing tasks like a CPU or GPU, thereby improving the utilization rate of the in-memory computing accelerator in practical applications to avoid serious waste of resources.
[0136] In addition, when the in-memory computing accelerator designed based on the above embodiment of the present invention executes instructions, it can execute instructions such as read, write, and, or, not, XOR, XNOR, addition, subtraction, multiplication, division, multiplication and addition on integer data, and execute instructions such as addition, subtraction, multiplication, division, multiplication and addition on floating-point data. The execution process of each of the above instructions is described in detail below. It should be noted that the in-memory computing accelerator designed based on the above embodiment of the present invention can execute more different instructions, and the execution process of the following instructions is only a partial example, which is explained in detail in order to more clearly understand the functions of each component in the in-memory computing accelerator, and more instruction execution processes will not be repeated one by one.
[0137] 1. For integer data
[0138] (I) Read instruction
[0139] When executing a read instruction, the word line driver and the data line driver are used to drive the word line and the data line respectively to select each row of non-volatile storage cells that need to execute the read instruction, and the pre-charged sensitive amplifier is used to obtain the voltage on the sensing line and perform the voltage control operation corresponding to the read instruction to be executed by the storage and calculation array where it is located, and then the result after the operation is inverted by the inverter to obtain the read data and output it to the third output register. Among them, the process of the pre-charged sensitive amplifier performing the voltage control operation to obtain the result of executing the read instruction has been introduced when introducing the structure of the pre-charged sensitive amplifier, and will not be repeated here.
[0140] (II) Write instruction
[0141] When executing a write instruction, a word line driver is used to drive the word line to select each row of non-volatile storage cells that need to execute the write instruction, and then the bit line is used to transmit data and write the data into each row of non-volatile storage cells that need to execute the write instruction.
[0142] (III) With instructions
[0143] When executing an AND instruction, if two data to be executed for the AND instruction are stored in two rows of non-volatile storage cells respectively, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then the current sensing sensitive amplifier is used to read the current on the bit line and perform the current comparison operation corresponding to the instruction to be performed by the storage and calculation array to obtain the result of executing the AND instruction on the two data; if one data to be executed for the AND instruction is stored in a row of non-volatile storage cells, and the other data is an immediate number transmitted through a row of volatile input cells, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the row of non-volatile storage cells, and then the current sensing sensitive amplifier is used to read the current on the bit line and perform the current comparison operation corresponding to the instruction to be performed by the storage and calculation array to obtain the result of executing the AND instruction on the two data. Among them, the process of the current sensing sensitive amplifier performing the current comparison operation to obtain the result of executing the AND instruction has been introduced when introducing the structure of the current sensing sensitive amplifier, and it will not be repeated here.
[0144] (IV) or Instruction
[0145] When executing an OR instruction, if two data of the instruction need to be executed and stored in two rows of non-volatile storage cells respectively, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then the pre-charge sensitive amplifier is used to obtain the voltage on the sensing line and perform the voltage control operation corresponding to the read instruction to be executed by the storage and calculation array where it is located, and then the result after the operation is inverted by the inverter to obtain the result of executing the OR instruction on the two data; if one data of the OR instruction needs to be executed is stored in a row of non-volatile storage cells, and the other data is an immediate number transmitted through a row of volatile input units, the word line driver and the data line driver are used to drive the word line and the data line respectively to select this row of non-volatile storage cells, and then the pre-charge sensitive amplifier is used to obtain the voltage on the sensing line and perform the voltage control operation corresponding to the read instruction to be executed by the storage and calculation array where it is located, and then the result after the operation is inverted by the inverter to obtain the result of executing the OR instruction on the two data. Among them, the process of pre-charging the sense amplifier to perform voltage control operation to obtain execution or instruction results has been introduced when introducing the structure of the current sensing sense amplifier, and will not be repeated here.
[0146] (V) Non-instructions
[0147] When executing non-instructions, the reference Figure 7 ,from Figure 7It can be seen that the output result after the two data are pre-charged to the sense amplifier is the result of executing non-execution on the two data. Among them, the process of executing non-instruction has been introduced when introducing the structure of the peripheral logic gate circuit, and it will not be repeated here.
[0148] (VI) XOR instruction
[0149] When performing XOR execution, still refer to Figure 7 ,from Figure 7 It can be seen that the output result of the two data after passing through the precharge sense amplifier and then passing through the inverter obtains the result of executing the XOR instruction on the two data, or the output result of the two data after passing through the current sensing sense amplifier and then passing through the inverter obtains the result of executing the XOR instruction on the two data. Among them, the process of executing the XOR instruction has been introduced when introducing the structure of the peripheral logic gate circuit, and will not be repeated here.
[0150] (VII) Agreement or Instructions
[0151] When executing the same or same instruction, still refer to Figure 7 ,from Figure 7 It can be seen that the result obtained after executing the XOR instruction on two data is then passed through the inverter to obtain the result of executing the XOR instruction on the two data. Among them, the process of executing the XOR instruction has been introduced when introducing the structure of the peripheral logic gate circuit, so it will not be repeated here.
[0152] (8) Addition instruction
[0153] When executing an addition instruction, if two data that need to execute the addition instruction are stored in two rows of non-volatile storage cells respectively, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then the current sensing sensitive amplifier is used to read the current on the bit line and perform the current comparison operation corresponding to the instruction to be executed by the storage array where it is located to obtain the result of the two data executing the AND instruction, and the pre-charge sensitive amplifier is used to obtain the voltage on the sensing line and perform the voltage control operation corresponding to the read instruction to be executed by the storage array where it is located, and then the result after the operation is inverted by the inverter to obtain the result of the two data executing the OR instruction, and the results of the two data executing the AND instruction and the results of the OR instruction are summed using a serial carry adder to obtain the result of the two data executing the addition instruction; if it is necessary to execute One data of a row or instruction is stored in a row of non-volatile storage cells, and the other data is an immediate value transmitted through a row of volatile input cells. The word line driver and the data line driver are used to drive the word line and the data line respectively to select the row of non-volatile storage cells, and then the current sensing sensitive amplifier is used to read the current on the bit line and perform the current comparison operation corresponding to the instruction to be performed by the storage and calculation array to obtain the results of the two data execution and instructions, and the pre-charge sensitive amplifier is used to obtain the voltage on the sensing line and perform the voltage control operation corresponding to the read instruction to be performed by the storage and calculation array to be performed, and then the result after the operation is inverted by the inverter to obtain the results of the two data execution or instructions, and the results of the two data execution and instructions and the results of the or instructions are summed using a serial carry adder to obtain the results of the two data execution addition instructions.
[0154] (IX) Subtraction Instructions
[0155] When executing a subtraction instruction, if the two data that need to execute the subtraction instruction are stored in two rows of non-volatile storage cells respectively, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then the current sensing sensitive amplifier is used to read the current corresponding to the subtrahend on the bit line and perform a current comparison operation to obtain the inverted value corresponding to the subtrahend, and the lowest bit of the serial carry adder is set to 1, and then the serial carry adder is used to perform a sum operation on the inverted value corresponding to the subtrahend and the minuend to obtain the result of executing the subtraction instruction on the two data; if it is necessary to execute One data of the row or instruction is stored in a row of non-volatile storage cells, and the other data is an immediate value transmitted through a row of volatile input cells. The word line driver and the data line driver are used to drive the word line and the data line respectively to select this row of non-volatile storage cells, and then the current sensing amplifier is used to read the current corresponding to the subtrahend on the bit line and perform a current comparison operation to obtain the inverted value corresponding to the subtrahend, and the lowest bit of the serial carry adder is set to 1, and then the serial carry adder is used to perform a sum operation on the inverted value corresponding to the subtrahend and the minuend to obtain the result of executing the subtraction instruction on the two data.
[0156] (X) When executing a multiplication instruction, two data that need to execute the multiplication instruction are stored in two rows of non-volatile storage cells respectively, and the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then a data stored in one row of non-volatile storage cells is read into the third register, and the multi-bit binary numbers corresponding to the data in the third register are sequentially input into another row of non-volatile storage cells through the data line in a bit serial manner, and multiplied with the other data stored therein to obtain a plurality of intermediate results, and the plurality of intermediate results are transmitted to the bit lines in the form of current, and then the digital signals corresponding to the plurality of intermediate results are obtained by using the current sensing amplifier and output to the shift accumulation unit, and the shift accumulation unit performs a shift operation on each input intermediate result and then performs an accumulation operation to obtain the result of executing the multiplication instruction on the two data.
[0157] (11) Multiply and add instructions
[0158] When executing a multiplication-addition instruction, a word line driver and a data line driver are used to respectively drive the word line and the data line to select each row of non-volatile storage cells in the cross switch array, and then a multi-bit binary number corresponding to a data is sequentially input into each row of non-volatile storage cells in a bit serial manner through a data line connected to each row of non-volatile storage cells, and multiplied with another data stored therein respectively, and then accumulated on the bit line in the form of current to obtain a plurality of intermediate results, and an analog-to-digital converter is used to convert the plurality of intermediate results into digital signals and output them to a shift-accumulation unit, and the shift-accumulation unit performs a shift operation on each input intermediate result and then performs an accumulation operation to obtain the result of executing the multiplication-addition instruction on the data.
[0159] (XII) Division Instruction
[0160] When executing a division instruction, two data that need to execute the division instruction are stored in two rows of non-volatile storage units respectively, and the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage units. First, the first position of the multi-bit binary number corresponding to the two data is found from left to right, and then all the binary numbers after the position are used as the valid bits of the two data to participate in the operation, and the valid bits of the dividend stored in one row of non-volatile storage units are read into the third register, and the valid bits of the dividend are input into the cross switch array in batches according to the preset rules through the data line to perform multiple subtraction calculations with the valid bits of the divisor (consistent with the execution process of the subtraction instruction) to obtain the result of executing the division instruction on the two data. Among them, according to the preset rules means that the positive or negative result after each subtraction calculation determines whether the result of the one-bit quotient obtained this time is 1 or 0, and it will also determine whether the valid bits of the dividend input into the cross switch array next time are directly shifted from the valid bits of the dividend participating in the calculation this time, or the remainder of the subtraction calculation this time is shifted and spliced with the valid bits after the dividend.
[0161] 2. For floating point data
[0162] When a corresponding instruction is executed on floating-point data, the corresponding floating-point data needs to be converted according to a preset floating-point data representation standard, that is, a floating-point data is converted to include an exponent part and a mantissa part.
[0163] (I) Addition instruction
[0164] When executing an addition instruction, if two data on which the addition instruction needs to be executed are stored in two rows of non-volatile storage cells respectively, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then a subtraction calculation is performed on the exponential parts of the two data to obtain one of the larger exponents, and then the mantissa part of the data with a smaller exponent is read into the shift accumulation unit for shift operation, and the shifted mantissa is input into the cross switch array through the data line to perform an addition calculation with the mantissa of another data to obtain the result of performing the addition calculation on the mantissa parts of the two data, and the larger exponential part is spliced with the result of performing the addition calculation on the mantissa parts of the two data to obtain the result of executing the addition instruction on the two data. In addition, when the result of performing the addition calculation on the mantissa parts corresponding to the two data exceeds the number of digits limited by the mantissa part, the result of performing the addition calculation on the mantissa parts of the two data is clipped according to the maximum number of digits of the mantissa limited by the IEEE-754 standard to obtain the final result of performing the addition calculation on the mantissa parts of the two data, and then the clipped data is passed through a row of volatile input units to perform the addition calculation on the clipped data and the larger exponent to obtain the final exponent part, and the final exponent part is spliced with the final result of performing the addition calculation on the mantissa parts of the two data to obtain the result of executing the addition instruction on the two data. It should be noted that the process of performing the addition calculation on the mantissa parts of two floating-point data is the same as the process of performing the addition instruction on integer data, and the process of performing the addition calculation and subtraction calculation on the exponent parts of two floating-point data is the same as the process of performing the addition instruction and subtraction instruction on integer data, which will not be repeated here.
[0165] (II) Subtraction instruction
[0166] When executing a subtraction instruction, if the two data on which the addition instruction needs to be executed are stored in two rows of non-volatile storage cells respectively, the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then a subtraction calculation is performed on the exponential parts of the two data to obtain a larger exponent, and then the mantissa part of the data with a smaller exponent is read into the shift accumulation unit for shift operation, and the shifted mantissa is input into the cross switch array through the data line to perform a subtraction calculation with the mantissa of another data to obtain a result of performing a subtraction calculation on the mantissa parts of the two data, and the larger exponential part is spliced with the result of performing a subtraction calculation on the mantissa parts of the two data to obtain a result of executing a subtraction instruction on the two data. In addition, when the result of performing a subtraction calculation on the mantissa parts corresponding to the two data exceeds the number of digits limited by the mantissa part, the result of performing a subtraction calculation on the mantissa parts of the two data is clipped according to the maximum number of digits of the mantissa limited by the IEEE-754 standard to obtain the final result of performing a subtraction calculation on the mantissa parts of the two data, and then the clipped data is passed through a row of volatile input units to perform an addition calculation on the clipped data and a larger exponent to obtain the final exponent part, and the final exponent part is spliced with the final result of performing a subtraction instruction on the mantissa parts of the two data to obtain the result of performing a subtraction instruction on the two data. It should be noted that the process of performing a subtraction calculation on the mantissa parts of two floating-point data is the same as the process of performing a subtraction instruction on integer data, and the process of performing an addition calculation and a subtraction calculation on the exponent parts of two floating-point data is the same as the process of performing an addition instruction and a subtraction instruction on integer data, which will not be repeated here.
[0167] (III) Multiplication Instructions
[0168] When executing a multiplication instruction, two data that need to execute the multiplication instruction are stored in two rows of non-volatile storage cells respectively, and a word line driver and a data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then the exponent parts of the two data are added to obtain an intermediate exponent, and then the mantissa part of one of the data stored in one row of non-volatile storage cells is read into a third register, and the multi-bit binary numbers corresponding to the mantissa part of the data in the third register are sequentially input into another row of non-volatile storage cells in a bit serial manner through the data line, and multiplied with the mantissa part of another data stored therein to obtain multiple intermediate results, and the multiple intermediate results are transmitted to the bit line in the form of current, and then the digital signals corresponding to the multiple intermediate results are obtained by using a current sensing sensitive amplifier and output to a shift accumulation unit, and the shift accumulation unit performs a shift operation on each input intermediate result and then performs an accumulation operation to obtain the result of performing the multiplication calculation on the mantissa part of the two data, and splices the intermediate exponent with the result of performing the multiplication calculation on the mantissa part of the two data to obtain the result of executing the multiplication instruction on the two data. In addition, when the result of performing the multiplication calculation on the mantissa parts corresponding to two data exceeds the number of bits limited by the mantissa part, the result of performing the multiplication calculation on the mantissa parts of the two data is trimmed according to the maximum number of bits of the mantissa limited by the IEEE-754 standard to obtain the final result of performing the multiplication calculation on the mantissa parts of the two data, and then the trimmed data is passed through a row of volatile input units to perform addition calculation on the trimmed data and the intermediate exponent to obtain the final exponent part, and the final exponent part is spliced with the final result of performing the multiplication calculation on the mantissa parts of the two data to obtain the result of executing the multiplication instruction on the two data.
[0169] (IV) Multiply and add instructions
[0170] When executing a multiplication-addition instruction, a word line driver and a data line driver are used to respectively drive the word line and the data line to select each row of non-volatile storage cells in the crossbar switch array, and a serial subtraction calculation is performed on the exponential part of a plurality of data that need to be input into the crossbar switch array to execute the multiplication-addition instruction to find the maximum exponent therein, and a subtraction calculation is performed on the maximum exponent and the remaining exponents to obtain the difference between the remaining exponents and the maximum exponent and transmit it to the delay unit, and the delay unit performs a dynamic floating-point alignment operation according to the difference between the remaining exponents and the maximum exponent to generate a clock cycle corresponding to each data that needs to be input into the crossbar switch array to execute the multiplication-addition instruction, and then the clock cycle corresponding to each data that needs to be input into the crossbar switch array to execute the multiplication-addition instruction is generated ... The data line inputs the multi-bit binary number corresponding to the mantissa part of each data into each row of non-volatile storage units in a bit serial manner in the corresponding clock cycle, and performs multiplication calculations with the mantissa part of another data stored therein respectively, and then accumulates them on the bit line in the form of current to obtain multiple intermediate results, and uses an analog-to-digital converter to convert the multiple intermediate results into digital signals and output them to the shift-accumulation unit. The shift-accumulation unit performs a shift operation on each input intermediate result and then performs an accumulation operation to obtain the result of performing multiplication and addition calculations on the mantissa part of the data, and concatenates the largest exponent therein with the result of performing multiplication and addition calculations on the mantissa part of the data to obtain the result of executing a multiplication and addition instruction on the data. In addition, when the result of performing multiplication and addition calculations on the mantissa part of the data exceeds the number of digits limited by the mantissa part, the result of performing multiplication and addition calculations on the mantissa part of the data is clipped according to the maximum number of digits of the mantissa limited by the IEEE-754 standard to obtain the final result of performing multiplication and addition calculations on the mantissa part of the data, and then the clipped data is passed through a row of volatile input units to perform addition calculations on the clipped data and the maximum exponent to obtain the final exponent part, and the final exponent part is spliced with the final result of performing multiplication and addition calculations on the mantissa part of the data to obtain the result of executing the multiplication and addition instruction on the data. It should be noted that the process of performing addition and subtraction calculations on the exponential part of two floating-point data is the same as the process of performing addition and subtraction instructions on integer data, and will not be repeated here.
[0171] (V) Division Instructions
[0172] When executing a division instruction, two data that need to execute the division instruction are stored in two rows of non-volatile storage cells respectively, and the word line driver and the data line driver are used to drive the word line and the data line respectively to select the two rows of non-volatile storage cells, and then a subtraction calculation is performed on the exponent parts of the two data to obtain an intermediate exponent, and then the first position of the multi-bit binary number corresponding to the mantissa part of the two data is found from left to right, and all the binary numbers after this position are used as the valid bits of the mantissa part of the two data to participate in the operation, and the valid bits of the mantissa part of the dividend stored in one row of non-volatile storage cells are read into the third register, and the valid bits of the mantissa part of the dividend are input into the cross switch array in batches according to a preset rule through the data line to perform multiple subtraction calculations with the valid bits of the mantissa part of the divisor (consistent with the execution process of the subtraction instruction) to obtain the result of performing the division calculation on the mantissa part of the two data, and the intermediate exponent is spliced with the result of performing the division calculation on the mantissa part of the two data to obtain the result of executing the division instruction on the two data. In addition, when the result of performing the division calculation on the mantissa of two data exceeds the number of digits limited by the mantissa, the result of performing the division calculation on the mantissa of the two data is clipped according to the maximum number of digits of the mantissa limited by the IEEE-754 standard to obtain the final result of performing the division calculation on the mantissa of the two data, and then the clipped data is transmitted through a row of volatile input units to perform addition calculation on the clipped data and the intermediate exponent to obtain the final exponent, and the final exponent is spliced with the final result of performing the division calculation on the mantissa of the two data to obtain the result of executing the division instruction on the two data. Among them, according to the preset rule, it means that the positive or negative result of each subtraction calculation determines whether the result of the one-bit quotient obtained this time is 1 or 0, and it will also determine whether the effective bit of the mantissa of the dividend input to the crossbar switch array next time is a direct shift of the effective bit of the mantissa of the dividend participating in the current calculation, or the splicing of the remainder of the current subtraction calculation after the shift and the effective bit after the mantissa of the dividend. It should be noted that the process of performing subtraction calculation on the mantissa part of two floating-point data is the same as the process of performing subtraction calculation on integer data, and the process of performing subtraction calculation and addition calculation on the exponent part is the same as the process of executing subtraction instructions and addition instructions on integer data, which will not be repeated here.
[0173] In summary, the storage calculation array in the existing in-memory computing accelerator only supports the operation of integer data or only supports the operation of floating-point data, so that the existing in-memory computing accelerator cannot support general computing tasks, while the above embodiment of the present invention designs a storage calculation array that can support operations on different data types (that is, it can support the operation of integer data and floating-point data); the instruction set corresponding to the existing in-memory computing accelerator only has instruction designs for integer data or only has instruction designs for floating-point data, which also causes the existing in-memory computing accelerator to be unable to support general computing tasks like CPU or GPU, while the instruction set corresponding to the in-memory computing accelerator of the above embodiment of the present invention has instruction designs for integer data and floating-point data, enriching the instruction set corresponding to the in-memory computing accelerator designed in the above embodiment of the present invention, so that the in-memory computing accelerator designed in the present invention supports general computing tasks like CPU or GPU. Therefore, the above embodiment of the present invention improves the instruction set level and the in-memory computing accelerator architecture level of the in-memory computing accelerator so that the in-memory computing accelerator designed in the embodiment of the present invention supports general computing tasks, improves the utilization rate of the in-memory computing accelerator of the above embodiment of the present invention in practical applications, and thus avoids serious waste of resources.
[0174] In order to verify that the performance and energy saving of the in-memory computing accelerator designed in the above embodiment of the present invention are better than those of the existing in-memory computing accelerator, the inventors conducted the following comparative experiments:
[0175] Comparison experiment 1: Using 16-bit integer data, the comparison instructions are AND, OR, XOR, and Add, which are the instruction sets supported by Plim. Fig.10 As shown, compared with Plim, the in-memory computing accelerator designed by the present invention can improve the performance by 14639.3 times and save 956.61 times of energy on average when executing instructions such as AND, OR, XOR and Add on integer data.
[0176] Comparison experiment 2: The data used is 32-bit floating point data, the instructions compared are Mul and Add, and the execution instructions are the instruction set supported by FloatPIM. Fig.10 Compared with FloatPIM, the in-memory computing accelerator designed by the present invention can improve the performance by 308.87 times and save 30.22 times of energy on average when executing multiplication and addition instructions on floating-point data.
[0177] Comparison experiment 3: The data used is 16-bit integer data, the instructions compared are AND and OR, and the executed instructions are the instruction set supported by Liquid Silicon. Fig.10Compared with Liquid Silicon, the in-memory computing accelerator designed by the present invention can improve the performance by 308.87 times and save 802.77 times of energy on average when executing AND and OR instructions on integer data.
[0178] Among them, performance refers to the time required to execute instructions on data to obtain results, measured in seconds. The speed of running time can reflect computing performance; energy refers to the energy consumption required to execute instructions on data to obtain results, measured in joules.
[0179] It can be seen from the above three comparative experiments that when executing instructions with the same data type and data amount, the performance and energy saving of the in-memory computing accelerator designed in the above embodiment of the present invention are better than the performance and energy saving of the existing in-memory computing accelerator, and the in-memory computing accelerator designed in the above embodiment of the present invention can support the execution of more instructions.
[0180] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0181] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0182] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0183] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A general-purpose in-memory computing accelerator, characterized in that: The accelerator comprises: Multiple instruction caches, each for caching multiple instructions; A plurality of processing units are used to execute instructions in a plurality of instruction caches in parallel, wherein one processing unit corresponds to one instruction cache, each processing unit is used to execute a plurality of instructions in a corresponding instruction cache, and each processing unit includes a plurality of storage and computing cores and a first peripheral circuit component, wherein: Multiple storage and computing cores are used to execute multiple instructions in the instruction cache corresponding to the processing unit in which they are located in parallel; The first peripheral circuit component is used to process multiple instructions that need to be executed by multiple storage and computing cores so that each storage and computing core correctly executes the corresponding instructions, and caches the input and output data generated when each storage and computing core executes the instructions; Among them, a storage and computing core is used to execute an instruction, and each storage and computing core includes multiple storage and computing arrays and second peripheral circuit components, wherein: The multiple storage and computing arrays are respectively used to store different types of data, and the multiple storage and computing arrays execute the same instruction in parallel based on the data stored in each array; The second peripheral circuit component is used to process the instructions that need to be executed by the multiple storage and computing arrays in the storage and computing core where it is located to obtain multiple operations required for each storage and computing array to execute the instructions based on its own stored data, as well as to cache and convert the input and output data generated when the multiple storage and computing arrays in the storage and computing core where it is located execute instructions.
2. The accelerator according to claim 1, characterized in that The first peripheral circuit component comprises: The first register is used to cache input and output data generated when each storage and computing core executes instructions; Memory addressable memory, used to detect instruction conflicts between multiple instructions that need to be executed by multiple storage and computing cores; A control unit is used to process the instruction conflicts detected by the memory addressable memory to control each storage and computing core to correctly execute the corresponding instructions.
3. The accelerator according to claim 1, characterized in that Each instruction and each data has a corresponding address, and the second peripheral circuit component includes: The second register is used to cache input and output data generated when multiple storage and computing arrays in the storage and computing core where the register is located execute instructions; An instruction register is used to cache the addresses of data required for executing instructions by multiple storage arrays in the storage and computing core where it is located; An instruction decoder is used to process instructions to be executed by multiple storage and computing arrays in the storage and computing core to obtain multiple operations required for each storage and computing array to execute the instructions based on the data stored in itself; A program counter is used to store the addresses of instructions to be executed by multiple storage arrays in the storage core where it is located; The analog-to-digital converter is used to perform analog-to-digital conversion on the input and output data generated when multiple storage and computing arrays in the storage and computing core execute instructions.
4. The accelerator according to claim 1, characterized in that A data is composed of a plurality of binary digits, and each storage and calculation array includes a crossbar switch array and a third peripheral circuit component, wherein: A crossbar switch array, used for storing data and transmitting the stored data to a third peripheral circuit component, or performing preprocessing on the stored data required by the instruction to be executed by the storage and computing array where the stored data is located and then transmitting the data to the third peripheral circuit component; The third peripheral circuit component is used to perform multiple operations on the data corresponding to the instructions to be executed by the storage and computing array to complete the execution of the instructions, and to cache the input and output data generated when the storage and computing array executes the instructions.
5. The accelerator according to claim 4, characterized in that The crossbar switch array comprises: A plurality of non-volatile storage units, one non-volatile storage unit is used to store a binary number corresponding to a data and transmit it to a third peripheral circuit component, or to perform required pre-processing on a binary number corresponding to a stored data and then transmit it to the third peripheral circuit component; A plurality of volatile input units, one volatile input unit is used to transfer a binary number corresponding to an immediate number required to execute an instruction to a third peripheral circuit component, wherein the immediate number is data not stored in the crossbar switch array.
6. The accelerator according to claim 5, characterized in that Each nonvolatile memory cell includes: a first transistor and a second transistor, wherein: The first transistor is used to control the enabling of the second transistor, The second transistor is used to store a binary number corresponding to a data and transmit the binary number to the third peripheral circuit component, or perform required preprocessing on the binary number corresponding to the stored data and then transmit it to the third peripheral circuit component; Each volatile input unit includes: a first transistor and a resistor, wherein, The first transistor is used to transmit a binary number corresponding to an immediate number required to execute the instruction to the third peripheral circuit component; The resistor is used to ensure the correctness of a binary number corresponding to an immediate number required for executing an instruction transmitted from the first transistor to the third peripheral circuit component.
7. The accelerator according to claim 6, characterized in that The third peripheral circuit component performs multiple operations on the data corresponding to the instructions to be executed by the storage array in which the data is located, including: dynamic floating point alignment operation, and / or shift operation, and / or accumulation operation, and / or current comparison operation, and / or voltage control operation, and / or negation operation, and / or summation operation, and the third peripheral circuit component includes: The delay unit is used to perform a dynamic floating point alignment operation on the data corresponding to the instruction to be executed by the storage and calculation array in which the data is located so as to obtain a correct result after the instruction is executed on the data; A shift-accumulate unit, used to perform a shift operation on the data corresponding to the instruction to be executed by the storage and calculation array in which the data is located so as to obtain a correct result after the instruction is executed on the data, or to perform a shift operation and an accumulation operation on the data corresponding to the instruction to be executed by the storage and calculation array in which the data is located so as to complete the execution of the instruction; A plurality of current sensing sensitive amplifiers, each current sensing sensitive amplifier is used to perform a current comparison operation corresponding to the instruction to be executed by the storage and calculation array where the current sensing sensitive amplifier is located on the data to complete the execution of the instruction; A plurality of pre-charged sensitive amplifiers, each pre-charged sensitive amplifier is used to perform a voltage control operation corresponding to the instruction to be executed by the storage and computing array where the pre-charged sensitive amplifier is located on the data to complete the execution of the instruction; A plurality of peripheral logic gate circuits, wherein a peripheral logic gate circuit is used to perform an inversion operation and / or a summation operation on output results of a current sensing sense amplifier and a precharge sense amplifier to complete the execution of the instruction; The third register is used to cache input and output data generated when the storage and calculation array where it is located executes instructions; A circuit line component is used to connect with the crossbar switch array, the delay unit, the shift accumulation unit, the multiple current sensing sense amplifiers, the multiple pre-charge sense amplifiers, the multiple peripheral logic gate circuits and the third register according to a preset connection method to control each component to perform an operation corresponding to the instruction to be executed by the storage and calculation array where it is located on the data, thereby completing the execution of the instruction; The circuit line component driver is used to connect with the circuit line component to drive the circuit line component so that it can control the cross switch array, the delay unit, the shift accumulation unit, multiple current sensing sensitive amplifiers, multiple pre-charged sensitive amplifiers, multiple peripheral logic gate circuits and the third register to perform operations corresponding to the instructions to be executed by the storage array where the data is located.
8. The accelerator according to claim 7, characterized in that The circuit line assembly comprises: Multiple word lines, multiple bit lines, multiple data lines, multiple sensing lines, and multiple immediate data lines are used to connect with a cross switch array, a delay unit, a shift accumulation unit, multiple current sensing sensitive amplifiers, multiple pre-charged sensitive amplifiers, multiple peripheral logic gate circuits, and a third register in a preset connection method to control each component to perform operations on data corresponding to the instructions to be executed by the storage array in which it is located.
9. The accelerator according to claim 8, characterized in that The plurality of nonvolatile storage units and the plurality of volatile input units in the crossbar switch array are arranged in a multi-row multi-column manner and a row multi-column manner, respectively, wherein the number of nonvolatile storage units in each row, the number of volatile input units in a row, the number of current sensing sense amplifiers, the number of pre-charge sense amplifiers and the number of peripheral logic gate circuits are all the same, and the preset connection mode is: All nonvolatile memory cells in a row are connected to the same data line and the same word line, each volatile input cell in a row is connected to an immediate data line, and all nonvolatile memory cells and one volatile input cell in each column are connected to the same bit line and the same sense line; A current sensing sense amplifier is connected to a bit line commonly connected to all nonvolatile memory cells of a column and a volatile input cell; A precharge sense amplifier is connected to a sensing line commonly connected to all nonvolatile storage cells of a column and a volatile input cell; A peripheral logic gate circuit is connected to a bit line and a sense line commonly connected to a current sensing sense amplifier and a precharge sense amplifier; The delay unit is connected to each data line; The shift-and-accumulate unit is connected to each bit line and each sensing line; The third register is connected to each data line, each bit line and each sensing line.
10. The accelerator according to claim 9, characterized in that The first transistor and the second transistor each include a gate at one end and a source and a drain at the other end, and In each nonvolatile memory cell, the gate of the first transistor is connected to the word line, the source is connected to the bit line, and the drain is connected to the source of the second transistor. The gate of the second transistor is connected to the data line, and the drain is connected to the sensing line. In each volatile input unit, one end of the resistor is connected to the bit line, and the other end is connected to the source of the first transistor. The gate of the first transistor is connected to the immediate data line, and the drain is connected to the sensing line.
11. The accelerator according to claim 1, characterized in that: The instructions include: Boolean logic instructions, arithmetic operation instructions, data movement instructions and branch instructions, among which, Boolean logic instructions include five instructions for integer data: AND, OR, NOT, XOR, and XNOR. Arithmetic operation instructions include 8 instructions for integer data, including remainder, addition, subtraction, multiplication, division, multiplication-addition, absolute value, and compare-and-set, as well as 7 instructions for floating-point data, including addition, subtraction, multiplication, division, multiplication-addition, absolute value, and compare-and-set; Data movement instructions include three types of instructions for integer data, including move, read, and write, and three types of instructions for floating-point data, including move, read, and write; Branch instructions include conditional branch instructions and unconditional branch instructions.
12. An electronic device, configured with an accelerator as claimed in any one of claims 1 to 11 to execute instructions.
Citation Information
Cited By
Storage and calculation framework of basic linear algebraic subprogram and implementation method of storage and calculation framework
CN119357123A
A storage and computing architecture for basic linear algebra subroutines and its implementation method
CN119357123B
