Processor supporting implicit sharing of scalar and vector operation units and application method thereof

By designing an implicitly shared scalar and vector operation unit architecture in the processor, vector instructions automatically call the scalar operation unit, which solves the problems of low resource utilization and complex code modification of traditional processors, and improves processor performance and resource utilization. Rate.

CN118585248APending Publication Date: 2024-09-03NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410849529.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

When traditional processors execute SIMD instructions, the scalar arithmetic unit cannot be effectively utilized, resulting in low resource utilization, and the explicit sharing mechanism requires code modification, which increases complexity and instruction overhead.

Method used

Design a processor architecture that supports implicit sharing of scalar and vector operation units. By establishing a data path between the scalar core and the vector core, and using the arbitration module and status control register, the function of the vector instruction calling the scalar operation unit is automatically realized, completely Completed by hardware and transparent to developers and compilers.

Benefits of technology

It improves the resource utilization and performance of the processor, reduces the difficulty of development, avoids code modification and instruction overhead, and improves the parallel computing capability of vector instructions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585248A
    Figure CN118585248A
Patent Text Reader

Abstract

The invention discloses a processor supporting implicit sharing of scalar and vector operation units and an application method of the processor. The processor comprises a processor body with a scalar core and a vector core. The scalar operation units are distributed in an execution platform of the scalar core, the vector operation units are distributed in an execution platform of the vector core, and the vector core is mounted on the scalar core in a coprocessor mode. And a group of data paths for realizing sharing of the scalar operation unit and the vector operation unit are arranged between the scalar core and the vector core so as to perform data interaction through a bus or a Cache. The invention aims to design a special processor architecture, so that the vector instruction can call the scalar operation unit to increase the parallel computing capability of the vector instruction, the execution of other scalar instructions is not influenced, the process of calling the scalar operation unit by the vector instruction is completely and automatically completed by hardware, program codes do not need to be modified, the process is completely transparent to developers and compilers, and the implementation is convenient. And the development difficulty of developers is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of microprocessor design, and in particular relates to a processor supporting implicit sharing of scalar and vector operation units and an application method thereof. Background Art

[0002] Single instruction-set extensions (SIMD) instruction set extensions are widely used in modern processor architectures, aiming to improve processor performance by developing data-level parallelism. Traditional processor designs often support the SIMD instruction set by integrating vector arithmetic units (such as vector channels or vector coprocessors). The scalar and vector arithmetic units are independent of each other and are scheduled and used by different types of instructions. However, this architecture has certain shortcomings. When accelerating the execution of some compute-intensive applications through the SIMD instruction set, often only the vector arithmetic units are used, and the scalar arithmetic units cannot be effectively utilized, resulting in insufficient processor resource utilization and difficulty in fully utilizing the actual performance of the processor. By issuing scalar computing instructions, the scalar arithmetic unit of the processor can be called, but this method requires code modification, which brings huge challenges to developers. For Figure 1 The C code shown in A in Figure 1 When executing the code segment named saxpy, the RISC-V "V" instruction set shown in B needs to add scalar instructions consistent with the vector instruction functions in the loop in order to call the scalar operation unit to enhance the parallel computing capability of SIMD operations, such as Figure 1 As shown in C in the figure, this method is visible to developers and is an explicit sharing mechanism. The explicit sharing mechanism has the following shortcomings: (1) It requires modifying the software code, which places higher requirements on developers and compilers and significantly increases the complexity of the code; (2) It requires occupying scalar registers, which makes register management and allocation more complicated and also affects the normal behavior of scalar instructions, destroying the execution scene of scalar instructions; (3) For some vector instruction sets of indefinite length, such as ARM SVE and RVV, vector instructions may be implemented in an iterative manner. Each vector instruction needs to be combined with multiple scalar instructions to fully utilize the scalar operation unit, which will significantly increase the instruction overhead. Summary of the invention

[0003] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a processor supporting implicit sharing of scalar and vector operation units and an application method thereof are provided. The present invention aims to design a special processor architecture so that vector instructions can call scalar operation units to increase their parallel computing capabilities without affecting the execution of other scalar instructions. The process of vector instructions calling scalar operation units is completely completed automatically by hardware, without modifying the program code, and is completely transparent to developers and compilers, thereby reducing the development difficulty for developers.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: A processor supporting implicit sharing of scalar and vector operation units includes a processor body with a scalar core and a vector core, and scalar operation units independently distributed in an execution station of the scalar core and vector operation units independently distributed in an execution station of the vector core. The vector core is mounted on the scalar core in the form of a coprocessor, and a group of data paths for realizing sharing of the scalar operation unit and the vector operation unit are included between the scalar core and the vector core to perform data exchange through a bus or a cache.

[0005] Optionally, the scalar core includes an instruction fetch station, a decoding station, a transmitting station, an execution station and a write-back scalar register connected in sequence, the execution station of the scalar core includes a memory access channel, and an integer channel, a multiplication channel, a division channel and a floating-point channel respectively located in a scalar operation unit, the vector core includes a vector decoding station, a transmitting station, an execution station and a write-back vector register connected in sequence, the input end of the vector decoding station is connected to the transmitting station of the scalar core, the execution station of the vector core includes a shared channel and a plurality of vector channels located in the vector operation unit The difference between the shared channel and the vector channel is that there is no real operation unit inside and it is used to package the operation request and forward it to the scalar core. The input ends of the integer channel, multiplication channel, division channel and floating-point channel in the scalar operation unit are all connected to an arbitration module, one input of the arbitration module comes from the transmitting station of the scalar core, and the other input comes from the output end of the shared channel of the vector core. The output ends of the integer channel, multiplication channel, division channel and floating-point channel in the scalar operation unit are also connected to the input end of the shared channel to transmit the calculation result back to the vector core.

[0006] Optionally, the arbitration module is used to arbitrate the computing requests sent by the vector core and the computing requests generated by the scalar core itself in a polling arbitration manner to ensure that the requests of the two cores can be responded to.

[0007] Optionally, the processor body further includes a state control register CSR, and the state control register CSR is used to configure an enable state for implementing implicit sharing between the scalar operation unit and the vector operation unit.

[0008] In addition, the present invention also provides an application method of the processor supporting implicit sharing of scalar and vector operation units, comprising the following steps: S101, enabling implicit sharing mode by configuring the value of a status control register CSR to be a first specified value; S102, the processor obtains the vector length of this operation; S103, determining whether the vector length of the current operation is less than the length of the single instruction multiple data stream SIMD, if so, configuring the value of the state control register CSR to be the second specified value to close the sharing mode of implicit sharing, and ending and exiting; otherwise, jumping to step S104; S104, calculate the number of non-shared iterations and shared iteration count ; S105, compare non-shared iteration counts and shared iteration count , if the number of iterations is not shared and shared iteration count If the two conditions are the same, the shared mode of implicit sharing is turned off by configuring the value of the state control register CSR to be the second specified value, and the process ends and exits; otherwise, the process jumps to step S106; S106, the configuration of the sharing mode for enabling implicit sharing is completed, and the sharing mode for implicit sharing is entered.

[0009] Optionally, the number of non-shared iterations in step S104 is The calculation function expression is: , In the above formula, is the bit width of the register, is the SIMD width of the vector channel in the vector operation unit, Express Round up.

[0010] Optionally, the number of shared iterations in step S104 The calculation function expression is: , In the above formula, is the bit width of the register, is the SIMD width of the vector channel in the vector operation unit, After the shared mode is turned on, the width of the SIMD stream of the vector channel in the vector operation unit needs to increase the number of scalar channels. Express Round up.

[0011] Optionally, entering the implicit sharing mode in step S106 includes: S201, using a round-robin arbitration method to compete for the right to use the scalar operation unit for vector shared computing requests and scalar computing requests that need to be sent to the scalar operation unit, wherein the vector shared computing request refers to a request from the vector operation unit; S202, the scalar operation unit processes the received vector sharing calculation request and scalar calculation request based on the state machine, wherein the state machine includes an idle state, a scalar instruction occupied state, and a vector instruction occupied state, and the conversion relationship between the three states is as follows: Idle state: As long as a scalar calculation request of a scalar instruction is received, it will switch to the scalar instruction occupied state; if a vector shared calculation request is received and there is no scalar calculation request at this time, it will switch to the vector instruction occupied state; otherwise, it will continue to remain in the idle state; Scalar instruction occupied state: if the calculation of the current scalar calculation request has been completed and there is no subsequent new calculation request, it will jump to the idle state; if a vector shared calculation request of a vector instruction is received, it will unconditionally switch to the vector instruction occupied state; if a scalar calculation request of a scalar instruction is received and there is no vector instruction calculation request at this time, it will continue to maintain the scalar instruction occupied state; Vector instruction occupied state: If the calculation of the current vector shared calculation request has been completed and there is no subsequent new calculation request, it jumps to the idle state; if a scalar calculation request of a scalar instruction is received, it unconditionally switches to the scalar instruction occupied state; if a vector shared calculation request of a vector instruction is received and there is no scalar instruction calculation request at this time, the vector instruction occupied state continues to be maintained.

[0012] Optionally, after entering the implicit sharing sharing mode in step S106, it also includes selecting the output data of the shared channel and the N vector channels totaling N+1 channels when the shared channel and the N vector channels in the execution station of the vector core perform a data packet write back operation of the calculation results to the write back vector register, and it is necessary to splice the two adjacent write back data to form a data packet write back containing the calculation results of the N channels, and the data processing is cyclic with N+1 clock cycles.

[0013] Optionally, after the sharing mode of implicit sharing is turned off by configuring the value of the status control register CSR to a second specified value in step S103, the process also includes writing back the data packets of the calculation results of the N vector channels in the execution station of the vector core to the write-back vector register when the data packets of the calculation results are written back, and the data processing is cyclically performed with N clock cycles.

[0014] Compared with the prior art, the present invention mainly has the following advantages: computationally intensive applications (such as matrix multiplication, convolution, etc.) usually require a large amount of parallel computing, and vector instructions supporting SIMD operations can effectively accelerate the execution of such applications. In actual computationally intensive application codes, only vector computing instructions are usually used, and the scalar operation unit is always idle during the execution of the application, resulting in a certain performance loss. Inserting scalar computing instructions can improve the resource utilization of the processor, but it is necessary to modify the program code, which will not only increase the complexity of the code, but also destroy the execution state of other scalar instructions. Therefore, the present invention proposes a processor architecture that supports implicit sharing of scalar and vector operation units, and vector instructions can call scalar operation units to increase parallel computing capabilities and achieve processor performance improvement. Compared with explicit sharing, implicit sharing is completely automatically implemented by hardware, which is completely transparent to developers and compilers, does not require code modification, and does not increase instruction overhead. In some cases, when the sharing mode does not increase performance, the processor architecture proposed in this embodiment will automatically turn off the sharing mode to reduce power consumption. Implicit sharing only requires a small amount of modification to the processor architecture, has low design complexity, and has low hardware overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 Schematic diagram of explicit sharing of traditional scalar and vector operation units.

[0016] Figure 2 Schematic diagram of the processor structure in an embodiment of the present invention.

[0017] Figure 3 It is a schematic diagram of the configuration of the sharing mode of implicit sharing in an embodiment of the present invention.

[0018] Figure 4 Schematic diagram of state transition of a scalar core computing unit in an embodiment of the present invention.

[0019] Figure 5 This is a vector core memory access interface data processing method in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] like Figure 2As shown, ARM SVE and RISC-V "V" instruction sets can support variable-length vector calculations, that is, from the perspective of developers and compilers, the vector calculation length is unknown and is only determined when the processor is actually executed. If the vector instruction calls the scalar operation unit to increase the parallel computing capability, then the vector calculation length will also increase accordingly, and this type of variable-length instruction set provides a basis for sharing vector and scalar operation units. The present invention supports the architecture of the processor for implicit sharing of scalar and vector operation units, and the hardware automatically calls the scalar operation unit to increase the computing power of the vector instruction according to the actual computing requirements of the application, without the need for manual intervention by the developer. As shown in FIG. Figure 1 As shown, the processor supporting implicit sharing of scalar and vector operation units in this embodiment includes a processor body with a scalar core and a vector core, and a scalar operation unit independently distributed in the execution station of the scalar core and a vector operation unit distributed in the execution station of the vector core. The processor architecture designed in this embodiment includes independent scalar operation units and vector operation units, which are used to execute vector instructions and scalar instructions respectively. The scalar operation unit and the vector operation unit are respectively distributed inside the scalar core and the vector core, and the vector core is mounted on the scalar core in the form of a coprocessor, and data can be exchanged between the two through a bus or a cache system.

[0021] In this embodiment, the vector core is mounted on the scalar core in the form of a coprocessor, and a group of data paths for realizing the sharing of the scalar operation unit and the vector operation unit are included between the scalar core and the vector core to perform data exchange through a bus or a cache.

[0022] like Figure 2 As shown, the scalar core in this embodiment includes an instruction fetch station, a decoding station, a transmitting station, an execution station, and a write-back scalar register connected in sequence, the execution station of the scalar core includes a memory access channel, and an integer channel, a multiplication channel, a division channel, and a floating-point channel respectively located in a scalar operation unit, the vector core includes a vector decoding station, a transmitting station, an execution station, and a write-back vector register connected in sequence, the input end of the vector decoding station is connected to the transmitting station of the scalar core, the execution station of the vector core includes a shared channel and a plurality of vectors located in the vector operation unit Channel, the difference between the shared channel and the vector channel is that there is no real operation unit inside and it is used to package the operation request and forward it to the scalar core. The input ends of the integer channel, multiplication channel, division channel and floating-point channel in the scalar operation unit are all connected to an arbitration module, one input of the arbitration module comes from the transmitting station of the scalar core, and the other input comes from the output end of the shared channel of the vector core. The output ends of the integer channel, multiplication channel, division channel and floating-point channel in the scalar operation unit are also connected to the input end of the shared channel to transmit the calculation results back to the vector core.

[0023] In this embodiment, the arbitration module is used to arbitrate the computing requests sent by the vector core and the computing requests generated by the scalar core itself in a polling arbitration manner to ensure that the requests of the two cores can be responded to.

[0024] The processor architecture that supports implicit sharing of scalar and vector arithmetic units in this embodiment can improve the resource utilization of the processor and enhance the actual performance of the processor. To this end, this embodiment adds a new sharing mode based on the traditional processor architecture. When configured in sharing mode, vector instructions can use the scalar arithmetic unit. In non-working mode, the functions are exactly the same as those of traditional processors. In this embodiment, the processor body also includes a control and status register CSR (Control and Status Register), which is used to configure the enable state of implicit sharing between the scalar arithmetic unit and the vector arithmetic unit.

[0025] Compared with the traditional main processor coupled coprocessor architecture, the shared architecture proposed in this embodiment needs to add a set of data paths between the two cores to realize the sharing of scalar and vector operation units. At the same time, it is also necessary to make a small adjustment to the data flow inside the scalar core and the vector core. The specific modifications are as follows. Scalar core: Add a data channel to the execution station (containing the scalar operation unit) for data interaction with the vector core. For the operation unit, only one calculation request source is added. The calculation request sent by the vector core and the calculation request generated by the scalar core itself are arbitrated. The polling arbitration method is adopted to ensure that the requests of both cores can be responded. The calculation request of the vector core only occupies the execution station, and the other parts of the scalar core do not need to be modified. Vector core: According to the number of calculation channels in the scalar core, the corresponding shared channel is added. The data flow of the shared channel is exactly the same as that of other vector channels. The difference is that there is no real operation unit inside the shared vector channel. The operation request needs to be packaged and forwarded to the scalar core. After the scalar core completes the calculation, the calculation result is returned. From the perspective of the vector core, there is no difference between the shared channel and the ordinary vector channel. However, since there is no computing unit inside the shared vector, its hardware overhead is much smaller than that of the ordinary vector channel.

[0026] like Figure 3 As shown, this embodiment provides an application method of a processor supporting implicit sharing of scalar and vector operation units, comprising the following steps: S101, enabling implicit sharing mode by configuring the value of the state control register CSR to be a first specified value; wherein the first specified value can be specified as required, for example, "1" in this embodiment; S102, the processor obtains the vector length of this operation; S103, determining whether the vector length of the current operation is less than the length of the single instruction multiple data stream SIMD, if so, configuring the value of the state control register CSR to be the second specified value to close the sharing mode of implicit sharing, and ending and exiting; otherwise, jumping to step S104; S104, calculate the number of non-shared iterations and shared iteration count ; S105, compare non-shared iteration counts and shared iteration count , if the number of iterations is not shared and shared iteration count If the two conditions are the same, the shared mode of implicit sharing is turned off by configuring the value of the state control register CSR to be the second specified value, and the process ends and exits; otherwise, the process jumps to step S106; S106, the configuration of the sharing mode for enabling implicit sharing is completed, and the sharing mode for implicit sharing is entered.

[0027] In this embodiment, the number of non-shared iterations in step S104 is The calculation function expression is: , In the above formula, is the bit width of the register, is the SIMD width of the vector channel in the vector operation unit, Express Round up.

[0028] In this embodiment, the number of shared iterations in step S104 is The calculation function expression is: , In the above formula, is the bit width of the register, is the SIMD width of the vector channel in the vector operation unit, After the shared mode is turned on, the width of the SIMD stream of the vector channel in the vector operation unit needs to increase the number of scalar channels. Express Round up.

[0029] In this embodiment, entering the implicit sharing mode in step S106 includes: S201, using a round-robin arbitration method to compete for the right to use the scalar operation unit for vector shared computing requests and scalar computing requests that need to be sent to the scalar operation unit, wherein the vector shared computing request refers to a request from the vector operation unit; S202, the scalar operation unit processes the received vector sharing calculation request and scalar calculation request based on the state machine, wherein the state machine includes an idle state, a scalar instruction occupied state, and a vector instruction occupied state, and the conversion relationship between the three states is as follows: Idle state: As long as a scalar calculation request of a scalar instruction is received, it will switch to the scalar instruction occupied state; if a vector shared calculation request is received and there is no scalar calculation request at this time, it will switch to the vector instruction occupied state; otherwise, it will continue to remain in the idle state; Scalar instruction occupied state: if the calculation of the current scalar calculation request has been completed and there is no subsequent new calculation request, it will jump to the idle state; if a vector shared calculation request of a vector instruction is received, it will unconditionally switch to the vector instruction occupied state; if a scalar calculation request of a scalar instruction is received and there is no vector instruction calculation request at this time, it will continue to maintain the scalar instruction occupied state; Vector instruction occupied state: If the calculation of the current vector shared calculation request has been completed and there is no subsequent new calculation request, it jumps to the idle state; if a scalar calculation request of a scalar instruction is received, it unconditionally switches to the scalar instruction occupied state; if a vector shared calculation request of a vector instruction is received and there is no scalar instruction calculation request at this time, the vector instruction occupied state continues to be maintained.

[0030] Figure 4 The example shows how the scalar core's computing unit handles computing requests. On the basis of the original, the computing unit adds a shared computing request from the vector core. The vector shared computing request and the scalar computing request use round-robin arbitration to compete for the right to use the computing unit, ensuring that the request is not responded to for a long time, causing the computing request to "starve".

[0031] Specifically, after entering the implicitly shared sharing mode in step S106 of this embodiment, it also includes that when the shared channel and N vector channels in the execution station of the vector core perform a data packet writeback operation of the calculation result to the writeback vector register, the output data of the shared channel and the N vector channels, a total of N+1 channels, are selected, and it is necessary to splice two adjacent write-back data to form a data packet write-back containing the calculation results of the N channels, and the data processing is cycled with N+1 clock cycles. After closing the implicitly shared sharing mode by configuring the value of the state control register CSR to the second specified value in step S103 of this embodiment, it also includes that when the N vector channels in the execution station of the vector core perform a data packet write-back operation of the calculation result to the writeback vector register, the data packet of the calculation result of the N vector channels is written back, and the data processing is cycled with N clock cycles. Figure 5 The diagram shows the data adjustment method of the vector core memory access interface. After the sharing mode is turned on, the computing power of the vector is enhanced and the number of vector channels increases, so the data needs to be adjusted accordingly. Figure 5The data adjustment is illustrated in the case of 4 vector channels and 1 shared channel. In processor design, the bit width of the data bus is usually proportional to the number of computing units to meet the bandwidth requirements of the computing units. In this embodiment, after adding a shared channel, the bus bit width and the number of vector channels no longer match, so the data needs to be converted when data interaction is performed. Specifically, the calculation results of 5 channels cannot be written back at once, and only four can be written back each time, so it is necessary to select the output data of the channel, and it is necessary to splice the adjacent two write-back data to form a data packet containing the calculation results of 4 channels and write it back. For the case of 4 vector channels and 1 shared channel, data processing is circulated in 5 clock cycles. When the number of channels is more, the cycle period should also be increased accordingly. The process of writing external data into the vector channel is consistent with the process of writing the results back, which will not be repeated here.

[0032] The processor architecture designed in this embodiment supports implicit sharing of scalar and vector operation units. Only a small amount of modification is required to the traditional processor data path. The design complexity is low, and the shared calculation process is completely transparent to the developer and the compiler. The code does not need to be modified in any way, which reduces the difficulty of use for the developer. Vector instructions effectively improve the performance of the processor by developing data-level parallelism, but vector instructions cannot use the scalar calculation units in the processor, even if these scalar calculation units are in an idle state. The traditional way of calling a scalar unit requires sending scalar instructions. This method is visible to the developer and requires the developer to modify the code, which not only increases the code complexity but also increases the instruction overhead, and because the scalar register is occupied, it will also affect the execution of other scalar instructions. The processor architecture designed in this embodiment supports implicit sharing of scalar and vector operation units. The hardware can automatically share the scalar operation unit with the vector instruction. The entire calculation process is completely transparent to the developer, and this method only requires a small amount of modification to the data path of the traditional processor architecture. From the perspective of hardware, the design complexity of this embodiment is low, and the difficulty of hardware implementation is small. From the perspective of software, the shared calculation supported by this embodiment is completely transparent to the developer and the compiler, and the program code does not need to be modified in any way before it can be transplanted.

[0033] In summary, the present invention supports a processor that implicitly shares scalar and vector arithmetic units, and proposes a processor architecture that supports implicit sharing of scalar and vector arithmetic units, so that vector instructions can call scalar arithmetic units to increase their parallel computing capabilities without affecting the execution of other scalar instructions. In addition, the process of vector instructions calling scalar arithmetic units (implicitly shared execution process) is completely completed automatically by hardware, which is completely transparent to developers and compilers. Without modifying the software code, the hardware can automatically provide scalar arithmetic units to vector instructions, thereby enhancing the parallel computing capabilities of vector instructions and reducing the development difficulty of developers. The implicitly shared processor architecture proposed in the present invention only requires a small amount of modification to the data path of the general processor architecture, is easy to implement, and has low hardware overhead. The processor architecture that supports implicit sharing of scalar and vector arithmetic units in this embodiment can improve the resource utilization of the processor and enhance the actual performance of the processor.

[0034] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A processor supporting implicit sharing of scalar and vector arithmetic units, characterized in that: The invention comprises a processor body with a scalar core and a vector core, and a scalar operation unit independently distributed in an execution station of the scalar core and a vector operation unit independently distributed in an execution station of the vector core. The vector core is mounted on the scalar core in the form of a coprocessor, and a group of data paths for realizing sharing of the scalar operation unit and the vector operation unit are included between the scalar core and the vector core so as to exchange data through a bus or a cache.

2. The processor supporting implicit sharing of scalar and vector operation units according to claim 1, characterized in that: The scalar core includes an instruction fetch station, a decoding station, a transmitting station, an execution station and a write-back scalar register connected in sequence, the execution station of the scalar core includes a memory access channel, and an integer channel, a multiplication channel, a division channel and a floating-point channel respectively located in a scalar operation unit, the vector core includes a vector decoding station, a transmitting station, an execution station and a write-back vector register connected in sequence, the input end of the vector decoding station is connected to the transmitting station of the scalar core, the execution station of the vector core includes a shared channel and a plurality of vector channels located in the vector operation unit, The difference between the shared channel and the vector channel is that there is no real operation unit inside and it is used to package the operation request and forward it to the scalar core. The input ends of the integer channel, multiplication channel, division channel and floating-point channel in the scalar operation unit are all connected to an arbitration module. One input of the arbitration module comes from the transmitting station of the scalar core, and the other input comes from the output end of the shared channel of the vector core. The output ends of the integer channel, multiplication channel, division channel and floating-point channel in the scalar operation unit are also connected to the input end of the shared channel to transmit the calculation results back to the vector core.

3. The processor supporting implicit sharing of scalar and vector operation units according to claim 2, characterized in that: The arbitration module is used to arbitrate the computing requests sent by the vector core and the computing requests generated by the scalar core itself in a polling arbitration manner to ensure that the requests of the two cores can be responded to.

4. The processor supporting implicit sharing of scalar and vector operation units according to claim 3, characterized in that: The processor body also includes a state control register CSR, and the state control register CSR is used to configure an enable state for implementing implicit sharing between a scalar operation unit and a vector operation unit.

5. An application method of a processor supporting implicit sharing of scalar and vector operation units as claimed in claim 4, characterized in that: The steps include: S101, enabling implicit sharing mode by configuring the value of a status control register CSR to be a first specified value; S102, the processor obtains the vector length of this operation; S103, determining whether the vector length of the current operation is less than the length of the single instruction multiple data stream SIMD, if so, configuring the value of the state control register CSR to be the second specified value to close the sharing mode of implicit sharing, and ending and exiting; otherwise, jumping to step S104; S104, calculate the number of non-shared iterations and shared iteration count ; S105, compare non-shared iteration counts and shared iteration count , if the number of iterations is not shared and shared iteration count If the two conditions are the same, the shared mode of implicit sharing is turned off by configuring the value of the state control register CSR to be the second specified value, and the process ends and exits; otherwise, the process jumps to step S106; S106, the configuration of the sharing mode for enabling implicit sharing is completed, and the sharing mode for implicit sharing is entered.

6. The application method of the processor supporting implicit sharing of scalar and vector operation units according to claim 5, characterized in that: The number of non-shared iterations in step S104 The calculation function expression is: , In the above formula, is the bit width of the register, is the SIMD width of the vector channel in the vector operation unit, Express Round up.

7. The application method of the processor supporting implicit sharing of scalar and vector operation units according to claim 5, characterized in that: The number of shared iterations in step S104 The calculation function expression is: , In the above formula, is the bit width of the register, is the SIMD width of the vector channel in the vector operation unit, After the shared mode is turned on, the width of the SIMD stream of the vector channel in the vector operation unit needs to increase the number of scalar channels. Express Round up.

8. The application method of the processor supporting implicit sharing of scalar and vector operation units according to claim 5, characterized in that: Entering the implicit sharing mode in step S106 includes: S201, using a round-robin arbitration method to compete for the right to use the scalar operation unit for vector shared computing requests and scalar computing requests that need to be sent to the scalar operation unit, wherein the vector shared computing request refers to a request from the vector operation unit; S202, the scalar operation unit processes the received vector sharing calculation request and scalar calculation request based on the state machine, wherein the state machine includes an idle state, a scalar instruction occupied state, and a vector instruction occupied state, and the conversion relationship between the three states is as follows: Idle state: As long as a scalar calculation request of a scalar instruction is received, it will switch to the scalar instruction occupied state; if a vector shared calculation request is received and there is no scalar calculation request at this time, it will switch to the vector instruction occupied state; otherwise, it will continue to remain in the idle state; Scalar instruction occupied state: if the calculation of the current scalar calculation request has been completed and there is no subsequent new calculation request, it will jump to the idle state; if a vector shared calculation request of a vector instruction is received, it will unconditionally switch to the vector instruction occupied state; if a scalar calculation request of a scalar instruction is received and there is no vector instruction calculation request at this time, it will continue to maintain the scalar instruction occupied state; Vector instruction occupied state: If the calculation of the current vector shared calculation request has been completed and there is no subsequent new calculation request, it jumps to the idle state; if a scalar calculation request of a scalar instruction is received, it unconditionally switches to the scalar instruction occupied state; if a vector shared calculation request of a vector instruction is received and there is no scalar instruction calculation request at this time, the vector instruction occupied state continues to be maintained.

9. The application method of the processor supporting implicit sharing of scalar and vector operation units according to claim 8, characterized in that: After entering the implicit sharing sharing mode in step S106, it also includes selecting the output data of the shared channel and the N vector channels totaling N+1 channels when the shared channel and the N vector channels in the execution station of the vector core perform a data packet write back operation of the calculation results to the write-back vector register, and it is necessary to splice the two adjacent write-back data to form a data packet write-back containing the calculation results of the N channels, and the data processing is cyclic with N+1 clock cycles.

10. The application method of the processor supporting implicit sharing of scalar and vector operation units according to claim 8, characterized in that: After the implicit sharing mode is turned off by configuring the value of the status control register CSR to the second specified value in step S103, the step also includes writing back the data packets of the calculation results of the N vector channels when the N vector channels in the execution station of the vector core perform a data packet write back operation on the write-back vector register, and the data processing is cyclically performed with N clock cycles.

Citation Information

Cited By

  • Instruction processing equipment, system and processing method based on RISC-V architecture

    CN120029671A

  • Vector coprocessor and vector calculation method

    CN120255957A

  • A vector coprocessor and vector calculation method

    CN120255957B