A tightly coupled heterogeneous multi-core processor architecture and processing method thereof
By tightly coupled heterogeneous multi-core processor architecture, the synchronization mechanism and multi-level cache structure between the master and slave cores are used to solve the problem that traditional structures cannot meet the irregular memory access requirements, and efficient data prefetching and computing are achieved Matching improves memory access bandwidth utilization and performance.
Patent Information
- Application Number
- CN202011478517.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-15
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-12-15
AI Technical Summary
Traditional heterogeneous structures cannot meet the application needs of irregular memory access and uncertain prefetch addresses, such as graphs, continuous matrix vector multiplication, convolutional networks, etc., resulting in a bottleneck in memory access bandwidth and unable to effectively improve performance.
Adopting a tightly coupled heterogeneous multi-core processor architecture, including thread synchronization and notification bus connection between the master and slave cores, multi-level cache structure and DMA, coordinates DMA to import data into the data through the master core in advance The secondary cache is arranged regularly in the secondary cache to achieve tight coupling of data prefetching and computing.
It improves the utilization rate of memory fetch bandwidth, reduces the number of cache missing times and power consumption, supports complex data prefetching, realizes seamless connection between computing and memory fetching, and dynamic task allocation balances the kernel load.
Smart Images

Figure CN112527729B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing technology, and in particular relates to a tightly coupled heterogeneous multi-core processor architecture and a processing method thereof. Background Art
[0002] The limitation of chip pin count and I / O frequency leads to memory bandwidth bottleneck. With the rise of applications that are determined by memory access performance, such as deep learning, big data, graph computing, and sparse matrix-vector multiplication, increasing the main memory capacity will not help improve performance for such applications due to the limitation of memory access bandwidth.
[0003] In traditional heterogeneous structures, the main thread prefetches data through very few prefetch instructions and ping-pong buffers, which is mainly aimed at scientific computing that is easy to parallelize and has regular memory access patterns. It cannot meet the application requirements of irregular memory access and uncertain prefetch addresses, such as graphs, continuous matrix-vector multiplication, convolutional networks, etc. Summary of the invention
[0004] The object of the present invention is to provide a tightly coupled heterogeneous multi-core processor architecture and a processing method thereof in view of the above problems.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A tightly coupled heterogeneous multi-core processor architecture includes a core group structure having a main core CCore and a slave core PCore connected to each other, the core group structure also includes a plurality of first-level data caches L1D respectively connected to the main core CCore and the slave core PCore, and the plurality of first-level data caches L1D are all connected to a second-level cache access bus, the second-level cache access bus is connected to a second-level cache L2Cache, the second-level cache L2Cache is connected to a memory access bus, and the memory access bus is connected to a DMA and a main memory.
[0007] In the above-mentioned tightly coupled heterogeneous multi-core processor architecture, the core group structure has a main core CCore and multiple slave cores PCore connected to the main core CCore, and the main core CCore and the slave cores PCore are connected through thread synchronization and notification buses;
[0008] The core group structure also includes a plurality of L1 instruction caches L1P respectively connected to the main core CCore and the slave core PCore, and the L1 instruction caches L1P are connected to the L2 cache access bus, and the plurality of L1 instruction caches L1P and the plurality of L1 data caches L1D are arranged in an interlaced interval;
[0009] The first-level data cache L1D and the first-level instruction cache L1P are connected to the master core CCore and the slave core PCore through a monitoring bus;
[0010] The master core CCore is a scalar or superscalar processor core, and the slave core PCore is a computing processor core.
[0011] In the above-mentioned tightly coupled heterogeneous multi-core processor architecture, the secondary cache L2Cache has multiple circular buffers, and at least one circular buffer is used to cache calculation result data, and at least one circular buffer is used to cache calculation data imported from the main memory and regularly arrange irregular data.
[0012] In the above-mentioned tightly coupled heterogeneous multi-core processor architecture, the L2Cache has at least two ring buffers for caching computing data imported from the main memory;
[0013] The memory access bus is connected to an I / O interface for connecting an I / O device, the I / O interface is connected to a peripheral bus, and the peripheral bus is connected to the DMA.
[0014] A data processing method based on the tightly coupled heterogeneous multi-core processor architecture comprises the following steps:
[0015] S1. The main core CCore pre-analyzes the storage address of the calculation data required by the slave core PCore, and coordinates DMA to import the calculation data from the main memory to the secondary cache L2Cache;
[0016] S2. The slave core PCore obtains the required computing data from the secondary cache L2Cache to the nearest primary data cache L1D for computing;
[0017] S3. The slave core PCore writes the calculation result data to the secondary cache L2Cache through the nearest primary data cache L1D;
[0018] S4. The main core CCore coordinates DMA again to write the calculation result data from the secondary cache L2Cache into the main memory.
[0019] In the data processing method of the tightly coupled heterogeneous multi-core processor architecture, in step S1, the calculation data includes regular data and irregular data, and when the data is irregular, it is regularly arranged in the secondary cache L2Cache.
[0020] In the data processing method of the above-mentioned tightly coupled heterogeneous multi-core processor architecture, three circular buffers are set in the secondary cache L2Cache, and one buffer is used to cache calculation result data, and the remaining two buffers are used to cache calculation data imported from the main memory and regularly arrange irregular data.
[0021] In the data processing method of the above-mentioned tightly coupled heterogeneous multi-core processor architecture, the master core CCore is a scalar or superscalar processor core, and the slave core PCore is a computing processor core;
[0022] During the execution of the method, the master core CCore dynamically allocates computing tasks to the slave cores PCore.
[0023] In the data processing method of the tightly coupled heterogeneous multi-core processor architecture, the master core CCore implements dynamic allocation of computing tasks through a master core-slave core synchronization mechanism, and the master core-slave core synchronization mechanism is implemented in the following manner:
[0024] Each slave core PCore independently determines whether it can perform calculations;
[0025] Each slave core PCore occupies an interrupt entry on the master control core, and sends an interrupt to the master core CCore through instructions to notify the master core CCore of the current operation completion status.
[0026] In the data processing method of the tightly coupled heterogeneous multi-core processor architecture described above, an atomic lock mechanism is used between the slave cores PCore to ensure that data stored at the same address is read and written by only one slave core PCore.
[0027] The advantages of the present invention are:
[0028] 1. Efficiently support producer-consumer buffer management, tightly coupling data pre-fetching and computing;
[0029] 2. The master core pre-analyzes the storage address of the calculation data required by the slave core and coordinates DMA to import irregular data from the main memory into the shared secondary cache, and arranges it in a certain regular manner to achieve memory access for applications with irregular and pre-fetched addresses. At the same time, it supports complex and efficient data pre-fetching, which can reduce the number of cache misses and improve memory access bandwidth utilization;
[0030] 3. The slave core obtains the required computing data from the shared L2 cache to the nearest L1 data cache for data computing, achieving seamless connection between computing and memory access, and reducing the power consumption of complex scheduling by matching computing with memory access;
[0031] 4. Setting up two buffers from the main memory to the slave core can further support complex and efficient data pre-fetching, improve memory access bandwidth utilization, and achieve seamless connection between computing and memory access;
[0032] 5. Dynamic task allocation is completely coordinated by the master core through the synchronization mechanism between the master core and the slave core, effectively reducing the imbalance of the slave core load. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The architecture diagram of the tightly coupled heterogeneous multi-core processor architecture of the present invention;
[0034] Figure 2 It is a diagram of the producer-consumer model of the present invention. DETAILED DESCRIPTION
[0035] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0036] Improving memory access bandwidth utilization and making full use of memory access bandwidth can help improve performance, and matching computing with memory access can reduce power consumption. Therefore, this embodiment proposes a tightly coupled master-slave heterogeneous multi-core processor architecture, such as Figure 1 As shown, the core group structure includes a main core CCore and multiple slave cores PCore connected to the main core CCore through a thread synchronization and notification bus, wherein the main core CCore is a scalar or superscalar processor core, and the slave core PCore is a computing processor core, which is a core optimized for power consumption for computing. The thread synchronization and notification bus of this embodiment supports a thread start / stop / notification mechanism (Fork / Join / Notify mechanism).
[0037] Furthermore, the core group structure also includes multiple first-level data caches L1D and multiple first-level instruction caches L1P, which are connected to the main core CCore and the slave core PCore through a monitoring bus for sharing by the main core CCore and the slave core PCore, wherein L1D is configurable as Cache / SRAM, and a monitoring-based consistency protocol maintenance method is adopted between L1Ds, and a write-update and write-invalidate consistency protocol can be adopted to share the second-level cache L2Cache.
[0038] Specifically, multiple first-level data caches L1D and multiple first-level instruction caches L1P are all connected to the second-level cache access bus, and the multiple first-level instruction caches L1P and the multiple first-level data caches L1D are arranged in an interlaced interval; the second-level cache access bus is connected to the second-level cache L2Cache, the second-level cache L2Cache is connected to the memory access bus, the memory access bus is connected to DMA (Direct Memory Access) and multiple main memories, and the multiple main memories are respectively connected to the memory access bus through multiple main memory interfaces, wherein DMA is used for data movement between memories.
[0039] Furthermore, the secondary cache L2Cache has multiple ring buffers, such as Figure 2 As shown, this embodiment preferably sets three ring buffers: M buffer, X buffer and Y buffer, and the Y buffer is used to cache the calculation result data of the slave core PCore written through the nearest first-level cache L1D, and the M buffer and X buffer are used to cache the calculation data imported from the main memory and arrange the irregular data in a regular manner;
[0040] Figure 2 In the producer-consumer model:
[0041] Y buffer: y_buffer, the slave core PCore is the producer, the master core CCore is the consumer
[0042] X buffer: x_buffer, the main core CCore is the producer, the slave core PCore is the consumer
[0043] M buffer: m_buffer, the main core CCore is the producer, the slave core PCore is the consumer
[0044] For ease of understanding, the pseudo codes of the master core Ccore and the slave core PCore are given below:
[0045]
[0046]
[0047]
[0048] Furthermore, the memory access bus is connected to an I / O interface for connecting an I / O device, the I / O interface is connected to the peripheral bus, and the peripheral bus is connected to the DMA.
[0049] Specifically, the data processing method of the tightly coupled heterogeneous multi-core processor architecture includes the following steps:
[0050] S1. The main core CCore pre-analyzes the storage address of the computing data required by the slave core PCore, and coordinates DMA to import the computing data from the main memory into the secondary cache L2Cache; the computing data here includes regular data and irregular data, and when it is irregular data, it is regularly arranged in the secondary cache L2Cache, specifically in this embodiment, it is irregularly arranged in the M buffer or X buffer.
[0051] This step enables memory access for irregular applications with uncertain prefetch addresses, supports complex and efficient data prefetching, reduces the number of cache misses, and improves memory access bandwidth utilization. In addition, this embodiment preferably sets two buffers from the main memory to the slave core PCore, which can further achieve the above-mentioned effect and realize seamless connection of computing / memory access.
[0052] S2. The slave core PCore obtains the required computing data from the L2Cache to the nearest L1D data cache for computing; specifically, in this embodiment, the pre-arranged data in the M buffer and the X buffer are read to the nearest L1D data cache for computing, such as vector multiplication;
[0053] Here, the core PCore obtains the required computing data from the second-level cache L2Cache to the nearest first-level data cache L1D for calculation, realizing seamless connection between calculation and memory access, and reducing the function of complex scheduling by matching calculation and memory access.
[0054] S3. The slave core PCore writes the calculation result data to the secondary cache L2Cache through the nearest primary data cache L1D, such as the Y buffer;
[0055] S4. The main core CCore coordinates DMA again to write the calculation result data in the Y buffer into the memory (ie, main memory).
[0056] Furthermore, the master core CCore dynamically allocates computing tasks to the slave cores PCore through the master-slave core synchronization mechanism, thereby reducing the load imbalance of the slave cores PCore, specifically:
[0057] The master core CCore distributes the required data of the slave core PCore to the slave core PCore cache through the master core-slave core synchronization mechanism, and starts the slave core PCore;
[0058] The slave core PCore dynamically obtains tasks through the synchronization mechanism between the master core and the slave core, calculates the data allocated to it by the master core CCore, and feeds back the task execution status to the master core CCore. The dynamic task allocation is completely coordinated by the master core CCore through the synchronization mechanism between the master core CCore and the slave core PCore, so as to reduce the load imbalance of the slave core PCore.
[0059] Specifically, this embodiment implements the synchronization mechanism between the master core and the slave core in the following manner:
[0060] Each slave core PCore occupies an interrupt entry on the master core CCore, and can send an interrupt to the master core CCore through instructions to notify the master core CCore that the current operation is completed. Set the thread control port from the master core CCore to each slave core PCore, and support the following operations:
[0061] (1) StartProcessor(coreID,threadAddress), start the slave core PCore numbered coreID to start execution from address threadAddress;
[0062] (2) HaltProcessor(coreID), suspend the slave core PCore numbered coreID;
[0063] (3) ResumeProcessor(coreID), restart the slave core PCore numbered coreID;
[0064] (4) ResetProcessor (coreID), reset the slave core PCore numbered coreID;
[0065] (5) value = GetProcessor (coreID), read the status of the slave core PCore numbered coreID, and return a status such as BUSY or STALL.
[0066] In addition, each slave core PCore occupies an interrupt entry of the master core CCore and sends an interrupt to the master core CCore of the same group through the following instructions:
[0067] Notify() generates an interrupt and notifies the main core Ccore.
[0068] Each slave core PCore independently determines whether it can perform calculations:
[0069] The slave core PCore independently determines whether it can be executed, and in order to reduce power consumption, the slave core PCore is set to wait for instructions:
[0070] wait ready_flag_address;
[0071] After executing this instruction, the slave core PCore queries ready_flag_address. If it is true, then continue to execute the following instructions. Otherwise, the slave core PCore is suspended and monitors the operations of other cores in the core group on this address. When it is monitored that other cores set this address to 1, the slave core Pcore resumes and starts.
[0072] In addition, in this embodiment, there is also a synchronization mechanism between DMA and the main core CCore:
[0073] DMA receives commands from the main core CCore, and after completing the specified operation, sends an interrupt to the main core CCore and sets the flag;
[0074] DMA command source address, destination address, length, and return flag storage address;
[0075] After DMA execution is completed, the return flag storage address is set to 1, and an interrupt is sent to the main core CCore. In this way, both query-based synchronization and interrupt-based synchronization between DMA and the main core CCore can be supported.
[0076] Preferably, this embodiment adds an atomic lock mechanism supported by RAW (Read-and-Write) dedicated instructions at the processor core to ensure that data stored at the same address is read and written by only one slave core PCore. Specifically, the atomic lock can be implemented in the following two ways:
[0077] 1) Implemented using the classic LL / SC (Load Linked / Store Condit ional) instruction pair;
[0078] 2) Use special instructions to monitor the read / write addresses of other cores during the entire operation cycle from reading to writing back. The master core CCore selects a slave core PCore to complete the instruction, and other cores are blocked and wait for the slave core PCore to complete before continuing the operation. Or return the instruction failure information to other slave cores PCore, at which time these slave cores PCore need to make an operation request again to complete the operation.
[0079] The main problem of blocking implementation is to avoid deadlock. In order to avoid deadlock, it can be stipulated that each slave core PCore cannot perform two atomic operations simultaneously in each clock cycle (or only set one functional component that can perform atomic operations).
[0080] This embodiment achieves tight coupling of data prefetching and computing through coordination among the main core CCore, the slave core PCore, DMA, the second-level cache L2Cache, and the first-level data cache L1D, which can solve the memory access requirements of applications with irregular data and uncertain prefetch addresses.
[0081] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
[0082] Although this article uses more terms such as main core Ccore, slave core PCore, core group structure, first-level data cache L1D, second-level cache access bus, second-level cache L2Cache, memory access total, DMA, main memory, thread synchronization and notification bus, first-level instruction cache L1P, etc., it does not exclude the possibility of using other terms. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional restrictions is contrary to the spirit of the present invention.
Claims
1. A tightly coupled heterogeneous multi-core processor architecture, characterized in that: The invention comprises a core group structure having a main core CCore and a slave core PCore connected to each other, wherein the core group structure further comprises a plurality of first-level data caches L1D respectively connected to the main core CCore and the slave core PCore, and the plurality of first-level data caches L1D are all connected to a second-level cache access bus, the second-level cache access bus is connected to a second-level cache L2Cache, the second-level cache L2Cache is connected to a memory access bus, and the memory access bus is connected to a DMA and a main memory; The secondary cache L2Cache has multiple ring buffers, and at least one ring buffer is used to cache calculation result data, and at least one ring buffer is used to cache calculation data imported from the main memory and regularly arrange irregular data; The main core CCore is used to pre-analyze the storage address of the calculation data required by the slave core PCore, and coordinate DMA to import the calculation data from the main memory to the secondary cache L2Cache; and, for coordinating DMA again to write the calculation result data from the secondary cache L2Cache into the main memory when the calculation result data is written into the secondary cache L2Cache; The slave core PCore is used to obtain the required computing data from the secondary cache L2Cache to the nearest primary data cache L1D for computing, and write the computing result data to the secondary cache L2Cache through the nearest primary data cache L1D.
2. The tightly coupled heterogeneous multi-core processor architecture according to claim 1, characterized in that: The core group structure comprises a main core CCore and a plurality of slave cores PCore connected to the main core CCore, and the main core CCore and the slave cores PCore are connected via thread synchronization and notification buses; The core group structure also includes a plurality of L1 instruction caches L1P respectively connected to the main core CCore and the slave core PCore, and the L1 instruction caches L1P are connected to the L2 cache access bus, and the plurality of L1 instruction caches L1P and the plurality of L1 data caches L1D are arranged in an interlaced interval; The first-level data cache L1D and the first-level instruction cache L1P are connected to the master core CCore and the slave core PCore through a monitoring bus; The master core CCore is a scalar or superscalar processor core, and the slave core PCore is a computing processor core.
3. The tightly coupled heterogeneous multi-core processor architecture according to claim 2, characterized in that: The secondary cache L2Cache has at least two ring buffers for caching computing data imported from the main memory; The memory access bus is connected to an I / O interface for connecting an I / O device, the I / O interface is connected to a peripheral bus, and the peripheral bus is connected to the DMA.
4. A data processing method based on the tightly coupled heterogeneous multi-core processor architecture according to any one of claims 1 to 3, characterized in that: The following steps are involved: S1. The main core CCore pre-analyzes the storage address of the calculation data required by the slave core PCore, and coordinates DMA to import the calculation data from the main memory to the secondary cache L2Cache; S2. The slave core PCore obtains the required computing data from the secondary cache L2Cache to the nearest primary data cache L1D for computing; S3. The slave core PCore writes the calculation result data to the secondary cache L2Cache through the nearest primary data cache L1D; S4. The main core CCore coordinates DMA again to write the calculation result data from the secondary cache L2Cache into the main memory.
5. The data processing method according to claim 4, characterized in that: In step S1, the calculation data includes regular data and irregular data, and when the data is irregular, it is regularly arranged in the secondary cache L2Cache.
6. The data processing method according to claim 5, characterized in that: The secondary cache L2Cache is provided with three circular buffers, and one of the buffers is used to cache calculation result data, and the remaining two buffers are used to cache calculation data imported from the main memory and to arrange irregular data in a regular manner.
7. The data processing method according to claim 6, characterized in that: The master core CCore is a scalar or superscalar processor core, and the slave core PCore is a computing processor core; During the execution of the method, the master core CCore dynamically allocates computing tasks to the slave cores PCore.
8. The data processing method according to claim 7, characterized in that: The master core CCore implements dynamic allocation of computing tasks through a master core-slave core synchronization mechanism, and implements the master core-slave core synchronization mechanism in the following ways: Each slave core PCore independently determines whether it can perform calculations; Each slave core PCore occupies an interrupt entry on the master control core, and sends an interrupt to the master core CCore through instructions to notify the master core CCore of the current operation completion status.
9. The data processing method according to claim 8, characterized in that: The slave cores PCore use an atomic lock mechanism to ensure that data stored at the same address is read and written by only one slave core PCore.
