Data processing method, processor and electronic equipment

By using the interconnection bus in the AI ​​processor to directly write data from the first functional unit to the second functional unit, multiple accesses to the internal storage unit of the processor are avoided, and the high power consumption in the data processing process in the existing technology is solved. and time-consuming problems, improving processor performance and reducing implementation costs.

CN118779267APending Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310413660.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing AI processors consume high power and time due to frequent on-chip cache access during data processing. They also have high bandwidth requirements for the on-chip cache system, high implementation costs, and complex data interactions, which affect processor performance.

Method used

By introducing an interconnection bus into the processor, the data processed by the first functional unit is directly written into the second functional unit without going through the internal storage unit of the processor, thereby reducing the number of accesses to the storage unit and reducing power consumption and time. consumption and reduce performance requirements on the storage system.

Benefits of technology

It effectively reduces the power consumption and time consumption of the processor, improves the overall performance, reduces the implementation cost, and simplifies the design complexity of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779267A_ABST
    Figure CN118779267A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method, a processor and electronic equipment, and relates to the technical field of artificial intelligence and the technical field of chips. The method is applied to a processor, and the processor comprises a first interconnection bus, a first functional unit and a second functional unit. The method comprises the following steps: a first functional unit sends a first write request to a first interconnection bus through a main interface of the first functional unit, wherein the first write request is used for requesting to write first data into a second functional unit; the first data is obtained by the first function unit through data processing; the first interconnection bus is connected with the main interface of the first functional unit and the slave interface connected with the second functional unit, and sends the first write request to the slave interface connected with the second functional unit; in response to the first write request, writing first data into the second functional unit; and the second function unit performs data processing according to the first data. The data processing power consumption and time consumption of the processor can be reduced, and the overall performance of the processor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip technology, and more specifically to a data processing method, a processor and an electronic device. Background Art

[0002] In modern artificial intelligence (AI) processors, data processing performance and flexibility greatly affect the overall performance of AI processors. The computing power of AI processing scenarios is relatively large, which places high demands on the parallelism of the data processing engine. Data computing units with high parallelism can process a large amount of data per clock cycle and can process more network layers per unit time.

[0003] In the related art, the data is originally stored in the memory, and a direct memory access device (DMA) is required to move the data to the on-chip cache in the AI ​​processor, and then the data processing unit moves the data from the on-chip cache to its internal for calculation. After the calculation is completed, the calculation result is moved to the on-chip cache, and finally the DMA moves the calculation result to the memory. It can be seen that the data processing flow in the related art is relatively complicated, and as the computational complexity of different neural networks increases, the data processing unit needs to repeatedly perform different types of operations on the data, which requires a large number of on-chip cache accesses, resulting in increased power consumption and time consumption. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, a processor, and an electronic device, which can reduce the power consumption and time consumption of processor data processing and improve the overall performance of the processor.

[0005] In a first aspect, an embodiment of the present application provides a method for data processing, the method being applied to a processor, the processor comprising a first interconnection bus, a first functional unit, and a second functional unit; the method comprising:

[0006] The first functional unit sends a first write request to the first interconnection bus through the main interface of the first functional unit, wherein the first write request is used to request to write first data to the second functional unit; the first data is obtained by data processing by the first functional unit;

[0007] The first interconnection bus interconnects a master interface of the first functional unit and a slave interface connected to the second functional unit, and sends the first write request to the slave interface connected to the second functional unit;

[0008] In response to the first write request, write the first data to the second functional unit;

[0009] The second functional unit performs data processing according to the first data.

[0010] In a second aspect, an embodiment of the present application provides a processor, comprising a first interconnection bus, a first functional unit, and a second functional unit; the first interconnection bus interconnects a master interface of the first functional unit and a slave interface connected to the second functional unit;

[0011] The first functional unit is used to send a first write request to the first interconnection bus through the main interface of the first functional unit, and the first write request is used to request to write first data to the second functional unit; the first data is obtained by data processing by the first functional unit;

[0012] The first interconnect bus is used to send the first write request to a slave interface connected to the second functional unit;

[0013] The second functional unit is used for writing the first data in response to the first write request;

[0014] The second functional unit is further configured to perform data processing according to the first data.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0016] The processor as described in the second aspect above. Optionally, the processor is suitable for implementing computer instructions.

[0017] Optionally, the electronic device may further include a memory storing computer instructions, where the computer instructions are suitable for being loaded by a processor and executing the method of the first aspect.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are read and executed by a processor of a computer device, the computer device executes the method of the first aspect above.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of the first aspect.

[0020] Based on the above technical solution, the first data obtained by the data processing of the first functional unit is written into the second functional unit through the interconnection bus, without first writing into the processor internal storage unit and then being read out from the storage unit by the second functional unit, that is, the second functional unit can obtain the first data as intermediate data without accessing the storage unit, so the embodiment of the present application can reduce the number of accesses to the processor internal storage unit, thereby reducing the power consumption and time consumption of the processor data processing, and improving the overall performance of the processor. In addition, the intermediate data in the embodiment of the present application does not need to pass through the processor internal storage unit, so the requirements for the performance of the processor internal storage system are relatively low, which can reduce the implementation cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of a processor involved in the related art;

[0022] Figure 2 A schematic diagram of a system architecture of a processor provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of another system architecture of a processor provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of the structure of the STMU provided in an embodiment of the present application;

[0025] Figure 5 A schematic flow chart of a data processing method provided in an embodiment of the present application;

[0026] Figure 6 A schematic flow chart of another data processing method provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of another system architecture of a processor provided in an embodiment of the present application;

[0028] Figure 8 A schematic diagram of a data alignment process provided in an embodiment of the present application;

[0029] Fig. 9 A schematic diagram of a streaming data processing process provided in an embodiment of the present application;

[0030] Fig.10 A schematic block diagram of a processor provided in an embodiment of the present application;

[0031] Fig.11 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0033] It should be understood that in the embodiment of the present application, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based only on A, and B can also be determined based on A and / or other information.

[0034] In the description of the present application, unless otherwise specified, "at least one" means one or more, and "plurality" means two or more than two. In addition, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0035] It should also be understood that the first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects, without any distinction of order, nor do they indicate any special limitation on the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.

[0036] It should also be understood that the specific features, structures or characteristics related to the embodiments in the specification are included in at least one embodiment of the present application. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.

[0037] In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.

[0038] The embodiments of the present application are applied to the field of artificial intelligence technology.

[0039] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0040] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0041] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0042] Artificial intelligence chips contain AI processors, which are designed with data processing units to process data. In related technologies, data is originally stored in memory, and DMA is required to move the data to the on-chip cache in the AI ​​processor, and then the data processing unit moves the data from the on-chip cache to its internal for calculation. After the calculation is completed, the calculation result is moved to the on-chip cache, and finally the DMA moves the calculation result to the memory.

[0043] Figure 1 A schematic diagram of the AI ​​processor architecture of the existing solution is shown. Among them, the on-chip cache system (memory system) is used to store the data that needs to be processed during the AI ​​processing process; DMA is responsible for data movement between the on-chip cache system inside the AI ​​processor and the external storage unit, and the function unit (FU) 0 / FU1 is used for data processing, such as the calculation of specific functions.

[0044] like Figure 1As shown, all data interactions are completed through the on-chip cache system. For example, when FU0 / FU1 needs to perform a certain combination operation, the operation process is that FU0 first reads data from the on-chip cache system and performs calculations. After FU0 completes the calculation, the obtained data is written to the on-chip cache system. Then FU1 reads the data output by FU0 from the on-chip cache system and performs the next calculation. For another example, the data read by DMA from the external storage unit needs to be written to the on-chip cache system, and the data on the on-chip cache system needs to be read and moved to the external storage unit.

[0045] The existing solutions have the following disadvantages:

[0046] 1) All data interactions are mediated by the on-chip cache system, which easily causes the bandwidth load of the on-chip cache system to be too heavy. This puts higher requirements on the design of the on-chip cache system, such as the need to provide higher bandwidth and higher implementation costs;

[0047] 2) In scenarios where multiple FUs need to cooperate, the data output by the FUs needs to be imported into the on-chip cache system. The next FU can only export data from the on-chip cache system for calculation. Frequent import and export of data results in low performance of the data processing process.

[0048] 3) The on-chip cache system consumes a lot of power for reading and writing. Frequent reading and writing will cause the power consumption of the chip to soar.

[0049] In order to solve the above problems, the embodiments of the present application propose a data processing method, device, equipment and storage medium, which can reduce the number of accesses to the internal storage unit of the processor during the data processing process, thereby reducing the power consumption and time consumption of the processor data processing.

[0050] Specifically, the processor includes an interconnect bus (cross bus, CB), a first FU and a second FU, the CB interconnects the master interface of the first FU and the slave interface connected to the second FU, the first FU can send a write request to the CB through the master interface of the first FU, the CB sends the write request to the slave interface connected to the second FU, and in response to the write request, writes the first data obtained by the first FU performing data processing into the second FU.

[0051] Therefore, the embodiment of the present application writes the first data obtained by the data processing of the first FU into the second FU through the CB, without first writing it into the processor's internal storage unit and then reading it from the storage unit by the second FU, that is, the second FU can obtain the first data as intermediate data without accessing the storage unit, so the embodiment of the present application can reduce the number of accesses to the processor's internal storage unit, thereby reducing the power consumption and time consumption of the processor data processing, and improving the overall performance of the processor. In addition, the intermediate data in the embodiment of the present application does not need to pass through the processor's internal storage unit, so the requirements for the performance of the processor's internal storage system are relatively low, which can reduce the implementation cost.

[0052] The master interface is the sender of the request and can actively initiate a read request or a write request, while the slave interface is the receiver of the request and can only passively receive a read request or a write request from the master interface.

[0053] Figure 2 An optional schematic diagram of a system architecture of a processor 200 provided in an embodiment of the present application. The processor 200 may be implemented as an AI processor. The processor may be included in any electronic device with data processing capability, such as a server or a terminal device, without limitation. Figure 2 As shown, the processor 200 includes a first CB 210 , a first FU 220 , and a second FU 230 .

[0054] Among them, the first CB 210 is used to interconnect the master interface (denoted as M) of the first FU and the slave interface (denoted as S) connected to the second FU; the first FU220 and the second FU230 are respectively used for computing tasks of the same or different logics, such as arithmetic and logical operations of integer data, or arithmetic and logical operations of floating-point data, or multiplication and accumulation operations.

[0055] In the embodiment of the present application, the master interface (denoted as M) of the first FU and the slave interface (denoted as S) connected to the second FU are interconnected through the first CB, so that the write request #1 sent by the first FU220 through its master interface M can be sent to the slave interface S connected to the second FU230. In response to the write request #1, the first data output by the first FU220 can be written to the second FU230.

[0056] Optionally, the processor 200 may further include a DMA 240 and an on-chip cache system 250. The DMA 240 is used to move data between the on-chip cache system 250 inside the processor and an external storage unit. For example, the DMA 240 may obtain data from an external storage unit through an external bus (BUS) and write the data to the on-chip cache system 250, or store the data read from the on-chip cache system 250 to the external storage unit through the BUS.

[0057] The on-chip cache system 250 is used to store data related to data processing, such as the original data required for the operation, or the final operation result written by the FU (such as the second FU230). It should be noted that in the embodiment of the present application, the data output by the first FU220 can be directly written into the second FU230 through the first CB210 without being written into the on-chip cache system 250.

[0058] Therefore, the embodiment of the present application writes the first data obtained by data processing by the first FU into the second FU through the CB, without the need to first write the first data into the internal storage unit of the processor and then read it from the storage unit by the second FU. That is, the second FU can obtain the first data as intermediate data without accessing the storage unit. Therefore, the embodiment of the present application can reduce the number of accesses to the internal storage unit of the processor, thereby reducing the power consumption and time consumption of processor data processing, and improving the overall performance of the processor.

[0059] Exemplarily, the processor internal storage unit includes an on-chip cache system, and may further include a storage unit in the on-chip cache system.

[0060] In some embodiments, the first CB 210 may also be used to interconnect a master interface M of the DMA 240 and a slave interface S connected to a FU (eg, the first FU 220 or the second FU 220 ).

[0061] As an example, Figure 2 As shown, the master interface M of DMA240 and the slave interface S connected to the first FU can be interconnected through the first CB210, so that the write request #2 sent by DMA240 through its master interface M is sent to the slave interface connected to the first FU, and the data read by DMA is written to the first FU in response to the write request #2.

[0062] As another example, the master interface M of DMA240 and the slave interface S connected to the second FU can be interconnected through the first CB210, so that the write request #2 sent by DMA240 through its master interface M is sent to the slave interface ( Figure 2 (not shown), in response to the write request #2, the DMA read data is written into the second FU.

[0063] Optionally, the DMA 240 may write the data read from the external storage unit into the FU via the first CB 210 . It should be noted that the data read by the DMA here is directly written into the FU via the first CB 210 , and does not need to be written into the on-chip cache system 250 .

[0064] Therefore, the embodiment of the present application writes the data acquired by DMA into FU through CB, without having to first write it into the internal storage unit of the processor and then read it out from the storage unit by FU. That is, FU can obtain the data read by DMA without accessing the storage unit. Therefore, the embodiment of the present application can further reduce the number of accesses to the internal storage unit of the processor and further improve the overall performance of the processor.

[0065] Optionally, the first FU220 or the second FU230 may also read data from the on-chip cache system 250 , or write the calculation result into the on-chip cache system 250 , which is not limited in the present application.

[0066] Optionally, the DMA may also read data from the on-chip cache system 250 , or write the acquired data into the on-chip cache system 250 , which is not limited in the present application.

[0067] Figure 3 An optional schematic diagram of another system architecture of a processor 300 provided by an embodiment of the present application is shown. The processor 300 includes a first CB 310, a first FU 320, a second FU 330, a DMA 340, an on-chip cache system 350, a second CB 460, a first slave to master convert unit (STMU) 325, and a second STMU 435. Exemplarily, the on-chip cache system 350 may include multiple storage units, such as a first storage unit 351, a second storage unit 352, and a third storage unit 353.

[0068] Among them, the first CB 310, the first FU 320, the second FU 330, the DMA 340, the on-chip cache system 350 and Figure 2 For similar modules, see Figure 2 Related description in .

[0069] In some embodiments, the second CB 360 can be used to interconnect the master interface M connected to the second FU 330 and the slave interface S of the first storage unit 351, so that the read request #1 sent by the second FU 330 through the master interface M connected thereto can be sent to the slave interface of the first storage unit 351, and the second FU 330 can read the third data in the first storage unit 351 in response to the read request #1. The second FU 330 can perform data processing on the third data.

[0070] Optionally, the third data includes original data stored in the first storage unit 351, so the embodiment of the present application can enable the FU to read the original data from the internal storage unit of the processor and perform data processing on the original data.

[0071] See also Figure 3, the slave interface connected to the second FU 330 (which can be considered as the slave interface of the second FU) can be set on the second STMU 335 connected to the second FU 330. The STMU can convert the slave interface of the FU into a master interface, so that the design of the FU does not need to introduce a slave interface, which is conducive to reducing the design complexity of the FU.

[0072] Optionally, the main interface connected to the second FU 330 (which can be considered as the main interface of the second FU) can also be set on the second STMU 435. By setting the main interface of the FU on the STMU, it is helpful to reduce the number of main interfaces on the FU, thereby further reducing the design complexity of the FU.

[0073] Figure 4 An optional schematic diagram of the structure of STMU is shown. Figure 4 As shown, the STMU may include a first in first out (FIFO) buffer 410 and a multiplexer (MUX) 420 . Figure 4 The number of multiplexers 420 is 2 for illustration, but the present application does not limit this, for example, it can also be 1 or 3. The STMU can include at least one slave interface (such as slave interface 401) and at least one master interface (such as master interfaces 402 to 405).

[0074] The input of the slave interface 401 comes from the FU or DMA, and the input of the master interface 402 or 403 comes from the on-chip cache system 350. The data input from the slave interface 401 can be stored in the FIFO cache 410, and the input of the multiplexer 420 is used as the source of the master interface (such as the master interface 404 or 405), for example, from the FIFO cache 410 (i.e., FU or DMA), or from the master interface 402 or 403 (i.e., the on-chip cache system).

[0075] See also Figure 4 , the output data of the upstream module is input from the interface 401, and the data is temporarily stored in the FIFO buffer 410. The operand load unit downstream of the STMU reads the data in the FIFO buffer 410 through the main interface (such as 404 or 405), completing the conversion from the interface to the main interface.

[0076] For example, for the second STMU335, the upstream module input from the interface 401 is the first FU320, and the output data is the first data requested by the write request #1 to be written to the second FU330. In response to the write request #1, the second STMU335 temporarily stores the first data in its internal FIFO buffer 410. Afterwards, the operand load unit of the second FU330 downstream thereof sends a read request through the master interface 404 or 405 to read the first data in the FIFO buffer 410, and in response to the read request, the first data is returned to the operand load unit of the second FU330 through one of the MUXs 420, thereby converting the write request #1 received from the slave interface 401 into a read request sent by the master interface 404 or 405.

[0077] For another example, for the second STMU335, the upstream module input from the interface 401 may also be the DMA340, and the output data is the second data requested by the write request #2 to be written to the second FU330. The second STMU335 temporarily stores the second data in its internal FIFO buffer 410 in response to the write request 2. Then, the operand load unit of the second FU330 downstream thereof sends a read request through the master interface 404 or 405 to read the second data in the FIFO buffer 410, and in response to the read request, returns the second data to the operand load unit of the second FU330 through one of the MUXs 420, thereby converting the write request #2 received from the slave interface 401 into a read request sent by the master interface 404 or 405.

[0078] Continue to see Figure 4 The third data read from the on-chip cache system 350 at the main interface 402 or 403 can be input to the MUX 420, and the operand load unit downstream of the STMU reads the third data through the main interface (such as 404 or 405).

[0079] For example, for the second STMU 335, the third data read from the first storage unit 351 through the master interface 402 or 403 may be input to the multiplexer 420. Then, the operand load unit of the second FU 330 downstream thereof sends a read request through the master interface 404 or 405 to read the third data, and in response to the read request, the third data is returned to the operand load unit of the second FU 330 through the MUX 420.

[0080] It should be noted that the data processing process is described above by taking the second FU and the second STMU 335 as examples. The data processing process of the first FU 320 and the first STMU 325 is similar to that of the second FU 330 and the second STMU 335, and the above description may be referred to, and will not be repeated here.

[0081] Optionally, the second CB 360 may also be used to interconnect the master interface M of the second FU 330 and the slave interface S of the second storage unit 352, so that the write request #3 sent by the second FU 330 through its master interface M may be sent to the slave interface of the second storage unit 352, and the second FU 330 may write the fourth data to the second storage unit 352 in response to the write request #3. The fourth data may include the final result obtained by the FU performing data processing.

[0082] Optionally, the second CB360 can also be used to interconnect the master interface M of DMA340 and the slave interface S of the second storage unit 352, so that the read request #2 sent by DMA340 through its master interface M can be sent to the slave interface of the second storage unit 352, and DMA340 can read the fourth data in the second storage unit 352 in response to the read request #2.

[0083] Therefore, the FU in the embodiment of the present application can write the final result of data processing into the internal storage unit of the processor, and further the DMA can read the final result of data processing performed by FU from the internal storage unit of the processor, thereby realizing the output of the final result of data processing by the processor.

[0084] Optionally, the second CB360 can also be used to interconnect the master interface M of the DMA340 and the slave interface S of the third storage unit 352, so that the write request #4 sent by the DMA340 through its master interface M can be sent to the slave interface of the third storage unit 353, and in response to the write request #4, the DMA340 writes the fifth data into the third storage unit 353. Optionally, the fifth data can be data read by the DMA340 from the external storage unit.

[0085] It should be understood that Figure 2 and Figure 3 This is only an exemplary description and does not specifically limit the system architecture of the processor in the embodiment of the present application. Figure 2 or Figure 3 Two FUs are shown as an example, but a greater number of FUs may be included in practice, and this application does not impose any limitation on this.

[0086] Figure 5 1 is a schematic flow chart of a data processing method 500 provided in an embodiment of the present application. The method 500 can be applied to a processor, such as Figure 2 The processor 200, or Figure 3 The processor 300 shown in FIG. 3 includes at least a first interconnect bus CB, a first functional unit FU and a second FU. Figure 5 As shown, the method 500 includes the following steps 510 to 540 .

[0087] 510. The first FU sends a first write request to the first CB through the main interface of the first FU. The first write request is used to request to write first data to the second FU. The first data is obtained by data processing by the first FU.

[0088] Exemplarily, the first FU may be the upper level FU of the second FU, and the second FU may be the lower level FU of the first FU. Specifically, the second FU needs to read the first data obtained by the first FU for data processing, and further perform data processing on the first data. Here, the first data obtained by the first FU for data processing may be referred to as intermediate data. In an embodiment of the present application, the intermediate data does not need to be written into a processor internal storage unit, such as an on-chip cache system.

[0089] Exemplarily, the first FU may be an integer arithmetic logic unit (IALU) for arithmetic logic operations of integer data; or the first FU may be a floating-point arithmetic logic unit (FALU) for arithmetic logic operations of floating-point data; or the first FU may be a multiply accumulate unit (MAC) for multiply accumulate operations. The second FU is similar to the first FU and will not be described in detail.

[0090] The main interface of the first FU is the sender of the first write request and can actively initiate the first write request. Figure 3 The first FU 320 may send a write request # 1 (an example of a first write request) to the first CB 310 through its main interface, where the write request # 1 is used to request writing the first data obtained by the first FU 220 through data processing to the second FU 330 .

[0091] 520. The first CB interconnects the master interface of the first FU and the slave interface connected to the second FU, and sends the first write request to the slave interface connected to the second FU.

[0092] Specifically, the first CB can establish an interconnection between the master interface of the first FU and the slave interface connected to the second FU, thereby interconnecting the master interface of the first FU and the slave interface connected to the second FU. Based on this, when the first CB receives a first write request from the master interface of the first FU, it can send the first write request to the slave interface connected to the second FU. Figure 3 After receiving the write request #1 sent from the master interface of the first FU320, the first CB310 sends the write request #1 to the slave interface S connected to the second FU320.

[0093] In some embodiments, the slave interface connected to the second FU may be located on the second FU.

[0094] In some embodiments, the processor may further include a slave interface to master interface conversion unit STMU, the STMU including a first-in first-out FIFO buffer and a multiplexer. The STMU may be connected to the second FU, so that the slave interface connected to the second FU is set on the STMU. Specifically, the structure of the STMU can be referred to Figure 4 The slave interface of the second FU can be converted into a master interface by setting a slave interface on the second STMU, so that the design of the FU does not need to introduce a slave interface, which is conducive to reducing the design complexity of the FU.

[0095] For example, see Figure 3 The slave interface S connected to the second FU330 may be located on the second STMU335 connected to the second FU330, so that the second FU330 does not need to be provided with a slave interface, which is helpful to reduce the design complexity of the FU.

[0096] 530 , in response to the first write request, write the first data to the second FU.

[0097] Specifically, after the first CB sends the first write request to the slave interface connected to the second FU, it can respond to the first write request and write the first data to the second FU.

[0098] In some embodiments, when the slave interface connected to the second FU is located on the STMU connected to the second FU, the STMU can write the first data into its internal FIFO cache in response to the first write request. Then, the operand loading unit of the second FU can send a first read request to the STMU through the master interface, and the first read request is used to read the first data in the FIFO cache. In response to the first read request, the first data is returned to the operand loading unit in the second FU through the multiplexer inside the STMU.

[0099] For example, in Figure 4 In the example, the slave interface 401 of the STMU, as a slave interface connected to the second FU330, can receive the write request #1 sent from the first FU320 of the upstream module, and in response to the write request #1, write the first data into the FIFO buffer 410. Afterwards, the operand loading unit in the second FU330 can send a read request to the STMU through the master interface (such as 404 or 405), requesting to read the first data stored in the FIFO buffer 410. In response to the read request, the MUX420 returns the first data to the operand loading unit in the second FU330.

[0100] Therefore, in the embodiment of the present application, the intermediate data (i.e., the first data) output by the first FU can be directly written into the second FU through the first CB, without having to be written into the internal storage unit of the processor (such as an on-chip cache system) and then read from the internal storage unit of the processor by the second FU.

[0101] At 540 , the second FU performs data processing according to the first data.

[0102] Exemplarily, when the second FU is IALU, arithmetic and logical operations of integer data can be performed on the first data (integer data at this time); when the second FU is FALU, arithmetic and logical operations of floating-point data can be performed on the first data (floating-point data at this time); when the second FU is MAC, multiplication and accumulation operations can be performed on the first data.

[0103] Therefore, the embodiment of the present application writes the first data obtained by the data processing of the first FU into the second FU through the CB, without first writing it into the processor's internal storage unit and then reading it from the storage unit by the second FU, that is, the second FU can obtain the first data as intermediate data without accessing the storage unit, so the embodiment of the present application can reduce the number of accesses to the processor's internal storage unit, thereby reducing the power consumption and time consumption of the processor data processing, and improving the overall performance of the processor. In addition, the intermediate data in the embodiment of the present application does not need to pass through the processor's internal storage unit, so the requirements for the performance of the processor's internal storage system are relatively low, which can reduce the implementation cost.

[0104] In some embodiments, the processor also includes a direct memory access DMA, such as Figure 6 As shown, the method 500 may further include the following steps 550 to 580 .

[0105] 550. The DMA sends a second write request to the first CB through the DMA master interface, where the second write request is used to request to write second data to the second FU.

[0106] In some embodiments, the DMA can read the second data from the external storage unit through the external bus, that is, the second data is the data to be processed that is moved from the external storage unit by the DMA.

[0107] The DMA master interface is the sender of the second write request and can actively initiate the second write request. Figure 3 The DMA 340 may send a write request #2 (an example of a second write request) to the first CB 310 through its master interface, where the write request #2 is used to request writing the second data read by the DMA 340 to the second FU 330 .

[0108] 560. The first CB interconnects the master interface of the DMA and the slave interface connected to the second FU, and sends the second write request to the slave interface connected to the second FU.

[0109] Specifically, the first CB can establish an interconnection between the DMA master interface and the slave interface connected to the second FU vector, thereby interconnecting the DMA master interface and the slave interface connected to the second FU. Based on this, when the first CB receives a second write request from the DMA master interface, it can send the second write request to the slave interface connected to the second FU. For example, Figure 3 After receiving the write request #2 sent from the master interface of the DMA 340 , the first CB 310 sends the write request #2 to the slave interface S connected to the second FU 330 .

[0110] In some embodiments, the slave interface connected to the second FU may be located on the second FU, or on the STMU connected to the second FU. Optionally, the slave interface connected to the second FU in step 560 and the slave interface connected to the second FU in step 520 above are the same slave interface. For details, please refer to the relevant description in step 520, which will not be repeated here.

[0111] 570 , in response to the second write request, write second data to the second FU.

[0112] Specifically, after the first CB sends the second write request to the slave interface connected to the second FU, it can respond to the second write request and write the second data to the second FU.

[0113] In some embodiments, when the slave interface connected to the second FU is located on the STMU connected to the second FU, the processing flow of the STMU internally responding to the second write request is similar to the processing flow of responding to the first write request. Please refer to the relevant description in step 530, which will not be repeated here.

[0114] Therefore, in the embodiment of the present application, the data to be processed (i.e., the second data) read by DMA can be directly written into the second FU through the first CB, without having to be written into the internal storage unit of the processor (such as an on-chip cache system) and then read from the internal storage unit of the processor by the second FU.

[0115] 580. The second FU performs data processing according to the first data and the second data.

[0116] Exemplarily, when the second FU is IALU, arithmetic and logical operations of integer data can be performed on the first data and the second data (both are integer data at this time); when the second FU is FALU, arithmetic and logical operations of floating-point data can be performed on the first data and the second data (both are floating-point data at this time); when the second FU is MAC, multiplication and accumulation operations can be performed on the first data and the second data.

[0117] Therefore, the embodiment of the present application writes the data acquired by DMA into FU through CB, without having to first write it into the internal storage unit of the processor and then read it out from the storage unit by FU. That is, FU can obtain the data read by DMA without accessing the storage unit. Therefore, the embodiment of the present application can further reduce the number of accesses to the internal storage unit of the processor and further improve the overall performance of the processor.

[0118] In some embodiments, the second FU may also send a second read request to the second CB through a master interface connected to the second FU, and the second read request is used to request to read the third data from the first storage unit. The third data includes original data. The second CB interconnects the master interface connected to the second FU and the slave interface of the first storage unit, and sends the second read request to the slave interface of the first storage unit. In response to the second read request, the second FU reads the third data.

[0119] Specifically, the main interface connected to the second FU is the sending end of the second read request and can actively initiate the second read request. Figure 3 The second FU 330 may send a read request #1 (an example of a second read request) to the second CB 360 through the master interface on the second STMU, where the read request #1 is used to request to read the third data to be processed from the first storage unit 351. Optionally, the third data may be original data pre-stored on the first storage unit 351.

[0120] The second CB360 can establish an interconnection between the main interface connected to the second FU330 (such as the main interface on the second STMU335) and the first storage unit 351. After the second CB360 receives the read request #1 sent from the main interface connected to the second FU330, it sends the read request #1 to the slave interface S connected to the first storage unit 351.

[0121] In some embodiments, the primary interface connected to the second FU may be located on the second FU.

[0122] In some embodiments, the slave interface connected to the second FU may be provided on the STMU connected to the second FU. Optionally, the number of STMUs connected to the FU is one, that is, the master interface and the slave interface connected to the FU are located on the same STMU. For details, the structure of the STMU can be found in Figure 4By setting the main interface connected to the second FU on the STMU, the number of main interfaces on the FU can be reduced, thereby further reducing the design complexity of the FU.

[0123] For example, see Figure 3 The main interface M connected to the second FU330 can be located on the second STMU35 connected to the second FU330, so that the second FU330 does not need to be provided with a main interface for sending a read request to the storage unit, which is conducive to reducing the design complexity of the FU.

[0124] After the second CB sends the second read request to the slave interface of the first storage unit, the second FU may read the third data from the first storage unit in response to the second read request.

[0125] In some embodiments, when the master interface connected to the second FU is located on the STMU connected to the second FU, the STMU can input the third data into the multiplexer in the STMU in response to the second read request. Then, the operand load unit of the second FU sends a third read request to the STMU through the master interface, and the third read request is used to read the third data. In response to the third read request, the third data is returned to the operand load unit in the second FU through the multiplexer.

[0126] For example, in Figure 4 In the embodiment, the master interface 402 or 403 of the STMU serves as the master interface connected to the second FU, and can input the third data read from the first storage unit 351 into the MUX 420 in response to the read request #1. Afterwards, the operand loading unit in the second FU 330 can send a read request to the STMU through the master interface (such as 404 or 405), requesting to read the third data. In response to the read request, the MUX 420 returns the third data to the operand loading unit in the second FU 330.

[0127] After the second FU obtains the third data, it may perform data processing on the third data. In some embodiments, the second FU may perform data processing on at least one of the obtained first data, second data, and third data.

[0128] Therefore, in the embodiment of the present application, the second FU can read the original data (ie, the third data) on the internal storage unit of the processor through the second CB to implement data processing on the original data.

[0129] In some embodiments, the second FU may also send a third write request to the second CB through the master interface on the second FU, and the third write request is used to request to write fourth data to the second storage unit. The fourth data includes the final result obtained by the FU performing data processing. The second CB interconnects the master interface on the second FU and the slave interface on the second storage unit, and sends the third write request to the slave interface of the second storage unit. In response to the third write request, the fourth data is written to the second storage unit.

[0130] Specifically, the main interface of the second FU is the sender of the third write request and can actively initiate the third write request. Figure 3 The second FU 330 may send a write request #3 (an example of a third write request) to the second CB 360 through a master interface provided thereon, and the write request #3 is used to request writing fourth data to the second storage unit 352. Exemplarily, the result obtained by the second FU 330 through data processing may be used as an example of a final result obtained by the FU through data processing.

[0131] The second CB 360 may establish an interconnection between the master interface connected to the second FU 330 and the second storage unit 352. After receiving the write request #3 sent from the master interface of the second FU 330, the second CB 360 sends the write request #3 to the slave interface S connected to the second storage unit 352. Thereafter, the fourth data may be written to the second storage unit 352 in response to the write request #3.

[0132] Therefore, in the embodiment of the present application, the second FU can write the final result (i.e., the fourth data) obtained by the FU for data processing to the internal storage unit of the processor through the second CB, so as to realize the storage of the final result of the data processing. In this way, the embodiment of the present application can realize that only the original data needs to be read out from the internal storage unit of the processor, and the final result of the data processing is written back to the internal storage unit of the processor, and the intermediate data of the data processing does not need to pass through the internal storage unit of the processor, and the data can be processed online in an online streaming manner, thereby improving the overall performance of data processing and reducing the power consumption and time consumption of the processor.

[0133] In some embodiments, the DMA may also send a third read request to the second CB through the master interface of the DMA, and the third read request is used to request to read the fourth data from the second storage unit. The second CB interconnects the master interface of the DMA and the slave interface of the second storage unit, and sends the third read request to the slave interface of the second storage unit. In response to the third read request, the DMA reads the fourth data from the second storage unit.

[0134] Specifically, the DMA master interface is the sender of the third read request and can actively initiate the third read request. Figure 3The DMA 340 may send a read request #2 (an example of the third read request) to the second CB 360 through the master interface set thereon, and the read request #2 is used to request to read the fourth data from the second storage unit 352. The second CB 360 may establish an interconnection from the master interface connected to the DMA 340 to the second storage unit 352. After receiving the read request #2 sent from the master interface of the DMA 340, the second CB 360 sends the read request #2 to the slave interface S connected to the second storage unit 352. Thereafter, in response to the read request #2, the DMA 340 may read the fourth data from the second storage unit 352.

[0135] Optionally, the DMA may write the fourth data into an external storage unit through an external bus, that is, output the final result obtained by the FU for data processing to the external storage unit.

[0136] Therefore, in the embodiment of the present application, the DMA can read the final result obtained by the FU on the internal storage unit of the processor through the second CB to process the data, and move the final result to the external storage unit.

[0137] In some embodiments, the DMA may also send a fourth write request to the second CB through the master interface of the DMA, and the third write request is used to request to write fifth data to the third storage unit. The second CB interconnects the master interface of the DMA and the slave interface of the third storage unit, and sends the fourth write request to the slave interface of the third storage unit. In response to the fourth write request, the DMA writes the fifth data to the third storage unit. Exemplarily, the fifth data may include data read from the external storage unit by the DMA through the external bus.

[0138] Specifically, the DMA master interface is the sender of the fourth write request and can actively initiate the fourth write request. Figure 3 The DMA 340 may send a write request #4 (an example of a fourth write request) to the second CB 360 through the master interface set thereon, and the write request #4 is used to request to read the fifth data from the third storage unit 353. The second CB 360 may establish an interconnection from the master interface connected to the DMA 340 to the third storage unit 353. After receiving the write request #4 sent from the master interface of the DMA 340, the second CB 360 sends the write request #4 to the slave interface S connected to the third storage unit 353. Thereafter, in response to the write request #4, the DMA 340 may write the fifth data to the third storage unit 353.

[0139] Therefore, in the embodiment of the present application, the DMA can move the data on the external storage unit to the internal storage unit of the processor through the second CB.

[0140] In some embodiments, the first to fifth data include vector data, and accordingly, the first FU and the second FU are vector processing units. Therefore, the embodiment of the present application can implement a vector processing flow for vector data.

[0141] It should be noted that the above description uses the processor including the first FU and the second FU, and takes the data processing flow of the second FU as an example to describe the technical solution of the embodiment of the present application, but the embodiment of the present application is not limited to this. For example, the processor may also include other FUs, and each FU and the second FU may perform the same or similar data processing flow.

[0142] Figure 7 A schematic diagram of another processor system architecture provided by an embodiment of the present application is shown. It should be understood that Figure 7 The modules (or components) of the processor shown are only examples. In the embodiments of the present application, the processor may also include other modules or Figure 7 In addition, Figure 7 The processor may not include Figure 7 All modules.

[0143] Figure 7 S stands for slave, i.e. slave interface; M stands for master, i.e. main interface. The main interface is the sender of the request and can actively initiate the request; while the slave interface is the receiver of the request and can only passively receive the request. The following introduces each module separately:

[0144] 1) mem0~7: 8 memory cells in the on-chip cache system. The specific number of memories can be expanded according to the actual usage scenario. Optionally, the memory is a single port, that is, only read or write access can be performed at a time point, and reading and writing cannot be performed at the same time. Figure 7 As shown, each memory includes a slave interface (S interface) for receiving a read request or a write request. The slave interface of each memory is connected to CB0.

[0145] 2) CB0: used to establish the interconnection between the master interface of FU / DMA and the slave interface of each memory. The master interface of FU / DMA is the memory access port, which is used to send read access (read request) or write access (write request) to the memory. Figure 7, DMA has 2 sets of master interfaces (read (rd) master interface and write (wr) master interface), FU0 / 1 / 2 each has 3 sets of master interfaces (two read master interfaces on STMU connected to FU and one write master interface on stu inside FU), a total of 11 sets of master interfaces. And mem0~7 have 8 sets of slave interfaces, so CB0 can realize any interconnection from 11 sets of master interfaces to 8 sets of slave interfaces, thereby realizing FU / DMA read access or write access to memory. CB0 is an example of the second CB mentioned above.

[0146] 3) CB1: used to establish the interconnection between the FU / DMA master interface (here refers to the write interface) and the FU read interface. Optional, such as Figure 7 As shown, the read interface of the FU can be implemented through the slave interface of the STMU connected to the FU. Alternatively, the read interface of the FU can be implemented through the slave interface located on the FU ( Figure 7 ), not shown in the figure, and is not limited thereto. Figure 7 , DMA has 1 set of write interfaces, FU0 / 1 / 2 each has 1 set of write interfaces (that is, a write master interface on the stu inside the FU), totaling 4 sets of write interfaces. Figure 7 Each FU corresponds to one STMU, and there are three STMUs (STMU0 / 1 / 2) in total. Each STMU has one set of slave interfaces, so CB1 can realize the interconnection between the four sets of master interfaces and the three sets of slave interfaces of STMU0 / 1 / 2, thereby realizing the write access of one FU to another FU, or realizing the write access of DMA to FU. CB1 is an example of the first CB mentioned above.

[0147] 4) BUS: external bus. DMA interacts with the external storage system through BUS. For example, it can read the data to be processed from the external storage unit through BUS, or write the final result of data processing to the external storage unit through BUS.

[0148] 5) DMA: used to move data between the on-chip cache (such as mem0-7) inside the processor and the external memory. In the embodiment of the present application, DMA is mounted on CB (CB0 and CB1). Among them, DMA is mounted on CB0, which can realize DMA read access or write access to memory; DMA is mounted on CB1, which can realize DMA write access to FU.

[0149] 6) STMU0 / 1 / 2: ​​Each STMU is implemented as follows Figure 4As shown, it includes a FIFO cache. The output data of the upstream module (such as DMA or FU) is input from the slave interface of STMU, and the data is temporarily stored in the FIFO cache. The operand load unit of the downstream FU reads the data in the FIFO cache through the master interface to complete the master-slave interface conversion. In addition, the source of the master interface is also realized by one or more MUXs inside STMU, which can come from the FIFO cache (that is, the output of DMA or FU) or from the data read from the memory.

[0150] For example, when the operand load unit of the current FU needs to read the data written by the previous level FU into the FIFO buffer of the STMU connected to the current FU, the data in the FIFO buffer can be input into the MUX, and the operand load unit reads the data in the FIFO buffer through the MUX. For another example, when the operand load unit of the current FU needs to read the data in the memory, the STMU can read the data from the memory through the read interface and input it into the MUX, and the operand load unit reads the data from the memory through the MUX.

[0151] 7) FU0 / 1 / 2: ​​used for computing tasks of different logics. It should be understood that Figure 7 Three FUs are instantiated in the example. The number of instantiations of specific FUs can be expanded arbitrarily according to actual needs. Among them, FU0 can be IALU, which is used for arithmetic and logical operations of integer data; FU1 can be FALU, which is used for arithmetic and logical operations of floating-point data; FU2 can be MAC, which is used for multiplication and accumulation operations. FU can further include opa_ldu / opb_ldu, align_unit, calculation unit (such as IALU, FALU or MAC) and stu.

[0152] 8) opa_ldu / opb_ldu: Operator a / b load unit, used to initiate a read request and receive data returned in response to the read request. Exemplarily, the operand a / b load unit can read data written by other FUs, or data written by DMA, or read data stored in memory through STMU. Specifically, the process of operand a / b load unit reading data can be found in the description of 6) STMU0 / 1 / 2, which will not be repeated here.

[0153] 9)align_unit: Alignment unit. When there are multiple operands and the multiple operands are not aligned in time, the alignment unit is used to time align the multiple operands so that the operation unit (such as IALU, FALU or MAC) can calculate the multiple operands.

[0154] For example, Figure 8 As shown, due to various reasons, such as a serious bank conflict when opb_ldu accesses memory, the memory return data lags behind the data returned by opa_ldu, resulting in operand b (opb_data) being returned later than operand a (opa_data). At this time, operands a and b need to be aligned so that subsequent operation units can process operands a and b. Exemplarily, the alignment unit can back-pressure operand a that arrives earlier, and then release back-pressure on operand a after operand b arrives, thereby achieving alignment of operands a and b.

[0155] 10) stu: store unit, used to write out the calculation results through the stu module after the FU completes the calculation. Figure 7 As shown, the main interface (such as a write interface) of the FU can be located on the stu to write the calculation results calculated by the FU into other FUs or into memory.

[0156] Combination Figure 7 The processor shown in the embodiment of the present application also provides a streaming data processing process 900, see Fig. 9 , including the following steps 901 to 910.

[0157] 901, DMA writes input 1a to FU0 through CB1.

[0158] Exemplarily, the data read by DMA from the external storage unit through the external bus BUS can be sent directly to CB1 through its master interface (write interface). CB1 interconnects the master interface of DMA and the slave interface of STMU0 connected to FU0, writes the data into the FIFO cache of STMU0, and the opa_ldu of FU0 reads the FIFO cache as input 1a.

[0159] 902, FU0 reads input 1b from mem0.

[0160] Exemplarily, FU0 sends a read request to CB0 through the master interface of STMU0 (i.e., the read interface of FU0) to read the data in mem0, CB0 interconnects the master interface of FU0 and the slave interface of mem0, inputs the read data into the multiplexer of STMU, and the opb_ldu of FU0 reads the multiplexer as input 1b. Input 1b can be the original data stored in mem0.

[0161] 903, FU0 performs IALU operation on inputs 1a and 1b to obtain output 1c.

[0162] 904, FU0 writes output 1c to input 2a of FU1 through CB1.

[0163] Exemplarily, FU0 sends output 1c directly to CB1 through its master interface (write interface), CB1 interconnects the write interface of FU0 and the slave interface of STMU1 connected to FU1, writes the data into the FIFO buffer of STMU1, and the opa_ldu of FU1 reads the FIFO buffer as input 2a.

[0164] 905, FU1 reads input 2b from mem1. Input 2b may be the original data stored in mem1. Step 905 is similar to step 902, and the description above may be referred to.

[0165] 906, FU1 performs FALU operation on inputs 2a and 2b to obtain output 2c.

[0166] 907, FU1 writes output 2c to input 3a of FU2 through CB1.

[0167] Exemplarily, FU1 sends output 2c directly to CB1 through its master interface (write interface), CB1 interconnects the write interface of FU1 and the slave interface of STMU2 connected to FU2, writes the data into the FIFO buffer of STMU2, and the opa_ldu of FU2 reads the FIFO buffer as input 3a.

[0168] 908, FU2 reads input 3b from mem2. Input 3b may be the original data stored in mem2. Step 908 is similar to step 902, and the description above may be referred to.

[0169] 909, FU2 performs FALU operation on inputs 3a and 3b to obtain output 3c.

[0170] 910, FU2 writes output 3c to mem7.

[0171] Exemplarily, FU2 sends output 3c to CB0 through its master interface (write interface), and CB0 interconnects the write interface of FU2 and the slave interface of mem7 to write the data into mem7. Output 3c can be processed by FU to obtain the final result.

[0172] Optionally, DMA can read the final result obtained by FU data processing from mem7 via CB0. Further, DMA can write the final result into an external storage unit via an external bus BUS.

[0173] Therefore, the embodiment of the present application can realize online streaming processing of data, which only requires the original data to be read out from the processor's internal storage unit and the final calculation result to be written back to the processor's internal storage unit. The intermediate calculation process does not need to pass through the processor's internal storage unit, which can greatly improve the overall performance of data processing and reduce the power consumption and time consumption of the processor. In addition, the intermediate data in the embodiment of the present application does not need to pass through the processor's internal storage unit, so the requirements for the performance of the processor's internal storage system are relatively low, which can reduce the implementation cost.

[0174] Furthermore, the embodiment of the present application converts the slave interface of FU into a master interface through STMU, so that the design of FU does not need to introduce a slave interface, which can reduce the design complexity of FU. Furthermore, by connecting DMA to CB, the data read by DMA can be input into FU through CB without passing through the processor memory storage unit, which can further reduce the overall performance of data processing.

[0175] It should be understood that Fig. 9 The steps or operations of the data processing flow are shown, but these steps or operations are only examples. The embodiments of the present application may also perform other operations or Fig. 9 In addition, Fig. 9 The steps in Fig. 9 are executed in a different order than the ones presented, and may not be executed Fig. 9 All operations.

[0176] The specific implementation modes of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above implementation modes. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific implementation modes can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different implementation modes of the present application can also be arbitrarily combined, and as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.

[0177] It should also be understood that in the various method embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. It should be understood that these sequence numbers can be interchanged where appropriate, so that the embodiments of the present application described can be implemented in an order other than those shown or described.

[0178] The above describes the method embodiment of the present application in detail. Figure 10 to Figure 11 , describing an apparatus embodiment of the present application.

[0179] Fig.10 1 is a schematic block diagram of a processor 10 provided in an embodiment of the present application. The processor 10 includes a first interconnection bus 11, a first functional unit 12 and a second functional unit 13. The first interconnection bus 11 interconnects a master interface of the first functional unit 12 and a slave interface connected to the second functional unit 13.

[0180] The first functional unit 12 is used to send a first write request to the first interconnection bus 11 through the main interface of the first functional unit 12, and the first write request is used to request to write first data to the second functional unit 13; the first data is obtained by the first functional unit 12 through data processing;

[0181] The first interconnection bus 11 is used to send the first write request to the slave interface connected to the second functional unit 13;

[0182] The second functional unit 13 is used for writing the first data in response to the first write request;

[0183] The second functional unit 13 is further configured to perform data processing according to the first data.

[0184] In some embodiments, the processor 10 further includes a slave interface to master interface conversion unit STMU connected to the second functional unit 13, the STMU including a first-in first-out FIFO buffer and a multiplexer; the slave interface connected to the second functional unit 13 is located on the STMU;

[0185] The STMU is used to write the first data into the FIFO buffer in response to the first write request;

[0186] The second functional unit 13 is used to send a first read request to the STMU through the operand loading unit through the main interface, where the first read request is used to read the first data in the FIFO buffer;

[0187] The multiplexer returns the first data to the operand load unit in response to the first read request.

[0188] In some embodiments, the processor 10 further includes a direct memory access device DMA, and the first interconnection bus 11 interconnects a master interface of the DMA and a slave interface connected to the second functional unit 13;

[0189] The DMA is used to send a second write request to the first interconnection bus 11 through the master interface of the DMA, and the second write request is used to request to write second data to the second functional unit 13;

[0190] The first interconnect bus is used to send the second write request to the slave interface connected to the second functional unit 13;

[0191] The second functional unit 13 is used for writing the second data in response to the second write request;

[0192] The second functional unit 13 is further configured to perform data processing according to the first data and the second data.

[0193] In some embodiments, the DMA is used to obtain the second data from an external storage unit through an external bus.

[0194] In some embodiments, the processor 10 further includes a second interconnection bus and a first storage unit, wherein the second interconnection bus interconnects a master interface connected to the second functional unit 13 and a slave interface of the first storage unit;

[0195] The second functional unit 13 is used to send a second read request to the second interconnect bus through a main interface connected to the second functional unit 13; the second read request is used to request to read third data from the first storage unit; the third data includes original data;

[0196] The second interconnect bus is used to send the second read request to the slave interface of the first storage unit;

[0197] The second functional unit 13 is configured to read the third data in response to the second read request.

[0198] The second functional unit 13 is further configured to perform data processing according to the first data and the third data.

[0199] In some embodiments, the processor 10 further includes a slave interface to master interface conversion unit STMU, the STMU including a multiplexer; the master interface connected to the second functional unit 13 is located on the STMU;

[0200] The STMU is used for inputting the third data into the multiplexer in response to the second read request;

[0201] The second functional unit 13 is used to send a third read request to the STMU through the operand loading unit through the main interface, where the third read request is used to read the third data;

[0202] The multiplexer is used to return the third data to the operand load unit in response to the third read request.

[0203] In some embodiments, the processor 10 further includes a second storage unit; the second interconnection bus interconnects a master interface on the second functional unit and a slave interface on the second storage unit.

[0204] The second functional unit 13 is used to send a third write request to the second interconnection bus through the main interface on the second functional unit 13, and the third write request is used to request to write fourth data to the second storage unit; the fourth data includes the final result obtained by the FU performing data processing;

[0205] The second interconnection bus is used to send the third write request to the slave interface of the second storage unit.

[0206] The second storage unit is used to write the fourth data in response to the third write request.

[0207] In some embodiments, the processor 10 further includes a DMA, and the second interconnection bus interconnects a master interface of the DMA and a slave interface of the second storage unit.

[0208] The DMA is used to send a third read request to the second interconnect bus through the master interface of the DMA, and the third read request is used to request to read the fourth data from the second storage unit.

[0209] The second interconnect bus is used to send the third read request to the slave interface of the second storage unit.

[0210] The DMA is configured to read the fourth data from the second storage unit in response to the third read request.

[0211] In some embodiments, the first functional unit 12 includes an integer arithmetic logic unit IALU, a floating point arithmetic logic unit FALU or a multiplication and accumulation unit MAC, and the second functional unit 13 includes an IALU, a FALU or a MAC.

[0212] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, in this embodiment, the processor 10 may correspond to a device for executing the method 500 of the embodiment of the present application, and the aforementioned and other operations and / or functions of each module in the device 10 are respectively for implementing the corresponding processes in each method 500 above, and for the sake of brevity, no further description is given here.

[0213] The above describes the device and system of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0214] like Fig.11 It is a schematic block diagram of an electronic device 20 provided in an embodiment of the present application.

[0215] like Fig.11 As shown, the electronic device 20 may include:

[0216] The memory 21 and the processor 22, the memory 21 is used to store the computer program and transmit the program code to the processor 22. In other words, the processor 22 can call and run the computer program from the memory 21 to implement the method in the embodiment of the present application.

[0217] For example, the processor 22 may be configured to execute corresponding steps in the above method 500 according to instructions in the computer program.

[0218] In some embodiments of the present application, the processor 22 may include but is not limited to:

[0219] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0220] In some embodiments of the present application, the memory 21 includes but is not limited to:

[0221] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0222] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 21 and executed by the processor 22 to complete the data processing method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 20.

[0223] Optional, such as Fig.11 As shown, the electronic device 20 may further include:

[0224] The transceiver 23 may be connected to the processor 22 or the memory 21 .

[0225] The processor 22 may control the transceiver 23 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 23 may include a transmitter and a receiver. The transceiver 23 may further include an antenna, and the number of antennas may be one or more.

[0226] It should be understood that the various components in the electronic device 20 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0227] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0228] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of the above method embodiment.

[0229] In other words, when implemented using software, it 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 and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may 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 may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0230] It should be understood that in the embodiment of the present application, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based only on A, and B can also be determined based on A and / or other information.

[0231] In the description of the present application, unless otherwise specified, "at least one" means one or more, and "plurality" means two or more than two. In addition, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0232] It should also be understood that the first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects, without any distinction of order, nor do they indicate any special limitation on the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.

[0233] It should also be understood that the specific features, structures or characteristics related to the embodiments in the specification are included in at least one embodiment of the present application. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.

[0234] In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.

[0235] It is understandable that in the specific implementation of the present application, when the above embodiments of the present application are applied to specific products or technologies and involve relevant data such as user information, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0236] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0237] In the several embodiments provided in the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0238] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment 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.

[0239] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for data processing, characterized in that: The method is applied to a processor, the processor comprising a first interconnection bus, a first functional unit and a second functional unit; the method comprises: The first functional unit sends a first write request to the first interconnection bus through the main interface of the first functional unit, wherein the first write request is used to request to write first data to the second functional unit; the first data is obtained by data processing by the first functional unit; The first interconnection bus interconnects a master interface of the first functional unit and a slave interface connected to the second functional unit, and sends the first write request to the slave interface connected to the second functional unit; In response to the first write request, write the first data to the second functional unit; The second functional unit performs data processing according to the first data.

2. The method according to claim 1, characterized in that The processor further comprises a slave interface to master interface conversion unit STMU connected to the second functional unit, the STMU comprising a first-in first-out FIFO buffer and a multiplexer; the slave interface connected to the second functional unit is located on the STMU; Wherein, in response to the first write request, writing the first data to the second functional unit includes: The STMU writes the first data into the FIFO buffer in response to the first write request; The operand loading unit of the second functional unit sends a first read request to the STMU through the main interface, where the first read request is used to read the first data in the FIFO buffer; In response to the first read request, the first data is returned to the operand load unit through the multiplexer.

3. The method according to claim 1, characterized in that The processor further includes a direct memory access device DMA, and the method further includes: The DMA sends a second write request to the first interconnect bus through the master interface of the DMA, where the second write request is used to request to write second data to the second functional unit; The first interconnection bus interconnects the master interface of the DMA and the slave interface connected to the second functional unit, and sends the second write request to the slave interface connected to the second functional unit; In response to the second write request, write the second data to the second functional unit; The second functional unit performs data processing according to the first data, including: The second functional unit performs data processing according to the first data and the second data.

4. The method according to claim 3, characterized in that The method further comprises: The DMA acquires the second data from an external storage unit through an external bus.

5. The method according to claim 1, characterized in that The processor further includes a second interconnect bus and a first storage unit, and the method further includes: The second functional unit sends a second read request to the second interconnect bus through a master interface connected to the second functional unit; the second read request is used to request to read third data from the first storage unit; the third data includes original data; The second interconnection bus interconnects a master interface connected to the second functional unit and a slave interface of the first storage unit, and sends the second read request to the slave interface of the first storage unit; In response to the second read request, the second functional unit reads the third data; The second functional unit performs data processing according to the first data, including: The second functional unit performs data processing according to the first data and the third data.

6. The method according to claim 5, characterized in that The processor further comprises a slave interface to master interface conversion unit STMU, the STMU comprising a multiplexer; the master interface connected to the second functional unit is located on the STMU; Wherein, in response to the second read request, the second functional unit reads the third data, including: The STMU inputs the third data into the multiplexer in response to the second read request; The operand loading unit of the second functional unit sends a third read request to the STMU through the main interface, where the third read request is used to read the third data; In response to the third read request, the third data is returned to the operand load unit through the multiplexer.

7. The method according to claim 5, characterized in that The processor further includes a second storage unit; and the method further includes: The second functional unit sends a third write request to the second interconnect bus through the master interface on the second functional unit, wherein the third write request is used to request writing fourth data to the second storage unit; the fourth data includes a final result obtained by the FU performing data processing; The second interconnection bus interconnects the master interface on the second functional unit and the slave interface on the second storage unit, and sends the third write request to the slave interface of the second storage unit; In response to the third write request, the fourth data is written to the second storage unit.

8. The method according to claim 7, characterized in that The processor also includes a DMA and the method also includes: The DMA sends a third read request to the second interconnect bus through the master interface of the DMA, where the third read request is used to request to read the fourth data from the second storage unit; The second interconnection bus interconnects the master interface of the DMA and the slave interface of the second storage unit, and sends the third read request to the slave interface of the second storage unit; In response to the third read request, the DMA reads the fourth data from the second storage unit.

9. The method according to any one of claims 1 to 8, characterized in that: The first functional unit includes an integer arithmetic logic unit IALU, a floating point arithmetic logic unit FALU or a multiplication and accumulation unit MAC, and the second functional unit includes an IALU, a FALU or a MAC.

10. A processor, characterized in that: It comprises a first interconnection bus, a first functional unit and a second functional unit; the first interconnection bus interconnects a master interface of the first functional unit and a slave interface connected to the second functional unit; The first functional unit is used to send a first write request to the first interconnection bus through the main interface of the first functional unit, and the first write request is used to request to write first data to the second functional unit; The first data is obtained by data processing by the first functional unit; The first interconnect bus is used to send the first write request to a slave interface connected to the second functional unit; The second functional unit is used for writing the first data in response to the first write request; The second functional unit is further configured to perform data processing according to the first data.

11. The processor according to claim 10, characterized in that The processor further comprises a slave interface to master interface conversion unit STMU connected to the second functional unit, the STMU comprising a first-in first-out FIFO buffer and a multiplexer; A slave interface connected to the second functional unit is located on the STMU; The STMU is used to write the first data into the FIFO buffer in response to the first write request; The second functional unit is used to send a first read request to the STMU through the operand loading unit through the main interface, where the first read request is used to read the first data in the FIFO buffer; The multiplexer is used to return the first data to the operand loading unit in response to the first read request.

12. The processor according to claim 10, characterized in that The processor further comprises a direct memory access DMA, the first interconnection bus interconnecting a master interface of the DMA and a slave interface connected to the second functional unit; The DMA is used to send a second write request to the first interconnect bus through the master interface of the DMA, and the second write request is used to request to write second data to the second functional unit; The first interconnect bus is used to send the second write request to a slave interface connected to the second functional unit; The second functional unit is used for writing the second data in response to the second write request; The second functional unit is further configured to perform data processing according to the first data and the second data.

13. The processor according to claim 12, characterized in that The DMA is used to obtain the second data from an external storage unit through an external bus.

14. The processor according to claim 10, characterized in that The processor further includes a second interconnection bus and a first storage unit, wherein the second interconnection bus interconnects a master interface connected to the second functional unit and a slave interface of the first storage unit, The second functional unit is used to send a second read request to the second interconnect bus through a main interface connected to the second functional unit; the second read request is used to request to read third data from the first storage unit; the third data includes original data; The second interconnect bus is used to send the second read request to the slave interface of the first storage unit; The second functional unit is used for reading the third data in response to the second read request; The second functional unit is further configured to perform data processing according to the first data and the third data.

15. The processor according to claim 14, characterized in that The processor further comprises a slave interface to master interface conversion unit STMU, the STMU comprising a multiplexer; the master interface connected to the second functional unit is located on the STMU; The STMU is used for inputting the third data into the multiplexer in response to the second read request; The second functional unit is used to send a third read request to the STMU through the operand loading unit through the main interface, and the third read request is used to read the third data; The multiplexer is used to return the third data to the operand load unit in response to the third read request.

16. The processor according to claim 14, characterized in that The processor further includes a second storage unit; the second interconnection bus interconnects a master interface on the second functional unit and a slave interface on the second storage unit; The second functional unit is used to send a third write request to the second interconnection bus through the main interface on the second functional unit, and the third write request is used to request to write fourth data to the second storage unit; the fourth data includes a final result obtained by the FU performing data processing; The second interconnect bus is used to send the third write request to the slave interface of the second storage unit; The second storage unit is used to write the fourth data in response to the third write request.

17. The processor according to claim 16, characterized in that The processor further includes a DMA; the second interconnect bus interconnects a master interface of the DMA and a slave interface of the second storage unit; The DMA is used to send a third read request to the second interconnect bus through the master interface of the DMA, and the third read request is used to request to read the fourth data from the second storage unit; The second interconnect bus is used to send the third read request to the slave interface of the second storage unit; The DMA is configured to read the fourth data from the second storage unit in response to the third read request.

18. The processor according to any one of claims 10 to 17, characterized in that: The first functional unit includes an integer arithmetic logic unit IALU, a floating point arithmetic logic unit FALU or a multiplication and accumulation unit MAC, and the second functional unit includes an IALU, a FALU or a MAC.

19. An electronic device, characterized in that: Comprising a processor as claimed in any one of claims 10 to 18.

Citation Information

Patent Citations

  • Elliptic curve cipher processor

    CN102156836A

  • Processor, data reading and writing method and device and storage medium

    CN115061972A

  • Digital signal processor having distributed register file

    US6510510B1