Storage and calculation integrated system, storage and calculation function unit and equipment
By embedding the memory computing function unit in the memory and connecting it with the processor through a non-bus line, the problem of data transmission bandwidth limitation between the processor and the memory is solved, and the working efficiency and data storage capabilities of the processor are improved.
Patent Information
- Application Number
- CN202311003545.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-05-30
- Filing Date
- 2023-08-09
- Publication Date
- 2024-12-03
AI Technical Summary
The separation architecture between processor and memory in existing computing devices leads to a limitation of data transmission bandwidth between memory and processor, increasing the computing delay of processors and reducing work efficiency.
The memory computing function unit is embedded in the memory and connected to the processor through non-bus lines to reduce the data transmission amount and improve the working efficiency of the processor.
By reducing data interaction between the processor and the computing functional unit, the computing pressure is reduced, the processor's processing efficiency is improved, and the system's data storage capabilities are expanded.
Smart Images

Figure CN119066022A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application requires submission to the China Patent Office on May 30, 2023, application number 202310628655.2, application The priority of the Chinese patent application entitled "A device for a vector processor with an embedded storage-computation integrated functional unit" The entire contents are incorporated into this application by reference. Technical Field
[0003] The present application relates to the field of communication technology, and in particular to a storage and computing integrated system, a storage and computing functional unit, and a device. Background Art
[0004] In common computing devices, the processor and memory adopt a separate architecture, the processor and memory are separately set, and data is transmitted between the memory and the processor through a bus. However, since the bus set between the memory and the processor will limit the data transmission bandwidth between the memory and the processor, the amount of data transmitted between the memory and the processor is limited, which will increase the processor's delay in calculating data and reduce the processor's work efficiency.
[0005] To solve this problem, computing circuits can be added to the memory to give the memory computing power. The computing circuits that are closer to the data can complete part of the data calculations that the processor needs to perform, reducing the amount of data transmitted between the memory and the processor and alleviating the data transmission pressure on the bus.
[0006] However, the computing performance of the computing circuit set in the memory is limited. In the process of executing data calculation, the computing circuit still needs to interact with the processor, such as transmitting the data or control signals required for data calculation, to ensure that the computing circuit can successfully complete the data calculation. The interaction between the computing circuit in the memory and the processor still needs to be carried out through the bus. The existence of the bus will still limit the data transmission between the computing circuit in the memory and the processor, affecting the working efficiency of the processor. Summary of the invention
[0007] The embodiments of the present application provide a storage-computing integrated system, a storage-computing functional unit, and a device to improve the working efficiency of the processor.
[0008] In the first aspect, the embodiment of the present application further provides a storage-computing integrated system, the storage-computing integrated system includes a storage-computing functional unit and a processor, the storage-computing functional unit is embedded in the processor, and the storage-computing functional unit is connected to the processor via a non-bus line. A non-bus line refers to a line that does not have standard constraints.
[0009] The processor can control the storage and calculation function unit to obtain the first calculation data, and send a first control signal to the storage and calculation function unit, where the first control signal is used to instruct the storage and calculation function unit to perform data calculation on the first calculation data. The first calculation data corresponds to the first data stored in the processor and / or memory mentioned in the embodiment of the present application, that is, the storage and calculation function unit needs a device outside the storage function unit to obtain the first data. The first control signal corresponds to the control signal mentioned in the embodiment of the present application for instructing the storage and calculation function unit to perform data calculation, such as a mode control signal for enabling the calculation mode.
[0010] The storage and calculation function unit obtains the first calculation data under the control of the processor, receives the first control signal, performs data calculation on the first calculation data according to the first control signal, and generates the second calculation data. The first calculation data corresponds to the second data mentioned in the embodiment of the present application.
[0011] Through the above system, the storage and computing functional unit is located inside the processor, and is no longer connected to the processor through a bus, but through a non-bus line. The amount of data interacting between the storage and computing functional unit and the processor at one time is no longer limited, so that the storage and computing functional unit can realize data calculation under the control of the processor, reducing the computing pressure of the processor and improving the processing efficiency of the processor.
[0012] In a possible implementation, the first calculation data acquired by the storage and calculation functional unit may be from a memory, or from a processor, or may be partly from a memory and partly from a processor. For example, when the processor controls the storage and calculation functional unit to acquire the first calculation data, the processor may acquire the first calculation data from the memory, and transmit the first calculation data to the storage and calculation functional unit through a non-bus line. The processor may also control the memory to transmit the first calculation data to the storage and calculation functional unit. The processor may also acquire the first sub-data in the first calculation data from the memory, transmit the first sub-data to the storage and calculation functional unit through a non-bus line, and control the memory to transmit the second sub-data in the first calculation data to the storage and calculation functional unit.
[0013] Through the above system, the storage and computing functional unit can obtain the first computing data from the memory and / or the processor, which is suitable for different computing scenarios.
[0014] In a possible implementation manner, the first control signal is further used to instruct output of the second calculation data.
[0015] The storage and calculation function unit outputs the second calculation data after receiving the first control signal; the processor can control the memory to receive and store the second calculation data output by the storage and calculation function unit.
[0016] Through the above system, the processor can store the second calculation data output by the storage and calculation functional unit in the memory in a timely manner.
[0017] In a possible implementation, the first control signal is also used to indicate the output of second calculation data; the storage and calculation function unit receives the first control signal, and outputs the second calculation data after performing data calculation to obtain the second calculation data; the processor can obtain the second calculation data from the storage and calculation function unit and perform data calculation on the second calculation data.
[0018] Through the above system, the processor can obtain the second calculation data output by the storage and calculation functional unit to continue data calculation, so that the processor and the storage and calculation functional unit can cooperate to complete the data calculation.
[0019] In a possible implementation, the processor may further send a second control signal to the storage and computing functional unit, and the second control signal is used to instruct the storage and computing functional unit to store data. The storage and computing functional unit may receive the second control signal and store the data in the memory or store the data in the storage and computing functional unit in the memory according to the second control signal. The second control signal corresponds to the control signal mentioned in the embodiment of the present application for instructing the storage and computing functional unit to store data, such as a mode control signal for enabling a storage mode.
[0020] Through the above system, the storage and computing functional unit has not only the computing function but also the storage function, and can store data, thereby improving the data storage capacity of the entire system.
[0021] In one possible implementation, the processor sends a third control signal to the storage and calculation function unit, and the third control signal is used to instruct the storage and calculation function unit to perform data calculation on the third calculation data in the storage and calculation function unit; the storage and calculation function unit receives the third control signal, and performs data calculation on the third calculation data according to the third control signal. The third calculation data corresponds to the first data stored in the storage and calculation function unit mentioned in the embodiment of the present application, that is, the storage and calculation function unit needs to obtain the first data stored locally. The third control signal corresponds to the control signal mentioned in the embodiment of the present application for instructing the storage and calculation function unit to perform data calculation, such as a mode control signal indicating switching to the calculation mode and indicating data calculation on the stored first data.
[0022] Through the above system, the storage and computing functional unit can also calculate the stored third computing data under the control of the processor, which effectively expands the computing scenario of the storage and computing functional unit.
[0023] In one possible implementation, the storage and computing functional unit includes a mode selection port, a computing input port, and a computing output port. The mode selection port is connected to the processor, the computing input port is connected to the processor and the memory, and the computing output port is connected to the processor and the memory. The storage and computing functional unit obtains first computing data from the processor and / or the memory through the computing input port, receives a first control signal through the mode selection port, performs data calculation on the first computing data according to the first control signal, generates second computing data, and outputs the second computing data through the computing port.
[0024] Through the above system, the storage and computing functional unit can change its own working mode through different ports, obtain the first computing data and output the second computing data.
[0025] In a possible implementation, the storage and computing functional unit also includes a data transmission port, which is connected to the memory. The storage and computing functional unit receives a second control signal through the mode selection port, sends data to the memory through the data transmission port, or receives data sent by the memory through the data transmission port, and stores the data sent by the memory.
[0026] Through the above system, the storage and computing functional unit can complete data transmission through the mode selection port to realize the storage function of the storage and computing functional unit.
[0027] In a possible implementation, the processor includes a controller and a register module, the controller is connected to the register module and the storage and calculation function unit respectively, the controller controls the storage and calculation function unit to obtain the first calculation data from the register module and / or the memory, and sends a first control signal to the mode selection port. The register module stores the first calculation data or the first sub-data in the first calculation data.
[0028] Through the above system, the processor can temporarily cache the first calculation data or the first sub-data in the first calculation data required for the storage and calculation functional unit to perform data calculation, so as to facilitate the storage and calculation functional unit to complete the data calculation.
[0029] In a possible implementation, the controller decodes instructions in a reduced instruction set or a complex instruction set preset in the controller, and sends a first control signal or a second control signal to the storage and computing functional unit according to the decoding result.
[0030] Through the above system, decoding the instructions in the reduced instruction set or complex instruction set preset in the controller can generate control signals for the storage and computing functional unit, such as the first control signal, the second control signal and the third control signal. There is no need to set an additional instruction set for the storage and computing functional unit, and it can be compatible with the existing reduced instruction set or complex instruction set.
[0031] In a possible implementation, the storage and calculation function unit includes an SRAM and a calculation circuit. The SRAM can store the acquired first calculation data; the calculation circuit can acquire the first calculation data from the SRAM, perform data calculation on the first calculation data, and generate second calculation data.
[0032] Through the above system, the storage and computing functional unit includes SRAM and computing circuit, and the structure is relatively simple, ensuring that the storage and computing functional unit has both storage function and computing function.
[0033] In a second aspect, the embodiment of the present application further provides a storage and calculation function unit, and the beneficial effects can be found in the description of the first aspect and will not be repeated here. The storage and calculation function unit is embedded in the processor, and the storage and calculation function unit is connected to the processor through a non-bus line;
[0034] The storage and calculation function unit obtains first calculation data under the control of the processor; receives a first control signal, the first control signal is used to instruct the storage and calculation function unit to perform data calculation on the first calculation data; performs data calculation on the first calculation data according to the first control signal to generate second calculation data.
[0035] In a possible implementation manner, the storage and calculation functional unit obtains the first calculation data in many ways, several of which are listed below:
[0036] The storage and calculation functional unit obtains the first calculation data from the memory under the control of the processor.
[0037] The storage and calculation functional unit obtains the first calculation data from the processor under the control of the processor.
[0038] Under the control of the processor, the storage and calculation functional unit obtains the first sub-data in the first calculation data from the processor, and obtains the second sub-data in the first calculation data from the memory.
[0039] In a possible implementation, the first control signal is also used to instruct output or storage of second calculation data; after receiving the first control signal, the storage and calculation functional unit outputs or stores the second calculation data according to the first control signal.
[0040] In a possible implementation, the storage and computing functional unit may also receive a second control signal, the second control signal being used to instruct the storage and computing functional unit to store data; store the data in the memory according to the second control signal or store the data in the storage and computing functional unit in the memory.
[0041] In a possible implementation, the storage and calculation function unit may also receive a third control signal, where the third control signal is used to instruct the storage and calculation function unit to perform data calculation on third calculation data in the storage and calculation function unit; and perform data calculation on the third calculation data according to the third control signal.
[0042] In one possible implementation, the storage and computing functional unit includes a mode selection port, a computing input port, and a computing output port. The mode selection port is connected to the processor, the computing input port is connected to the processor and the memory, and the computing output port is connected to the processor and the memory. The storage and computing functional unit obtains first computing data from the processor and / or the memory through the computing input port, receives a first control signal through the mode selection port, performs data calculation on the first computing data according to the first control signal, generates second computing data, and outputs the second computing data through the computing port.
[0043] In a possible implementation, the storage and computing functional unit also includes a data transmission port, which is connected to the memory. The storage and computing functional unit receives a second control signal through the mode selection port, sends data to the memory through the data transmission port, or receives data sent by the memory through the data transmission port, and stores the data sent by the memory.
[0044] In a possible implementation, the storage and calculation functional unit includes an SRAM and a calculation circuit; the SRAM is used to store the acquired first calculation data.
[0045] The calculation circuit obtains first calculation data from the SRAM, performs data calculation on the first calculation data, and generates second calculation data.
[0046] In a third aspect, an embodiment of the present application further provides a data processing method, which can be executed by the processor and the storage and computing function unit mentioned in the first aspect. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The method includes:
[0047] The processor controls the storage and calculation function unit to obtain the first calculation data, and sends a first control signal to the storage and calculation function unit, where the first control signal is used to instruct the storage and calculation function unit to perform data calculation on the first calculation data;
[0048] The storage and calculation function unit receives a first control signal, performs data calculation on the first calculation data according to the first control signal, and generates second calculation data.
[0049] In a possible implementation, the system also includes a memory. When the processor controls the storage and computing functional unit to obtain the first calculation data, it can obtain the first calculation data from the memory and transmit the first calculation data to the storage and computing functional unit through a non-bus line; it can also control the memory to transmit the first calculation data to the storage and computing functional unit; it can also obtain the first sub-data in the first calculation data from the memory, transmit the first sub-data to the storage and computing functional unit through a non-bus line, and control the memory to transmit the second sub-data in the first calculation data to the storage and computing functional unit.
[0050] In a possible implementation, the first control signal is also used to instruct to output the second calculation data; after obtaining the second calculation data, the storage and calculation function unit outputs the second calculation data. The processor controls the memory to receive and store the second calculation data output by the storage and calculation function unit.
[0051] In a possible implementation, the first control signal is also used to instruct output of second calculation data; the processor obtains the second calculation data from the storage and calculation functional unit, and performs data calculation on the second calculation data.
[0052] In one possible implementation, the processor sends a second control signal to the storage and computing functional unit, and the second control signal is used to instruct the storage and computing functional unit to store data; the storage and computing functional unit receives the second control signal, and stores the data in the memory according to the second control signal or stores the data in the storage and computing functional unit in the memory.
[0053] In a possible implementation, the processor sends a third control signal to the storage and calculation function unit, where the third control signal is used to instruct the storage and calculation function unit to perform data calculation on third calculation data in the storage and calculation function unit.
[0054] The storage and calculation functional unit receives the third control signal, and performs data calculation on the third calculation data according to the third control signal.
[0055] In one possible implementation, the storage and computing functional unit includes a mode selection port, a computing input port, and a computing output port. The mode selection port is connected to the processor, the computing input port is connected to the processor and the memory, and the computing output port is connected to the processor and the memory. The storage and computing functional unit obtains first computing data from the processor and / or the memory through the computing input port, receives a first control signal through the mode selection port, performs data calculation on the first computing data according to the first control signal, generates second computing data, and outputs the second computing data through the computing port.
[0056] In a possible implementation, the storage and computing functional unit also includes a data transmission port, which is connected to the memory. The storage and computing functional unit receives a second control signal through the mode selection port, sends data to the memory through the data transmission port, or receives data sent by the memory through the data transmission port, and stores the data sent by the memory.
[0057] In a possible implementation, the processor includes a controller and a register module, and the controller is connected to the register module and the storage and calculation function unit respectively. The controller controls the storage and calculation function unit to obtain the first calculation data from the register module and / or the memory, and sends a first control signal to the mode selection port; the register module stores the first calculation data or the first sub-data in the first calculation data.
[0058] In a possible implementation, the controller decodes instructions in a reduced instruction set or a complex instruction set preset in the controller, and sends a first control signal or a second control signal to the storage and computing functional unit according to the decoding result.
[0059] In a possible implementation, the storage and calculation function unit includes an SRAM and a calculation circuit; the SRAM stores the acquired first calculation data; the calculation circuit acquires the first calculation data from the SRAM, performs data calculation on the first calculation data, and generates second calculation data.
[0060] In a fourth aspect, an embodiment of the present application further provides a computing device, which may be the processor and storage and computing functional unit mentioned in the first aspect. The functions and connection methods of the processor and the storage and computing functional unit may refer to the relevant description of the first aspect, which will not be repeated here. Optionally, the computing device also includes a memory.
[0061] In a fifth aspect, the present application also provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the method in the third aspect and various possible implementations of the third aspect.
[0062] In a sixth aspect, the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method in the third aspect and various possible implementations of the third aspect.
[0063] In the seventh aspect, the present application also provides a computer chip, which is connected to a memory, and the chip is used to read and execute a software program stored in the memory, and to execute the methods in the above-mentioned third aspect and various possible implementation methods of the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A schematic diagram of the structure of a storage and calculation function system provided for this application;
[0065] Figure 2 A schematic diagram of the structure of a processor provided in this application;
[0066] Figure 3 A port diagram of a register module in a processor provided by the present application;
[0067] Figures 4A to 4B A schematic diagram of port connections of a register module in a processor provided in the present application;
[0068] Figure 5 A port diagram of a logic computing module in a processor provided by the present application;
[0069] Figure 6A schematic diagram of port connections of a logic computing module in a processor provided in the present application;
[0070] Fig. 7A A port diagram of a storage and computing functional unit provided in this application;
[0071] Figure 7B A schematic diagram of port connections of a storage and computing functional unit provided in this application;
[0072] Figures 8A-8B A schematic diagram of the structure of a storage and computing functional unit provided in this application;
[0073] Fig. 9 A schematic diagram of the signal change trend of each port in a storage and computing functional unit provided in the present application;
[0074] Fig.10 A schematic diagram of the workflow of a processor provided for this application;
[0075] Fig.11 A schematic diagram of the workflow of a storage and computing functional unit provided for this application. DETAILED DESCRIPTION
[0076] like Figure 1 As shown, a storage and computing integrated system provided by an embodiment of the present application includes a processor 100, a storage and computing functional module, and a memory 300. The storage and computing functional unit 200 is embedded in the processor 100, and the storage and computing functional unit 200 is connected to the module inside the processor 100 through an internal line (i.e., non-bus). The processor 100 and the memory 300 can be connected through a bus. The storage and computing functional unit 200 can be connected to the memory 300.
[0077] The processor 100 is the main computing unit in the system, which can access the memory 300 and perform data calculations on the data in the memory 300. The embodiment of the present application does not limit the type of the processor 100. The processor 100 can be a processing chip such as a central processing unit (CPU), a data processing unit (DPU), a graphics processing unit (GPU), an embedded neural network processor (neural-network processing units, NPU), and can also be other general-purpose processors, digital signal processors (digital signal processing, DSP), application specific integrated circuits (application specific integrated circuits, ASIC), field programmable gate arrays (field programmable gate arrays, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0078] The system is provided with a storage and calculation function unit 200, which has a calculation function and can assist the processor 100 in completing a part of the data calculation. The storage and calculation function unit 200 also has a storage function. The storage and calculation function unit 200 itself can store the data to be calculated and can also store the calculated data. In addition, since the storage and calculation function unit 200 has a storage function, the storage and calculation function unit 200 can also be used as another "memory 300" in the system for storing data.
[0079] When the processor 100 transfers the data calculation operation to the storage and calculation functional unit 200 for execution, the processor 100 can control the storage and calculation functional unit 200 to read the data to be calculated from the processor 100 and / or the memory 300. Under the control of the processor 100, the storage and calculation functional unit 200 calculates the data to obtain the calculated data.
[0080] For the convenience of explanation, in the embodiment of the present application, the data involved in the data calculation performed by the processor 100 and the storage and calculation function unit 200 are named to distinguish different data. The data to be calculated obtained by the storage and calculation function unit 200 is called the first data, and the calculated data obtained after the storage and calculation function unit 200 performs data calculation is called the second data. The first data may come from the processor 100, the memory 300, and part or all of the storage and calculation function unit 200. The data to be calculated obtained by the processor 100 is called the third data, and the calculated data obtained after the processor 100 performs data calculation is called the fourth data, and the third data may come from the storage and calculation function unit 200 and / or the memory 300.
[0081] When the storage and calculation functional unit 200 is used as another "memory" in the system, under the control of the processor 100, the storage and calculation functional unit 200 can access the memory 300 and read and write data to the memory 300. That is, the storage and calculation functional unit 200 can read data from the memory 300 and can also write data in the storage and calculation functional unit 200 to the memory 300.
[0082] In an embodiment of the present application, the access of the storage and calculation function unit 200 to the memory 300 can be divided into two categories, one of which is access for the purpose of data storage. In this type of access, the storage and calculation function unit 200 can transfer the data in the memory 300 to the storage function unit for storage under the control of the processor 100, and can also migrate the data in the storage and calculation function unit 200 to the memory 300 for storage. This type of data access is a change in the data storage location, and the data itself will not be changed, that is, the data will not be calculated. The other type is access for the purpose of data calculation. In this type of access, the storage and calculation function unit 200 reads data (such as first data) from the memory 300 under the control of the processor 100 in order to complete the data calculation, and calculates the read data. The storage and calculation function unit 200 can also write the data obtained after calculation (such as second data) into the memory 300. In this type of access, the storage and calculation function unit 200 needs to calculate the data in the memory 300.
[0083] The memory 300 is the main data storage unit in the system. The memory 300 can be a random access memory or a read only memory 300 (ROM). The random access memory 300 is a dynamic random access memory (DRAM), a storage class memory (SCM), a resistive random access memory (RRAM), or a static random access memory (SRAM). The memory 300 can also be a dual in-line memory module or a dual in-line memory module (DIMM), i.e., a module composed of a dynamic random access memory (DRAM). The memory 300 can also be a solid state disk (SSD). The present embodiment does not limit the number and type of the memory 300.
[0084] The system is provided with a storage and calculation function unit 200. The existence of the storage and calculation function unit 200 can relieve the calculation pressure of the processor 100 and assist the processor 100 in completing a part of the data calculation. In addition, since the storage and calculation function unit 200 has a storage function, the storage and calculation function unit 200 is closer to the data itself, which is convenient for quickly obtaining data when performing data calculation and completing data calculation. In addition, the storage function of the storage and calculation function unit 200 can also further expand the data storage space of the system, so that more data can be stored in the system. In the system, since the storage and calculation function unit 200 is embedded in the processor 100, it does not need to be connected to the processor 100 using an advanced microcontroller bus architecture (AMBA) bus such as an advanced extensible interface (AXI), an advanced high-performance bus (AHB), and an advanced peripheral bus (APB), but is connected to the processor 100 using a non-bus-type line. The storage and computing functional unit 200 forms a tightly coupled architecture with the processor 100. This connection method can avoid the transmission delay caused by the bus, ensure efficient interaction between the storage and computing functional unit 200 and the processor 100, and enable the in-memory computing unit to perform data calculations more quickly.
[0085] The various components of the system are described below in conjunction with the accompanying drawings.
[0086] (1) Processor 100.
[0087] The processor 100 serves as the control center of the storage and computing system. The processor 100 can send a control signal to the storage and computing functional unit 200 to control the storage and computing functional unit to perform data calculation or data storage. The processor 100 can also control the storage and computing functional unit 200 to obtain the first data.
[0088] like Figure 2 , which is a schematic diagram of the structure of a processor 100 provided in an embodiment of the present application. The processor 100 includes a register module 120, a logic calculation module 130, and a controller 110. The register module 120 is connected to the logic calculation module 130, and the controller 110 is connected to the register module 120 and the logic calculation module 130 respectively. The controller 110 is also connected to the storage and calculation function unit 200 and the memory 300.
[0089] 1) Controller 110.
[0090] The controller 110 is the control center in the processor 100. The controller 110 can allocate operations that require data calculation, such as determining data calculations that need to be performed by the processor 100 and data calculations that need to be performed by the storage and calculation functional unit 200. For data calculations that need to be performed by the processor 100, the controller 110 controls the logic calculation module 130 to complete the data calculations. For data calculations that need to be performed by the storage and calculation functional unit 200, the controller 110 controls the storage and calculation functional unit 200 to complete the data calculations.
[0091] When the controller 110 controls the storage and calculation function unit 200 to complete the data calculation, the controller 110 can control the memory 300 and / or the register module 120 to transfer the first data to be calculated to the storage and calculation function unit 200, and control the storage and calculation function unit 200 to calculate the first data to generate the second data. The controller 110 can also control the storage and calculation function unit 200 to calculate the first data stored internally to generate the second data.
[0092] After the storage and calculation function unit 200 completes the data calculation, the controller 110 can also control the storage and calculation function unit 200 to migrate the generated second data to the memory 300 or the register module 120, and can also control the storage and calculation function unit 200 to store the second data internally.
[0093] The situation where the controller 110 controls the storage and calculation function unit 200 to migrate the second data to the register module 120 means that the second data is data required for the processor 100 to perform calculations. In other words, the logic calculation module 130 in the processor 100 can obtain the second data from the register module 120 under the control of the controller 110 and perform calculations on the second data.
[0094] When the controller 110 controls the logic calculation module 130 to complete the data calculation, the controller 110 may control the memory 300 and / or the storage and calculation function unit 200 to transfer the third data to be calculated to the register module 120, control the logic calculation module 130 to obtain the third data from the register module 120, calculate the third data, and generate fourth data. After the logic calculation module 130 completes the data calculation, the controller 110 may also control the fourth data generated by the logic calculation module 130 to be migrated to the memory 300.
[0095] The controller 110 stores an instruction set internally, and the instruction set includes at least one instruction. The controller 110 controls the register module 120, the logic calculation module 130, the storage and calculation function unit 200, and the memory 300 in accordance with the instructions in the instruction set. For any instruction, the controller 110 can decode the instruction. By decoding the instruction, the controller 110 can determine the data calculation that needs to be performed by the processor 100 and the storage and calculation function unit 200, and then control the register module 120, the logic calculation module 130, the storage and calculation function unit 200, and the memory 300 to realize the data calculation.
[0096] The embodiment of the present application does not limit the specific type of the instruction set inside the controller 110. For example, the instruction set inside the controller 110 includes a first instruction set and a second instruction set, wherein the first instruction set includes instructions for the processor 100, which are used to control the processor 100, such as controlling the processor 100 to perform data calculations. The first instruction set can be a traditional general instruction set such as RISC-V, RAM, and x86. The second instruction set includes instructions for the storage and calculation function unit 200, which are used to control the storage and calculation function unit 200, such as controlling the storage and calculation function unit 200 to perform data calculations or data storage. The second instruction set is a unique instruction set designed specifically for the storage and calculation function unit 200.
[0097] For another example, the instruction set inside the controller 110 may adopt a reduced instruction set, such as the fifth generation reduced instruction set computer (Reduced Instruction Set Computing Five, RISC-V), advanced reduced instruction set processor 100 (Advanced RISC Machines, RAM), microprocessor 100 without internal interlocked pipeline stages (Microprocessor without interlocked piped stages architecture, MIPS), or a complex instruction set such as x86. The reduced instruction set and the complex instruction set usually include instructions for the processor 100 and some reserved instructions. These reserved instructions are used to design instructions for the storage and computing functional unit 200.
[0098] Here, the RISC-V instruction set is taken as an example. On the basis of the RISC-V instruction set, four instructions for the storage and computing functional unit 200 are added by using reserved instructions. The instructions in the RISC-V instruction set include the funct7 field, the opcode field, the rs2 field, the rs1 field, the funct3 field, and the rd field. The instructions with the opcode field of 000000 are reserved instructions. The four added instructions for the storage and computing functional unit 200 can be designed as follows:
[0099] The data read instruction for the storage and calculation function unit 200, the opcode field is 0000000, the funct7 field is 0000000, and the data read instruction is used to control the storage and calculation function unit 200 to read data from the storage and calculation function unit 200 and output it to the memory 300 or the register module 120, wherein the data output memory 300 or the register module 120, and the storage address of the data can be specified by using other fields in the instruction;
[0100] A data write instruction for the storage and computing function unit 200, where the opcode field is 0000000, and the funct7 field is 0000001. The data write instruction is used to control the storage and computing function unit 200 to write the data output by the register module 120 or the memory 300 into the storage and computing function unit 200, wherein the data comes from the register module 120 or the memory 300, and the storage address of the data can be specified by using other fields in the instruction;
[0101] Special function instructions for the storage and computing function unit 200, the opcode field is 0000000, the funct7 field is 0000010, and the special function instructions are used to control the storage and computing function unit 200 to perform specified operations, such as formatting, suspending work, or starting work, etc., except for data storage and data calculation. The specified operation can be designed according to specific application requirements;
[0102] The calculation instruction for the storage and computing function unit 200, the opcode field is 0000000, the funct7 field is 0000011, and the calculation instruction is used to control the storage and computing function unit 200 to perform data calculation and output the calculated data. The type of the data calculation (such as matrix operation, vector operation, scalar operation, etc.) can be specified by other fields in the instruction.
[0103] The above-mentioned design method of instructions for the storage and computing functional unit 200 is only an example. In actual applications, the design can be carried out according to factors such as the type of instruction set adopted by the system and the specific application scenario. The embodiment of the present application does not limit the specific method of designing instructions for the storage and computing functional unit 200 using reserved instructions in the general instruction set. Designing instructions for the storage and computing functional unit 200 using reserved instructions in the general instruction set ensures the compatibility of the general instruction set, and there is no need to design an instruction set specifically for the storage and computing functional unit 200. This instruction design method is simpler and the system compatibility is stronger.
[0104] The controller 110 can decode the instruction, generate control signals for the register module 120, the logic calculation module 130, the storage and computing function unit 200, and the memory 300 respectively, and send corresponding control signals to the register module 120, the logic calculation module 130, the storage and computing function unit 200, and the memory 300. The register module 120, the logic calculation module 130, the storage and computing function unit 200, and the memory 300 complete corresponding operations according to the received control signals.
[0105] For example, for the register module 120, the control signal received by the register module 120 may instruct the register module 120 to store the first data or the third data output by the memory 300, and may also instruct the register module 120 to output the first data or the third data.
[0106] For another example, for the logic calculation module 130 , the control signal received by the logic calculation module 130 may instruct the logic calculation module 130 to receive the third data output by the register module 120 .
[0107] For another example, for the storage and computing functional unit 200, the control signal received by the storage and computing functional unit 200 can instruct the storage and computing functional unit 200 to receive the first data output by the register module 120 or the memory 300 and perform data calculation on the first data; or instruct the storage and computing functional unit 200 to perform data calculation on the stored first data.
[0108] For another example, for the memory 300, the control signal received by the memory 300 may instruct the memory 300 to output the first data or the third data.
[0109] The control method of the controller 110 on the register module 120, the logic calculation module 130, the storage and calculation function unit 200, and the memory 300 is related to the specific connection method between the register module 120, the logic calculation module 130, the storage and calculation function unit 200, and the memory 300. This will be described below in conjunction with the specific connection method between the register module 120, the logic calculation module 130, the storage and calculation function unit 200, and the memory 300, and will not be described in detail here.
[0110] 2) Register module 120.
[0111] The register module 120 is a module with a storage function inside the processor 100, which can store data, such as first data and third data. The register module 120 includes a plurality of registers and a control circuit. Among them, the register is used to store data, and the control circuit is used to write data or read data from the register according to a control signal from the controller 110. The control circuit can be formed by a logic circuit. The present application does not limit the specific structure of the control circuit, and any circuit that can be used to write data or read data in the register is applicable to the embodiments of the present application.
[0112] like Figure 3 , which is a schematic diagram of various ports of a register module 120 provided in an embodiment of the present application. The register module 120 includes three ports, namely an address selection port 121 , a data output port 122 and a data input port 123 .
[0113] The controller 110 is connected to the address selection port 121. Through the address selection port 121, the register module 120 can receive a control signal from the controller 110 for indicating output data (such as the first data or the third data), and the control signal is used to indicate the storage address of the data that the register module 120 needs to output. After receiving the control signal, the register module 120 reads data from the storage address indicated by the control signal and outputs the data from the data output port 122. The address selection port 121 and the data output port 122 are usually configured in pairs, that is, one data output port 122 corresponds to one address selection port 121, and the data output by the data output port 122 is the data output indicated by the control signal received by the corresponding address selection port 121. In order to distinguish different control signals sent by the controller 110, the control signal sent by the controller 110 to the register module 120 through the address selection port 121 is called an address control signal.
[0114] In the embodiment of the present application, the data output by the register module 120 can be transmitted to the logic calculation module 130 and the storage and calculation functional unit 200, and the data output port 122 of the register module 120 can be connected to the logic calculation module 130 and the storage and calculation functional unit 200 respectively. The controller 110 can control the connection state between the data output port 122 of the register module 120 and the logic calculation module 130 and the storage and calculation functional unit 200, that is, control the data output port 122 of the register module 120 to disconnect or maintain the connection with the logic calculation module 130, and the data output port 122 of the register module 120 to disconnect or maintain the connection with the storage and calculation functional unit 200, so that the data output port 122 of the register module 120 can be transmitted to the logic calculation module 130 and the storage and calculation functional unit 200.
[0115] The data input port 123 can receive data output by the memory 300, and the data input port 123 is connected to the memory 300. Optionally, the data input port 123 can also receive data output by the storage and calculation function unit 200, that is, the data input port 123 can also be connected to the storage and calculation function unit 200. This connection mode is suitable for the case where the logic calculation module 130 needs to calculate the data output by the storage and calculation function unit 200.
[0116] like Figure 4A As shown, a connection method between each port of the register module 120 and the controller 110, the logic calculation module 130, the storage and calculation functional unit 200 and the memory 300 provided in an embodiment of the present application. Figure 4AIn the example, the register module 120 includes two address selection ports 121 (respectively, an address selection port 121A and an address selection port 121B), two data output ports 122 (respectively, a data output port 122A and a data output port 122B), and a data input port 123. Among them, the address selection port 121A corresponds to the data output port 122A, and the address selection port 121B corresponds to the data output port 122B.
[0117] exist Figure 4A In the embodiment, the controller 110 is connected to the address selection port 121A and the address selection port 121B. The controller 110 can transmit an address control signal to the address selection port 121A and the address selection port 121B to control the data output from the data output port 122A and the data output port 122B.
[0118] The data output port 122A is connected to the logic calculation module 130 and the storage and calculation functional unit 200 through the demultiplexer 1. The data output port 122A is connected to the input end of the demultiplexer 1, and the logic calculation module 130 and the storage and calculation functional unit 200 are connected to the output end of the demultiplexer. The controller 110 is connected to the control end of the demultiplexer 1. The demultiplexer 1 is used to transmit the data received by the input end to one of the multiple output ends according to the address control signal received by the control end. The demultiplexer 1 is used to transmit the data output from the data output port 122A of the register module 120 to the logic calculation module 130 or the storage and calculation functional unit 200 according to the address control signal sent by the controller 110.
[0119] Similarly, the data output port 122B is connected to the logic calculation module 130 and the storage and calculation functional unit 200 respectively through the demultiplexer 2. The data output port 122B is connected to the input end of the demultiplexer 2, and the logic calculation module 130 and the storage and calculation functional unit 200 are respectively connected to the output end of the demultiplexer 2. The controller 110 is connected to the control end of the demultiplexer 2. The demultiplexer 2 is used to transmit the data received by the input end to one of the multiple output ends according to the control signal received by the control end. The demultiplexer 2 is used to transmit the data output from the data output port 122A of the register module 120 to the logic calculation module 130 or the storage and calculation functional unit 200 according to the address control signal sent by the controller 110.
[0120] The data input port 123 is connected to the memory 300 (eg, a data read / write port of the memory 300 ), and the register module 120 can receive data output by the memory 300 through the data input port 123 .
[0121] Figure 4A In the embodiment, the data input port 123 is only connected to the memory 300, that is, the data input port 123 only needs to store the data output by the memory 300. In practical applications, the data input port 123 can also be connected to the storage and calculation function unit 200. This connection method can be referred to in Figure 4B .
[0122] like Figure 4B As shown, another connection method between each port of the register module 120 and the controller 110, the logic calculation module 130, the storage and calculation functional unit 200 and the memory 300 provided in an embodiment of the present application. Figure 4B The connection between the two address selection ports 121 of the register module 120, the two data output ports 122, the controller 110, the logic calculation module 130, and the storage and calculation function unit 200 is similar to Figure 4A The connection between the two address selection ports 121 of the register module 120, the two data output ports 122, the controller 110, the logic calculation module 130, and the storage and calculation function unit 200 can be specifically referred to the above description, which will not be repeated here.
[0123] Figure 4B The data input port 123 of the register module 120 is connected to the memory 300 and the storage and calculation function unit 200 respectively through the multiplexer 1, wherein the memory 300 and the storage and calculation function unit 200 are respectively connected to the input end of the multiplexer 1, and the data input port 123 of the register module 120 is connected to the output end of the multiplexer 1. The controller 110 is connected to the control end of the multiplexer 1. The multiplexer 1 is used to transmit data received by one of the input ends of the multiple output ends to the output end according to the control signal received by the control end. The data input port 123 can receive the data to be written into the register module 120 through the output end of the multiplexer. Figure 4B In the embodiment, the multiplexer 1 is used to transmit the data output by the memory 300 or the storage-computation functional unit 200 to the data input port 123 according to the control signal sent by the controller 110.
[0124] The embodiments of the present application do not limit the internal structure of the multiplexer and demultiplexer. For example, the multiplexer and demultiplexer may be implemented by one or more transistors. Any circuit logic that can implement the multiplexer and demultiplexer is applicable to the embodiments of the present application.
[0125] 3) Logical calculation module 130.
[0126] The logic calculation module 130 is the computing center of the processor 100, and all data calculation operations that the processor 100 needs to perform are performed by the logic calculation module 130. The logic calculation module 130 can receive a control signal from the controller 110 and perform data calculation according to the control signal. The logic calculation module 130 can be implemented by a logic circuit. This application does not limit the internal structure of the logic calculation module 130. All modules that can implement data calculation are applicable to the embodiments of this application. For convenience, the control signal sent by the controller 110 to the logic calculation module 130 is called a calculation control signal.
[0127] like Figure 5 , which is a port diagram of a logic calculation module 130 provided in an embodiment of the present application. The logic calculation module 130 includes three ports, namely a data port 131 , a calculation result output port 132 , and a control port 133 .
[0128] The controller 110 is connected to the control port 133. Through the control port 133, the logic calculation module 130 can receive a calculation control signal from the controller 110 for instructing data calculation, and the calculation control signal is used to instruct the logic calculation module 130 to perform data calculation on the data (such as the third data) input by the data port 131. The calculation control signal can inform the logic calculation module 130 of the type of data calculation to be performed, such as logical operations such as AND, OR, NOT, XOR, XNOR, and shift, and tensor operations such as addition, multiplication, division, and subtraction.
[0129] The data port 131 is connected to the data output port 122 of the register module 120, and the number of the data ports 131 is consistent with the number of the data output ports 122 of the memory module 300. The logic calculation module 130 can perform data calculation on the data input from the data port 131 according to the calculation control signal.
[0130] The calculation result output port 132 may be connected to the memory 300 , and the logic calculation module 130 may output the calculated data (such as the fourth data) through the calculation result output port 132 , and the output fourth data may be stored in the memory 300 .
[0131] like Figure 6 As shown, a connection method between each port of the logic calculation module 130 and the controller 110, the register module 120, and the memory 300 provided in an embodiment of the present application is provided. Figure 6 In the example, the logic calculation module 130 includes two data ports 131 (respectively a data port 131A and a data port 131B), a calculation result output port 132 and a control port 133 . Figure 6It is assumed that the connection between each port of the register module 120 and the controller 110, the logic calculation module 130, the storage and calculation function unit 200 and the memory 300 is the same as Figure 4A The ports of the register module 120 shown in FIG. 1 are connected in the same manner as the controller 110 , the logic calculation module 130 , the storage and calculation function unit 200 , and the memory 300 .
[0132] The data port 131A is connected to the data port A of the register module 120 through the demultiplexer 1, and the data port 131A is connected to one output end of the demultiplexer 1. The data port 131B is connected to the data output port 122B of the register module 120 through the demultiplexer 2, and the data port 131B is connected to the other output end of the demultiplexer 2.
[0133] The control port 133 of the logic calculation module 130 is connected to the controller 110 . The calculation result output port 132 of the logic calculation module 130 is connected to the memory 300 .
[0134] In the above description, the controller 110, the register module 120 and the logic calculation module 130 included in the processor 100 are described respectively. Since the storage and calculation function unit 200 is embedded in the processor 100, the controller 110 and the register module 120 in the processor 100 can be connected to the storage and calculation function unit 200 through internal, non-bus lines. Under the control of the controller 110, the data transmission between the register module 120 and the storage and calculation function unit 200 is more efficient and time-consuming, which can effectively improve the calculation efficiency of the storage and calculation function unit 200. The structure of the storage and calculation function unit 200 is described below.
[0135] (2) Storage and computing functional unit 200.
[0136] In order to facilitate the storage and calculation function unit 200 to connect with the outside, the storage and calculation function unit 200 can be provided with a variety of different types of ports, such as Fig. 7A As shown, it is a schematic diagram of various ports of a storage and computing function unit 200 provided in an embodiment of the present application. The storage and computing function unit 200 includes four ports, namely a mode selection port 201, a computing input port 202, a computing output port 203 and a data transmission port 204.
[0137] Since the storage and calculation function unit 200 has two different functions, the storage and calculation function unit 200 can have two different working modes, namely, calculation mode and storage mode. In the calculation mode, the storage and calculation function unit 200 has a calculation function and can realize data calculation. In the storage mode, the storage and calculation function unit 200 has a storage function for realizing data storage.
[0138] A mode selection port 201 is provided in the storage and calculation function unit 200, and the working mode of the storage and calculation function unit 200 is configured through the mode selection port 201, that is, the storage and calculation function unit 200 is controlled to perform data calculation or data storage. In the embodiment of the present application, the controller 110 is connected to the mode selection port 201, and the controller 110 configures the working mode of the storage and calculation function unit 200 through the mode selection port 201; the storage and calculation function unit 200 receives a control signal from the controller 110 through the mode selection port 201, and configures the working mode of the storage and calculation function unit 200 according to the control signal. For the convenience of explanation, the control signal received by the storage and calculation function unit 200 through the mode selection port 201 is referred to as a mode control signal.
[0139] Through the mode control signal, the controller 110 can also control the type of data calculation performed in the calculation mode, such as vector operations such as vector addition, subtraction, scalar product, dot product, modulus, etc., matrix operations such as matrix addition, subtraction, multiplication, transposition, etc., logical operations or arithmetic operations between values, etc., and tensor operations other than vectors and matrices.
[0140] The calculation input port 202 and the calculation output port 203 are ports that work in the calculation mode, wherein the calculation input port 202 is used to receive the first data to be calculated, and the calculation output port 203 is used to output the calculated second data. The controller 110 enables the calculation mode by transmitting a mode control signal to the mode selection port 201, and the storage and calculation function unit 200 can perform data calculation on the data input by the calculation input port 202, and can also output the second data through the calculation output port 203. When the mode control signal indicates to perform data calculation on the stored first data, the storage and calculation function unit 200 can perform data calculation on the stored first data, and can also output the second data through the calculation output port 203.
[0141] The calculation input port 202 may be connected to the register module 120 or the memory 300 , and the calculation output port 203 may be connected to the register module 120 or the memory 300 .
[0142] The data transmission port 204 is a port that works in the storage mode. The data transmission port 204 is used to receive or send data. The data transmission port 204 can be connected to the memory 300. For example, the data transmission port 204 can receive data that needs to be stored in the storage and computing functional unit 200 from the memory 300. For another example, the data transmission port 204 can send data that needs to be stored in the memory 300 to the memory 300. The controller 110 enables the storage mode by transmitting a mode control signal to the mode selection port 201, and the storage and computing functional unit 200 can perform data transmission with the memory 300 through the data transmission port 204. For example, when the controller 110 enables the storage mode by transmitting a mode control signal to the mode selection port 201, and indicates that data needs to be received from the memory 300 and the data needs to be written to the storage address in the storage and computing functional unit 200, the storage and computing functional unit 200 can receive data from the memory 300 through the data transmission port 204, and write the received data to the storage address. When the controller 110 enables the storage mode by transmitting a control signal to the mode selection port 201, and indicates the data that needs to be read from the storage and computing functional unit 200 and the storage address of the data in the storage and computing functional unit 200, the storage and computing functional unit 200 obtains the data stored in the storage and computing functional unit 200 according to the storage address, and sends the data to the memory 300 through the data transmission port 204.
[0143] like Figure 7B As shown, a connection method between each port of the storage and computing function unit 200 and the controller 110, the register module 120, and the memory 300 provided in an embodiment of the present application. Figure 7B In the example, the logic calculation module 130 includes a mode selection port 201 , a calculation input port 202 , a calculation output port 203 and a data transmission port 204 . Figure 7B It is assumed that the connection between each port of the register module 120 and the controller 110, the logic calculation module 130, the storage and calculation function unit 200 and the memory 300 is the same as Figure 4A The ports of the register module 120 shown in the figure are connected in the same manner as the controller 110 , the logic calculation module 130 , the storage and calculation function unit 200 , and the memory 300 .
[0144] The calculation input port 202 of the storage and calculation functional unit 200 is connected to the data output port 122A of the register module 120 through the demultiplexer 1, and the calculation input port 202 is connected to an output end of the demultiplexer 1. The calculation input port 202 is connected to the data output port 122B of the register module 120 through the demultiplexer 2, and the calculation input port 202 is connected to an output end of the demultiplexer 2.
[0145] The mode selection port 201 of the storage and calculation function unit 200 is connected to the controller 110, and the calculation output port 203 of the storage and calculation function unit 200 is connected to the memory 300. Since the calculation result output port 132 of the logic calculation module 130 also needs to be connected to the memory 300, a multiplexer 2 can be set between the memory 300 and the logic calculation module 130 and the storage and calculation function unit 200. That is, the calculation result output port 132 of the logic calculation module 130 and the calculation output port 203 of the storage and calculation function unit 200 are connected to the memory 300 through the multiplexer 2, and the calculation result output port 132 of the logic calculation module 130 and the calculation output port 203 of the storage and calculation function unit 200 are respectively connected to the input end of the multiplexer 2, and the memory 300 is connected to the output end of the multiplexer 2. The controller 110 is connected to the control end of the multiplexer 2. The multiplexer 2 is used to transmit the data received by one of the input ends of the multiple output ends to the output end according to the control signal received by the control end. Figure 7B In the embodiment, the multiplexer 2 is used to transmit the data (such as the third data) output by the logic calculation module 130 or the data (such as the second data) output by the storage and calculation function unit 200 to the memory 300 according to the control signal sent by the controller 110.
[0146] Optionally, the calculation output port 203 of the storage and calculation functional unit 200 can also be connected to the data input port 123 of the register module 120, and the data input port 123 of the register module 120 is respectively connected to the memory 300 and the calculation output port 203 of the storage and calculation functional unit 200 through the multiplexer 1, and the data input port 123 of the register module 120 is connected to the output end of the multiplexer 1. The controller 110 is connected to the control end of the multiplexer 1. The multiplexer 1 is used to transmit the data received by one of the input ends of the multiple output ends to the output end according to the control signal received by the control end. The data input port 123 can receive the data to be written into the register module 120 through the output end of the multiplexer.
[0147] The data transmission port 204 of the storage and calculation function unit 200 is connected to the memory 300 , and when the storage and calculation function unit 200 is in the storage mode, data is transmitted between the storage and calculation function unit 200 and the memory 300 through the data transmission port 204 .
[0148] During the process of data transmission between the storage and computing functional unit 200 and the memory 300 through the data transmission port 204, if the storage and computing functional unit 200 transmits data to the memory 300 through the data transmission port 204, the data in the storage and computing functional unit 200 is transmitted to the memory 300 for storage. The storage and computing functional unit 200 notifies the memory 300 through the data transmission port 204 that data needs to be written, and also transmits the storage address of the data in the memory 300 and the data itself through the data transmission port 204. If the storage and computing functional unit 200 obtains data in the memory 300 through the data transmission port 204, the data in the memory 300 is transmitted to the storage and computing functional unit 200 for storage. The storage and computing functional unit 200 can notify the memory 300 through the data transmission port 204 that data needs to be read, and also transmits the storage address of the data in the memory 300 through the data transmission port 204. The memory reads the data according to the storage address and sends the data to the storage and computing functional unit 200 through the data transmission port 204.
[0149] From a functional perspective, the data transmission port 204 includes an address selection subport, a data subport, and a read / write mode conversion subport. The address selection subport is used to transmit the storage address of the data (that is, the storage address of the data in the memory 300 mentioned in the above content), the data subport is used to transmit the data itself, and the read / write mode conversion subport is used by the storage and computing functional unit 200 to inform the memory 300 of the data read / write mode, wherein the data read mode refers to reading data from the storage and computing functional unit 200, that is, writing the data read by the storage and computing functional unit 200 into the memory 300. The data write mode refers to writing data to the storage and computing functional unit 200, that is, writing the data in the memory 300 into the storage and computing functional unit 200.
[0150] The types of ports of the storage and calculation function unit 200 mentioned above, and the connection methods of the ports of the storage and calculation function unit 200 with the processor 100 and the memory 300 are only examples. In practical applications, the ports of the storage and calculation function unit 200 can be increased, such as splitting the data transmission port 204 into a data input port 123 and a data read port. The ports of the storage and calculation function unit 200 can also be reduced, such as no longer distinguishing between the calculation input port 202, the calculation output port 203, and the data transmission port 204, but setting a data input port 123 and a data read port, wherein the data input port 123 is used to receive data transmitted to the storage and calculation function unit 200, which can be data to be calculated (such as the first data) or data that needs to be stored in the storage and calculation function unit 200. The data read port is used to output data, and the data output by the data read port can be calculated data (such as the second data) or data stored in the storage and calculation function unit 200, such as data that needs to be stored in the memory 300 or data that needs to be transmitted to the register module 120. The data types output by the data input port 123 and the data read port are related to the working mode of the storage and computing functional unit 200.
[0151] The internal structure of the storage and calculation functional unit 200 is described below.
[0152] The storage and calculation function unit 200 has both a calculation function and a storage function. The storage and calculation function unit 200 includes a storage medium 210 and a calculation circuit 220. The storage medium 210 is used to implement the storage function of the storage and calculation function unit 200. The embodiment of the present application does not limit the type of the storage medium 210 in the storage and calculation function unit 200. For example, the storage medium 210 can be a random access memory, such as DRAM, SCM, SRAM. The calculation circuit 220 is used to implement the calculation function of the storage and calculation function unit 200, and can perform data calculation on the data stored in the storage medium 210. The calculation circuit 220 can be implemented by a logic circuit.
[0153] The embodiments of the present application do not limit the deployment methods of the internal storage medium 210 and the computing circuit 220 of the storage and computing functional unit 200. Any deployment method that can realize the functions of the storage and computing functional unit 200 is applicable to the embodiments of the present application.
[0154] Taking the storage medium 210 in the storage and computing function as SRAM as an example, two deployment methods of the storage medium 210 and the computing circuit 220 in the storage and computing function unit 200 are listed below.
[0155] Method 1: In-memory computing deployment method.
[0156] In this deployment mode, part of the computing circuit 220 in the storage computing functional unit 200 is arranged in the storage medium 210, closer to the storage medium 210. The other part is arranged around the storage medium 210. For the convenience of distinction, the part of the computing circuit 220 arranged in the storage medium 210 is called the in-memory computing circuit 221. The other part is called the near-memory computing circuit 222.
[0157] like Fig. 8A As shown, it is a schematic diagram of the structure of the storage and calculation function unit 200 provided in an embodiment of the present application, in which the storage medium 210 includes a plurality of SRAM units (bitcells), and the plurality of SRAM units are deployed in an array form. Each SRAM unit is implemented by a plurality of transistors. The amount of data stored in each SRAM unit is 1 bit.
[0158] In the multiple SRAM cells, two in-memory calculation circuits 221 are provided, each of which is connected to multiple SRAM cells around it, and can directly calculate the data in the multiple SRAM cells. The number and position of the in-memory calculation circuits 221 are examples, and the embodiment of the present application does not limit the number of the in-memory calculation circuits 221 and the specific position in the storage medium 210.
[0159] In addition to the multiple SRAM cells, a near memory calculation circuit 222 is provided. The near memory calculation circuit 222 is connected to the in-memory calculation circuit 221 and multiple SRAM cells surrounding it, and can calculate the data calculated by the in-memory calculation circuit 221 and / or the data in the multiple SRAM cells surrounding it.
[0160] In addition, the storage and calculation functional unit 200 also includes some other circuits related to the ports of the storage and calculation functional unit 200. Here, the storage and calculation functional unit 200 includes a calculation input port 202, a calculation output port 203, a mode selection port 201 and a data transmission port 204 as an example.
[0161] The storage and calculation functional unit 200 also includes a calculation input port circuit 240, a mode selection circuit 230, a data transmission port circuit 260, and a calculation output port circuit 250. The calculation input port circuit 204 provides a calculation input port 202 to receive data to be calculated (such as first data) and writes the received data to be calculated into the storage medium 210. The mode selection circuit 230 provides a mode selection port 201 to receive a mode control signal from the controller 110 and sets the working mode of the storage and calculation functional unit 200 according to the mode control signal. The data transmission port circuit 260 provides a data transmission port 204 to receive data from the memory 300, stores the received data into the storage medium 210, and can also send the data stored in the storage medium 210 to the memory 300 or the register module 120. The calculation output port circuit 250 provides a calculation output port 203 to the outside for sending calculated data (such as second data); usually, since the data output by the near storage calculation circuit 222 is calculated data, the calculation output port 250 circuit can be used as a part of the near storage calculation circuit 222.
[0162] exist Fig. 8A The deployment positions of the computing input port circuit 240, the mode selection circuit 230, the data transmission port circuit 260, and the computing output port circuit 250 can be seen in Fig. 8A , that is, the calculation input port circuit 240 , the mode selection circuit 230 , the data transmission port circuit 260 , and the calculation output port circuit 250 can be arranged around the storage medium 210 .
[0163] Method 2: Near-storage computing deployment method.
[0164] In this deployment method, the computing circuit 220 in the storage and computing functional unit 200 is arranged around the storage medium 210, close to the storage medium 210.
[0165] like Figure 8B As shown, it is a structural diagram of the storage and computing function unit 200 provided in an embodiment of the present application. In the storage and computing function unit 200, the storage medium 210 includes multiple SRAM units. For the description of multiple SSRAM units, please refer to the above description, which will not be repeated here.
[0166] A calculation circuit 220 is provided outside the plurality of SRAM cells. The calculation circuit 220 is connected to part or all of the plurality of SRAM cells and can calculate the data in the connected plurality of SRAM cells.
[0167] In addition, the storage and calculation function unit 200 also includes some other circuits related to the ports of the storage and calculation function unit 200. Here, the storage and calculation function unit 200 also includes a calculation input port circuit 240, a mode selection circuit 230, a data transmission port circuit 260, and a calculation output port circuit 250. The functions of the calculation input port circuit 240, the mode selection circuit 230, the data transmission port circuit 260, and the calculation output port circuit 250 can be referred to the above content, and will not be repeated here.
[0168] Generally, since the data output by the calculation circuit 220 is calculated data, the calculation output port 203 circuit can be located in the calculation circuit 220 as a part of the calculation circuit 220 .
[0169] exist Figure 8B The deployment positions of the computing input port circuit 240, the mode selection circuit 230, the data transmission port circuit 260, and the computing output port circuit 250 can be seen in Figure 8B , that is, the calculation input port circuit 240 , the mode selection circuit 230 , the data transmission port circuit 260 , and the calculation output port circuit 250 can be arranged around the storage medium 210 .
[0170] The storage and calculation function unit 200 has a calculation function and can perform data calculation. In the embodiment of the present application, the storage and calculation function unit 200 supports multiple types of tensor operations. For example, the storage and calculation function unit 200 supports matrix operations or vector operations, which can be abstracted as W°X=Y, where: and m is a positive integer, And p is a positive integer, "°" represents the operator symbol of matrix operation or vector operation, such as addition, multiplication, subtraction, etc.; Y is the calculation result or the calculated data. For another example, the storage and calculation function unit 200 supports scalar operation, which can be abstracted as U°V=S, where U and V represent scalars, S represents the calculation result or the calculated data, and "°" represents the operator symbol of scalar operation, such as addition, multiplication, subtraction, division, etc.
[0171] The storage and calculation function unit 200 has a storage function and can store data. In the embodiment of the present application, in the system, the storage and calculation function unit 200 and the memory 300 both have storage functions, so the location of the data can be identified by the storage address of the data. In other words, by parsing the storage address of the data, it can be determined that the data is stored in the memory 300 or in the storage and calculation function unit 200. In the embodiment of the present application, the configuration method of the storage address of the data in the system is not limited. For example, L+1 address intervals are set for the entire storage space formed by the storage and calculation function unit 200 and the memory 300, and the storage addresses within the 0 to K address intervals are allocated to the memory 300, that is, the storage address of the data in the memory 300 is the storage address within the 0 to K address interval, and the storage address within the K+1 to L address intervals is allocated to the storage and calculation function unit 200, that is, the storage address of the data in the storage and calculation function unit 200 is the storage address within the 0 to K address interval. For another example, inside the processor 100, the controller 110 may include a memory 300 for storing instructions (for the convenience of explanation, the memory 300 is referred to as the instruction memory 300), and L+1 address intervals are set for the instruction memory 300, the storage and computing functional unit 200, and the entire storage space formed by the memory 300, and storage addresses within the address interval of 0 to K are allocated to the memory 300 and the instruction memory 300, that is, the storage addresses of the data in the memory 300 are storage addresses within the address interval of 0 to K, and the storage addresses within the address interval of K+1 to L are allocated to the storage and computing functional unit 200, that is, the storage addresses of the data in the storage and computing functional unit 200 are storage addresses within the address interval of 0 to K.
[0172] Since the storage and calculation function unit 200 is embedded in the processor 100, the storage and calculation function unit 200 and the processor 100 work based on the same clock signal. The data storage operation and data calculation operation performed by the storage and calculation function unit 200 can be completed within a fixed time. Among them, the data storage operation includes a data read operation and a data write operation. Among them, the data read operation refers to reading the data of the storage and calculation function unit 200 into the memory 300, and the data write operation refers to writing the data in the memory 300 into the storage and calculation function unit 200.
[0173] like Fig. 9 As shown in FIG. 1 , it is the time distribution of each operation performed by the storage and calculation functional unit 200 under the clock signal of the processor 100. Fig. 9In the figure, the clock signal based on which the processor 100 works, the change trend of the signal transmitted by the read-write mode conversion subport in the data transmission port 204, the change trend of the signal on the address selection subport in the data transmission port 204, the change process of the data transmitted on the data subport in the data transmission port 204 (the change process of the data transmitted by the data subport when data is written, and the change process of the data transmitted by the data subport when data is read are respectively shown), the change trend of the mode control signal received by the mode selection port 201, the change process of the data received on the calculation input port 202, and the change process of the output data on the calculation output port 203 are respectively shown.
[0174] The clock signal based on which the processor 100 works can be pre-configured with the time distribution state of the data storage operation and data calculation operation performed by the storage and calculation function unit 200. Fig. 9 In the data storage operation, the data calculation operation is executed successively, and the end time of the data storage operation is the start time of the data calculation operation. In the data storage operation, the data writing operation and the data reading operation are separated by two clock cycles.
[0175] When using Fig. 9 In the time distribution state shown, the signal transmitted by the read-write mode conversion subport in the data transmission port 204 changes to a high level near the start time of the data write operation and the end time of the data write operation. The signal on the address selection subport in the data transmission port 204 transmits the storage address of the data that needs to be written to the storage and calculation function unit 200 during the period of time close to the start time of the data write operation and the end time of the data write operation, wherein A0, A1, and A2 are the storage addresses of the data transmitted during this period of time. When writing data, the data transmitted by the data subport transmits the data that needs to be written to the storage and calculation function unit 200 during the period of time close to the start time of the data write operation and the end time of the data write operation, wherein D0, D1, and D2 are the data transmitted during this period of time. The mode control signal received by the mode selection port 201 changes to a low level near the start time of the data write operation and the end time of the data write operation, indicating that the memory calculation function unit 200 is in storage mode during this period of time. The data that is not received on the calculation input port 202 during this period of time, and the calculation output port 203 does not send data during this period of time.
[0176] The signal transmitted by the read / write mode conversion subport in the data transmission port 204 changes to a low level near the start time of the data reading operation and the end time of the data reading operation. The signal on the address selection subport in the data transmission port 204 transmits the storage address of the data in the storage and calculation function unit 200 during the period of time close to the start time of the data reading operation and the end time of the data reading operation, wherein A2 and A0 are the storage addresses of the data transmitted during this period of time. The data transmitted by the data subport during data reading transmits the data in the storage and calculation function unit 200 during the period of time close to the start time of the data reading operation and the end time of the data reading operation, wherein D2 and D0 are the data transmitted during this period of time. The mode control signal received by the mode selection port 201 remains at a low level near the start time of the data reading operation and the end time of the data pair operation, indicating that the memory calculation function unit 200 is still in the storage mode during this period of time. The data not received on the calculation input port 202 during this period of time, the calculation output port 203 does not send data during this period of time.
[0177] The signal transmitted by the read / write mode conversion subport in the data transmission port 204 remains at a low level when it is close to the start time of the data calculation operation and the end time of the data calculation operation. The signal on the address selection subport in the data transmission port 204 does not transmit the storage address of the data during the period of time close to the start time of the data calculation operation and the end time of the data calculation operation, or the storage address of the data transmitted during this period is invalid data. During data calculation, the data transmitted by the data subport does not transmit data during the period of time close to the start time of the data calculation operation and the end time of the data calculation operation, or the data transmitted during this period is invalid data and is not processed. The mode control signal received by the mode selection port 201 changes to a high level when it is close to the start time of the data calculation operation and the end time of the data pair operation, indicating that the internal calculation function unit 200 is in the calculation mode during this period. The calculation input port 202 receives the first data to be calculated during this period, wherein I0, I1, and I2 are the first data to be calculated received during this period. The calculated second data is outputted on the calculation output port 203 within the period of time, wherein O0, O1, and O2 are the second data to be calculated received within the period of time.
[0178] from Fig. 9 It can be found that the operations performed by the storage and computing function unit 200 can be completed within a fixed time and follow the clock signal of the processor 100 itself, so that the storage and computing function unit 200 can be applicable to different types of processors 100, ensuring the compatibility of the storage and computing function unit 200 with different processors 100.
[0179] (3) Memory 300.
[0180] The embodiment of the present application does not limit the type of the memory 300. From a functional perspective, the memory 300 is provided with two ports, namely a data read / write port and a storage control port. The data read / write port is used to receive or send data, and the storage control port is used to receive a control signal from the processor 100, and receive or send data through the data read / write port according to the control signal.
[0181] In an embodiment of the present application, the processor 100 (such as the controller 110 in the processor 100) can be connected to the control signal, and the control signal is used to instruct the memory 300 to read data or write data.
[0182] When the control instructs the memory 300 to read data, the memory 300 will read the data in the memory 300 (such as the first data or the third data) and output the data through the data read and write port, wherein the storage address of the data that the memory 300 needs to read can be indicated by the control signal, or it can be informed to the memory 300 through the data read and write port by the unit or module that needs to obtain the data (such as the storage and computing function unit 200 or the register module 120).
[0183] When the control instructs the memory 300 to write data, the memory 300 receives the data through the data read / write port and stores the data in the memory 300. The storage address of the data in the memory 300 may be indicated by the control signal, or may be notified to the memory 300 through the data read / write port by the unit or module (such as the storage and calculation function unit 200 or the logic calculation unit) that sends the data.
[0184] In the embodiment of the present application, the processor 100 (such as the register module 120, the logic calculation module 130) and the storage and calculation function unit 200 in the system can be connected to the data read and write port of the memory 300 to transfer data to the memory 300 for storage, or read data from the memory 300. The data input port 123 of the register module 120, the calculation result output port 132 of the logic calculation module 130, the data transmission port 204, the calculation input port 202, and the calculation output port 203 of the storage and calculation function unit 200 can all be connected to the data read and write port of the memory 300.
[0185] The data input end of the register module 120 is connected to the data read / write port of the memory 300, and the memory 300 can transfer the data in the memory 300 to the register module. The calculation result output port 132 of the logic calculation module 130 is connected to the data read / write port of the memory 300, and the memory 300 can store the data (such as the fourth data) output by the logic calculation module 130 in the memory 300. The data transmission port 204 of the storage and calculation functional unit 200 is connected to the data read / write port of the memory 300, and the memory 300 can store the data output by the storage and calculation functional unit 200, or send the data in the memory 300 to the storage and calculation functional unit 200 for storage. The calculation input port 202 of the storage and calculation functional unit 200 is connected to the data read / write port of the memory 300, and the memory 300 can transfer the data (such as the first data, or part of the first data) required for data calculation in the storage and calculation functional unit 200 to the calculation input port 202. The calculation output port 203 of the storage and calculation functional unit 200 is connected to the data read and write port of the memory 300, and the memory 300 can store the data (such as the second data) obtained after the storage and calculation functional unit 200 performs data calculation.
[0186] After explaining the functions and structures of each component in the system, the workflow of the processor 100 and the storage and computing functional unit 200 will be explained in conjunction with the accompanying drawings.
[0187] 1. Workflow of the processor 100.
[0188] like Fig.10 As shown, it is a schematic diagram of the working process of the processor 100 provided in the embodiment of the present application. Fig.10 The control process of the processor 100 on the storage and computing functional unit 200 is shown in FIG. The working process of the processor 100 is as follows:
[0189] Step 1001: The processor 100 (controller 110 in the processor 100) reads a preset instruction.
[0190] Step 1002: The processor 100 decodes the instruction and controls the working mode of the storage and calculation function unit 200 according to the decoding result, such as sending a mode control signal to the mode selection port 201 of the storage and calculation function unit 200 to control the storage and calculation function unit 200 to be in the storage mode or the calculation mode. If the processor 100 controls the storage and calculation function unit 200 to be in the storage mode according to the decoding result, steps 1003 to 1004 are executed. If the processor 100 controls the storage and calculation function unit 200 to be in the calculation mode according to the decoding result, step 1005 is executed.
[0191] Step 1003: If the instruction is a data read instruction for the storage and computing functional unit 200, the processor 100 needs to control the storage and computing functional unit 200 to be in storage mode. The processor 100 controls the memory 300 to receive the data output by the storage and computing functional unit 200. In this case, the mode control signal sent by the processor 100 to the storage and computing functional unit 200 indicates that the storage and computing functional unit 200 is in storage mode. The mode control signal also indicates the data that needs to be read from the storage and computing functional unit 200 and the storage address of the data in the storage and computing functional unit 200. The storage and computing functional unit 200 reads data from the storage address according to the mode control signal and outputs the data through the data transmission port 204. The processor 100 sends a control signal to the memory 300, and the memory 300 receives the data output by the storage and computing functional unit 200 through the data transmission port 204 according to the control signal.
[0192] Step 1004: If the instruction is a data write instruction for the storage and computing functional unit 200, the processor 100 needs to control the storage and computing functional unit 200 to be in storage mode. The processor 100 controls the storage and computing functional unit 200 to receive the data output by the memory 300. In this case, the mode control signal sent by the processor 100 to the storage and computing functional unit 200 indicates that the storage and computing functional unit 200 is in storage mode. The mode control signal also indicates the data that needs to be received from the memory 300 and the storage address to which the data needs to be written in the storage and computing functional unit 200. The processor 100 sends a control signal to the memory 300, and the memory 300 reads the data that needs to be written to the storage and computing functional unit 200 according to the control signal, and transmits the data to the data transmission port 204 of the storage and computing functional unit 200. The storage and computing functional unit 200 writes the data to the storage address indicated by the mode control signal according to the mode control signal.
[0193] Step 1005: If the instruction is a calculation instruction for the storage and calculation functional unit 200, the processor 100 needs to control the storage and calculation functional unit 200 to be in the calculation mode. The processor 100 controls the storage and calculation functional unit 200 to perform data calculation. In this case, the mode control signal sent by the processor 100 to the storage and calculation functional unit 200 indicates that the storage and calculation functional unit 200 is in the calculation mode. The mode control signal also indicates the type of data operation to be performed, such as vector operation or scalar operation.
[0194] After receiving the mode control signal, the storage and calculation function unit 200 receives the first data to be calculated from the calculation input port 202, exemplarily in the form of Figure 7BTaking the connection mode of the data port 131A and the data port 131B of the register module 120 and the calculation input port 202 of the storage and calculation functional unit 200 as an example, the processor 100 can send control signals to the multiplexer 1 and the multiplexer 2 respectively, and control the multiplexer 1 and the multiplexer 2 to input the data output from the data port 131A and the data port 131B of the register module 120 to the calculation input port 202. In this case, the first data to be calculated is the data output from the data port 131A and the data port 131B. The processor 100 can also send control signals to the multiplexer 1 and the memory 300 respectively, control the multiplexer 1 to input the data output from the data port 131 of the register module 120 to the calculation input port 202, and control the memory 300 to transmit data to the calculation input port 202. In this case, the first data to be calculated is the data output from the data port 131A and the data output from the memory 300. The processor 100 may also send control signals to the memory 300 to control the memory 300 to transmit data to the calculation input port 202 . In this case, the first data to be calculated is the data output by the memory 300 .
[0195] After receiving the first data to be calculated from the calculation input port 202, the storage and calculation function unit 200 performs data calculation on the first data according to the mode control signal to generate second data, and outputs the second data from the calculation output port 203. Figure 7B Taking the connection mode of the calculation output port 203 of the storage and calculation functional unit 200 with the data input port 123 of the register module 120 and the memory 300 as an example, the processor 100 can send a control signal to the multiplexer 2 to control the multiplexer 2 to calculate the second data output by the output port 203 to the memory 300. The processor 100 can also send a control signal to the multiplexer 1 to control the multiplexer 1 to calculate the second data output by the output port 203 to the data input port 123 of the register module 120.
[0196] by Figure 7BTaking the connection mode of the data port 131A and the data port 131B of the register module 120 and the calculation input port 202 of the storage and calculation functional unit 200 as an example, the process of the processor 100 performing data calculation itself is described, and the process is as follows: the processor 100 decodes the preset instruction. If the instruction is an instruction for the processor 100, the controller 110 sends a control signal to the memory 300 to instruct the memory 300 to output the third data to be calculated. The controller 110 sends a control signal to the multiplexer 1 to control the multiplexer 1 to transmit the third data output by the memory 300 to the data input port 123 of the register module 120. The controller 110 sends an address control signal to the register module 120 to control the register module 120 to output the third data from the data port 131A and the data port 131B. The processor 100 sends a control signal to the demultiplexer 1 and the demultiplexer 2, and controls the demultiplexer 1 and the demultiplexer 2 to transmit the third data outputted from the data port 131A and the data port 131B of the register module 120 to the logic calculation module 130, respectively. The controller 110 sends a control signal to the logic calculation module 130, and instructs the logic calculation module 130 to perform data calculation. After receiving the control signal, the logic calculation module 130 performs data calculation on the third data according to the control signal, generates fourth data, and outputs the fourth data from the calculation result output port 132. The controller 110 sends a control signal to the multiplexer 2, and controls the multiplexer 2 to transmit the fourth data outputted from the logic calculation module 130 to the memory 300. The controller 110 sends a control signal to the memory 300, and instructs the memory 300 to store the fourth data and indicates the storage address of the fourth data. According to the control signal, the memory 300 stores the fourth data at the location indicated by the storage address.
[0197] 2. The working process of the storage and computing functional unit 200.
[0198] like Fig.11 As shown, it is a schematic diagram of the workflow of the storage and calculation function unit 200 provided in an embodiment of the present application. The workflow of the storage and calculation function unit 200 is as follows:
[0199] Step 1101: The storage and calculation function unit 200 receives the mode control signal sent by the processor 100, and adjusts the working module of the storage and calculation function unit 200 according to the mode control signal. If the mode control signal indicates that the storage and calculation function unit 200 is in the storage mode, steps 1102 to 1103 are executed; if the mode control signal indicates that the storage and calculation function unit 200 is in the calculation mode, steps 1104 to 1105 are executed.
[0200] Step 1102: If the mode control signal also indicates the data to be read from the storage and computing functional unit 200 and the storage address of the data in the storage and computing functional unit 200, the storage and computing functional unit 200 reads the data from the storage address according to the mode control signal and outputs the data through the data transmission port 204.
[0201] Step 1103: If the mode control signal also indicates that data needs to be received from the memory 300 and the data needs to be written to the storage address in the storage and computing functional unit 200. The storage and computing functional unit 200 receives the data transmitted by the memory 300 from the data transmission port 204. The storage and computing functional unit 200 writes the data to the storage address indicated by the mode control signal according to the mode control signal.
[0202] Step 1104 : The storage and calculation function unit 200 receives the first data to be calculated from the calculation input port 202 .
[0203] Step 1105: The mode control signal indicates the type of data operation to be performed, such as vector operation or scalar operation. The storage and computing function unit 200 performs data calculation on the first data according to the mode control signal to generate second data and outputs the second data from the calculation output port 203.
[0204] For some data calculations, due to the large amount of data involved in the data calculation, the processor 100 (such as the controller 110 in the processor 100) can decompose the data calculation into multiple calculation operations, and the processor 100 (such as the controller 110 in the processor 100) can control the storage and calculation function unit 200 to complete the multiple calculation operations in multiple times. For any calculation operation, the processor 100 (such as the controller 110 in the processor 100) can control the storage and calculation function unit 200 to perform the calculation operation. Fig.10 In the embodiment shown, the processor 100 controls the storage and calculation function unit 200 to perform data calculation in a similar manner. For details, please refer to the above description and will not be repeated here. The processor 100 (such as the controller 110 in the processor 100) can also control the storage and calculation function unit 200 and the logic calculation module 130 to cooperate to complete the multiple calculation operations. For any calculation operation, the processor 100 (such as the controller 110 in the processor 100) can control the storage and calculation function unit 200 or the logic calculation module 130 to perform the calculation operation. Fig.10 In the illustrated embodiment, the processor 100 controls the storage and computing functional unit 200 or the logic calculation module 130 to perform data calculation in a similar manner, and details may be found in the foregoing description and will not be repeated here.
[0205] It should be noted that the division of modules or units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional modules in the embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0206] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid state drive (SSD).
[0207] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0208] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0209] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0211] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A storage and computing system, It is characterized in that The storage-in-one system comprises a storage-computing functional unit and a processor, wherein the storage-computing functional unit is embedded in the processor, and the storage-computing functional unit is connected to the processor via a non-bus line; The processor is used to control the storage and calculation function unit to obtain first calculation data, and send a first control signal to the storage and calculation function unit, wherein the first control signal is used to instruct the storage and calculation function unit to perform data calculation on the first calculation data; The storage and calculation functional unit is used to obtain first calculation data under the control of the processor, receive the first control signal, perform data calculation on the first calculation data according to the first control signal, and generate second calculation data.
2. The system according to claim 1, It is characterized in that The system further includes a memory, and the processor, when controlling the storage and calculation functional unit to obtain the first calculation data, is used to: Acquire the first calculation data from the memory, and transmit the first calculation data to the storage and calculation functional unit through the non-bus line; or controlling the memory to transmit the first calculation data to the storage and calculation functional unit, or Acquire the first sub-data in the first calculation data from the memory, transmit the first sub-data to the storage and calculation functional unit through the non-bus line, and control the memory to transmit the second sub-data in the first calculation data to the storage and calculation functional unit.
3. The system according to any one of claims 1 to 2, It is characterized in that The first control signal is also used to instruct outputting the second calculated data; The storage and calculation functional unit is further used to output the second calculation data; The processor is further used to control the memory to receive and store the second calculation data output by the storage and calculation functional unit.
4. The system according to any one of claims 1 to 3, It is characterized in that The first control signal is also used to instruct outputting the second calculated data; The processor is further used to: obtain the second calculation data from the storage and calculation functional unit, and perform data calculation on the second calculation data.
5. The system according to any one of claims 1 to 4, It is characterized in that The processor is further used to: send a second control signal to the storage and calculation function unit, wherein the second control signal is used to instruct the storage and calculation function unit to perform data storage; The storage and calculation functional unit is further used to receive the second control signal, and store the data in the memory or store the data in the storage and calculation functional unit in the memory according to the second control signal.
6. The system according to any one of claims 1 to 5, It is characterized in that The processor is further used to: send a third control signal to the storage and calculation function unit, wherein the third control signal is used to instruct the storage and calculation function unit to perform data calculation on the third calculation data in the storage and calculation function unit; The storage and calculation functional unit is further used to receive the third control signal and perform data calculation on the third calculation data according to the third control signal.
7. The system according to any one of claims 1 to 6, It is characterized in that The storage and calculation functional unit includes a mode selection port, a calculation input port, and a calculation output port. The mode selection port is connected to the processor, the calculation input port is connected to the processor and the memory, and the calculation output port is connected to the processor and the memory. The storage and calculation functional unit is used to: The first calculation data is obtained from the processor and / or the memory through the calculation input port, the first control signal is received through the mode selection port, data calculation is performed on the first calculation data according to the first control signal to generate the second calculation data, and the second calculation data is output through the calculation port.
8. The system of claim 7, It is characterized in that The storage and calculation functional unit further includes a data transmission port, wherein the data transmission port is connected to the memory, and the storage and calculation functional unit is used to: The second control signal is received through the mode selection port, data is sent to the memory through the data transmission port, or data sent by the memory is received through the data transmission port, and the data sent by the memory is stored.
9. The system according to claim 7 or 8, It is characterized in that The processor includes a controller and a register module, wherein the controller is connected to the register module and the storage and calculation function unit respectively. The controller is used to control the storage and calculation function unit to obtain the first calculation data from the register module and / or the memory, and send the first control signal to the mode selection port; The register module is used to store the first calculation data or the first sub-data in the first calculation data.
10. The system of claim 9, It is characterized in that The controller is used to decode instructions in a reduced instruction set or a complex instruction set preset in the controller, and send the first control signal or the second control signal to the storage and computing functional unit according to the decoding result.
11. The system according to any one of claims 1 to 10, It is characterized in that The storage and calculation functional unit includes a static random access memory SRAM and a calculation circuit; The SRAM is used to store the first calculated data obtained; The calculation circuit is used to obtain the first calculation data from the SRAM, perform data calculation on the first calculation data, and generate the second calculation data.
12. A storage and computing functional unit, It is characterized in that The storage and calculation functional unit is embedded in the processor, and the storage and calculation functional unit is connected to the processor via a non-bus line; The storage and calculation function unit is used to obtain first calculation data under the control of the processor; receive the first control signal, the first control signal is used to instruct the storage and calculation function unit to perform data calculation on the first calculation data; perform data calculation on the first calculation data according to the first control signal to generate second calculation data.
13. The unit according to claim 12, It is characterized in that When the storage and calculation functional unit obtains the first calculation data under the control of the processor, it is used to: Obtaining the first calculation data from a memory; or acquiring the first calculation data from the processor; or The first sub-data in the first calculation data is acquired from the processor, and the second sub-data in the first calculation data is acquired from the memory.
14. The unit according to any one of claims 12 to 13, It is characterized in that The first control signal is also used to instruct to output or save the second calculation data; The storage and calculation functional unit is further used to output or save the second calculation data according to the first control signal.
15. The unit according to any one of claims 12 to 14, It is characterized in that The storage and calculation functional unit is also used to receive a second control signal, where the second control signal is used to instruct the storage and calculation functional unit to store data; store the data in the memory or store the data in the storage and calculation functional unit in the memory according to the second control signal.
16. The unit according to any one of claims 12 to 15, It is characterized in that The storage and calculation functional unit is also used to receive a third control signal, and the third control signal is used to instruct the storage and calculation functional unit to perform data calculation on the third calculation data in the storage and calculation functional unit; and perform data calculation on the third calculation data according to the third control signal.
17. A unit according to any one of claims 12 to 16, It is characterized in that The storage and calculation functional unit includes a mode selection port, a calculation input port, and a calculation output port. The mode selection port is connected to the processor, the calculation input port is connected to the processor and the memory, and the calculation output port is connected to the processor and the memory. The storage and calculation functional unit is used to: The first calculation data is obtained from the processor and / or the memory through the calculation input port, the first control signal is received through the mode selection port, data calculation is performed on the first calculation data according to the first control signal to generate the second calculation data, and the second calculation data is output through the calculation port.
18. The unit according to claim 17, It is characterized in that The storage and calculation functional unit further includes a data transmission port, wherein the data transmission port is connected to the memory, and the storage and calculation functional unit is used to: The second control signal is received through the mode selection port, data is sent to the memory through the data transmission port, or data sent by the memory is received through the data transmission port, and the data sent by the memory is stored.
19. A unit according to any one of claims 12 to 18, It is characterized in that The storage and calculation functional unit includes a static random access memory SRAM and a calculation circuit; The SRAM is used to store the first calculated data obtained; The calculation circuit is used to obtain the first calculation data from the SRAM, perform data calculation on the first calculation data, and generate the second calculation data.
20. A computing device, It is characterized in that The computing device is deployed with the storage-in-one system as claimed in any one of claims 1 to 11.
Citation Information
Cited By
Inclination angle detection method and system based on storage and calculation array, terminal and storage medium
CN119533408A
Storage and calculation integrated processor, data processing method and computer equipment
CN119670830A
A storage-computing integrated data scheduling system and method for high concurrency scenarios
CN120743844B
Storage and calculation integrated chip, data access method, electronic equipment and storage medium
CN121301275A
