A method for realizing fast calculation and fast synchronization under multi-core architecture

By separating the atomic computing instruction bus and data bus in the multi-core architecture, each processor has independent atomic computing entrances and exits, and the directly connected design solves the problem of low atomic computing efficiency under the multi-core architecture and achieves fast calculation and synchronization. , the delay is fixed at 8 clock cycles.

CN114579507BActive Publication Date: 2024-09-10CHENGDU BEIZHONG NETCORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210173605.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2024-09-10
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

Atomic computing under the existing multi-core architecture results in low processor efficiency, mainly due to the waste of bus bandwidth, uncertainty in delay and the bottleneck of the exit and entry of the atomic computing module.

Method used

By separating the atomic computing instruction bus and the data bus, each processor of the atomic computing module is designed to have independent entrances and exits. A 16-bit wide atomic computing instruction bus is used. The processor and the atomic computing module are directly connected, eliminating arbitration nodes and realizing atomic computing. Fixed latency and efficient merge processing of operations.

Benefits of technology

The atomic operation efficiency of the processor and the synchronization speed of calculation results between multiple cores are greatly improved. The atomic operation delay is shortened to about 8 clock cycles, which significantly improves the processing efficiency of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579507B
    Figure CN114579507B
Patent Text Reader

Abstract

The present invention relates to a method for realizing fast calculation and fast synchronization under a multi-core architecture, and belongs to the field of multi-core processors. In the present invention, the atomic calculation instruction bus is separated from other buses for transmitting data; the atomic calculation module and each processor have an entry and an exit, and the delay of the atomic calculation operation of each processor is not affected by other processors; in terms of software: the atomic calculation operation includes global statistical operation, atomic lock operation and global variable operation. This patent uses a dedicated bus for atomic operations to achieve a fixed delay of atomic operations (generally about 8 clock cycles), greatly improving the atomic operation efficiency of the processor, and improving the fast calculation and fast synchronization of calculation results between multiple processors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of multi-core processors, and in particular relates to a method for realizing fast calculation and fast synchronization under a multi-core architecture. Background Art

[0002] Semiconductor technology has entered the post-Moore era. The speed of chip process improvement has slowed down, and the frequency of processors has been increasing less and less. Due to power consumption limitations, the frequency of processors cannot be run too high. Therefore, it is becoming increasingly difficult to improve performance by relying on a single core, and multi-core architecture has emerged. Most tasks in real life can be run in parallel without any correlation with each other. We call such tasks stateless tasks. Multi-core architecture solves the problem of parallel processing of stateless tasks very well. However, there are also some tasks that are related to each other, such as traffic statistics of packets, context updates, atomic operations between multiple cores, etc., which require multiple processors to communicate in real time and process collaboratively. We call such tasks stateful tasks.

[0003] For example: the network is developing rapidly, the network bandwidth is getting higher and higher, the network protocol is getting more and more complex, and the network protocol processing requires programmable processing. Multi-core architecture is often used to process various network messages in parallel, but some traffic statistics, spin lock and other operations must be atomic operations, that is, they are executed in series and require fast and synchronous calculation and settlement results to each processor core; most of the current multi-core architectures are multiple cores connected to a unified atomic computing unit through a Ring bus or a crossbar bus. Each core transmits the atomic computing instructions to the atomic computing unit in series through the bus. After the atomic computing unit completes the calculation, it returns the calculation results to each processor core in series through the bus; because the bus is serial, the bus bit width is large, and there are many president nodes, some simple atomic operations will cause bandwidth waste, uncertainty in latency, and performance that is difficult to meet demand.

[0004] Multiple cores access atomic operation units through the Ring bus, such as Figure 1 shown.

[0005] Multi-core accesses atomic computing units through a star-shaped interconnected Crossbar bus, such as Figure 2 shown.

[0006] Whether the Ring bus or the Crossbar bus is used to connect the atomic computing module, the atomic computing module has only one entrance and exit. This is because the bus is not only used to transmit computing commands, but also to transmit data. Since the bus needs to transmit message data or API data, the bus is very wide. It is not convenient to make multiple sets of entrances and exits of the atomic computing module, otherwise the chip layout and wiring will be difficult to succeed. The computing commands of multiple processor cores are transmitted to the atomic computing module through a unique entrance, and the atomic computing module returns the results to each processor core through a unique exit. The unique entrance and exit of the atomic computing module have become performance bottlenecks.

[0007] The current general technology multi-core atomic operation process is as follows Figure 3 shown.

[0008] Therefore, the existing technology has the following disadvantages:

[0009] The commands for atomic computing are transmitted through the data bus, which is too wide, resulting in a waste of bandwidth.

[0010] The command of atomic calculation is transmitted through the data transmission bus, which has multiple arbitration nodes, resulting in transmission delay uncertainty, that is, the processor does not know when the atomic operation will end and return the result, which is not conducive to the processor core to perform pipeline processing and greatly reduces the processing efficiency of the processor. Since it is uncertain when the atomic operation will return, the processor has some operations waiting for instructions, that is, the number of effective instructions executed in each cycle will be greatly reduced;

[0011] Since the atomic computing module has a single export and import, it can only execute commands transmitted from the bus in serial, resulting in low processing efficiency of the atomic computing module. Summary of the invention

[0012] 1. Technical issues to be resolved

[0013] The technical problem to be solved by the present invention is how to provide a method for realizing fast computing and fast synchronization under a multi-core architecture, so as to solve the problem of low processor efficiency caused by atomic computing under a multi-core architecture.

[0014] (II) Technical solution

[0015] In order to solve the above technical problems, the present invention proposes a method for realizing fast computing and fast synchronization under a multi-core architecture, which includes hardware improvement and software improvement.

[0016] Hardware:

[0017] The atomic computing instruction bus is separated from other buses that transmit data;

[0018] The atomic computing module and each processor have an entry and an exit, and the delay of the atomic computing operation of each processor is not affected by other processors;

[0019] Software: Atomic computing operations include global statistical operations, atomic lock operations, and global variable operations;

[0020] Global statistical operation: The number of bytes of the message processed by each processor is accumulated into a global counter through the atomic calculation module. The atomic calculation module returns the accumulated result to each processor, so that each processor knows the latest value of the global counter after accumulating the current message;

[0021] Atomic lock operation: Multiple processors may compete for the same spin lock in the same cycle. The atomic computing module needs to complete the allocation of atomic locks and information return at the same time.

[0022] Global variable operations: Multiple processors need to modify different domains of the same variable at the same time. The atomic computing module needs to merge these operations and return the latest value of the variable to each processor.

[0023] Furthermore, the atomic computing instruction bus width is controlled at 16 bits, merging the atomic computing of dozens to hundreds of processors in one clock cycle and returning the atomic computing results of each processor at the same time.

[0024] Furthermore, a single processor issues multiple commands concurrently, and the calculation results of the multiple commands are written into the register using time division multiplexing.

[0025] Furthermore, the latency of atomic computing operations is around 8 clock cycles.

[0026] Furthermore, the processor and the atomic computing module are directly connected via an atomic computing instruction bus, and there is no arbitration node on the bus.

[0027] Furthermore, the atomic operations of each processor go through the atomic computing instruction bus, and the atomic computing module merges and processes the atomic operation requests of multiple processors in the same clock cycle.

[0028] Furthermore, when the number of multi-cores reaches more than 100 and the atomic operation is not an addition or subtraction operation, the bit width of the atomic operation is designed to be 32 bits.

[0029] Furthermore, in each clock cycle, each processor may issue these three types of operations. The atomic computing module needs to merge multiple inputs and return the results to each processor in a pipeline processing manner in one cycle or in multiple cycles.

[0030] Furthermore, the atomic computing module processes the request command of each processor at line speed and returns the result to each processor at a fixed time point, that is, the atomic computing result can be output to each processor in each clock cycle.

[0031] Furthermore, in the global variable operation, if multiple cores operate the same domain of the same variable at the same time, the result of the operation is the result of the combined processing of the requests of multiple processors.

[0032] (III) Beneficial effects

[0033] The present invention proposes a method for realizing fast calculation and fast synchronization under a multi-core architecture. This patent utilizes a dedicated bus for atomic operations to realize a fixed delay of atomic operations (generally about 8 clock cycles), which greatly improves the atomic operation efficiency of the processor and improves the fast calculation and fast synchronization of calculation results between multiple processors. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 Schematic diagram of multi-core access to atomic operation units through the Ring bus;

[0035] Figure 2 Schematic diagram of multi-core access to atomic computing units through a star-shaped interconnected Crossbar bus;

[0036] Figure 3 A schematic diagram of the multi-core atomic operation process for general technology;

[0037] Figure 4 A schematic diagram of a direct bus connection between a processor and an atomic computing module of the present invention;

[0038] Figure 5 A block diagram of data processing by the processor of the present invention;

[0039] Figure 6 Schematic diagram of the processing flow of the global statistics module of the present invention;

[0040] Figure 7 This is a schematic diagram of the global spin lock processing flow chart of the present invention;

[0041] Figure 8 This is a schematic diagram of the global variable update processing flow chart of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0043] The purpose of the present invention is to solve the problem of low processor efficiency caused by atomic computing under a multi-core architecture.

[0044] The present invention mainly solves the following four difficult problems:

[0045] Solve the problem of bus bandwidth waste in atomic computing;

[0046] Solve the problem of unstable bus delay and calculation delay in atomic computing;

[0047] Solve the bottleneck problem of the export and import bandwidth of the atomic computing module;

[0048] Solve the computing bottleneck problem of the atomic computing module.

[0049] The present invention includes hardware improvements and software improvements. The hardware implementation of the present invention is as follows:

[0050] The atomic computing instruction bus and other data transmission buses are separated in hardware.

[0051] The atomic computing module and each processor have an entry and an exit, and the delay of the atomic computing operation of each processor is not affected by other processors.

[0052] In one clock cycle, the atomic calculations of dozens to hundreds of processors are combined. The atomic calculation instruction bus has a small bit width, for example, it is generally controlled at 16bit. This bit width makes it easy to realize the atomic calculations of dozens to hundreds of processors in one clock cycle from the hardware design, and return the atomic calculation results of each processor at the same time.

[0053] Since the delay of atomic calculation is fixed, a single processor can concurrently execute multiple commands, and the calculation results of multiple commands are written into the register in a time-division multiplexing manner, avoiding complex arbitration logic.

[0054] The delay of atomic computing operations is fixed, generally around 8 clock cycles, which is more than 10 times faster than the delay of traditional atomic operations.

[0055] The software implementation of the present invention is as follows:

[0056] Atomic computing operations include atomic lock operations, global statistics operations, and global variable operations.

[0057] To solve the problem of bus bandwidth waste in atomic computing: the atomic computing instruction bus and the data transmission bus are separated. The atomic computing instruction bus has a small bit width and does not occupy the data bus, thus not wasting the bandwidth of the data bus.

[0058] To solve the problem of unstable bus delay and calculation delay of atomic computing: the atomic computing instruction bus has a small bit width, the processor and the atomic computing module are directly connected using the atomic computing instruction bus, there is no arbitration node on the bus, the bus delay and atomic computing delay are fixed; the atomic operation of each processor uses a dedicated bus, the atomic computing module can merge and process the atomic operation requests of multiple processors in the same clock cycle, and the calculation delay is also fixed;

[0059] To solve the problem of the inlet and outlet bandwidth of the atomic computing module: the atomic computing instruction bus has a small bit width, and the processor can be directly connected to the atomic computing module. The atomic computing module and each processor have an inlet and an outlet, and there is no bandwidth bottleneck problem between the inlet and outlet.

[0060] To solve the multi-way merging calculation problem of the atomic computing module: the atomic computing instruction bus has a small bit width, the processor can be directly connected to the atomic computing module, the atomic computing module and each processor have an entry and an exit. When the bit width of the atomic computing instruction bus is less than or equal to 16bit, the atomic computing module can be connected to hundreds of processors at the same time (with hundreds of input and output interfaces); the atomic operation commands of all processors can be merged in each clock cycle, the processing performance is high, and the delay of returning the calculation results is fixed;

[0061] When the number of multi-cores reaches more than 100, it is recommended that the bit width of the combined addition and subtraction instructions be 16 bits. For atomic operations that are not addition and subtraction operations, the bit width of the atomic operation can also be 32 bits. This is because the back-end timing of the combined addition and subtraction instructions limits the bit width. The timing of other atomic operations is easier to handle, and the bit width can be made wider.

[0062] In some cases, the atomic computing instruction bus is designed to have a bit width of 32 bits, which can also achieve this effect.

[0063] For atomic operations, we generally divide them into the following categories:

[0064] Global statistical operation: the number of bytes of the message processed by each processor is accumulated into a global counter through the atomic calculation module (fast calculation). The atomic calculation module returns the accumulated result to each processor, so that each processor knows the latest value of the global counter after accumulating the current message (fast synchronization); Figure 6 shown.

[0065] In atomic lock operation, multiple processors may grab the same spin lock in the same cycle. The atomic computing module needs to complete the allocation of atomic locks and information return at the same time. Figure 7As shown, multiple processors grab the same spin lock in the same cycle, and the atomic computing module returns the allocation results at the same time.

[0066] Global variable operations (multiple writes and multiple reads), multiple processors need to modify different fields of the same variable at the same time. The atomic computing module needs to merge these operations and return the latest value of the variable to each processor; if multiple cores operate the same field of the same variable at the same time, the result of the operation is the result of the merged processing requested by multiple processors; Figure 8 As shown, when multiple processors modify a variable at the same time, these operations are merged and the latest value of the variable is returned.

[0067] Each processor may issue these three types of operations in each clock cycle in order to return the results to each processor at a fixed time. The atomic computing module needs to merge multiple inputs and return the results to each processor in a pipeline processing manner in one cycle or in multiple cycles; that is, the atomic computing module can process the request commands of each processor at line speed and return the results to each processor at a fixed time point, that is, the atomic computing results can be output to each processor in each clock cycle. Each processor and the atomic computing module have a direct bus connection. Figure 4 shown.

[0068] In each clock cycle, the atomic calculation module can merge the input data of each processor and return the result to each processor at line speed within a fixed clock cycle. Since the delay of returning the atomic calculation result is fixed, each processor can process data in a pipeline with almost no waiting process. The processing block diagram is as follows: Figure 5 shown.

[0069] like Figure 6 As shown,

[0070] The processor processes messages in a pipeline manner. Figure 1 Each pipeline stage of the logo requires one clock cycle;

[0071] At the first stage of the pipeline, the processor calculates the number of counters to be accumulated and the global counter to be accumulated according to the size of the currently processed message and the input and output port numbers of the current message; and issues a counter global statistics accumulation command.

[0072] In the second stage of the pipeline, the atomic calculation module combines and accumulates the accumulated counter quantities of all global statistical accumulation commands input by multiple processors in the current clock cycle in one clock cycle, and returns the results to each processor that issued the statistical command.

[0073] At the third stage of the pipeline, each processor obtains the accumulated statistical results within a fixed time and obtains the current statistical value of the global statistical counter in real time.

[0074] This is an example process. In the actual implementation of various scenarios, due to different logic complexities, the number of clock cycles required for each pipeline stage is different. The total latency of global statistics is generally around 8 clock cycles.

[0075] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for realizing fast computing and fast synchronization under a multi-core architecture, characterized in that: The method includes hardware improvement and software improvement. Hardware: The atomic computing instruction bus is separated from other buses that transmit data; The atomic computing module and each processor have an entry and an exit, and the delay of the atomic computing operation of each processor is not affected by other processors; Software: Atomic computing operations include global statistical operations, atomic lock operations, and global variable operations; Global statistical operation: The number of bytes of the message processed by each processor is accumulated into a global counter through the atomic calculation module. The atomic calculation module returns the accumulated result to each processor, so that each processor knows the latest value of the global counter after accumulating the current message; Atomic lock operation: Multiple processors may grab the same spinlock in the same cycle. The atomic calculation module needs to complete the allocation of atomic locks and information return at the same time. Global variable operations: Multiple processors need to modify different fields of the same variable at the same time. The atomic computing module needs to merge these operations and return the latest value of the variable to each processor. in, The atomic computing instruction bus width is controlled at 16 bits, combining the atomic computing of dozens to hundreds of processors in one clock cycle and returning the atomic computing results of each processor at the same time; The processor and the atomic computing module are directly connected using an atomic computing instruction bus, and there is no arbitration node on the bus; The atomic operations of each processor go through the atomic computing instruction bus, and the atomic computing module combines and processes the atomic operation requests of multiple processors in the same clock cycle; The atomic computing module processes the request commands of each processor at line speed and returns the results to each processor at a fixed time point, that is, the atomic computing results can be output to each processor in each clock cycle.

2. The method for realizing fast computing and fast synchronization under a multi-core architecture as claimed in claim 1, characterized in that: A single processor issues multiple commands concurrently, and the calculation results of multiple commands are written into registers using time-division multiplexing.

3. The method for realizing fast computing and fast synchronization under a multi-core architecture as claimed in claim 1, characterized in that: The latency of atomic computation operations is 8 clock cycles.

4. The method for realizing fast computing and fast synchronization under a multi-core architecture as claimed in claim 1, characterized in that: When the number of multi-cores reaches more than 100 and the atomic operation is not an addition or subtraction operation, the bit width of the atomic operation is designed to be 32 bits.

5. The method for realizing fast computing and fast synchronization under a multi-core architecture according to any one of claims 1 to 4, characterized in that: In the global variable operation, if multiple cores operate the same domain of the same variable at the same time, the result of the operation is the result of the combined processing of the requests of multiple processors.