Data processing method and apparatus, and chip, device, medium and program product

By generating and executing a vector instruction queue in the AI ​​processor after the scalar instruction is executed, the decoupling of vector processing and scalar processing is achieved, which solves the design and verification complexity issues caused by high parallelism and improves processor performance.

WO2024222216A1PCT designated stage expired Publication Date: 2024-10-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/080205
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-27
Filing Date
2024-03-06
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Existing AI processors have increased design and verification complexity due to high parallelism, put pressure on chip layout and routing, and lack a high-performance vector processing architecture.

Method used

By generating a vector instruction queue after the execution of the scalar instructions in the instruction package is completed, and using the vector processing unit to execute the vector instructions, the vector processing and scalar processing are decoupled, and the overall design and verification complexity of the AI ​​processor is reduced.

Benefits of technology

It achieves the decoupling of vector processing and scalar processing, simplifies the design and verification process of AI processors, reduces the pressure on chip layout and wiring, and improves processor performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024080205_31102024_PF_FP_ABST
    Figure CN2024080205_31102024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a data processing method and apparatus, and a chip, a device, a medium and a program product, which can realize the decoupling of vector processing from scalar processing, thereby reducing the overall design and verification complexity of an artificial intelligence (AI) processor. In view of this, provided in one aspect of the present application is a data processing method. The method comprises: after the execution of a scalar instruction in an instruction packet is completed, generating a vector instruction queue according to a plurality of vector instructions in the instruction packet; performing instruction decoding on a first instruction in the vector instruction queue, so as to obtain a control signal set and an instruction code for the first instruction; broadcasting the control signal set to a vector processing unit, and performing detection on the first instruction according to the instruction code, so as to obtain a detection result; when the detection result indicates that the transmission of the first instruction is allowed, transmitting the first instruction to the vector processing unit; and using the vector processing unit to execute the first instruction according to the control signal set. The technical solution provided in the present application can be applied to the fields of computers, cloud technology, AI, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing method, device, chip, equipment, medium and program product

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 27, 2023, with application number 2023104815763 and application name “A Data Processing Method, Device and Chip”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present invention relates to the field of computers, and in particular to data processing. Background Art

[0003] Vector processors can process multiple data paths in parallel within a single clock cycle, achieving a high degree of parallelism. They are a crucial component of artificial intelligence (AI) processors. Currently, AI processors typically utilize single instruction multi-data (SIMD) technology, which controls the execution of multiple data paths with a single instruction. This technology is widely used in image processing, neural network reasoning, and training.

[0004] To match the high computing power in AI computing scenarios, AI processors have a high degree of parallelism. However, excessive parallelism can cause more problems and put greater pressure on the layout and routing during chip implementation.

[0005] Therefore, there is an urgent need to design an AI processor with a high-performance vector processing architecture.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a data processing method, device, and chip that can decouple vector processing and scalar processing, thereby reducing the complexity of the overall design and verification of the AI ​​processor.

[0008] In view of this, the present application provides, on one hand, a data processing method, comprising: after a scalar instruction in an instruction packet is executed, generating a vector instruction queue according to a plurality of vector instructions in the instruction packet;

[0009] Performing instruction decoding on a first instruction in the vector instruction queue to obtain a control signal set and an instruction code for the first instruction, where the control signal set and the instruction code are used to indicate execution information of the first instruction, the first instruction being a vector instruction in the vector instruction queue;

[0010] broadcasting the control signal set to the vector processing unit, and detecting the first instruction according to the instruction code to obtain a detection result;

[0011] When the detection result indicates that the first instruction is allowed to be issued, issuing the first instruction to the vector processing unit;

[0012] The vector processing unit is utilized to execute the first instruction according to the control signal set.

[0013] On the other hand, the present application provides a data processing device, comprising: a vector instruction queue unit, a decoding unit, a broadcast unit, a detection unit, a transmitting unit, and a vector processing unit;

[0014] A vector instruction queue unit, configured to generate a vector instruction queue according to multiple vector instructions in the instruction packet after the scalar instruction in the instruction packet is executed;

[0015] a decoding unit, configured to perform instruction decoding on a first instruction in the vector instruction queue generated by the vector instruction queue unit to obtain a control signal set and an instruction code of the first instruction, transmit the control signal set to the broadcast unit, and transmit the instruction code to the detection unit, wherein the control signal set and the instruction code are used to indicate execution information of the first instruction;

[0016] a broadcasting unit, configured to broadcast the control signal set to the vector processing unit;

[0017] a detection unit, configured to detect the first instruction according to the instruction code to obtain a detection result;

[0018] a transmitting unit, configured to transmit the first instruction to the vector processing unit when the detecting unit determines that the detection result indicates that the first instruction is allowed to be transmitted;

[0019] The vector processing unit is configured to execute the first instruction according to the control signal set.

[0020] Another aspect of the present application provides a computer device, comprising: a memory, a processor, and a bus system;

[0021] Wherein, the memory is used to store programs;

[0022] The processor is used to execute the program in the memory, and the processor is used to perform the above-mentioned methods according to the instructions in the program code;

[0023] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.

[0024] Another aspect of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the above-mentioned methods.

[0025] Another aspect of the present application provides a computer program product, which includes a computer program. When the computer program product is run on a computer, the computer device executes the methods provided in the above aspects.

[0026] Another aspect of the present application provides a chip having the function of performing the above-mentioned data processing and including the data processing device described above.

[0027] It can be seen from the above technical solution that the embodiments of the present application have the following advantages: after the execution of the scalar instruction is completed, the vector instruction is generated into a vector instruction queue, and the vector instruction queue is executed, so that the execution result of the vector instruction can be written back as long as the execution is completed during the execution process, thereby realizing the decoupling of vector processing and scalar processing, thereby reducing the overall design and verification complexity of the AI ​​processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] FIG1 is a schematic diagram of an architecture of a communication system according to an embodiment of the present application;

[0029] FIG2 is a schematic diagram of an embodiment of a data processing method in an embodiment of the present application;

[0030] FIG3 is a schematic diagram of the architecture of a vector processor according to an embodiment of the present application;

[0031] FIG4a is a schematic diagram of a flow chart of state detection of a vector register in an embodiment of the present application;

[0032] FIG4 b is a schematic diagram of a process of performing state detection on a Boolean register according to an embodiment of the present application;

[0033] FIG5 is a schematic diagram of a timing diagram of dependency relationships between instructions in an embodiment of the present application;

[0034] FIG6 is a schematic diagram of data flow for data processing by a vector processor according to an embodiment of the present application;

[0035] FIG7 is a schematic diagram of an embodiment of a data processing device according to an embodiment of the present application;

[0036] FIG8 is a schematic diagram of another embodiment of a data processing device according to an embodiment of the present application;

[0037] FIG9 is a schematic diagram of another embodiment of a data processing device according to an embodiment of the present application;

[0038] FIG10 is a schematic diagram of another embodiment of a data processing device according to an embodiment of the present application;

[0039] FIG11 is a schematic diagram of another embodiment of a data processing device according to an embodiment of the present application;

[0040] FIG12 is a schematic diagram of another embodiment of a data processing device according to an embodiment of the present application;

[0041] FIG13 is a schematic diagram of another embodiment of a data processing device in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The embodiments of the present application provide a data processing method, device, and chip that can decouple vector processing and scalar processing, thereby reducing the complexity of the overall design and verification of the AI ​​processor.

[0043] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "corresponding to" 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0044] Vector processors can process multiple data streams in parallel within a single clock cycle, achieving high levels of parallelism and making them a crucial component of AI processors. Currently, AI processors typically utilize SIMD technology and are widely used in image processing, neural network inference, and training. To match the high computing power of AI computing scenarios, AI processors typically have a high degree of parallelism. However, excessive parallelism can lead to numerous problems and place significant pressure on chip layout and routing. Therefore, there is an urgent need to design an AI processor with a high-performance vector processing architecture.

[0045] In order to solve this technical problem, the present application provides the following technical solution: after the execution of the scalar instructions in the instruction packet is completed, a vector instruction queue is generated according to the multiple vector instructions in the instruction packet; the first instruction in the vector instruction queue is decoded to obtain a control signal set and instruction code of the first instruction, and the control signal set and the instruction code are used to indicate the execution information of the first instruction; the control signal set is broadcast to the vector processing unit, and the first instruction is detected according to the instruction code to obtain a detection result; when the detection result indicates that the first instruction is allowed to be transmitted, the first instruction is transmitted to the vector processing unit; and the vector processing unit is used to execute the first instruction according to the control signal set. In this way, after the execution of the scalar instruction is completed, a vector instruction queue is generated for the vector instruction, and the vector instruction queue is executed, so that the execution result of the vector instruction can be written back as long as the execution is completed during the execution process, thereby decoupling vector processing and scalar processing, thereby reducing the overall design and verification complexity of the AI ​​processor.

[0046] This application relates to technologies related to artificial intelligence. AI refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, artificial intelligence is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, enabling them to have the capabilities of perception, reasoning, and decision-making.

[0047] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0048] This application involves machine learning in artificial intelligence. Among them, machine learning (ML) is a multi-disciplinary interdisciplinary subject that involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning generally include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by formula.

[0049] The machine learning involved in this application may refer to that the instructions in this application may be instructions for executing model tasks, and the model may be obtained through machine learning.

[0050] A data processing method, device and chip provided in the embodiment of the present application can realize the decoupling of vector processing and scalar processing, thereby reducing the complexity of the overall design and verification of the AI ​​processor. Referring to Figure 1, Figure 1 is an optional architectural diagram of an application scenario of the data processing method provided in the embodiment of the present application, the terminal device 100 is connected to the server 300 through the network 200, the server 300 is connected to the database 400, and the network 200 can be a wide area network or a local area network, or a combination of the two. The client for implementing the data processing solution can be deployed on the terminal device 100, wherein the client can be run on the terminal device 100 in the form of a browser, or can be run on the terminal device 100 in the form of an independent application (application, APP), etc. The specific presentation form of the client is not limited here. The server 300 involved in this application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device 100 can be a smart phone, tablet computer, laptop computer, PDA, personal computer, smart TV, smart watch, car device, wearable device, etc., but is not limited to this. The terminal device 100 and the server 300 can be directly or indirectly connected through the network 200 via wired or wireless communication, and this application does not limit this. The number of servers 300 and terminal devices 100 is also not limited. The solution provided in this application can be completed independently by the terminal device 100, or by the server 300, or by the terminal device 100 and the server 300 in cooperation, and this application does not make specific limitations on this. Database 400 can be thought of as a digital filing cabinet—a place where electronic files are stored, allowing users to add, query, update, and delete data within the files. A "database" is a collection of data that is stored in a specific manner, can be shared with multiple users, has minimal redundancy, and is independent of application programs. A database management system (DBMS) is a computer software system designed for database management, generally providing basic functions such as storage, retrieval, security, and backup.Database management systems can be classified according to the database models they support, such as relational and Extensible Markup Language (XML); or according to the types of computers they support, such as server clusters and mobile phones; or according to the query language used, such as Structured Query Language (SQL) and XQuery; or according to performance impulse focus, such as maximum scale and maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, supporting multiple query languages ​​at the same time. In the present application, the database 400 can be used to store vector data. Of course, the storage location of the vector data is not limited to the database. For example, it can also be stored in the terminal device 100, the blockchain, or the distributed file system of the server 300.

[0051] Since this application involves some professional terms, these professional terms will be introduced below.

[0052] Registers (RF): These are small storage areas within the Central Processing Unit (CPU) used to store data. They are typically used to temporarily store data involved in calculations, calculation results, and other information required for CPU operation. Registers typically include the following:

[0053] General registers: These are the most commonly used and basic registers for program execution code. During program execution, most of the time is spent operating these registers to implement instruction functions.

[0054] Flag register: It includes many flag bits, which are used to record a series of states during the CPU's instruction execution process. Most of these flags are automatically set and modified by the CPU.

[0055] Instruction register: It is the most important register in the CPU. It points to the address where the next instruction to be executed is stored. The job of the CPU is actually to continuously fetch the instruction it points to and then execute this instruction. At the same time, the instruction register continues to point to the next instruction. This is repeated continuously, which is the basic daily work of the CPU.

[0056] Segment register: The content stored in it is closely related to the memory addressing mode currently in use by the CPU. When the CPU is in 16-bit real address mode, the segment register stores the base address of the segment. When addressing, the segment register content is shifted left by 4 bits (multiplied by 16) to obtain the segment base address plus the offset within the segment to obtain the final address. When the CPU is operating in protected mode, the content stored in the segment register is no longer the segment base address. Instead, the segment register stores the segment selector, which indicates which segment the segment register is currently "pointing to."

[0057] The above-mentioned general registers, segment registers, flag registers, and instruction registers together constitute a basic instruction execution environment. The context of a thread is basically these registers. When executing thread switching, their contents are modified.

[0058] Single instruction multiple-data (SIMD) is a technology that uses a single controller to control multiple processors, simultaneously executing the same operation on each element of a set of data (also called a "data vector"), thereby achieving spatial parallelism. This typically utilizes data-level parallelism (not concurrency). That is, at any given moment, there is only one instruction, but multiple computations are occurring simultaneously, also known as parallel computing. SIMD is particularly well-suited for common tasks, such as adjusting the contrast of a digital image or adjusting the volume of digital audio.

[0059] Very long instruction word (VLIW): A common architecture for AI processors, characterized by issuing one instruction packet at a time. The instruction packet contains multiple instructions that can be executed in parallel. The instruction packet includes vector instructions and scalar instructions, with scalar instructions containing flow instructions to control the execution flow of the instruction packet. The main idea behind VLIW, which can actually include both vector instructions and header instructions in the instruction packet, is to encapsulate multiple independent instructions into a single very long instruction word. The CPU has a corresponding number of arithmetic and logic units (ALUs) to complete the corresponding instruction operations. The compiler handles the dependencies and scheduling between instructions. Because multiple parallel operations are encapsulated in a single instruction, the instruction length is longer than that of reduced instruction set computers (RISC) or complex instruction set computers (CISC), hence the name very long instruction set.

[0060] It is understandable that in the specific implementation of this application, related data such as instruction data is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0061] In combination with the above introduction, the data processing method in this application is introduced below with the server as the execution subject. Please refer to Figure 2. An embodiment of the data processing method in the embodiment of this application includes:

[0062] 201. After the scalar instruction in the instruction packet is executed, generate a vector instruction queue according to the multiple vector instructions in the instruction packet.

[0063] In this embodiment, during the instruction preparation phase, a very long instruction word (VLIW) is used to generate an instruction packet containing the scalar instruction and the vector instruction. This instruction packet is then transmitted. The scalar instruction in the instruction packet is then executed. After the scalar instruction is executed and committed (i.e., committed), the vector instruction in the instruction packet is pushed into the vector instruction queue. Optionally, the vector instruction queue can be executed on a first-in, first-out basis.

[0064] In an exemplary solution, illustrated using the architecture shown in Figure 3, during the instruction preparation phase, a very long instruction word (VLIW) is used to generate an instruction packet containing the scalar instruction and the vector instruction, which is then transmitted. The RISC executes the scalar instruction in the instruction packet. After the scalar instruction is executed and committed (i.e., committed), the RISC pushes the vector instruction in the instruction packet into the vector instruction queue (VIQ). The vector instruction queue decouples the vector instruction from the scalar instruction, thereby reducing the complexity of overall processor design and verification.

[0065] 202. Perform instruction decoding on a first instruction in the vector instruction queue to obtain a control signal set and an instruction code of the first instruction, where the control signal set and the instruction code are used to indicate execution information of the first instruction.

[0066] The server calls the instructions in the vector instruction queue according to the first-in-first-out principle. The vector quality of any call can be used as the first instruction. The first instruction called is then decoded to obtain the instruction type of the first instruction; and then a control signal set and corresponding instruction code of the first instruction are generated according to the instruction type.

[0067] The control signal set includes but is not limited to the source register number, destination register code, data path mode control signal, and data path selection signal of the first instruction.

[0068] The instruction code includes but is not limited to information such as the instruction name of the first instruction, the register entry (i.e., entry) for the first instruction to read data from the register, and the register entry (i.e., entry) for the first instruction to write data into the register.

[0069] In an exemplary embodiment, using the architecture shown in Figure 3 as an example, an instruction is called from the VIQ and sent to the decoder (i.e., DEC). The DEC decodes the instruction and, based on the instruction type, obtains the corresponding control signal set and instruction encoding. Assuming the first instruction is "instr1," the instruction encoding may be as follows: "instr1: ABS out.r0, in.r3." This instruction encoding indicates that the instruction name of instr1 is ABS, that the input data of instr1 will be read from register entry 0, and that the output data of instr1 will be written to register entry 3.

[0070] 203. Broadcast the control signal set to the vector processing unit, and detect the first instruction according to the instruction code to obtain a detection result.

[0071] In this embodiment, the control signal set is broadcast after being beat, so that the control signal set can be sent to the vector processing unit; at the same time, a dependency check is performed on the first instruction according to the instruction code to obtain the check result.

[0072] In an exemplary solution, when the vector processing unit includes N vector processing slices, a specific manner of broadcasting the control signal set after beating may be as follows:

[0073] The control signal set is copied to obtain N identical control signal sets; the N identical control signal sets are then broadcast to N vector processing slices, where N is a positive integer greater than 1, and each vector processing slice corresponds to one control signal set. In this embodiment, because the N vector processing slices have the same structure, each vector processing slice can perform different data calculations of the first instruction, thereby increasing the efficiency of the vector processing unit in executing the instruction.

[0074] In an exemplary solution, performing dependency detection on the first instruction according to the instruction code to obtain the detection result may be performed in the following manner:

[0075] A source register number and a destination register number of the first instruction are obtained according to the instruction code, and a register type to be used by the first instruction is determined according to the source register number and the destination register number (for example, at least one of a vector register and a Boolean register is determined to be used by the first instruction according to the source register number), and a hardware resource to be used by the first instruction is determined according to the instruction code; then a resource status table is obtained; then first status information of the register corresponding to the source register number is queried from the resource status table, second status information of the register corresponding to the destination register number is queried from the resource status table, and third status information of the hardware resource to be used by the first instruction is queried from the resource status table, wherein the first status information, the second status information, and the third status information are used to indicate the busy or idle status of the register or the hardware resource; finally, the detection result is determined according to the above-mentioned first status information, second status information, and third status information.

[0076] In this embodiment, each instruction may use only vector registers and hardware resources, or may use only Boolean registers and hardware resources, or may use vector registers, Boolean registers, and hardware resources at the same time. Therefore, the resource status table includes the following three tables:

[0077] vrf_bt: vector register file busy table, vector register status table, used to indicate the busy or idle status of each register of the current vector register.

[0078] brf_bt: boolean register file busy table, Boolean register status table, used to indicate the busy or idle status of each register in the current Boolean register file.

[0079] hw_bt: hardware busy table, used to indicate the busy or idle status of hardware resources reused in the vector execution unit.

[0080] When performing dependency detection based on the above three tables, the following methods can be used:

[0081] 1. Determine the status information of the vector register to be used by the first instruction according to the vector register status table.

[0082] That is, when the register type to be used by the instruction is determined to be a vector register according to the source register number and destination register number corresponding to the instruction, the busy / idle status of the vector register to be used is queried through the vector register status table to obtain the status information corresponding to the vector register to be used.

[0083] As shown in Figure 4a, the number of entries in vrf_bt corresponds to the number of registers in vrf. Four entries are used as an example. Each entry in vrf_bt stores a counter, indicating the number of clock cycles before the vrf register corresponding to the current entry becomes idle. Initially, the counters of all entries are 0, indicating that they are all idle. At this time, instr1 is issued. This instruction is an ABS instruction, and the output is the r0 register. It requires two clock cycles to calculate. When the ABS instruction is issued, entry0 of vrf_bt is set to 2, and then the value of entry0 is reduced by 1 every clock cycle. One clock cycle after instr1 is issued, instr2 enters the issue unit. The source register of instr2 is r0. By querying the vrf_bt table, it can be seen that the current entry0 counter is not 0. It is necessary to wait for the counter of entry0 to become 0 before issuing isntr2.

[0084] 2. Determine the status information of the Boolean register to be used by the first instruction according to the Boolean register status table.

[0085] That is, when the register type to be used by the instruction is determined to be a Boolean register according to the source register number and destination register number corresponding to the instruction, the busy and idle status of the Boolean register to be used is queried through the Boolean register status table to obtain the status information corresponding to the Boolean register to be used.

[0086] As shown in Figure 4b, the number of entries in brf_bt corresponds to the number of registers in brf. Four entries are used as an example. Each entry in brf_bt stores a counter, which indicates how many clock cycles the brf register corresponding to the current entry will be idle. Initially, the counters of all entries are 0, indicating that they are all idle. At this time, instr1 is issued. This instruction is an ABS instruction, and the output is the r0 register. It requires two clock cycles to calculate. When the ABS instruction is issued, entry0 of vrf_bt is set to 2, and then the value of entry0 is reduced by 1 every clock cycle. One clock cycle after instr1 is issued, instr2 enters the issue unit. The source register of instr2 is r0. By querying the brf_bt table, it can be seen that the current entry0 counter is not 0. It is necessary to wait for the entry0 counter to become 0 before issuing isntr2.

[0087] 3. Determine the status information of the hardware resources to be used by the first instruction according to the hardware resource status table.

[0088] That is, the hardware resource to be used for the instruction is determined according to the instruction code corresponding to the instruction, and the busy / idle status of the hardware resource to be used is queried through the hardware resource status table, thereby obtaining the status information corresponding to the hardware resource to be used.

[0089] In the vector execution unit, instr1 and instr2 reuse the multiplier resources. If instr1 is still using the multiplier, instr2 needs to wait until instr1 finishes using the multiplier resources before issuing instr2.

[0090] After passing the above dependency detection, the dependency timing diagram can be determined for each instruction based on the detection results. For the scenario shown in Figure 4a, the dependency timing diagram of instr1 and instr2 can be shown in Figure 5. instr1 corresponds to the first row in Figure 5, and instr2 corresponds to the second row in Figure 5. Taking the first row as an example, RF (register file) is the register data reading stage of instr1, while EX (Execute) 1 and EX2 are the instruction execution stages of instr1, and WB (write back) is the instruction calculation result write back stage. However, instr2 needs to insert two bubbles when it is launched, as shown in the second row. Instr2, it cannot be launched until the calculation result of instr1 is written back to the register.

[0091] It's understandable that the bubble can be interpreted as the wait time for instr2 to be issued. During the instruction execution phase, this wait time can be calculated in clock cycles. For example, in the scenario shown in Figure 5, if instr2 is entered into the issue preparation unit at the start of instr1 execution, instr2 will need to be inserted two clock cycles. If instr1's execution phase only takes one clock cycle, instr2 only needs to be inserted one clock cycle.

[0092] When multiple registers and hardware resources exist, the one with the longest clock cycle can be used as the instruction issuance wait interval. For example, if the hardware resources determine that instr2 requires a 2-clock cycle wait, the vector register status information determines that instr2 requires a 3-clock cycle wait, and the Boolean register status information determines that instr2 requires a 2-clock cycle wait, then the wait interval for instr2 can be set to 3 clock cycles.

[0093] After obtaining the above status information, the detection result is determined based on the above status information. The details are as follows:

[0094] When the first status information indicates that the register corresponding to the source register number is in an idle state, the second status information indicates that the register corresponding to the destination register number is in an idle state, and the third status information indicates that the hardware resource is in an idle state, determining that the detection result is that the first instruction is allowed to be issued;

[0095] When at least one of the following conditions is met: the first status information indicates that the register corresponding to the source register number is in an occupied state; the second status information indicates that the register corresponding to the destination register number is in an occupied state; and the third status information indicates that the hardware resource is in an occupied state, it is determined that the detection result is that the first instruction is not allowed to be issued.

[0096] In an exemplary solution, using the architecture shown in FIG3 as an example, the DEC unit sends the instruction code (opcode) of the instruction to the detection (hazard detect) unit for inter-instruction dependency checking. The specific checking process can be seen in the above process and is not limited here. At the same time, the DEC unit updates each control signal in the control signal set (i.e., as shown in FIG3, through a first-level register, such as hw_bt), and then sends it to the broadcast unit for broadcasting. That is, the control signal set is copied N times, and then one control signal set is broadcast to a vector processing slice (i.e., slice).

[0097] After the control signal set is broadcast to the vector processing slice, it can also be written to the register corresponding to the vector processing slice for beat processing. This control signal set is input into "ctrl_regs" as shown in Figure 3 for beat processing. This allows each vector processing slice to read the control signal from the local register, thereby ensuring good timing and making each vector processing slice independent of each other, solving the problem of instruction congestion during data processing.

[0098] 204. When the detection result indicates that the first instruction is allowed to be issued, issue the first instruction to the vector processing unit.

[0099] When the detection result indicates that the first instruction is allowed to be issued, the first instruction is issued to the vector processing unit.

[0100] In this embodiment, after determining that the detection result indicates that the first instruction is allowed to be emitted, the aforementioned resource status table can also be updated. This can ensure that the resource status table is updated in a timely manner, so that the detection result of the dependency detection of the instruction achieved through the busy and idle status of each register is more accurate. In this way, the instruction emission can be achieved in an orderly manner, thereby effectively reducing the fan-out problem, which is beneficial to layout and wiring.

[0101] 205. Utilize the vector processing unit to execute the first instruction according to the control signal set.

[0102] The vector processing unit includes N vector processing slices, each of which has an identical structure. Each slice is used to process one channel of data in the vector calculation indicated by the first instruction. For example, if the first instruction indicates performing a pixel-plus-1 calculation operation for 100,000 pixels in an image, and the number of vector processing slices is 10, then each round of calculation will calculate 10 pixels. Thus, only 10,000 calculations are required to process all 100,000 pixels.

[0103] Each slice includes two groups of registers: VRF and BRF, which have their own read and write ports. In an exemplary solution, as shown in Figure 3, the read and write ports of the VRF and BRF can adopt a three-read and three-write interface design. The three read ports are used for op0 and op1 and vector store operations, respectively, and the three write ports are used for write back of operation instructions and two vector load operations. At the same time, each slice includes multiple execution paths set according to the number of pipeline stages, and then these multiple execution paths constitute the execution path set. Then, each execution path in the execution path set can write back the calculation results.

[0104] In one exemplary solution, using the architecture shown in Figure 3, the slice is divided into four distinct execution paths based on the pipeline level of the vector instruction. alu_1pip processes instructions requiring only one pipeline level, alu_2pip processes instructions requiring two pipeline levels, alu_3pip processes instructions requiring three pipeline levels, and alu_iter processes instructions requiring iteration. The computational data generated by these four execution paths is written back to the VRF via a wb_mux.

[0105] Based on the slice described above, the execution process of the first instruction can be described in detail below:

[0106] First, the pipeline stage number of the first instruction is obtained according to the instruction type of the first instruction; then, a corresponding target execution path is matched from the execution path set according to the pipeline stage number, the data path mode control signal, and the data path selection signal; then, to-be-processed data is read from the register corresponding to the source register number, and the to-be-processed data is sent to the target execution path; then, the target execution path operates on the to-be-processed data to obtain a calculation result of the first instruction; and then, the calculation result is written back to the register corresponding to the destination register number. In an exemplary scheme, assuming that the instruction code obtained after decoding the first instruction is "instr1: ABS out.r0, in.r3", and the control set number set includes "read r3 in register, write r0 in register, select alu_1pip, and enable alu_1pip", it can be determined that the instruction type of the first instruction is an ABS instruction, and at the same time, based on the instruction type, the instruction level of the ABS instruction is judged to be 1 level; at the same time, the data path mode control signal is used to instruct the vector processing slice to select the alu_1pip path shown in Figure 3, and the data path selection signal is used to enable the alu_1pip path shown in Figure 3; then the vector processing slice reads the data to be processed corresponding to r3 in the register, and calculates the data to be processed through the operation logic unit of the alu_1pip path to obtain a calculation result; finally, the calculation result is written into r0 of the register through the wb_mux of the alu_1pip path.

[0107] Due to the pipeline level of the first instruction, it is possible to intuitively identify that the first instruction is divided into several execution stages, so that the data path mode control signal and the data path selection signal can be combined to accurately select the target execution path suitable for the first instruction from the execution path set, thereby improving the execution efficiency of the first instruction.

[0108] In this embodiment, a vector data memory for storing vector data may also be included. In this case, the data to be processed and the calculation result may be stored in the storage unit. Therefore, when executing the first instruction, the register corresponding to the source register number may first read the number to be processed from the vector data memory through a load instruction and write it into the register corresponding to the source register number; and when the execution of the first instruction is completed, the register corresponding to the target register number may write the calculation result into the vector data memory through a store instruction.

[0109] The following uses the architecture shown in Figure 6 to illustrate the data flow of vector registers and Boolean registers:

[0110] In this embodiment, data in the VRF and BRF are loaded and written using load / store instructions. The load instruction supports dual-issue, that is, two load instructions are executed simultaneously, while the store instruction can only be issued single-issue. This is because most vector instructions are two-input and one-output types, such as vector addition instructions.

[0111] VMEM is a vector memory used to store vector data. Load instructions read vector data from VMEM through the vector load queue (VLQ) and write it to the VRF or BRF. Store instructions read computation results from the VRF or BRF, pass through the vector store queue (VSQ), and write them to VMEM.

[0112] 1. Vector registers

[0113] When it is determined that the first instruction is an operation instruction that requires processing three stages of pipeline, the alu_3pip execution path shown in Figure 6 is selected; then, through the vector load instruction, the data to be processed is read from VMEM, passed through VLQ0 / 1, and written to VRF; then, by executing the first instruction (also called a vector execution instruction), the data to be processed is read, and the calculation result is obtained through the logical calculation of the alu_3pip, and the calculation result is written back to the VRF; finally, through the vector store instruction, the calculation result is read from the VRF and written back to VMEM through VSQ.

[0114] 2. Boolean registers

[0115] When it is determined that Boolean data needs to be processed in the first instruction, the secondary execution path of the Boolean register shown in Figure 6 is selected; then, through a vector load instruction, the data to be processed is read from VMEM, passed through VLQ0 / 1, and written into the BRF; then, by executing the first instruction (also called a vector execution instruction), the data to be processed is read, and the calculation result is obtained through the secondary execution path of the Boolean register, and the calculation result is written back to the BRF; finally, through a vector store instruction, the calculation result is read from the BRF and written back to VMEM through VSQ.

[0116] The data processing device in the present application is described in detail below. Please refer to FIG7 , which is a schematic diagram of an embodiment of the data processing device in the present application. The data processing device 20 includes: a vector instruction queue unit 201, a decoding unit 202, a broadcast unit 203, a detection unit 204, a transmitting unit 205, and a vector processing unit 206.

[0117] A vector instruction queue unit 201 is configured to generate a vector instruction queue according to multiple vector instructions in an instruction packet after the scalar instruction in the instruction packet is executed;

[0118] a decoding unit 202 configured to decode a first instruction in the vector instruction queue generated by the vector instruction queue unit 201 to obtain a control signal set and an instruction code for the first instruction, transmit the control signal to the broadcast unit 203, and transmit the instruction code to the detection unit 204. The control signal set and the instruction code are used to indicate execution information of the first instruction;

[0119] a broadcast unit 203 , configured to broadcast the control signal set to the vector processing unit 206 ;

[0120] A detection unit 204 is configured to detect the first instruction according to the instruction code to obtain a detection result;

[0121] The transmitting unit 205 is configured to transmit the first instruction to the vector processing unit 206 when the detecting unit 204 determines that the detection result indicates that the first instruction is allowed to be transmitted;

[0122] The vector processing unit 206 is configured to execute the first instruction according to the control signal set.

[0123] In an embodiment of the present application, a data processing device is provided. Using the above device, after a scalar instruction is executed, a vector instruction is generated for the vector instruction into a vector instruction queue, and the vector instruction queue is executed, so that the execution result of the vector instruction can be written back as soon as the execution is completed, thereby decoupling vector processing from scalar processing and reducing the overall design and verification complexity of the AI ​​processor.

[0124] Optionally, based on the embodiment corresponding to FIG. 7 , in another embodiment of the data processing device 20 provided in the embodiment of the present application,

[0125] The broadcast unit 203 is configured to replicate the control signal set to generate N copies of the control signal set;

[0126] The N control signal sets are broadcasted to the N vector processing slices 2061 of the vector processing unit 206 in a one-to-one correspondence, where N is a positive integer greater than 1, and the N vector processing slices 2061 have the same structure.

[0127] In an embodiment of the present application, a data processing device is provided. Using the above device, a vector processing unit is divided into multiple slices, each slice having the same structure, which can improve the efficiency of vector processing.

[0128] Optionally, based on the embodiment corresponding to FIG. 7 , as shown in FIG. 8 , in another embodiment of the data processing device 20 provided by an embodiment of the present application, each of the N vector processing slices 2061 corresponds to a register, and the vector processing slice 2061 is used to write the control signal set into the register.

[0129] In an embodiment of the present application, a data processing device is provided. Using the above device, the control signal of each slice comes from its local register. This improves the timing when the slice executes instructions, and makes the control signals between the slices independent, thereby solving the congestion problem during instruction execution.

[0130] Optionally, based on the embodiment corresponding to FIG8 , in another embodiment of the data processing device 20 provided in the embodiment of the present application,

[0131] The N vector processing slices 2061 are configured to execute the first instruction according to the control signal set.

[0132] In an embodiment of the present application, a data processing device is provided. Using this device, a vector processing unit is divided into multiple slices, each with an identical structure, thereby improving vector processing efficiency. Furthermore, the control signals for each slice are derived from its local register, ensuring better timing when executing instructions. Control signals between slices are also independent, thus alleviating congestion during instruction execution.

[0133] Optionally, based on the embodiment corresponding to FIG8 , in another embodiment of the data processing device 20 provided in the embodiment of the present application,

[0134] The control signal set includes a source register number, a destination register number, a datapath mode control signal, and a datapath selection signal of the first instruction, and the vector processing slice 2061 is used to obtain a pipeline stage number of the first instruction;

[0135] Selecting a target execution path from an execution path set according to the pipeline stage number, the datapath mode control signal, and the datapath selection signal, the execution path set including a plurality of execution paths, the execution path being an instruction execution path set according to the pipeline stage number of the instruction in the vector processing slice;

[0136] The first instruction is executed using the target execution path, the source register number, and the destination register number.

[0137] In an embodiment of the present application, a data processing device is provided. Using the device, different instruction execution paths are set in each slice according to the number of pipeline stages. The corresponding execution path for the instruction is then selected based on the number of pipeline stages. The different execution paths are all written back to registers, thus achieving out-of-order writeback between different instructions, reducing power consumption while improving processing performance.

[0138] Optionally, based on the embodiment corresponding to FIG. 8 , in another embodiment of the data processing device 20 provided by the embodiment of the present application, the vector processing slice 2061 is configured to read the data to be processed of the first instruction according to the source register number;

[0139] Calculating using the target execution path and the data to be processed to obtain a calculation result of the first instruction;

[0140] The calculation result of the first instruction is written according to the target register code.

[0141] In an embodiment of the present application, a data processing device is provided. Using the device, different instruction execution paths are set in each slice according to the number of pipeline stages. The corresponding execution path for the instruction is then selected based on the number of pipeline stages. The different execution paths are all written back to registers, thus achieving out-of-order writeback between different instructions, reducing power consumption while improving processing performance.

[0142] Optionally, based on the embodiment corresponding to FIG. 8 , as shown in FIG. 9 , in another embodiment of the data processing device 20 provided by an embodiment of the present application, the data processing device 20 further includes a vector data memory 207, which is used to store the data to be processed and the calculation result; the vector processing slice 2061 is further used to read the data to be processed from the vector data memory 207 through a load instruction and write it into the register corresponding to the source register number;

[0143] The calculation result is read from the register corresponding to the target register number through a store instruction and written into the vector data memory 207 .

[0144] In an embodiment of the present application, a data processing device is provided. Using the device, a dedicated memory is used to store the calculation results of vector instructions, thereby improving the storage time and storage security of the calculation results.

[0145] Optionally, based on the embodiment corresponding to FIG. 7 , FIG. 8 or FIG. 9 , in another embodiment of the data processing device 20 provided in the embodiment of the present application,

[0146] The detection unit 204 is specifically configured to obtain a resource status table and obtain a source register number and a destination register number of the first instruction according to the instruction code;

[0147] querying the first status information of the register corresponding to the source register number from the resource status table, querying the second status information of the register corresponding to the destination register number from the resource status table, and querying the third status information of the hardware resource to be used by the first instruction from the resource status table;

[0148] The detection result is determined according to the first state information, the second state information, and the third state information.

[0149] In an embodiment of the present application, a data processing device is provided. Using the above device, dependency detection is performed on the vector instruction before the vector instruction is sent to the slice, which can effectively reduce fan-out problems and facilitate layout and routing.

[0150] Optionally, based on the embodiment corresponding to FIG. 7 , FIG. 8 or FIG. 9 , in another embodiment of the data processing device 20 provided in the embodiment of the present application,

[0151] The detection unit 204 is specifically configured to query a vector register status table for first status information of a register corresponding to the source register number, and query the vector register status table for second status information of a register corresponding to the destination register number, wherein the vector register status table is included in the resource status table;

[0152] or;

[0153] querying first state information of the register corresponding to the source register number from a Boolean register state table, and querying second state information of the register corresponding to the destination register number from the Boolean register state table, the Boolean register state table being included in the resource state table;

[0154] or;

[0155] querying first information of the register corresponding to the source register number from the vector register status table, and querying second information of the register corresponding to the destination register number from the vector register status table;

[0156] querying the third information of the register corresponding to the source register number from the Boolean register status table, and querying the fourth information of the register corresponding to the destination register number from the Boolean register status table;

[0157] The first information and the third information serve as the first status information, the second information and the fourth information serve as the second status information, and the vector register status table and the Boolean register status table are included in the resource status table.

[0158] In an embodiment of the present application, a data processing device is provided. Using the above device, dependency detection of the instruction is implemented by checking the busy / idle status of each register, thereby enabling orderly instruction issuance, effectively reducing fan-out issues, and facilitating layout and routing.

[0159] Optionally, based on the embodiment corresponding to FIG. 7 , FIG. 8 or FIG. 9 , in another embodiment of the data processing device 20 provided in the embodiment of the present application,

[0160] The detection unit 204 is specifically configured to determine that the detection result is to allow the first instruction to be issued when the first status information indicates that the register corresponding to the source register number is in an idle state, the second status information indicates that the register corresponding to the destination register number is in an idle state, and the third status information indicates that the hardware resource is in an idle state;

[0161] When at least one of the first status information indicates that the register corresponding to the source register number is in an occupied state, the second status information indicates that the register corresponding to the destination register number is in an occupied state, and the third status information indicates that the hardware resource is in an occupied state, it is determined that the detection result is that the first instruction is not allowed to be issued.

[0162] In an embodiment of the present application, a data processing device is provided. Using the above device, dependency detection of the instruction is implemented by checking the busy / idle status of each register, thereby enabling orderly instruction issuance, effectively reducing fan-out issues, and facilitating layout and routing.

[0163] Optionally, based on the embodiments corresponding to Figures 7, 8 or 9 above, in another embodiment of the data processing device 20 provided in an embodiment of the present application, the detection unit 204 is further used to determine the waiting time interval for transmitting the first instruction based on the first state information, the second state information and the third state information when the detection result indicates that the first instruction is not allowed to be transmitted.

[0164] In an embodiment of the present application, a data processing device is provided. Using the above device, dependency detection of the instruction is implemented by checking the busy / idle status of each register, thereby enabling orderly instruction issuance, effectively reducing fan-out issues, and facilitating layout and routing.

[0165] Optionally, based on the embodiments corresponding to Figures 7, 8 or 9 above, as shown in Figure 10, in another embodiment of the data processing device 20 provided in an embodiment of the present application, the data processing device 20 also includes an update unit 208, which is used to update the resource status table after the detection unit 204 determines that the detection result indicates that the first instruction is allowed to be transmitted.

[0166] In an embodiment of the present application, a data processing device is provided. Using the device, a resource status table is updated in a timely manner, so that the dependency detection results of the instruction, which are implemented by the busy / idle status of each register, are more accurate. This allows for orderly instruction transmission, effectively reduces fan-out issues, and facilitates layout and routing.

[0167] The data processing device is described below using an exemplary architecture shown in FIG11 :

[0168] As shown in Figure 11, the VIQ is equivalent to the vector instruction queue unit 201 shown in Figures 7 to 10, the DEC is equivalent to the decoding unit 202 shown in Figures 7 to 9, the broadcast is equivalent to the broadcast unit 203 in Figures 7 to 10, the hazard detect is equivalent to the detection unit 204 in Figures 7 to 9, the issue is equivalent to 205 in Figures 7 to 10, the slice0 to sliceN are equivalent to N vector processing slices 2061, at this time, the slice0 to sliceN constitute the vector processing unit 206, the VMEM is equivalent to the vector data memory 207 shown in Figure 9, and the update is equivalent to the update unit 208 shown in Figure 10.

[0169] Based on the architecture shown in FIG11 , the execution process of the vector instructions in this application is described below:

[0170] After executing the scalar instruction in the instruction packet through RISC and submitting the scalar instruction, the data processing device 20 writes the vector instruction into the VIQ, and then generates the vector instruction queue through the VIQ, wherein the vector instruction queue is executed in the VIQ according to the first-in-first-out principle.

[0171] During the execution of the vector instruction, the vectors in the VIQ are sequentially transmitted to the DEC. The DEC performs a decoding operation on each input vector instruction to obtain a control signal set and an instruction code corresponding to the vector instruction. The control signal set and the instruction code can both be used to indicate the execution information corresponding to the vector instruction, such as the data reading source, the calculation result writing location, the instruction type of the vector instruction, the data path selection signal and the data path selection signal of the vector instruction in the vector processing unit, etc. After obtaining the above-mentioned control signal set and the instruction code, the DEC transmits the control signal set to the broadcast and transmits the instruction code to the hazard detect. When transmitting the control signal set to the broadcast, the DEC can also beat the control signal set through a first-level register and then transmit it to the broadcast. Similarly, when transmitting the instruction code to the hazard detect, the DEC can also beat the instruction code through a first-level register and then transmit it to the hazard detect.

[0172] The broadcast copies the control signal set and sends it to slices 0 through N. Each vector processing slice corresponds to a control signal set. Each vector processing slice also corresponds to a register, ctrl_regs, which stores the control signal set.

[0173] The hazard detect method performs dependency checking on the vector instruction based on the instruction encoding, specifically, determining whether the registers and hardware resources to be used by the vector instruction are idle. If both the registers and the hardware resources are idle, the vector instruction is determined to be transmittable. Specifically, the specific process of performing dependency checking on the vector instruction based on the instruction encoding by the hazard detect method can be as described in step 203 above and will not be further described here.

[0174] When the hazard detect determines that the vector instruction can be issued, the issue sends the vector instruction to slice0 to sliceN; and at the same time, the update updates the resource status table.

[0175] The specific structure of the vector processing slice can be shown in Figure 11. Each slice includes two groups of registers: VRF and BRF, which have their own read and write ports. In an exemplary solution, as shown in Figure 11, the read and write ports of the VRF and BRF can adopt a three-read and three-write interface design. The three read ports are used for op0 and op1 and vector store operations, respectively, and the three write ports are used for writeback of operation instructions and two vector load operations. At the same time, each slice includes multiple execution paths set according to the number of pipeline stages. These multiple execution paths then constitute the execution path set, and each execution path in the execution path set can write back the calculation results. In an exemplary solution, taking the architecture shown in Figure 11 as an example, the slice is divided into four different execution paths according to the number of pipeline stages of the instruction. Among them, alu_1pip is used to process operation instructions that only require one level of pipeline, alu_2pip is used to process operation instructions that require two levels of pipeline, alu_3pip is used to process operation instructions that require three levels of pipeline, and alu_iter is used to process operation instructions that require iteration. At the same time, the computational data obtained by the four execution paths are all written back to the VRF via a wb_mux. In an exemplary solution, when the vector processing slice executes the vector instruction, it can be as described in step 205 above, and the details are not repeated here.

[0176] The VMEM is used to store vector data. During the execution of a vector instruction, the VMEM can be used to store the data to be processed by the vector instruction and the calculation result of the vector instruction. The specific execution process can be as described in step 205 above, and will not be repeated here.

[0177] The data processing device provided by the present application can be used in a server. Please refer to Figure 12. Figure 12 is a schematic diagram of a server structure provided by an embodiment of the present application. The server 300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 322 (for example, one or more processors) and memory 332, and one or more storage media 330 (for example, one or more mass storage devices) for storing application programs 342 or data 344. Among them, the memory 332 and the storage medium 330 can be temporary storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 322 can be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the server 300.

[0178] The server 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and / or one or more operating systems 341, such as Windows Server 2003 or Windows Server 2003R. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0179] The steps executed by the data processing device in the above embodiment can be based on the server structure shown in FIG12 .

[0180] The data processing device provided in this application can be used in a terminal device. Please refer to Figure 13. For the sake of convenience, only the part related to the embodiment of this application is shown. For specific technical details not disclosed, please refer to the method part of the embodiment of this application. In the embodiment of this application, the terminal device is a smartphone as an example for explanation:

[0181] FIG13 is a block diagram showing a partial structure of a smartphone related to a terminal device provided in an embodiment of the present application. Referring to FIG13 , the smartphone includes components such as a radio frequency (RF) circuit 410, a memory 420, an input unit 430, a display unit 440, a sensor 450, an audio circuit 460, a wireless fidelity (WiFi) module 470, a processor 480, and a power supply 490. It will be understood by those skilled in the art that the smartphone structure shown in FIG13 does not constitute a limitation on the smartphone, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0182] The following is a detailed introduction to the various components of a smartphone with reference to FIG13:

[0183] The RF circuit 410 can be used to receive and send signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 480 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 410 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 410 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.

[0184] The memory 420 can be used to store software programs and modules. The processor 480 executes the various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 420. The memory 420 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created based on the use of the smartphone (such as audio data, a phone book, etc.). In addition, the memory 420 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0185] The input unit 430 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 430 may include a touch panel 431 and other input devices 432. The touch panel 431, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 431) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 431 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 480, and can receive commands sent by the processor 480 and execute them. In addition, the touch panel 431 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 431, the input unit 430 may further include other input devices 432. Specifically, the other input devices 432 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, and a joystick.

[0186] The display unit 440 can be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 440 may include a display panel 441. Optionally, the display panel 441 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 431 may cover the display panel 441. When the touch panel 431 detects a touch operation on or near it, it is transmitted to the processor 480 to determine the type of touch event. Subsequently, the processor 480 provides a corresponding visual output on the display panel 441 according to the type of touch event. Although in Figure 13, the touch panel 431 and the display panel 441 are used as two independent components to implement the input and output functions of the smartphone, in some embodiments, the touch panel 431 and the display panel 441 can be integrated to implement the input and output functions of the smartphone.

[0187] The smartphone may also include at least one sensor 450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 441 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 441 and / or the backlight when the smartphone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the smartphone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the smartphone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.

[0188] The audio circuit 460 , the speaker 461 , and the microphone 462 may provide an audio interface between the user and the smartphone.

[0189] The processor 480 is the control center of the smartphone. It uses various interfaces and lines to connect various parts of the entire smartphone. By running or executing software programs and / or modules stored in the memory 420 and calling data stored in the memory 420, it executes various functions of the smartphone and processes data, thereby controlling the smartphone as a whole.

[0190] The smartphone also includes a power supply 490 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 480 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0191] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0192] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the methods described in the aforementioned embodiments.

[0193] An embodiment of the present application also provides a computer program product including a program, which, when executed on a computer, enables the computer to execute the methods described in the aforementioned embodiments.

[0194] An embodiment of the present application also provides a chip having the function of executing the data processing shown in FIG. 2 and including the data processing device shown in FIG. 7 to FIG. 11 .

[0195] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0196] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods, such as multiple units 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 an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0197] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0198] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0199] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0200] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method, the method being executed by a server, the method comprising: After the scalar instruction in the instruction packet is executed, generating a vector instruction queue according to the plurality of vector instructions in the instruction packet; Performing instruction decoding on a first instruction in the vector instruction queue to obtain a control signal set and an instruction code of the first instruction, wherein the control signal set and the instruction code are used to indicate execution information of the first instruction, and the first instruction is a vector instruction in the vector instruction queue; broadcasting the control signal set to a vector processing unit, and detecting the first instruction according to the instruction code to obtain a detection result; When the detection result indicates that the first instruction is allowed to be issued, issuing the first instruction to the vector processing unit; The first instruction is executed using the vector processing unit according to the set of control signals.

2. The method according to claim 1, wherein broadcasting the set of control signals to a vector processing unit comprises: Copying the control signal set to generate N control signal sets; The N control signal sets are broadcasted to the N vector processing slices of the vector processing unit in a one-to-one correspondence, wherein N is a positive integer greater than 1, and the N vector processing slices have the same structure.

3. The method according to claim 2, wherein the control signal set includes a source register number, a destination register number, a datapath mode control signal, and a datapath selection signal of the first instruction, and the using the vector processing unit to execute the first instruction according to the control signal set comprises: Obtaining the pipeline stage number of the first instruction; Selecting a target execution path from an execution path set according to the pipeline stage number, the data path mode control signal and the data path selection signal, the execution path set including a plurality of execution paths, the execution path being an instruction execution path set according to the pipeline stage number of the vector instruction in the vector processing slice; The first instruction is executed using the target execution path, the source register number, and the destination register number.

4. The method according to claim 3, wherein executing the first instruction using the target execution path, the source register number and the destination register number comprises: Read the to-be-processed data of the first instruction according to the source register number; Calculating the data to be processed using the target execution path to obtain a calculation result of the first instruction; The calculation result of the first instruction is written according to the target register encoding.

5. According to the method of any one of claims 1 to 4, the detecting the first instruction according to the instruction code to obtain a detection result comprises: Acquire a resource status table, and acquire a source register number and a destination register number of the first instruction according to the instruction code; query the first status information of the register corresponding to the source register number from the resource status table, query the second status information of the register corresponding to the destination register number from the resource status table, and query the third status information of the hardware resource to be used by the first instruction from the resource status table; The detection result is determined according to the first state information, the second state information and the third state information.

6. The method according to claim 5, wherein determining the detection result according to the first state information, the second state information and the third state information comprises: When the first state information indicates that the register corresponding to the source register number is in an idle state, the second state information indicates that the register corresponding to the destination register number is in an idle state, and the hardware resource indicated by the third state information is in an idle state, determining that the detection result is to allow the first instruction to be issued; When at least one of the first status information indicates that the register corresponding to the source register number is in an occupied state, the second status information indicates that the register corresponding to the destination register number is in an occupied state, and the third status information indicates that the hardware resource is in an occupied state, it is determined that the detection result is that the first instruction is not allowed to be issued.

7. The method according to claim 6, further comprising: When the detection result indicates that the first instruction is not allowed to be transmitted, a waiting time interval for transmitting the first instruction is determined according to the first state information, the second state information and the third state information.

8. A data processing device, comprising: A vector instruction queue unit, a decoding unit, a broadcast unit, a detection unit, a transmission unit, and a vector processing unit; A vector instruction queue unit, configured to write a plurality of vector instructions in the instruction packet to generate a vector instruction queue after the scalar instruction in the instruction packet is executed; a decoding unit, configured to decode a first instruction in the vector instruction queue generated by the vector instruction queue unit to obtain a control signal set and an instruction code of the first instruction, and transmit the control signal set to the broadcast unit, and transmit the instruction code to the detection unit, wherein the control signal set and the instruction code are used to indicate execution information of the first instruction, and the first instruction is a vector instruction in the vector instruction queue; A broadcast unit, configured to broadcast the control signal set to a vector processing unit; A detection unit, configured to detect the first instruction according to the instruction code to obtain a detection result; a transmitting unit, configured to transmit the first instruction to the vector processing unit when the detecting unit determines that the detecting result indicates that the first instruction is allowed to be transmitted; The vector processing unit is configured to execute the first instruction according to the control signal set.

9. The apparatus according to claim 8, wherein the broadcast unit is configured to copy the control signal set to generate N sets of control signal sets; The N control signal sets are broadcasted to the N vector processing slices of the vector processing unit in a one-to-one correspondence, wherein: The N is a positive integer greater than 1, and the N vector processing slices have the same structure.

10. The apparatus according to claim 9, wherein each of the N vector processing slices corresponds to a register, and the N vector processing slices are used to write the control signal set broadcast by the broadcast unit into the register. 11 . The apparatus according to claim 10 , wherein the N vector processing slices are configured to execute the first instruction according to the control signal set.

12. The apparatus according to claim 11, wherein the control signal set comprises a source register number, a destination register number, a data path mode control signal and a data path selection signal of the first instruction, and the N vector processing slices are further used to obtain a pipeline stage number of the first instruction; From the execution path according to the number of pipeline stages, the data path mode control signal and the data path selection signal Selecting a target execution path from a set, wherein the execution path set includes a plurality of execution paths, and the execution path is an instruction execution path set according to the pipeline stage of the vector instruction in the vector processing slice; The first instruction is executed using the target execution path, the source register number, and the destination register number.

13. The apparatus according to claim 12, wherein the N vector processing slices are further configured to read the to-be-processed data of the first instruction according to the source register number; Calculating the data to be processed using the target execution path to obtain a calculation result of the first instruction; The calculation result of the first instruction is written according to the target register encoding.

14. The device according to claim 13, further comprising a vector data memory, wherein the vector data memory is used to store the data to be processed and the calculation result; The N vector processing slices are used to read the to-be-processed data from the vector data memory through a load instruction and write the data into a register corresponding to the source register number; The calculation result is read from the register corresponding to the target register number through a storage instruction, and is written into the vector data memory.

15. The device according to any one of claims 8 to 14, wherein the detection unit is used to obtain a resource status table, and obtain a source register number and a destination register number of the first instruction according to the instruction code; query the first status information of the register corresponding to the source register number from the resource status table, query the second status information of the register corresponding to the destination register number from the resource status table, and query the third status information of the hardware resource to be used by the first instruction from the resource status table; The detection result is determined according to the first state information, the second state information and the third state information.

16. The device according to claim 15, wherein the detection unit is used to query the first state information of the register corresponding to the source register number according to a vector register state table, and query the second state information of the register corresponding to the destination register number from the vector register state table, wherein the vector register state table is included in the resource state table; or; The detection unit is used to query the first state information of the register corresponding to the source register number according to a Boolean register state table, and query the second state information of the register corresponding to the destination register number from the Boolean register state table, wherein the Boolean register state table is included in the resource state table; or; The detection unit is used to query the first information of the register corresponding to the source register number according to the vector register status table, and query the second information of the register corresponding to the destination register number from the vector register status table; The detection unit is further used to query the third information of the register corresponding to the source register number according to the Boolean register status table, and query the fourth information of the register corresponding to the destination register number from the Boolean register status table; The first information and the third information are used as the first state information, the second information and the fourth information are used as the second state information, and the vector register state table and the Boolean register state table are included in the resource state table.

17. The apparatus according to claim 15, wherein the detection unit is configured to determine that the detection result is to allow the first instruction to be issued when the first status information indicates that the register corresponding to the source register number is in an idle state, the second status information indicates that the register corresponding to the destination register number is in an idle state, and the hardware resource indicated by the third status information is in an idle state; When at least one of the first status information indicates that the register corresponding to the source register number is in an occupied state, the second status information indicates that the register corresponding to the destination register number is in an occupied state, and the third status information indicates that the hardware resource is in an occupied state, it is determined that the detection result is that the first instruction is not allowed to be issued.

18. The device according to claim 17, wherein the detection unit is further configured to determine a waiting time interval for transmitting the first instruction according to the first state information, the second state information and the third state information when the detection result indicates that the first instruction is not allowed to be transmitted.

19. The apparatus according to claim 15, further comprising an updating unit, configured to update the resource status table after the detecting unit determines that the detecting result indicates that the first instruction is allowed to be issued.

20. A chip comprising the data processing device according to any one of claims 8 to 19.

21. A server, comprising: Processor, communication interface, memory and communication bus; Wherein, the processor, the communication interface and the memory communicate with each other through the communication bus; the communication interface is an interface of a communication module; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to call the computer program in the memory to execute the method according to any one of claims 1 to 7.

22. A storage medium, wherein the storage medium is used to store a computer program, wherein the computer program is used to execute the method according to any one of claims 1 to 7.

23. A computer program product comprising a computer program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Processing unit, computing device and instruction processing method

    CN114924793A

  • Access control method of scalar processing unit and scalar processing unit

    CN115129480A

  • Realization method and architecture of RISC-V vector processing unit

    CN115774575A

  • Thread-based organization of slice target register file entry in a microprocessor

    US20210072993A1