Methods, apparatus, and storage media for handling cache consistency transaction conflicts

By identifying and merging transaction phases in cache consistency transaction conflict handling, the target transmission path is determined, which solves the problems of duplicate transmission and latency of cache line data and improves the processing efficiency of inter-chip interconnect systems.

CN122733742BActive Publication Date: 2026-11-10JINDI SPACE TIME (ZHUHAI) TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611226911.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-11-10
Estimated Expiration
2046-08-13

AI Technical Summary

Technical Problem

In existing technologies, cache consistency transaction conflict handling methods result in repeated cross-chip transmission of cache line data, large transaction processing latency, and high bandwidth consumption in inter-chip interconnects, which reduces the throughput performance of inter-chip interconnect systems.

Method used

By acquiring information about write-back transactions and listener transactions, it is determined whether the same cache line is hit, and the target transmission path is determined based on the combination of transaction stages to avoid duplicate transmission. Transaction processing is completed by a proxy.

Benefits of technology

This reduces the repeated cross-chip transmission of the same cache line data, lowers transaction processing latency and bandwidth usage, and improves the processing efficiency of the inter-chip interconnect system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122733742B_ABST
    Figure CN122733742B_ABST
Patent Text Reader

Abstract

This application relates to the semiconductor field and provides a method, apparatus, and storage medium for handling cache consistency transaction conflicts. The method includes: acquiring transaction information of a write-back transaction and a listener transaction; determining whether two transactions hit the same cache line based on the transaction information and determining the transaction stage of the two transactions; when two transactions hit the same cache line and constitute a mergeable transaction stage combination, determining a target transmission path from the write-back path and the listener response path; transmitting cache line data to a second chip node through the target transmission path, and generating a protocol response for another transaction based on the transaction processing result of that path, thereby proxying the completion of the two transactions. This application can reduce repeated cross-chip transmission of the same cache line data and serial waiting of conflicting transactions, reduce inter-chip interconnect bandwidth usage and transaction processing latency, and improve the processing efficiency of cache consistency transactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the semiconductor field, and more specifically to a method, apparatus, and storage medium for handling cache consistency transaction conflicts. Background Technology

[0002] With the development of die-and-die architectures, multiple chip nodes can form a multi-chip consistency system through chip-to-chip (C2C) interconnect devices, where chip nodes include dies or chips. In a multi-chip consistency system based on the Coherent Hub Interface (CHI) protocol, C2C devices are used to forward consistency transactions between different chip nodes.

[0003] During cache consistency maintenance, requesting nodes write back cache line data using WriteBackFull transactions, and the Home node can also initiate Snoop transactions for the corresponding cache line. When a WriteBackFull transaction and a Snoop transaction access the same cache line, a transaction conflict may occur at the C2C device. A WriteBackFull transaction can be used by requesting nodes to write back cache lines containing dirty data to the consistent Home node responsible for managing that cache line. When an incomplete WriteBackFull transaction and a Snoop transaction meet at the C2C device and both hit the same cache line address, the two transactions need to be either ordered or mutually exclusive, resulting in a transaction conflict (Hazard).

[0004] Existing processing methods typically handle conflicting transactions serially according to their arrival order, blocking transactions that arrive later until the earlier transactions are completed. Since cross-chip node transactions have long transmission paths, this serial processing method may increase transaction waiting time and the number of cross-chip node transmissions, and cause duplicate transmissions of the same cached line data, thereby consuming C2C bandwidth, prolonging transaction processing latency, and reducing the throughput performance of the inter-chip interconnect system. Summary of the Invention

[0005] This application provides a method, apparatus, and storage medium for handling cache consistency transaction conflicts, which solves the technical problems in the prior art caused by serial processing, such as repeated cross-chip transmission of cache line data, large transaction processing latency, and high bandwidth consumption of inter-chip interconnection.

[0006] In a first aspect, embodiments of this application provide a method for handling cache consistency transaction conflicts, the method comprising: The first transaction information of the write-back transaction and the second transaction information of the listen transaction received from the second chip node are obtained. The write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listen transaction is used to listen to the cache line held by the requesting node. Based on the first transaction information and the second transaction information, determine whether the write-back transaction and the listener transaction hit the same cache line, and determine the transaction stage of each of the write-back transaction and the listener transaction; If the write-back transaction and the listen transaction hit the same cache line, and the transaction stages in which the write-back transaction and the listen transaction are located constitute a mergeable transaction stage combination, then the target transmission path corresponding to the second chip node is determined from the write-back path corresponding to the write-back transaction and the listen response path corresponding to the listen transaction based on the transaction stage combination. The cache line data is transmitted to the second chip node through the target transmission path, and a protocol response for the transaction corresponding to the non-target transmission path is generated based on the transaction processing result of the target transmission path, so as to proxies the completion of the write-back transaction and the listen transaction.

[0007] Secondly, embodiments of this application provide a cache consistency transaction conflict handling apparatus, which has the function of implementing the cache consistency transaction conflict handling method corresponding to the first aspect described above. In one embodiment, the apparatus includes: The input / output module is configured to acquire first transaction information of a write-back transaction and second transaction information of a listener transaction received from a second chip node, wherein the write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listener transaction is used to listen to the cache line held by the requesting node. The processing module is configured to determine, based on the first transaction information and the second transaction information, whether the write-back transaction and the listening transaction hit the same cache line, and to determine the transaction stage of each of the write-back transaction and the listening transaction; if the write-back transaction and the listening transaction hit the same cache line, and the transaction stages of the write-back transaction and the listening transaction constitute a mergeable transaction stage combination, then, based on the transaction stage combination, determine the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction; transmit the cache line data to the second chip node through the target transmission path, and generate a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, so as to proxies the completion of the write-back transaction and the listening transaction.

[0008] It is worth noting that the functions of the above-mentioned device can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions, and the modules can be software and / or hardware.

[0009] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the cache consistency transaction conflict handling method as described in the first aspect.

[0010] Fourthly, embodiments of this application provide a chip including a processor coupled to a transceiver for executing the technical solution provided in the first aspect of this application. In one possible design, the chip can also be a dedicated hardware structure for implementing the technical solution provided in the first aspect above; for example, processing involving neural network models can be implemented by a dedicated neural network processor or a graphics processor.

[0011] Compared to existing technologies, in this embodiment, the inter-chip interconnect device first obtains the transaction information of write-back transactions and listen transactions, and determines whether the two transactions access the same cache line based on the cache line address and node identifier. Since write-back transactions and listen transactions on the same cache line may arrive at the inter-chip interconnect device at different times, the inter-chip interconnect device further determines the transaction phase combination based on the sending status of the write-back transaction, the response status of the listen transaction, and the receiving order of the two transactions, thereby identifying whether the two transactions are in a phase that can be merged. For transaction phase combinations that do not meet the merging conditions, they are processed serially according to the transaction receiving order to avoid changing the original transaction processing order. For transaction phase combinations that meet the merging conditions, the inter-chip interconnect device determines the target transmission path between the write-back path and the listen response path based on the transaction phase combination, so that the same cache line data is transmitted to the second chip node only along the target transmission path, and stops repeatedly sending the cache line data through non-target transmission paths. If the write-back transaction has not yet been sent, the listen response can be directly generated using the cache line data carried by the write-back transaction and sent to the second chip node through the listen response path. If the write-back transaction has already been sent, the completion response of the write-back transaction can be used to confirm that the cached line data has arrived at the second chip node, and then a listen response without carrying cached line data can be generated. If the listen transaction arrives first, the listen response and cached line data can be sent to the second chip node through the listen response path first, and then the data handshake of the write-back transaction on the requesting node side can be completed, and the repeated transmission of the write-back path can be stopped.

[0012] This application's embodiments, while ensuring mutual matching of transaction phases and correct protocol processing, reduce repeated cross-chip transmission of the same cache line data between the write-back path and the listen-response path, reduce serial waiting between transactions, and lower bandwidth consumption and transaction processing latency of inter-chip interconnect devices. Simultaneously, by selecting the target transmission path based on different transaction phase combinations and proxying the generation of protocol responses for other transactions, it can reduce the blocking of subsequent transactions by conflicting transactions, improving the processing efficiency of consistent transactions and bus throughput performance in the inter-chip interconnect system.

[0013] In summary, the embodiments of this application can reduce the repeated cross-chip transmission of the same cache line data and the serial waiting of conflicting transactions, reduce the bandwidth occupation of inter-chip interconnection and transaction processing latency, and improve the processing efficiency of cache consistency transactions. Attached Figure Description

[0014] The objectives, features, and advantages of the embodiments of this application will become readily understood by referring to the accompanying drawings and the detailed description of the embodiments. Wherein: Figure 1 This is a schematic diagram of a dual-chip interconnect structure in the prior art; Figure 2 This is a schematic diagram of a cross-chip WriteBackFull transaction processing flow in the prior art; Figure 3 This is a schematic diagram of a cross-chip Snoop transaction processing flow in the prior art. Figure 4 This is a schematic diagram of a serial processing flow for cross-chip transaction conflicts in the prior art; Figure 5 This is a flowchart illustrating a method for handling cache consistency transaction conflicts according to an embodiment of this application. Figure 6 This is a schematic diagram illustrating the principle of the cache consistency transaction conflict handling method according to an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a cache consistency transaction conflict handling device according to an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a computing device according to an embodiment of this application; Figure 9 This is a schematic diagram of a server structure in one embodiment of this application.

[0015] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0016] See Figure 1 , Figure 1 This is a schematic diagram of a dual-chip interconnect structure in the prior art. Figure 1Chip0 and Chip1 are shown, each containing a Network on Chip (NoC). Each NoC is connected to a corresponding Central Processing Unit (CPU), a Fully-coherent Home Node (HN-F), a Peripheral Component Interconnect Express (PCIe), Double Data Rate (DDR) memory, and a Chip-to-Chip (C2C) device. A bidirectional connection exists between two C2C devices. The ellipses in the figure indicate that other components may also be present. Figure 1 The specific types and quantities of other components are not shown.

[0017] In Chiplet and multi-Die architectures, multiple chips can maintain their own local consistency domains and interconnect via C2C devices. The C2C device acts as a cross-chip bridge node for the Coherent Hub Interface (CHI) protocol, forwarding consistent transactions from one chip to another. When a Fully-coherent Request Node (RN-F) in a local chip initiates a consistency access, the RN-F responsible for managing the target address may be located on the local chip or on the peer chip. When a consistency access crosses a chip boundary, the corresponding transaction needs to be forwarded via the C2C device.

[0018] Compared to intra-chip access, cross-chip access requires traversing the interconnection structure of the local chip, C2C devices, and the interconnection structure of the peer chip. This results in a longer transmission path and increases access latency and interconnection bandwidth usage.

[0019] In existing technologies, WriteBackFull transactions and Snoop transactions process the data and consistency state of the same cache line within a similar timeframe, and their processing results are interdependent, meaning they cannot be executed independently. This application primarily addresses non-forwarding Snoop transactions.

[0020] Specifically, a WriteBackFull transaction is used to write back dirty cache line data held by the requesting node to the Home node, and to change the cache line in the requesting node from a valid state to an invalid state. A Snoop transaction is used to query or change the consistency state of the cache line in the requesting node, and may request the requesting node to return the latest data of the cache line. When both transactions are executed concurrently for the same cache line, the data needed by Snoop may be being written back by a WriteBackFull transaction, and the cache state indicated by the Snoop response will be affected by the progress of the WriteBackFull execution.

[0021] For example, a requesting node is writing back the latest dirty data of a cache line through a WriteBackFull transaction, while the Home node initiates a Snoop transaction for the same cache line. If no ordering or correlation processing is performed between the two, technical problems may arise, such as the Snoop transaction failing to obtain the latest data that has not yet been completed, the same cache line data being sent repeatedly through both the WriteBackFull and Snoop channels, WriteBackFull and Snoop updating the directory state separately, leading to inconsistencies between the state recorded by the Home node and the actual cache state of the requesting node, and the data state carried in the Snoop response not matching the cache state after WriteBackFull is completed. Therefore, when a C2C device detects that two transactions have the same cache line address based on incomplete transaction records, and that the lifecycles of the two transactions overlap, it needs to perform ordering, mutual exclusion, or merging processing on the two transactions. This situation requiring coordination is called a transaction conflict (Hazard).

[0022] See Figure 2 , Figure 2 This is a schematic diagram of a cross-chip WriteBackFull transaction processing flow in the prior art. Figure 2 The diagram illustrates the transaction interactions between Chip0 RN-F, Chip0 C2C, Chip1 C2C, and Chip1 HN-F. When Chip0 RN-F needs to write back dirty data in a cache line, it sends a WriteBackFull transaction to Chip0 C2C. Chip0 C2C allocates a data buffer and returns a completion response and a data buffer identifier merge response CompDBID to Chip0 RN-F. Upon receiving the CompDBID, Chip0 RN-F sends writeback data CopyBackWrData to Chip0 C2C based on the data buffer identifier within it. After receiving the writeback data, Chip0 C2C sends the WriteBackFull request and the writeback data to Chip1 C2C. Figure 2In this code, "WriteBackFull Req+WDat" represents a WriteBackFull request and cross-chip data transfer. After receiving the transaction, Chip1 C2C returns a completion response (Comp) to Chip0 C2C and sends a WriteBackFull transaction to Chip1 HN-F. After Chip1 HN-F returns CompDBID to Chip1 C2C, Chip1 C2C sends CopyBackWrData to Chip1 HN-F to complete the corresponding write-back process.

[0023] Depend on Figure 2 As shown in the flowchart, a cross-chip WriteBackFull transaction requires interaction between Chip0 RN-F, Chip0 C2C, Chip1 C2C, and Chip1 HN-F, involving requests, data buffer identifiers, cached line data, and completion responses. This paper refers to the transaction path where cached line data is sent from Chip0 RN-F via Chip0 C2C and Chip1 C2C to Chip1 HN-F as the writeback path, for explanation later.

[0024] See Figure 3 , Figure 3 This is a schematic diagram of a cross-chip Snoop transaction processing flow in the prior art. Figure 3 The transaction interactions between Chip0 RN-F, Chip0 C2C, Chip1 C2C, Chip1 HN-F, and Chip1 RN-F are shown. Figure 3In the illustrated process, Chip1 RN-F sends an Allocating Read transaction to Chip1 HN-F. Chip1 HN-F initiates a Snop transaction for the corresponding cache line and sends it to Chip1 C2C. Chip1 C2C forwards the Snop transaction across chips to Chip0 C2C, which then forwards it to Chip0 RN-F. Chip0 RN-F returns a SnpRespData response carrying cache line data in response to the Snop transaction. Chip0 C2C sends the received SnpRespData to Chip1 C2C, which then forwards it to Chip1 HN-F. After receiving the cache line data, Chip1 HN-F returns a CompData response carrying the data to Chip1 RN-F. The transaction path where Chip0 RN-F generates a listener response for a Snop transaction, and Chip0 C2C and Chip1 C2C send this listener response to Chip1 HN-F, is called the listener response path. For non-forwarding Snop transactions, if cached row data needs to be returned, the listened-to RN-F can return SnpRespData. If cached row data does not need to be returned, the listened-to RN-F can return SnpResp carrying the cached state but not the cached row data.

[0025] Figure 2 The write-back path and Figure 3 The listening response paths shown can all be used to transfer data for the same cache line from the Chip0 side to the Chip1 side. When two types of transactions execute on the same cache line within a similar timeframe, their processing order needs to be coordinated.

[0026] In existing technologies, conflicting transactions are typically processed serially according to their arrival order, meaning that transactions arriving later are blocked until the earlier transactions are completed. Since the transmission path for cross-chip node transactions is relatively long, this serial processing method may increase transaction waiting time and the number of cross-chip node transmissions, and cause duplicate transmissions of the same cached line data, thereby consuming C2C bandwidth, prolonging transaction processing latency, and reducing the throughput performance of the inter-chip interconnect system.

[0027] See Figure 4 , Figure 4 This is a schematic diagram of a serial processing flow for cross-chip transaction conflicts in existing technology. Wherein, Figure 4 The first sub-graph in the diagram illustrates the scenario where the WriteBackFull transaction arrives at Chip0 C2C before the Snoop transaction. Figure 4The second sub-graph illustrates the scenario where the WriteBackFull transaction arrives at Chip0 C2C later than the Snoop transaction. The yellow section represents the blocking interval when a transaction conflict occurs. In one scenario, Chip0 RN-F holds dirty data for the cache line corresponding to address A and initiates a WriteBackFull transaction to write the cache line data back to HN-F on the Chip1 side. Simultaneously, another RN-F in Chip1 accesses address A, causing Chip1 HN-F to initiate a Snoop transaction for address A. The WriteBackFull and Snoop transactions meet at Chip0 C2C and hit the same cache line address, thus creating a transaction conflict.

[0028] like Figure 4 As shown in the first sub-diagram, when the WriteBackFull transaction arrives at Chip0 C2C first, the existing processing method can continue to process the WriteBackFull transaction first, sending the WriteBackFull request and corresponding write data to Chip1 HN-F via Chip1 C2C; the Snoop transaction that arrives later is blocked, and the Snoop transaction and its response processing can continue to be executed after the WriteBackFull transaction that arrives first is completed.

[0029] like Figure 4 As shown in the second sub-diagram, when the Snoop transaction arrives at Chip0 C2C first, the existing processing method can first send the Snoop transaction to Chip0 RN-F, and send the SnpRespData returned by Chip0 RN-F to Chip1 HN-F via Chip1 C2C; the WriteBackFull transaction that arrives later is blocked, and the corresponding cross-chip writeback processing will continue to be executed after the Snoop transaction is processed.

[0030] Therefore, existing C2C proxy nodes typically process conflicting WriteBackFull and Snoop transactions serially according to the transaction reception order, that is, they process the transactions that arrive first and block the transactions that arrive later until the transactions that arrive first are completed.

[0031] Since the cached line data carried by the WriteBackFull transaction may be the same as the cached line data required by the Snoop transaction, executing the complete write-back process and the listen-response process separately may cause repeated cross-chip transmission of the same cached line data. Simultaneously, serial processing increases the waiting time for later-arriving transactions and keeps related transaction processing resources continuously occupied during conflicts, thereby increasing C2C bandwidth usage and transaction processing latency, and reducing the transaction processing efficiency of the inter-chip interconnect system.

[0032] To address the aforementioned problems in the prior art, this application provides a method, apparatus, and storage medium for handling cache consistency transaction conflicts, which solves the technical problems in the prior art that result in repeated cross-chip transmission of cache line data due to serial processing, large transaction processing latency, and high bandwidth consumption of inter-chip interconnection.

[0033] This application provides a method, apparatus, and storage medium for handling cache consistency transaction conflicts, applicable to multi-chip consistency systems based on the Coherent Hub Interface (CHI) protocol. The multi-chip consistency system includes multiple chip nodes connected via chip-to-chip (C2C) devices, where each chip node comprises a die or a chip. Request nodes and home nodes can be configured within different chip nodes. The C2C devices are used to forward cache consistency transactions and corresponding protocol responses between different chip nodes.

[0034] This application primarily addresses scenarios where write-back transactions and non-forwarding listener transactions conflict at the C2C device. A write-back transaction writes back the cached line data held by the requesting node of the first chip node to the second chip node. A listener transaction is issued by the second chip node to listen for cached lines held by the requesting node of the first chip node. When an incomplete write-back transaction and a listener transaction hit the same cached line, the two transactions constitute a transaction conflict.

[0035] The method provided in this application embodiment can be executed by a C2C device in a first chip node. The C2C device obtains transaction information for write-back transactions and listener transactions, and determines whether the two transactions hit the same cache line and their respective transaction stages. When the two transactions hit the same cache line and their transaction stages constitute a mergeable combination of transaction stages, the C2C device determines a target transmission path from the write-back path and the listener response path, transmits the cache line data to the second chip node through the target transmission path, and generates a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, thereby proxying the completion of the write-back transaction and the listener transaction. The path selection and protocol response generation process under each transaction stage combination will be described in detail in subsequent embodiments.

[0036] In some implementations, the first chip node and the second chip node can be connected via their respective C2C devices. Cross-chip write-back transactions initiated by the requesting node in the first chip node are transmitted to the second chip node via the C2C device, and cross-chip snooping transactions initiated by the second chip node are transmitted to the first chip node via the C2C device. The C2C device of the first chip node can perform conflict detection and merging processing on the two transactions. Embodiments of this application can also be applied to multi-chip consistency systems including more chip nodes, where the above processing is performed by the C2C devices between the corresponding chip nodes.

[0037] The cache consistency transaction conflict handling device provided in this application embodiment can be set in a C2C device and implemented through hardware circuits, programmable logic, firmware, or a combination of hardware and software. Multiple functional units can be integrated or set separately and cooperate to complete transaction information acquisition, conflict judgment, transaction stage judgment, target transmission path determination, and protocol response generation.

[0038] Compared to the method of serially processing write-back transactions and listener transactions according to their arrival order, this embodiment determines the target transmission path based on the cache line matching results and transaction phase combination of the two transactions. The cache line data is then transmitted to the second chip node through the target transmission path, and the transaction corresponding to the non-target transmission path is proxies and completed based on the transaction processing results of the target transmission path. This reduces repeated cross-chip transmission of the same cache line data and serial waiting for conflicting transactions, lowers C2C bandwidth usage and transaction processing latency, and improves the processing efficiency of consistent transactions in the inter-chip interconnect system.

[0039] Reference Figure 1 , Figure 1 This is a flowchart illustrating a method for handling cache consistency transaction conflicts provided in an embodiment of this application. The method can be executed by a cache consistency transaction conflict handling device, which can be located in the C2C device of a first chip node. This embodiment can be applied to multi-chip consistency scenarios using the CHI protocol, for example, scenarios where cache consistency transactions are transmitted between two or more chip nodes connected via a C2C device. The chip node includes a die or a chip. The method includes steps 101-104: Step 101: Obtain the first transaction information of the write-back transaction and the second transaction information of the listening transaction received from the second chip node.

[0040] The write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listen transaction is used to listen for the cache lines held by the requesting node.

[0041] The first and second chip nodes are different chip nodes that perform transaction transmissions via a C2C device. The first chip node includes request nodes, such as a fully-coherent request node (RN-F). Request nodes can be processor cores with cache. The second chip node can include a consistency home node responsible for managing the corresponding address range, such as a fully-coherent home node (HN-F).

[0042] Write-back transactions can be WriteBackFull transactions. When a requesting node of the first chip node needs to replace or clean up a cache line containing dirty data, the requesting node can initiate a write-back transaction to write back the corresponding cache line data to the Home node in the second chip node that manages the address of that cache line. Listening transactions can be non-forwarding listening transactions, which are sent from the second chip node to the first chip node via the C2C device. They are used to query or change the cache status of the corresponding cache line in the requesting node, and obtain the cache line data when the data return conditions are met.

[0043] The first transaction information describes the write-back transaction received or being processed by the C2C device, and may include the cache line address, transaction type, requesting node identifier, and transaction stage. The second transaction information describes the listening transaction received by the C2C device from the second chip node, and may include the cache line address, transaction type, target requesting node identifier, and transaction stage. The first and second transaction information can be recorded respectively in the request transaction table and listening transaction table maintained by the C2C device for subsequent transaction matching and transaction stage determination.

[0044] By obtaining the cache line addresses, associated nodes, and processing status of two transactions, a correspondence between write-back transactions and listening transactions can be established, providing a data basis for identifying whether the two constitute a transaction conflict.

[0045] Further optionally, the listening transaction is a non-forwarding listening transaction, which is used to cause the listening request node to return a listening response carrying the cache state but not the cache line data, or to return a listening response carrying the cache line data and the cache state.

[0046] Step 102: Based on the first transaction information and the second transaction information, determine whether the write-back transaction and the listener transaction hit the same cache line, and determine the transaction stage of the write-back transaction and the listener transaction respectively.

[0047] C2C devices can match the cache line address and request node identifier of a write-back transaction with the cache line address and target request node identifier of a listening transaction. If the cache line addresses are the same and the request node identifier matches the target request node identifier, it indicates that the cache line being processed by the write-back transaction is the same as the cache line that the listening transaction needs to listen to, and it can be determined that the two transactions hit the same cache line.

[0048] In one implementation, the C2C device maintains a request transaction table and a listener transaction table, respectively. When a write-back transaction enters the request transaction table, the C2C device matches it with incomplete listener transactions in the listener transaction table. When a listener transaction enters the listener transaction table, the C2C device matches it with incomplete write-back transactions in the request transaction table. Therefore, regardless of which transaction arrives first, it is possible to detect whether the two transactions hit the same cache line.

[0049] After determining that two transactions hit the same cache line, the C2C device further determines the transaction stage of each transaction. For write-back transactions, the sending status can be used to determine whether the write-back transaction is in the first transaction stage, which has not yet been sent to the second chip node through the write-back path, or in the second transaction stage, which has been sent to the second chip node through the write-back path but has not yet been completed. For listen transactions, the response status can be used to determine whether the listen transaction is in the third transaction stage, which has been received from the second chip node but has not yet returned a listen response to the second chip node.

[0050] C2C devices can also determine the receiving order of two transactions based on the timing of the write-back transaction and the listener transaction being written into the request transaction table and listener transaction table, respectively. The transaction phase and the receiving order together reflect whether the cached line data has been transmitted across chips when the conflict occurs, whether the listener response has been returned, and which transaction entered the processing flow first, providing a basis for subsequent judgment on whether the two transactions can be merged.

[0051] If two transactions do not hit the same cache line, they can be executed according to their respective transaction processing flow. If two transactions hit the same cache line, but their transaction stages do not meet the merging condition, they can be processed serially according to the transaction reception order to ensure transaction processing order and cache consistency.

[0052] Step 103: If the write-back transaction and the listen transaction hit the same cache line, and the transaction stages of the write-back transaction and the listen transaction constitute a mergeable transaction stage combination, then the target transmission path corresponding to the second chip node is determined from the write-back path corresponding to the write-back transaction and the listen response path corresponding to the listen transaction based on the transaction stage combination.

[0053] Among them, the combinable transaction phase combination refers to the current processing phase and reception order of the write-back transaction and the listen transaction, which allows one of the transaction paths to be reused to transmit buffered line data, and enables the C2C device to proxies the protocol processing of another transaction. The C2C device can pre-set the correspondence between different transaction phase combinations and target transmission paths.

[0054] The write-back path is the transaction path through which a write-back transaction sends cached line data from the first chip node to the second chip node. The listen response path is the transaction path through which the first chip node generates a listen response for a listen transaction and returns the listen response to the second chip node. The target transmission path is the path selected based on the current transaction phase combination for transmitting the corresponding cached line data to the second chip node; another path not used to repeatedly transmit this cached line data is a non-target transmission path.

[0055] For example, when a write-back transaction arrives at the C2C device first, and the write-back transaction and cached line data have not yet been sent to the second chip node via the write-back path, the listener response path can be determined as the target transmission path. The C2C device receives the cached line data sent by the requesting node for the write-back transaction and uses this cached line data to generate a listener response, causing the cached line data to be sent to the second chip node via the listener response path, without being sent repeatedly via the write-back path.

[0056] For example, when a write-back transaction arrives first, and the write-back transaction has been sent to the second chip node through the write-back path but has not yet been completed, the write-back path can be determined as the target transmission path. At this time, the cached line data is already in the process of cross-chip transmission or has already arrived at the second chip node, and there is no need to retransmit the cached line data through the listen response path.

[0057] For example, when a listener transaction arrives first and a write-back transaction arrives later, the listener response path can be determined as the target transmission path. After the requesting node returns a listener response carrying cached line data for the listener transaction, the C2C device sends the cached line data to the second chip node through the listener response path and stops the write-back transaction that arrives later from repeatedly sending the same cached line data.

[0058] Therefore, step 103 determines the target transmission path based on the actual transmission status of the cached line data when the conflict occurs, so that the target transmission path matches the processing progress of the two transactions, avoiding repeated transmission through another path when the cached line data has already been transmitted through one path or can meet the processing needs of the two transactions through one path.

[0059] Step 104: Transmit the cache line data to the second chip node through the target transmission path, and generate a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, so as to proxies the completion of the write-back transaction and the listening transaction.

[0060] The C2C device processes cached line data according to the target transmission path determined in step 103, and processes transactions corresponding to non-target transmission paths based on the data generated by the target transmission path, the cache status, or the completion response. The transaction processing result may include cached line data obtained or sent through the target transmission path, the cache status of the cached lines, and the transaction completion response returned by the target transmission path.

[0061] When the listen response path is the target transmission path, the C2C device can generate a listen response using the cached line data sent by the requesting node for the write-back transaction, and send this listen response to the second chip node. This listen response can determine whether it carries cached line data and the cache state it represents, based on the listen type, the returned source field, and the cache state. Since the cached line data has already been transmitted through the listen response path, the C2C device no longer retransmits the write-back transaction and its cached line data to the second chip node through the write-back path, and completes the protocol processing such as data buffer identification and completion response required for the write-back transaction on the first chip node side.

[0062] When the write-back path is the target transmission path, the C2C device can determine that the cached line data has been transmitted to the second chip node via the write-back path after receiving the completion response returned by the second chip node for the write-back transaction. Since the corresponding cached line in the requesting node has been changed to an invalid state with the write-back transaction, the C2C device can generate a listen response indicating an invalid state without carrying cached line data, and send the listen response to the second chip node, without having to send the listen transaction to the requesting node of the first chip node again.

[0063] In this context, the proxy's completion of write-back and listen-back transactions refers to the C2C device, even when transmitting cached line data only through the target transmission path, still returning the required responses to the initiators of the corresponding write-back and listen-back transactions according to their respective protocol requirements, thus completing both transactions. The target transmission path handles the actual cross-chip transmission of cached line data, while transactions corresponding to non-target transmission paths utilize the processing results of the target transmission path to complete the protocol loop.

[0064] In this embodiment, the C2C device first identifies whether two transactions hit the same cache line based on the transaction information of the write-back transaction and the listen transaction. Then, it determines whether the two transactions can be merged based on their processing stage and receiving order. If they can be merged, the C2C device selects either the write-back path or the listen response path as the target transmission path based on the current transmission status of the cache line data, and uses the processing result of the target transmission path to generate the protocol response required for the other transaction. Thus, while maintaining the protocol processing relationship between the write-back transaction and the listen transaction, the same cache line data can be transmitted to the second chip node only through the corresponding target transmission path, reducing the repeated cross-chip transmission of cache line data in the write-back path and the listen response path.

[0065] Compared to the method of serially processing conflicting transactions according to their arrival order, the embodiments of this application can shorten the waiting time of later-arriving transactions, reduce the serial waiting between write-back transactions and listener transactions, and reduce the C2C bandwidth occupied by repeated transmission of cache line data. Simultaneously, the C2C device selects the corresponding target transmission path based on the transaction stage combination, which can adapt to different conflict scenarios such as before the write-back transaction has been sent, after the write-back transaction has been sent, and before the listener transaction arrives, thereby improving the applicability of cache consistency transaction conflict handling and the transaction processing efficiency of the inter-chip interconnect system.

[0066] In the above or following embodiments, the first transaction information includes the cache line address, transaction type, request node identifier, and transaction stage of the write-back transaction, and the second transaction information includes the cache line address, transaction type, target request node identifier, and transaction stage of the listener transaction. The cache line address identifies the cache line accessed by the write-back transaction or the listener transaction; the transaction type distinguishes between write-back transactions, listener transactions, and other cache consistency transactions; the request node identifier identifies the request node initiating the write-back transaction; and the target request node identifier identifies the request node targeted by the listener transaction. The transaction stage indicates the current processing status of the corresponding transaction, for example, whether the write-back transaction has been sent to the second chip node, or whether the listener transaction has returned a listener response.

[0067] Based on this, in step 102, determining whether the write-back transaction and the listening transaction hit the same cache line according to the first transaction information and the second transaction information includes: recording the cache line address and request node identifier of the write-back transaction in the request transaction table; recording the cache line address and target request node identifier of the listening transaction in the listening transaction table; matching the write-back transactions entering the request transaction table with the incomplete listening transactions in the listening transaction table, and / or matching the listening transactions entering the listening transaction table with the incomplete write-back transactions in the request transaction table; if the cache line address of the write-back transaction is the same as the cache line address of the listening transaction, and the request node identifier matches the target request node identifier, then it is determined that the write-back transaction and the listening transaction hit the same cache line.

[0068] Specifically, in step 102, based on the first transaction information and the second transaction information, it is determined whether the write-back transaction and the listening transaction hit the same cache line, including the following processing steps: First, the cache line address and request node identifier of the write-back transaction are recorded in the request transaction table, and the cache line address and target request node identifier of the listener transaction are recorded in the listener transaction table. The request transaction table records write-back transactions that the C2C device has not yet completed, and the listener transaction table records listener transactions that the C2C device has not yet completed. In addition to the cache line address and node identifier, the request transaction table and the listener transaction table can also record the transaction type and transaction stage of the corresponding transaction for subsequent transaction type identification and transaction stage combination judgment.

[0069] Furthermore, the write-back transactions entering the request transaction table are matched with the incomplete listener transactions in the listener transaction table, and / or, the listener transactions entering the listener transaction table are matched with the incomplete write-back transactions in the request transaction table. In other words, when the C2C device receives a new write-back transaction, it can use the cache line address and request node identifier of the write-back transaction as matching information to query whether a corresponding incomplete listener transaction exists in the listener transaction table. When the C2C device receives a new listener transaction from the second chip node, it can use the cache line address and target request node identifier of the listener transaction as matching information to query whether a corresponding incomplete write-back transaction exists in the request transaction table. Therefore, regardless of which transaction, write-back or listener, is received first, the two transactions can be matched.

[0070] If the cache line address of the write-back transaction is the same as the cache line address of the listening transaction, and the request node identifier matches the target request node identifier, then the write-back transaction and the listening transaction are determined to have hit the same cache line. Here, the same cache line address indicates that both transactions access the same cache line, and matching node identifiers indicates that the request node targeted by the listening transaction is the same request node that initiated the write-back transaction. By simultaneously matching the cache line address and the node identifier, transactions that access the same cache line but are associated with different request nodes can be avoided from being incorrectly identified as transactions to be merged.

[0071] For example, the requesting node RN-F0 in the first chip node holds the cache line data corresponding to address A and initiates a write-back transaction for address A. After receiving this write-back transaction, the C2C device records address A, the write-back transaction type, the node identifier of RN-F0, and the current transaction stage in the request transaction table. Subsequently, the C2C device receives a listening transaction from the second chip node for both address A and RN-F0, and records address A, the listening transaction type, the target requesting node identifier of RN-F0, and the current transaction stage in the listening transaction table. Since the cache line address for both transactions is address A, and the requesting node identifier of the write-back transaction and the target requesting node identifier of the listening transaction both correspond to RN-F0, it can be determined that the write-back transaction and the listening transaction hit the same cache line. The addresses A and RN-F0 are only used to illustrate the transaction matching process and do not constitute a limitation on the cache line address and the requesting node.

[0072] By recording incomplete write-back transactions and listener transactions in a request transaction table and a listener transaction table respectively, and matching any transaction entering the corresponding transaction table with incomplete transactions in the other transaction table, write-back transactions and listener transactions targeting the same cache line and the same request node under different receiving orders can be identified in a timely manner. This process provides an accurate transaction association basis for subsequently determining the combination of mergeable transaction stages and the target transmission path based on the transaction stages of two transactions, reducing the impact of transaction association errors on cache consistency processing.

[0073] As an optional embodiment, step 102, determining the transaction stage of the write-back transaction and the listening transaction, includes: determining, based on the sending status of the write-back transaction recorded in the request transaction table, that the write-back transaction is in a first transaction stage where it has not yet been sent to the second chip node through the write-back path, or in a second transaction stage where it has been sent to the second chip node through the write-back path but has not yet been completed; and determining, based on the response status of the listening transaction recorded in the listening transaction table, that the listening transaction is in a third transaction stage where it has received a listening response from the second chip node but has not yet returned a listening response to the second chip node.

[0074] The request outstanding transaction table records the cached line address, transaction type, request node identifier, and transaction stage of the write-back transaction. It updates the write-back transaction's sending status based on the processing status, including request sending, cached line data reception, cached line data transmission, and response reception. The snoop outstanding transaction table records the snoop outstanding transaction's cached line address, transaction type, target request node identifier, and transaction stage. It updates the snoop outstanding transaction's response status based on the snoop outstanding transaction's reception, transmission to the request node, and response reception and return.

[0075] In some embodiments, the request transaction table and the listener transaction table are incomplete transaction record structures maintained by the inter-chip interconnect device (ICD), used to record write-back transactions and listener transactions that have entered the ICD but have not yet been processed. The request transaction table records incomplete write-back transactions, and the listener transaction table records incomplete listener transactions. The transaction tables can be hardware transaction tracking structures within the ICD device, and are not limited to two-dimensional tables in a software sense.

[0076] Each request transaction entry in the request transaction table can correspond to an incomplete write-back transaction. A request transaction entry may include a validity identifier, cached line address, transaction type, request node identifier, and transaction stage. It may also include a data buffer identifier for completing the write-back transaction, a transaction identifier, and a sending status. The validity identifier indicates whether the corresponding entry has stored valid write-back transaction information; the cached line address identifies the cached line accessed by the write-back transaction; the transaction type identifies whether the transaction is a WriteBackFull transaction or another supported write-back transaction; the request node identifier identifies the request node that initiated the write-back transaction; and the transaction stage or sending status indicates whether the write-back transaction has not yet been sent through the write-back path, or has been sent through the write-back path but has not yet been completed.

[0077] Each entry in the listener transaction table corresponds to an incomplete listener transaction. A listener transaction entry may include a valid identifier, cache line address, transaction type, target request node identifier, and transaction stage. It may also include a listener type, return source field, transaction identifier, and response status. The target request node identifier identifies the request node to which the listener transaction is targeted; the listener type and return source field are used to determine whether the listener response carries cache line data and the cache state represented by the listener response; the response status indicates whether the listener transaction has been sent to the target request node, whether a listener response has been received, and whether a listener response has been returned to the second chip node.

[0078] In practical applications, the request transaction table and the listener transaction table can respectively adopt register arrays, static random access memory, content-addressable memory, or an associative lookup structure composed of memory arrays and comparator circuits. In practical applications, the specific implementation form can be determined based on the number of incomplete transactions supported by the inter-chip interconnect device, address width, number of nodes, lookup latency, and hardware area.

[0079] For example, when the number of incomplete transactions is small and conflict detection is required to be completed in a single cycle, the request transaction table and the listener transaction table can be configured as register arrays. Each entry is configured with a corresponding address comparator and node identifier comparator. When a new transaction enters, its cached line address and node identifier can be compared in parallel with each valid entry in the other transaction table. This approach facilitates the rapid determination of whether there are incomplete transactions that hit the same cached line and request node.

[0080] For example, request and listener transaction tables can utilize content-addressable memory (CNTM). Cache line addresses and node identifiers can serve as lookup keys, with CNTM outputting the location of matching entries and a valid match signal. For cases with a large number of entries, static random access memory (SRAM) can be used in conjunction with indexes or hash values ​​for initial location, followed by comparison of the complete cache line addresses and node identifiers of candidate entries.

[0081] The request transaction table and the listener transaction table can also be implemented using different entry types from a unified transaction table. For example, a transaction category field can be set in each entry of the unified transaction table to distinguish between write-back transactions and listener transactions, and correlation matching can be performed based on the transaction category, cached line address, and node identifier. As long as incomplete write-back transactions and listener transactions can be recorded and identified separately, and matching between the two can be supported, the request transaction table and the listener transaction table in this application embodiment can be implemented.

[0082] Optionally, the inter-chip interconnect device can establish a request transaction table and a listener transaction table during initialization or reset. Establishing the transaction table may involve configuring a preset number of entries for each type of transaction and initializing the validity flag of each entry to an invalid state. The number of entries in the transaction table can be determined based on the number of incomplete write-back transactions and incomplete listener transactions that the inter-chip interconnect device is allowed to process simultaneously.

[0083] For example, a request transaction table can have multiple request transaction entries, each tracking an incomplete write-back transaction; a listener transaction table can have multiple listener transaction entries, each tracking an incomplete listener transaction. When an inter-chip interconnect device receives a new transaction, it selects a free entry in the corresponding transaction table whose valid flag is currently invalid, writes the transaction information to the selected entry, and updates the valid flag to a valid state.

[0084] Free entries can be selected according to a fixed priority, polling order, free entry number, or free entry indicator vector. This application does not limit the specific allocation method of free entries.

[0085] Optionally, when the inter-chip interconnect device receives a write-back transaction from the requesting node of the first chip node, it can allocate a request transaction entry from the request transaction table and extract transaction information from the request Flit of the write-back transaction. The inter-chip interconnect device can write the cache line address, transaction type, requesting node identifier, and transaction identifier into the allocated request transaction entry and initialize the transaction stage of the entry to the first transaction stage. The cache line address can be obtained by removing the cache line offset from the transaction address. For example, when the cache line size is a preset number of bytes, the address bits other than the cache line offset in the transaction address can be used as the cache line address to obtain the same matching result for transactions at different byte positions within the same cache line.

[0086] Optionally, the transaction phase of a write-back transaction can be dynamically updated during the transaction processing. For example, if the inter-chip interconnect device has received the write-back transaction but has not yet sent it to the second chip node through the write-back path, the sending status is recorded as not sent, and the transaction phase is recorded as the first transaction phase; after the inter-chip interconnect device has sent the write-back transaction through the write-back path, the sending status is updated to sent, and the transaction phase is updated to the second transaction phase; after the inter-chip interconnect device receives the corresponding completion response, or completes the write-back transaction through the merge processing agent, the valid identifier of the corresponding request transaction entry is updated to invalid to release the entry.

[0087] When the data buffer identifier, cache line data reception status, or completion response status of a write-back transaction need to be used for subsequent processing, the corresponding information can also be recorded in the request transaction table entry or in the data buffer structure associated with the request transaction table entry.

[0088] Optionally, when the inter-chip interconnect device receives a listening transaction from the second chip node, it can allocate a listening transaction entry from the listening transaction table and extract information such as the cache line address, listening type, target request node identifier, return source field, and transaction identifier from the listening request Flit. The extracted information is then written into the allocated listening transaction entry. When a listening transaction is received but has not yet returned a listening response to the second chip node, the response status of the listening transaction can be recorded as a pending response status, and the transaction stage can be recorded as the third transaction stage. As the listening transaction processing progresses, the response status can further record whether the listening transaction has been sent to the target request node, whether a listening response has been received from the target request node, and whether the listening response has been sent to the second chip node.

[0089] Once the inter-chip interconnect device has returned a listen response to the second chip node, or has completed the listen transaction through the merge processing agent, the valid flag of the corresponding listen transaction entry can be updated to invalid, thereby releasing the entry.

[0090] Optionally, when allocating and writing request transaction entries, the inter-chip interconnect device can use the cache line address of the write-back transaction and the request node identifier as matching keys to match each valid entry in the listening transaction table. When allocating and writing listening transaction entries, the inter-chip interconnect device can use the cache line address of the listening transaction and the target request node identifier as matching keys to match each valid entry in the request transaction table. When the cache line addresses are the same and the request node identifier matches the target request node identifier, a conflict hit result can be output, and the matching request transaction entry number and listening transaction entry number can be recorded for subsequent reading of the transaction stage, sending status, response status, and receiving order of the two transactions. If multiple matching entries exist simultaneously, the corresponding entry can be selected according to the transaction record sequence or preset priority, and the order preservation processing can continue to be performed on other matching transactions.

[0091] For example, the requesting node RN-F0 of the first chip node initiates a WriteBackFull transaction for cache line address A. The inter-chip interconnect device can allocate an entry R0 in the request transaction table and record address A, WriteBackFull transaction type, RN-F0 node identifier, and unsent status in entry R0. Subsequently, the inter-chip interconnect device receives a Snoop transaction for address A and RN-F0 from the second chip node, allocates an entry S0 in the listen transaction table, and records address A, Snoop transaction type, RN-F0 target requesting node identifier, and pending response status. Since the cache line address of entry R0 and entry S0 is the same, and the requesting node identifier matches, the inter-chip interconnect device can determine that the two transactions hit the same cache line and further read the transaction stages in entries R0 and S0 to determine the corresponding transaction stage combination.

[0092] Through the aforementioned transaction table and entry update mechanism, inter-chip interconnect devices can continuously track the processing status of write-back transactions and listener transactions from receipt to completion, and query another type of incomplete transaction when any transaction enters. Therefore, regardless of the order in which write-back and listener transactions arrive, transaction conflicts accessing the same cache line and associated with the same request node can be identified in a timely manner. Simultaneously, readable status information is provided for subsequent transaction phase combination judgments, target transmission path selection, and protocol response generation.

[0093] In the above optional embodiments, the first transaction phase indicates that the C2C device has received the write-back transaction, but has not yet sent it to the second chip node via the write-back path. During this phase, the cache line data corresponding to the write-back transaction has not yet been transmitted across chips along the write-back path. For example, if a requesting node in the first chip node initiates a WriteBackFull transaction to the C2C device, and the C2C device has recorded this transaction in its request transaction table, but has not yet sent the WriteBackFull request and its cache line data to the second chip node, then it can be determined that the write-back transaction is in the first transaction phase. At this time, if the C2C device receives a listen transaction for the same cache line and the same requesting node, it can still generate a listen response using the cache line data corresponding to the write-back transaction.

[0094] The second transaction phase indicates that the C2C device has sent the write-back transaction to the second chip node via the write-back path, but has not yet received a completion response for the write-back transaction. This phase may include situations where the cached line data of the write-back transaction is being transmitted across chips or has already arrived at the second chip node. For example, if the C2C device has sent a WriteBackFull request to the second chip node, and the corresponding write data is in the process of being transmitted across chips or has already arrived at the second chip node, but has not yet received a completion response from the second chip node, then it can be determined that the write-back transaction is in the second transaction phase. At this time, the cached line data has already been transmitted along the write-back path, and it is no longer appropriate to cancel the cross-chip transmission of this data.

[0095] The third transaction phase indicates that the C2C device has received the listen transaction from the second chip node, but has not yet returned the corresponding listen response to the second chip node. This phase can include situations where the C2C device has not yet sent the listen transaction to the requesting node of the first chip node, or has sent the listen transaction but has not yet returned the listen response. For example, if the Home node of the second chip node initiates a Snop transaction for a target cache line, and the C2C device of the first chip node has received the Snop transaction but has not yet returned SnpResp or SnpRespData to the second chip node, then it can be determined that the listen transaction is in the third transaction phase.

[0096] Furthermore, the C2C device can determine the receiving order of two transactions based on the record sequence of the write-back transaction and the listener transaction in the request transaction table and the listener transaction table. Then, by combining the first or second transaction stage of the write-back transaction and the third transaction stage of the listener transaction, it can determine the corresponding transaction stage combination. For example, if the write-back transaction is in the first transaction stage and is received before the listener transaction, it forms a transaction stage combination indicating that the write-back transaction has not yet been sent across the chip; if the write-back transaction is in the second transaction stage and is received before the listener transaction, it forms a transaction stage combination indicating that the write-back transaction has already been sent across the chip; if the listener transaction is received before the write-back transaction in the first transaction stage, it forms a transaction stage combination indicating that the listener transaction arrived first. Different transaction stage combinations can be used to subsequently determine the target transmission path and the corresponding transaction processing method.

[0097] By recording and updating the sending and response statuses of transactions in the request transaction table and the listener transaction table, it can be determined whether cached line data has been transmitted across chips along the write-back path when a conflict occurs, and whether the listener transaction is still in a waiting-for-response state. Combining the receiving order of the two transactions allows for differentiation between scenarios such as the write-back transaction not yet sent, the write-back transaction already sent, and the listener transaction arriving first. This provides a basis for subsequent judgments on whether transaction phase combinations can be merged and for selecting either the write-back path or the listener response path, avoiding erroneous handling of transactions unsuitable for merging and ensuring the correctness of cache consistency transaction processing.

[0098] Subsequently, in the above optional embodiment, after determining the transaction stage of the write-back transaction and the listening transaction in step 102, the method further includes: determining the receiving order of the write-back transaction and the listening transaction based on the record sequence of the write-back transaction and the listening transaction in the request transaction table and the listening transaction table; obtaining the transaction stage combination of the write-back transaction and the listening transaction based on the transaction stage of the write-back transaction, the transaction stage of the listening transaction, and the receiving order, and determining whether the transaction stage combination is a preset mergeable transaction stage combination; if the transaction stage combination is not the preset mergeable transaction stage combination, then the write-back transaction and the listening transaction are processed serially according to the receiving order.

[0099] The timing record indicates the order in which write-back transactions and listener transactions are received and recorded by the C2C device. When allocating request transaction entries or listener transaction entries, the C2C device can record the timestamp, sequence number, entry allocation order, or first-arrival identifier for the corresponding transaction. For matching request transaction entries and listener transaction entries, the C2C device compares the corresponding record information to determine whether the write-back transaction was received before the listener transaction, or vice versa.

[0100] For example, a C2C device can maintain an incrementing transaction sequence number. Upon receiving each write-back transaction or listener transaction, the C2C device writes the current transaction sequence number to the corresponding transaction table entry and updates the transaction sequence number. If the transaction sequence number in the request transaction table entry is less than the transaction sequence number in its matching listener transaction table entry, it can be determined that the write-back transaction was received first. Conversely, it can be determined that the listener transaction was received first. In practical applications, the specific recording format of the receiving order is not limited, as long as the order of the two transactions can be determined.

[0101] Transaction phase combinations are used to collectively describe the sending status of the write-back transaction, the response status of the listener transaction, and the receiving order of the two transactions when a transaction conflict occurs. Simply determining that two transactions hit the same cache line is insufficient to determine which path the cache line data should be transmitted via. It is also necessary to determine, based on the transaction phase combination, whether the cache line data has already been sent via the write-back path, whether the listener transaction is still in a pending response state, and which transaction entered the processing flow first. C2C devices can pre-establish the correspondence between transaction phase combinations and processing strategies, and set transaction phase combinations that meet the merging processing conditions as mergingable transaction phase combinations.

[0102] In this embodiment of the application, the preset combination of mergeable transaction phases includes at least one of the following: The first combinatorial transaction phase combination is as follows: the write-back transaction is in the first transaction phase, the listener transaction is in the third transaction phase, and the write-back transaction is received before the listener transaction. This combination indicates that the C2C device has received the write-back transaction but has not yet sent the write-back transaction and its cache line data to the second chip node through the write-back path. At this time, it receives a listener transaction for the same cache line and the same requesting node. Since the cache line data has not yet been transmitted across chips along the write-back path, the C2C device can use the cache line data sent by the requesting node for the write-back transaction to generate a listener response and transmit the cache line data to the second chip node through the listener response path.

[0103] For example, the requesting node RN-F0 of the first chip node initiates a WriteBackFull transaction for cache line address A. The C2C device receives this transaction and records it in the request transaction table, but has not yet sent the WriteBackFull transaction to the second chip node. Subsequently, the C2C device receives a Snoop transaction from the second chip node for cache line address A and RN-F0. At this point, the WriteBackFull transaction is in the first transaction phase, the Snoop transaction is in the third transaction phase, and the WriteBackFull transaction is received first, thus forming the first mergeable transaction phase combination.

[0104] The second combinatorial transaction phase combination is as follows: the write-back transaction is in the second transaction phase, the listener transaction is in the third transaction phase, and the write-back transaction is sent before the listener transaction is received. This combination indicates that the C2C device has sent the write-back transaction to the second chip node via the write-back path, the cache line data is being transmitted across chips or has already arrived at the second chip node, but the write-back transaction has not yet been completed. At this time, the C2C device receives a listener transaction for the same cache line. Since the cache line data has already been transmitted along the write-back path, the C2C device can continue to use the write-back path as the transmission path for the cache line data, and generate the protocol response required for the listener transaction after receiving the write-back transaction completion response.

[0105] For example, the C2C device has sent a WriteBackFull transaction initiated by RN-F0 for cache line address A to the second chip node, but has not yet received the corresponding completion response. Subsequently, the C2C device receives a Snoop transaction for address A and RN-F0. At this point, the WriteBackFull transaction is in the second transaction phase, the Snoop transaction is in the third transaction phase, and the WriteBackFull transaction was received first, thus forming a second mergeable transaction phase combination.

[0106] The third mergeable transaction phase combination is as follows: the write-back transaction is in the first transaction phase, the listener transaction is in the third transaction phase, and the listener transaction is received before the write-back transaction. This combination means that the C2C device first receives the listener transaction for the target cache line, and before returning the listener response to the second chip node, it receives the write-back transaction for the same cache line from the requesting node of the first chip node. At this time, the cache line data can be returned to the second chip node first through the listener response path, and then the write-back transaction handshake on the requesting node side can be completed, and the repeated sending of the same cache line data through the write-back path can be stopped.

[0107] For example, the C2C device first receives a Snoop transaction for cache line address A and RN-F0 from the second chip node and records it in the listen transaction table. Before returning a corresponding listen response to the second chip node, the C2C device receives a WriteBackFull transaction for address A from RN-F0 and records it in the request transaction table. At this point, the WriteBackFull transaction is in the first transaction phase, and the Snoop transaction is in the third transaction phase. Since the Snoop transaction was received first, it constitutes a third mergeable transaction phase combination.

[0108] It should be noted that the first, second, and third transaction stages are used to characterize the current processing status of a transaction. The combination of the first, second, and third mergeable transaction stages is further formed by combining the receiving order of the two transactions. The stage numbers and combination numbers mentioned above are only used to distinguish different states and processing scenarios, and do not indicate processing priority, nor do they constitute an additional restriction on the execution order of transactions.

[0109] If the transaction phase combination does not belong to the preset mergeable transaction phase combination, the C2C device processes the two transactions serially according to the order in which they are received. Specifically, the transaction received first can be processed first, while the transaction received later is blocked; the transaction received later is processed only after the transaction received first completes or releases its corresponding cache line. For example, if a write-back transaction or a listening transaction has entered a processing phase that cannot be canceled, converted, or proxied, then merging processing can be avoided, and a normal serial processing method can be used to maintain the transaction processing order and the correctness of the protocol processing.

[0110] By combining the sending status of the write-back transaction, the response status of the listener transaction, and the receiving order of the two transactions, the C2C device can distinguish between different conflict scenarios, such as the write-back transaction not yet being sent across chips, the write-back transaction already being sent across chips, and the listener transaction arriving first. For preset combinations of mergeable transaction stages, a target transmission path adapted to the current data transmission status can be further selected. For transaction stage combinations that do not meet the merging conditions, serial processing is used. This avoids merging two transactions solely based on identical cache line addresses, reducing the risk of protocol response errors due to mismatched transaction stages, and providing a basis for reducing repeated cross-chip transmission of cache line data in the future.

[0111] For example, the preset mergeable transaction phase combination includes a first mergeable transaction phase combination, wherein the write-back transaction is in the first transaction phase, the listener transaction is in the third transaction phase, and the write-back transaction is received before the listener transaction.

[0112] Specifically, the first mergeable transaction phase corresponds to the C2C device of the first chip node having received the write-back transaction initiated by the requesting node, but not yet sending the write-back transaction and its cached line data to the second chip node. At this time, it receives a listen transaction from the second chip node for the same cached line and the same requesting node. Since the listen transaction has not yet returned a listen response, and the cached line data corresponding to the write-back transaction has not yet been transmitted across chips through the write-back path, the C2C device can still adjust the subsequent processing paths of the two transactions.

[0113] For example, the first chip node is Chip0, and the second chip node is Chip1. The requesting node RN-F in Chip0 holds the cache line data corresponding to address A and initiates a WriteBackFull transaction for address A to Chip0's C2C device. Chip0's C2C device has received the WriteBackFull transaction but has not yet sent the WriteBackFull request and its cache line data to Chip1. Subsequently, Chip0's C2C device receives a Snoop transaction for address A and the RN-F from Chip1 but has not yet returned a corresponding listen response to Chip1. At this point, the WriteBackFull transaction is in the first transaction phase, the Snoop transaction is in the third transaction phase, and the WriteBackFull transaction was received before the Snoop transaction; therefore, it can be determined that the two transactions constitute a first mergeable transaction phase combination.

[0114] By combining these transaction phases, it can be determined that when a conflict occurs, the cached line data of the write-back transaction has not yet been transmitted across chips along the write-back path, and the listening transaction is still in the phase where a listening response can be generated, thus providing a processing basis for generating a listening response for reusing the cached line data corresponding to the write-back transaction.

[0115] In the above example, when the write-back transaction and the listening transaction are in the first mergeable transaction phase combination, step 103, determining the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction according to the transaction phase combination, includes: determining the listening response path as the target transmission path and determining the write-back path as the non-target transmission path.

[0116] Specifically, the write-back path is the transaction path through which the C2C device sends the write-back transaction and its cached line data to the second chip node, and the listen response path is the transaction path through which the C2C device returns the listen response generated for the listen transaction to the second chip node. In the first mergeable transaction phase combination, the write-back transaction and its cached line data have not yet been sent along the write-back path, while the listen transaction is still waiting for the C2C device to return a listen response. Therefore, the C2C device stops sending the listen transaction to the requesting node of the first chip node. After receiving and collecting the cached line data returned by the requesting node for the write-back transaction, it converts the cached line data into a listen response corresponding to the listen transaction and returns it to the second chip node through the listen response path.

[0117] Continuing with Chip0 and Chip1 as examples, the C2C device on Chip0 no longer sends Snoop transactions to the RN-F in Chip0, and determines the listener response path used to return the Snoop response as the target transmission path. When the Snoop transaction requests data, the cached line data can be sent to Chip1 along with the listener response via this target transmission path; when the Snoop transaction does not request data, the C2C device can return the corresponding cached state via this target transmission path. The write-back path is correspondingly determined as a non-target transmission path, and the cached line data is no longer transmitted repeatedly. That is, the C2C device on Chip0 cancels sending WriteBackFull requests and their CopyBackWrData to Chip1, and no longer performs cross-chip transmission of the WriteBackFull transaction.

[0118] By selecting a listener response path before cached line data has been sent along the writeback path, cross-chip processing of WriteBackFull transactions can be avoided, thereby reducing unnecessary cross-chip transmissions.

[0119] In the above example, when the write-back transaction and the listener transaction are combined in the first mergeable transaction phase, in step 104, the cache line data is transmitted to the second chip node through the target transmission path, and a protocol response for the transaction corresponding to the non-target transmission path is generated based on the transaction processing result of the target transmission path to proxies the completion of the write-back transaction and the listener transaction, including: Stop sending the listening transaction to the requesting node of the first chip node, and receive the cache line data sent by the requesting node for the write-back transaction; convert the cache line data into a listening response corresponding to the listening transaction; send the listening response to the second chip node through the listening response path, proxies the completion of the listening transaction, and stop sending the write-back transaction and the cache line data to the second chip node through the write-back path, so as to stop the cross-chip transmission of the write-back transaction.

[0120] Specifically, after detecting the first mergeable transaction phase combination, the C2C device stops sending the listening transaction received from the second chip node to the requesting node of the first chip node, and waits for the requesting node to send the cache line data according to the data transmission process of the write-back transaction. After the C2C device receives the cache line data, it converts the cache line data into a corresponding listening response according to the data return requirements of the listening transaction and the cache status corresponding to the cache line data.

[0121] For example, after detecting that the WriteBackFull transaction and the Snoop transaction constitute a first mergeable transaction phase combination, the C2C device in Chip0 stops sending the Snoop transaction to the RN-F in Chip0. The RN-F sends writeback data to the C2C device in Chip0 according to the data buffer identifier of the WriteBackFull transaction. After receiving the writeback data, the C2C device in Chip0 converts the writeback data into a response to the Snoop transaction (such as SnpResp or SnpRespData) and sends the converted listener response to the C2C device in Chip1. Since the writeback data has already been used to complete the response processing of the Snoop transaction, the C2C device in Chip0 cancels sending the WriteBackFull request and writeback data to Chip1, and there is no need to execute the cross-chip WriteBackFull transaction again.

[0122] When the listen response needs to carry cached line data, the C2C device converts the cached line data corresponding to the write-back transaction into a listen response carrying that cached line data and the corresponding cache status, allowing the cached line data to be sent to the second chip node through the listen response path. When the listen response does not need to carry cached line data, the C2C device generates a listen response without data based on the listen type and cache status. The C2C device also completes the completion response and data buffer flag processing required for the write-back transaction on the first chip node side, enabling the requesting node to complete the data transmission process of the write-back transaction. Thus, the write-back transaction is proxied and completed on the first chip node side without performing cross-chip transmission, while the listen transaction is completed by generating and returning a listen response.

[0123] The above implementation directly uses the cache line data corresponding to the write-back transaction to meet the data or status return requirements of the listening transaction, so that the write-back transaction and the listening transaction share the same cache line data processing process. There is no need to send the listening transaction to the request node again, nor is there a need to send the WriteBackFull request and its write-back data to the second chip node, thereby reducing intra-chip listening access and cross-chip write-back transmission, and shortening the processing flow of the two transactions.

[0124] Further optionally, the step of converting the cache line data into a listener response corresponding to the listener transaction includes: obtaining the listener type and return source field of the listener transaction, and obtaining the cache state corresponding to the cache line data; determining whether the listener response carries the cache line data and the cache state represented by the listener response based on the listener type, the return source field, and the cache state; if it is determined that the listener response carries the cache line data, generating a listener response carrying the cache line data based on the cache line data and the cache state; if it is determined that the listener response does not carry the cache line data, generating a listener response not carrying the cache line data based on the cache state.

[0125] Specifically, the listener type indicates the processing performed on the target cache line by the listener transaction, such as invalidating the target cache line or requesting the return of the target cache line data. The return source field can be the Return-to-Source field, i.e., the RetToSrc field, which indicates whether the listened party needs to return cache line data to the Home node. The cache state indicates the consistency state corresponding to the cache line data sent by the requesting node, such as a unique dirty state, a unique clean state, or a shared clean state. The C2C device combines the listener type, the RetToSrc field, and the cache state to determine whether to generate a listener response SnpRespData carrying data or a listener response SnpResp without data.

[0126] For example, when the Snop transaction is of type SnpMakeInvalid, the C2C device can generate SnpResp_I representing an invalid state without carrying cached line data. When the cached line data corresponds to a unique dirty state and carries a dirty data delivery status, the C2C device can convert the cached line data into SnpRespData_I_PD to return the cached line data and indicate the delivery of dirty data through the PassDirty status. When the RetToSrc field is 1, and the cached line data corresponds to a unique clean state or a shared clean state, the C2C device can convert the cached line data into SnpRespData_I to return the cached line data to the second chip node and indicate that the corresponding cached line in the requesting node has become invalid. When the above data return conditions are not met, the C2C device can generate SnpResp_I based on the cache state corresponding to the cached line data.

[0127] Through the above transformation, the C2C device can generate a matching listening response based on the actual data return requirements of the listening transaction and the cached status of the write-back data. It can directly use the cached line data carried by the WriteBackFull transaction in the Snoop response when needed, or only return the corresponding cached status when no data is needed, thereby avoiding unnecessary data transmission and ensuring that the data and status in the listening response match the current transaction processing situation.

[0128] Optionally, receiving the cache line data sent by the requesting node for the write-back transaction includes: determining whether a completion response and a data buffer identifier merging response have been sent to the requesting node; if the completion response and data buffer identifier merging response have not been sent to the requesting node, then sending the completion response and data buffer identifier merging response to the requesting node, and receiving the cache line data sent by the requesting node according to the data buffer identifier; if the completion response and data buffer identifier merging response have been sent to the requesting node, then waiting to receive the cache line data sent by the requesting node according to the data buffer identifier.

[0129] Specifically, the completion response and the data buffer identifier combined response can be a CompDBID. The CompDBID includes transaction completion information and a data buffer identifier allocated for the write-back data. After receiving the CompDBID, the requesting node of the first chip node sends the cached line data corresponding to the write-back transaction to the C2C device according to the data buffer identifier therein.

[0130] When the first mergeable transaction phase is formed, the C2C device can query the response sending status recorded in the request transaction table to determine whether the CompDBID has been sent to the requesting node. If the CompDBID has not been sent, the C2C device first sends the CompDBID to the requesting node, enabling the requesting node to send cached line data based on the DBID. If the CompDBID has already been sent, there is no need to send it again; the C2C device waits for and receives the cached line data subsequently returned by the requesting node. The C2C device can associate the cached line data with the write-back transaction in the request transaction table based on the DBID carried by the cached line data, and after waiting to receive and collect the corresponding cached line data, it converts the cached line data into a listen response corresponding to the listen transaction.

[0131] For example, if Chip0's C2C device detects the first mergeable transaction phase combination before returning the CompDBID to RN-F, it first resends the CompDBID and then receives the CopyBackWrData sent by RN-F. If it has already returned the CompDBID to RN-F before detecting the transaction phase combination, it directly waits for the CopyBackWrData. After all the write data is received, Chip0's C2C device converts the CopyBackWrData into the corresponding Snoop response according to the Snoop transaction's response requirements and returns the Snoop response to Chip1. Simultaneously, it cancels sending the WriteBackFull request and CopyBackWrData to Chip1, and no longer executes the cross-chip transmission of the WriteBackFull transaction.

[0132] The above implementation selects to resend or wait for processing based on the actual sending status of CompDBID, ensuring that the first mergeable transaction phase combination can continue to acquire cached line data for generating the listen response, regardless of whether it is formed before or after the CompDBID sending. Simultaneously, it avoids retransmitting CompDBID and maintains the continuity of the write-back transaction data handshake process on the requesting node's side, enabling the C2C device to collect the write-back data, convert it into a Snoop transaction response, and proxies the completion of both transactions without executing a cross-chip WriteBackFull transaction.

[0133] In another example, the preset mergeable transaction phase combination includes a second mergeable transaction phase combination, wherein the write-back transaction is in the second transaction phase, the listen transaction is in the third transaction phase, and the write-back transaction is sent before the listen transaction is received.

[0134] Specifically, the second mergeable transaction phase corresponds to the C2C device at the first chip node having received the write-back transaction and sent it to the second chip node via the write-back path, but not yet completing the write-back transaction. At this point, it receives a listen transaction from the second chip node for the same cache line and the same requesting node. The cache line data corresponding to the write-back transaction may be in the process of cross-chip transmission or may have already arrived at the second chip node. The listen transaction is in the phase where it has been received by the C2C device but has not yet returned a listen response.

[0135] For example, the first chip node is Chip0, and the second chip node is Chip1. The requesting node RN-F in Chip0 initiates a WriteBackFull transaction for address A. Chip0's C2C device receives this WriteBackFull transaction first and has already sent the WriteBackFull request to Chip1's C2C device. The corresponding cached line data is either in the process of cross-chip transmission or has already arrived at Chip1, but Chip0's C2C device has not yet received the completion response from Chip1. Subsequently, Chip0's C2C device receives a Snoop transaction from Chip1 for address A and the RN-F, but has not yet returned the corresponding listen response to Chip1. At this point, the WriteBackFull transaction is in the second transaction phase, and the Snoop transaction is in the third transaction phase. Since the WriteBackFull transaction was received before the Snoop transaction, it can be determined that the two constitute a second mergeable transaction phase combination.

[0136] In this transaction phase combination, the cached line data has already entered the write-back path and cannot be canceled or reused locally by the local C2C device via another path. Therefore, subsequent processing can continue to utilize the write-back path to complete the cached line data transmission and generate the protocol response required for the listening transaction based on the processing result of the write-back transaction, without having to send the Snoop transaction to the requesting node of the first chip node again.

[0137] Based on the above example, when the write-back transaction and the listening transaction are in the second mergeable transaction phase combination, in step 103, the target transmission path corresponding to the second chip node is determined from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction according to the transaction phase combination, including: determining the write-back path as the target transmission path and determining the listening response path as a non-target transmission path.

[0138] Specifically, the write-back path already carries the WriteBackFull transaction and its cached line data, which is being transmitted across chips along this path or has already reached the second chip node. Therefore, the C2C device retains the original data transmission process of the write-back transaction, determines the write-back path as the target transmission path, and allows the cached line data to continue to be transmitted to the second chip node through this path.

[0139] The listener response path is designated as a non-target transmission path, meaning that the same cached line data will no longer be repeatedly transmitted through this path. The C2C device still needs to return a listener response to the second chip node through the listener response path, but this listener response may only carry the cached state and not the cached line data. In other words, the non-target transmission path is still used to complete the protocol response transmission for the listener transaction, but it no longer undertakes the cross-chip transmission of the cached line data.

[0140] For example, Chip0's C2C device has already sent the WriteBackFull request and cached line data corresponding to address A to Chip1, and therefore continues to deliver this data to Chip1 via the writeback path. Meanwhile, Chip0's C2C device no longer sends the Snoop transaction for address A to RN-F, nor does it repeatedly return the same cached line data via the Snoop response. Instead, after confirming the completion of the WriteBackFull transaction, it returns a response without cached line data via the listener response path.

[0141] By selecting the target transmission path based on the actual status of the cached line data that has entered the write-back path, it is possible to avoid interrupting the write-back process that has already begun, and also to avoid repeatedly transmitting the same cached line data through the listen response path, thereby reducing redundant data transmission and unnecessary request node access.

[0142] Based on the above example, in step 104, transmitting the cache line data to the second chip node through the target transmission path, and generating a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path to proxies the completion of the write-back transaction and the listening transaction, includes: stopping the sending of the listening transaction to the requesting node of the first chip node, and receiving a completion response returned by the second chip node for the write-back transaction; determining, based on the completion response, that the cache line data has been sent to the second chip node through the write-back path; generating a listening response based on the completion response indicating that the corresponding cache behavior in the requesting node is invalid and does not carry the cache line data, and sending the listening response to the second chip node to proxies the completion of the listening transaction.

[0143] Specifically, since the WriteBackFull transaction has already invalidated the corresponding cached line in the requesting node, and the cached line data has already been transmitted along the write-back path, the C2C device no longer needs to send the Snoop transaction to the requesting node of the first chip node. The C2C device continues to wait for the second chip node to return a completion response for the WriteBackFull transaction. This completion response can be a transaction completion response (Comp), indicating that the second chip node has received and processed the write-back transaction.

[0144] For example, after Chip0's C2C device receives the Comp response from Chip1's C2C device for the WriteBackFull transaction, it can determine that the cache line data corresponding to address A has been transmitted to Chip1 via the write-back path. Since RN-F in Chip0 has already invalidated the cache line corresponding to address A with the WriteBackFull transaction, Chip0's C2C device directly generates a listener response indicating the invalid state without carrying cache line data, such as SnpResp_I, and sends this listener response to Chip1's C2C device. Thus, the WriteBackFull transaction is completed via the original write-back path, while the Snoop transaction is completed by Chip0's C2C device returning a status response on its behalf.

[0145] Here, generating a listening response based on the completion response means using the write-back transaction processing result represented by the completion response as the basis for generating the listening response. After confirming that the cache line data has been transmitted through the write-back path and that the corresponding cache line in the requesting node is invalid, the C2C device generates an invalid state response that does not carry cache line data. The completion response itself does not need to be converted into the data content of the listening response.

[0146] The above optional implementation allows WriteBackFull transactions that have already begun transmission to continue completing without canceling or resending cached line data. It also generates a Snoop response through the C2C device proxy, avoiding resending the Snoop transaction to the requesting node and repeatedly returning cached line data via the listener response path. This reduces one requesting node listener operation and corresponding data transmission, shortens the Snoop transaction processing path, and reduces the bandwidth consumption of conflicting transactions on C2C and subsequent transaction processing.

[0147] In the third example, the preset mergeable transaction phase combination includes a third mergeable transaction phase combination, wherein the write-back transaction is in the first transaction phase, the listener transaction is in the third transaction phase, and the listener transaction is received before the write-back transaction.

[0148] Specifically, the third mergeable transaction phase combination corresponds to the C2C device of the first chip node first receiving a listen transaction from the second chip node, and before returning a listen response to the second chip node, receiving a write-back transaction for the same cache line from the requesting node of the first chip node. Since the write-back transaction has not yet been sent to the second chip node through the write-back path, the write-back transaction is in the first transaction phase. The listen transaction has been received but has not yet returned a listen response; therefore, the listen transaction is in the third transaction phase.

[0149] For example, the first chip node is Chip0, and the second chip node is Chip1. Chip0's C2C device first receives a Snoop transaction from Chip1 for address A and the requesting node RN-F in Chip0, and records this Snoop transaction in the listen transaction table. Before returning a corresponding listen response to Chip1, Chip0's C2C device receives a WriteBackFull transaction for address A from the same RN-F, and records this WriteBackFull transaction in the request transaction table. Since the two transactions hit the same cache line and the same requesting node, the Snoop transaction is received before the WriteBackFull transaction, and the WriteBackFull transaction has not yet been sent to Chip1 through the write-back path. Therefore, it can be determined that the two transactions constitute a third mergeable transaction phase combination.

[0150] In this transaction phase combination, the Snoop transaction has already entered the processing flow. The C2C device can continue to obtain the cached line data held by the requesting node through the Snoop transaction and send the cached line data to the second chip node via the listen response path. The data to be written back by the subsequent WriteBackFull transaction is the same cached line data as the data returned by the Snoop transaction. Therefore, the cross-chip transmission of the WriteBackFull transaction can be stopped after the listen response is completed, avoiding the same cached line data from being transmitted again through the write-back path.

[0151] Based on the above example, when the write-back transaction and the listening transaction are in the third mergeable transaction phase combination, in step 103, determining the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction according to the transaction phase combination includes: determining the listening response path as the target transmission path and determining the write-back path as the non-target transmission path.

[0152] Specifically, since the listening transaction is received first and a listening response has not yet been returned to the second chip node, the C2C device can continue to send the listening transaction to the requesting node of the first chip node and obtain the cached line data through the listening response. Therefore, the listening response path is determined as the target transmission path, so that the cached line data is sent to the second chip node along with the listening response.

[0153] The writeback path is determined to be a non-target transmission path, meaning that the later-arriving WriteBackFull transaction and its cached line data will no longer be sent to the second chip node through this path. The C2C device still needs to complete the data buffer identifier sending and cached line data reception required for the WriteBackFull transaction on the first chip node side to complete the writeback transaction processing on the requesting node side, but will no longer resend the received cached line data through the writeback path.

[0154] For example, Chip0's C2C device sends a Snoop transaction for address A to RN-F and sends the SnpRespData returned by RN-F to Chip1 via the listen response path. Since the cache line data for address A has already reached Chip1 via SnpRespData, subsequent WriteBackFull cache line data received from RN-F will no longer be sent to Chip1 via the writeback path.

[0155] By reusing the listener response path that has already entered the processing flow, Snoop transactions can be avoided, and cached line data can be transferred across chips only through the listener response path. At the same time, the write-back path no longer carries the same data repeatedly, thereby reducing the number of cross-chip data transfers and C2C bandwidth usage.

[0156] Based on the above example, in step 104, transmitting the cache line data to the second chip node through the target transmission path, and generating a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path to proxy the completion of the write-back transaction and the listening transaction, includes: sending the listening transaction to the requesting node of the first chip node, receiving the listening response carrying the cache line data returned by the requesting node, and sending the listening response to the second chip node through the listening response path; after the listening response is sent to the second chip node, sending a data buffer identifier to the requesting node, and receiving the cache line data sent by the requesting node for the write-back transaction; and stopping the transmission of the write-back transaction and the cache line data to the second chip node through the write-back path based on the fact that the cache line data has been sent to the second chip node through the listening response path, so as to proxy the completion of the write-back transaction.

[0157] Specifically, the C2C device first sends the Snoop transaction to the requesting node of the first chip node according to the Snoop transaction processing flow. The requesting node processes the corresponding cache line according to the Snoop transaction and returns a snoop response carrying the cache line data to the C2C device. After receiving the snoop response, the C2C device sends it to the second chip node through the snoop response path, so that the cache line data reaches the second chip node through the Snoop path.

[0158] Taking Chip0 and Chip1 as an example, Chip0's C2C device sends a Snop transaction for address A to the RN-F, receives the SnpRespData returned by the RN-F, and then sends the SnpRespData to Chip1's C2C device. Thus, the cache line data corresponding to address A has been sent to Chip1 through the listen response path, and the Snop transaction response processing is complete.

[0159] Subsequently, the C2C device on Chip0 processes the arriving WriteBackFull transaction, sends the data buffer identifier DBID to the RN-F, and receives the write-back data (CopyBackWrData) sent by the RN-F based on the DBID. Since the same cache line data has already been sent to Chip1 via SnpRespData, the C2C device no longer sends the WriteBackFull transaction and CopyBackWrData to Chip1, but instead terminates the subsequent cross-chip processing of the WriteBackFull transaction. Here, receiving CopyBackWrData is used to complete the WriteBackFull data handshake initiated on the RN-F side, and this data is no longer transmitted repeatedly through the write-back path.

[0160] In one alternative implementation, the C2C device may process the sending of the data buffer identifier and the reception of cached line data for the WriteBackFull transaction only after receiving the listen response from the requesting node, thus maintaining the order of completing the Snoop response first and then processing the WriteBackFull transaction. The C2C device may update the request transaction entry corresponding to the WriteBackFull transaction to indicate that it has been proxied and release the corresponding transaction entry.

[0161] It should be noted that this implementation example uses the requesting node returning a listener response carrying cached line data for the Snoop transaction. That is, the Snoop path has already delivered the cached line data that the WriteBackFull transaction would normally write back to the second chip node, thus subsequent write-back data constitutes redundant data. For cases where the listener response does not carry cached line data, whether the cross-chip transmission of the WriteBackFull transaction and its cached line data can be stopped should be determined separately based on whether the second chip node has already obtained the cached line data and the corresponding protocol processing requirements; the data reuse processing in this example is not directly applicable.

[0162] The above implementation first sends the cached line data to the second chip node via the listener response path, then completes the data handshake for the WriteBackFull transaction on the first chip node and stops its cross-chip transmission, allowing the Snoop transaction and the WriteBackFull transaction to share the cached line data already transmitted via the listener response path. This avoids the same cached line data from being subsequently transmitted across chips via the writeback path, reducing redundant data handling and C2C bandwidth consumption, and preventing unnecessary cross-chip writeback processes after the Snoop transaction is completed.

[0163] See Figure 6 , Figure 6 This is a schematic diagram of a cache consistency transaction conflict merging process provided in an embodiment of this application. Figure 6 This diagram illustrates two processing flows under the first mergeable transaction phase combination: one where the completion response and data buffer identifier merge response CompDBID have been sent, and another where they have not yet been sent. In this diagram, the first chip node is Chip0, the second chip node is Chip1, Chip0 RN-F is the requesting node in the first chip node, Chip0 C2C and Chip1 C2C are the C2C devices in the two chip nodes respectively, Chip1 HN-F is the home node in the second chip node, and Chip1 RN-F is the requesting node in the second chip node.

[0164] Figure 6 The first sub-diagram illustrates the scenario where the Snoop transaction arrives at Chip0 C2C, and Chip0 C2C has already returned a CompDBID to Chip0 RN-F. Chip0 RN-F first sends a WriteBackFull transaction to Chip0 C2C. After receiving the WriteBackFull transaction, Chip0 C2C returns a CompDBID to Chip0 RN-F. Simultaneously, Chip1 RN-F sends an Allocating Read transaction to Chip1 HN-F, thereby initiating a Snoop transaction, which is then sent to Chip0 C2C via Chip1 C2C.

[0165] When Chip0 C2C determines that the WriteBackFull transaction and the Snoop transaction hit the same cache line, and the WriteBackFull transaction has not yet been sent to Chip1 C2C, it determines that the two transactions are in the first mergeable transaction phase. Chip0 C2C no longer sends the Snoop transaction to Chip0 RN-F, but waits for Chip0 RN-F to send CopyBackWrData based on the already received CompDBID. After receiving CopyBackWrData, Chip0 C2C merges it with the Snoop transaction, generating a corresponding Snoop response based on the Snoop transaction's listener type, the returned source fields, and the cache state corresponding to CopyBackWrData. Figure 6 The first sub-diagram in the diagram takes the generation of SnpRespData carrying cached line data as an example. The generated SnpRespData is sent from Chip1 C2C to Chip1 HN-F, and Chip1 HN-F returns CompData to Chip1 RN-F accordingly. During the above process, Chip0 C2C no longer sends the original WriteBackFull transaction and its CopyBackWrData to Chip1 C2C. Therefore, the cached line data carried by CopyBackWrData is used to generate SnpRespData and is sent to Chip1 through the listener response path, enabling the write-back transaction and the listener transaction to share the cross-chip transmission process of this cached line data.

[0166] Figure 6 The second sub-diagram illustrates the scenario where the Snoop transaction arrives at Chip0 C2C before Chip0 C2C has returned a CompDBID to Chip0RN-F. Chip0 RN-F first sends a WriteBackFull transaction to Chip0 C2C, and the Snoop transaction initiated by Chip1 HN-F subsequently arrives at Chip0 C2C via Chip1 C2C. At this point, the WriteBackFull transaction has not yet been sent to Chip1 via the write-back path, and the Snoop transaction has not yet returned a listener response; therefore, both transactions are in the first mergeable transaction phase combination.

[0167] In this scenario, since Chip0 RN-F has not yet obtained the data buffer identifier for sending write-back data, Chip0 C2C first resends CompDBID to Chip0 RN-F. After receiving CompDBID, Chip0 RN-F sends CopyBackWrData to Chip0 C2C based on the data buffer identifier within it. Upon receiving CopyBackWrData, Chip0 C2C performs merging processing according to the data return requirements of the Snoop transaction and converts CopyBackWrData into the corresponding Snoop response. Figure 6 The second subgraph in the diagram also takes the generation of SnpRespData as an example. SnpRespData is sent to Chip1 HN-F via Chip1 C2C, and then Chip1 HN-F returns CompData to Chip1 RN-F.

[0168] Figure 6 The two subgraphs in the diagram correspond to the scenarios where CompDBID has been sent and CompDBID has not yet been sent when the merge process is triggered. If CompDBID has been sent, Chip0 C2C waits for Chip0 RN-F to return CopyBackWrData. If CompDBID has not yet been sent, Chip0 C2C first resends the CompDBID, and then receives the CopyBackWrData returned by Chip0 RN-F. In both scenarios, Chip0 C2C no longer sends the Snoop transaction to Chip0 RN-F, nor does it send the WriteBackFull transaction and its cached line data to Chip1 through the writeback path. Instead, it generates a Snoop response using the cached line data corresponding to the writeback transaction and sends the corresponding data or status to Chip1 through the listener response path.

[0169] It should be noted that, Figure 6 Taking the scenario where a Snop response carries cached line data as an example, Chip0 C2C can also generate a SnpResp without cached line data when it is determined, based on the Snop transaction's listener type, the RetToSrc field, and the cache state, that cached line data does not need to be returned. For example, for the SnpMakeInvalid type, SnpResp_I can be generated. For cached line data with a unique dirty state and carrying the dirty data delivery status, SnpRespData_I_PD can be generated. For cached line data with the RetToSrc field being 1 and the cache state being a unique clean state or a shared clean state, SnpRespData_I can be generated. SnpResp_I can be generated in other scenarios where data does not need to be returned. Figure 6The SnpRespData shown is only used to illustrate a specific response format and does not constitute a limitation on the Snoop response type.

[0170] pass Figure 6 As shown in the processing method, regardless of whether the CompDBID has been sent when the Snoop transaction arrives, Chip0 C2C can obtain the cached line data corresponding to the WriteBackFull transaction and use this cached line data to complete the Snoop response. This eliminates the need for repeated sending of the Snoop transaction to the Chip0 RN-F and the cross-chip write-back of the WriteBackFull transaction and cached line data. It prevents the same cached line data from being repeatedly transmitted through the write-back path and the listener response path, reducing the number of cross-chip accesses and C2C bandwidth usage, and shortening the processing time of the WriteBackFull and Snoop transactions.

[0171] The above describes a method for handling cache consistency transaction conflicts in the embodiments of this application. The following describes the apparatus for handling cache consistency transaction conflicts that executes the above method.

[0172] See Figure 7 ,like Figure 7 The diagram shows a structural schematic of a cache consistency transaction conflict handling device. The cache consistency transaction conflict handling device in this embodiment can achieve the above-described... Figure 5 The steps of the cache consistency transaction conflict handling method executed in the corresponding embodiment are described below. The function implemented by the cache consistency transaction conflict handling device can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware. The cache consistency transaction conflict handling device may include an input / output module 701 and a processing module 702. The functional implementation of the processing module 702 and the input / output module 701 can be found in [reference]. Figure 5 The operations performed in the corresponding embodiments will not be described in detail here. For example, the processing module 702 can be used to control the sending, receiving, and acquiring operations of the input / output module 701.

[0173] The input / output module 701 is configured to acquire first transaction information of a write-back transaction and second transaction information of a listener transaction received from a second chip node, wherein the write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listener transaction is used to listen to the cache line held by the requesting node. The processing module 702 is configured to determine, based on the first transaction information and the second transaction information, whether the write-back transaction and the listening transaction hit the same cache line, and to determine the transaction stage of each of the write-back transaction and the listening transaction; if the write-back transaction and the listening transaction hit the same cache line, and the transaction stages of the write-back transaction and the listening transaction constitute a mergeable transaction stage combination, then, based on the transaction stage combination, determine the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction; transmit the cache line data to the second chip node through the target transmission path, and generate a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, so as to proxies the completion of the write-back transaction and the listening transaction.

[0174] In some implementations, the preset mergeable transaction phase combination includes a second mergeable transaction phase combination. The second mergeable transaction phase combination is as follows: the write-back transaction is in the second transaction phase, the listener transaction is in the third transaction phase, and the write-back transaction is sent before the listener transaction is received. The processing module 702 is further configured to determine the write-back path as the target transmission path and the listener response path as the non-target transmission path; control the input / output module 701 to stop sending the listener transaction to the requesting node of the first chip node and receive a completion response returned by the second chip node for the write-back transaction; determine, based on the completion response, that the cache line data has been sent to the second chip node through the write-back path, generate a listener response indicating that the corresponding cache behavior in the requesting node is invalid and does not carry cache line data, and send the listener response to the second chip node to proxies the completion of the listener transaction.

[0175] In some implementations, the preset mergeable transaction phase combination includes a third mergeable transaction phase combination. The third mergeable transaction phase combination is as follows: the write-back transaction is in the first transaction phase, the listener transaction is in the third transaction phase, and the listener transaction is received before the write-back transaction. The processing module 702 is further configured to determine the listener response path as the target transmission path and the write-back path as the non-target transmission path; the control input / output module 701 sends the listener transaction to the requesting node of the first chip node, receives the listener response carrying cache line data returned by the requesting node, and sends the listener response to the second chip node through the listener response path; after the listener response is sent, it sends a data buffer identifier to the requesting node and receives the cache line data sent by the requesting node for the write-back transaction; based on the fact that the cache line data has been sent to the second chip node through the listener response path, it stops repeatedly sending the write-back transaction and the cache line data through the write-back path to proxies the completion of the write-back transaction.

[0176] In this embodiment, the aforementioned device determines the combinatorial combination of transaction stages based on the matching results of cache lines for write-back and listen-back transactions, the transaction stages, and the receiving order. Accordingly, it selects either a write-back path or a listen-back response path to transmit cache line data. Under the control of the processing module 702, the input / output module 701 completes the transmission and reception of cache line data and corresponding protocol responses via the target transmission path. This allows the same cache line data to be transmitted through a path adapted to the current transaction processing state, and the transaction processing result of that path to proxies the completion of another transaction. This reduces redundant cross-chip transmission of cache line data and serial waiting for conflicting transactions, lowering the bandwidth usage of inter-chip interconnects and transaction processing latency.

[0177] The cache consistency transaction conflict handling device 70 in this application embodiment has been described above from the perspective of modular functional entities. The cache consistency transaction conflict handling device in this application embodiment will be described below from the perspective of hardware processing.

[0178] It should be noted that, Figure 7 The physical device corresponding to the input / output module 701 shown can be a transceiver, radio frequency circuit, communication module, and input / output (I / O) interface, etc., and the physical device corresponding to the processing module 702 can be a processor.

[0179] Figure 7 The devices shown can all have the following characteristics: Figure 8 The structure shown, when Figure 7 The cache consistency transaction conflict handling device 70 shown has, as Figure 8 When the structure shown is used, Figure 8The processor and transceiver in the device can perform the same or similar functions as the processing module 702 and input / output module 701 provided in the aforementioned device embodiments. Figure 8 The computer program that the memory storage processor needs to call when executing the above-mentioned cache consistency transaction conflict handling method.

[0180] This application also relates to a chip system including at least one processor and an interface circuit. The processor includes a plurality of vector storage units. The processor is used to perform instruction and / or data interaction through the interface circuit, causing the chip system to perform the methods of any of the above embodiments.

[0181] In one possible implementation, the chip system may also directly include a memory in which computer programs or computer instructions are stored.

[0182] For example, the memory can be volatile memory or non-volatile memory, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM).

[0183] This application also relates to a processor, which includes a plurality of storage units for calling computer programs or computer instructions stored in the memory to cause the processor to execute the methods described in any of the above embodiments.

[0184] For example, in the embodiments of this application, the processor is an integrated circuit chip with signal processing capabilities. For instance, the processor may be an FPGA, a general-purpose processor, a DSP, an ASIC, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, a SoC, a CPU, a network processor (NP), a microcontroller unit (MCU), a PLD, or other integrated chips, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. In one possible implementation, the embodiments of this application also provide a computer-readable storage medium storing program code, which, when executed on the computer, causes the computer to perform the above-described method embodiments.

[0185] This application provides a server; please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing application programs 1142 or data 1144. The memory 1132 and storage media 1130 can be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations in the storage media 1130 on the server 1100.

[0186] Server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0187] The steps performed by the server in the above embodiments can be based on this Figure 9 The structure of server 1100 is shown. For example, in the above embodiment, it consists of... Figure 9 The steps performed by the cache consistency transaction conflict handling device shown can be based on this Figure 9The server structure is shown. For example, the central processing unit 1122 performs the following operations by calling instructions from memory 1132: The first transaction information of the write-back transaction and the second transaction information of the listen transaction received from the second chip node are obtained through the input / output interface 1158. The write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listen transaction is used to listen to the cache line held by the requesting node. The central processing unit 1122 determines, based on the first transaction information and the second transaction information, whether the write-back transaction and the listening transaction hit the same cache line, and determines the transaction stage of each transaction. If the write-back transaction and the listening transaction hit the same cache line, and the transaction stages of the write-back transaction and the listening transaction constitute a mergeable transaction stage combination, then the target transmission path corresponding to the second chip node is determined from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction based on the transaction stage combination. The cache line data is transmitted to the second chip node through the target transmission path, and a protocol response for the transaction corresponding to the non-target transmission path is generated based on the transaction processing result of the target transmission path to proxies the completion of the write-back transaction and the listening transaction.

[0188] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0189] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0190] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, apparatuses, or modules, and may be electrical, mechanical, or other forms.

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

[0192] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0193] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0194] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0195] The technical solutions provided in the embodiments of this application have been described in detail above. Specific examples have been used in the embodiments of this application to illustrate the principles and implementation methods of the embodiments of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of this application. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.

Claims

1. A method for handling cache consistency transaction conflicts, characterized in that, The method includes: The first transaction information of the write-back transaction and the second transaction information of the listen transaction received from the second chip node are obtained. The write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listen transaction is used to listen to the cache line held by the requesting node. Based on the first transaction information and the second transaction information, determine whether the write-back transaction and the listener transaction hit the same cache line, and determine the transaction stage of each of the write-back transaction and the listener transaction; If the write-back transaction and the listen transaction hit the same cache line, and the transaction stages in which the write-back transaction and the listen transaction are located constitute a mergeable transaction stage combination, then the target transmission path corresponding to the second chip node is determined from the write-back path corresponding to the write-back transaction and the listen response path corresponding to the listen transaction based on the transaction stage combination. The cache line data is transmitted to the second chip node through the target transmission path, and a protocol response for the transaction corresponding to the non-target transmission path is generated based on the transaction processing result of the target transmission path, so as to proxies the completion of the write-back transaction and the listen transaction.

2. The method according to claim 1, characterized in that, The first transaction information includes the cache line address, transaction type, request node identifier, and transaction stage of the write-back transaction; the second transaction information includes the cache line address, transaction type, target request node identifier, and transaction stage of the listener transaction. The step of determining whether the write-back transaction and the listener transaction hit the same cache line based on the first transaction information and the second transaction information includes: Record the cache line address and request node identifier of the write-back transaction in the request transaction table; Record the cache line address and target request node identifier of the listening transaction in the listening transaction table; The write-back transactions entering the request transaction table are matched with the incomplete listen transactions in the listen transaction table, and / or the listen transactions entering the listen transaction table are matched with the incomplete write-back transactions in the request transaction table; If the cache line address of the write-back transaction is the same as the cache line address of the listener transaction, and the request node identifier matches the target request node identifier, then it is determined that the write-back transaction and the listener transaction hit the same cache line.

3. The method according to claim 2, characterized in that, The determination of the transaction phase of the write-back transaction and the listening transaction includes: Based on the sending status of the write-back transaction recorded in the request transaction table, it is determined that the write-back transaction is in the first transaction stage, which has not yet been sent to the second chip node through the write-back path, or in the second transaction stage, which has been sent to the second chip node through the write-back path but has not yet been completed. Based on the response status of the listening transaction recorded in the listening transaction table, it is determined that the listening transaction is in the third transaction stage, which is that it has received a listening response from the second chip node but has not yet returned a listening response to the second chip node. After determining the respective transaction stages of the write-back transaction and the listening transaction, the method further includes: The receiving order of the write-back transaction and the listen-up transaction is determined based on the record sequence of the write-back transaction and the listen-up transaction in the request transaction table and the listen-up transaction table; Based on the transaction stage of the write-back transaction, the transaction stage of the listening transaction, and the receiving order, obtain the transaction stage combination of the write-back transaction and the listening transaction, and determine whether the transaction stage combination is a preset mergeable transaction stage combination. If the transaction phase combination is not the preset mergeable transaction phase combination, then the write-back transaction and the listen transaction are processed serially according to the receiving order.

4. The method according to claim 1, characterized in that, The write-back transaction and the listening transaction are combined in a first mergeable transaction phase, wherein the write-back transaction is in a first transaction phase, the listening transaction is in a third transaction phase, and the write-back transaction is received before the listening transaction. The transmission of the cache line data to the second chip node via the target transmission path includes: Stop sending the listening transaction to the requesting node of the first chip node, and receive the cache line data sent by the requesting node for the write-back transaction; Convert the cached line data into a listener response corresponding to the listener transaction; The listen response is sent to the second chip node through the listen response path, the listen transaction is completed by proxy, and the sending of the write-back transaction and the cache line data to the second chip node through the write-back path is stopped, so as to stop the cross-chip transmission of the write-back transaction.

5. The method according to claim 4, characterized in that, The step of converting the cached line data into a listener response corresponding to the listener transaction includes: Obtain the listening type and return source field of the listening transaction, and obtain the cache status corresponding to the cache line data; Based on the listening type, the returned source field, and the cache status, determine whether the listening response carries the cache line data and the cache status represented by the listening response; If it is determined that the listening response carries the cache line data, a listening response carrying the cache line data is generated based on the cache line data and the cache state; If it is determined that the listening response does not carry the cache line data, a listening response without carrying the cache line data is generated based on the cache state.

6. The method according to claim 5, characterized in that, Determining the listener response based on the listener type, the returned source field, and the cache state includes at least one of the following: In the case that the monitored transaction is of the cache line invalidation type, the monitored response is determined to be a monitored response that indicates an invalid state and does not carry the cache line data; When the cache line data corresponds to a unique dirty state and carries the dirty data delivery state, the listening response is determined to be a listening response carrying the cache line data, the invalid state, and the dirty data delivery state; If the returned source field indicates that the cache line data needs to be returned, and the cache line data corresponds to a unique clean state or a shared clean state, then the listening response is determined to be a listening response carrying the cache line data and an invalid state. If the aforementioned conditions are not met, the listening response will be determined as a listening response indicating an invalid state and not carrying the cache line data.

7. The method according to claim 3, characterized in that, The preset mergeable transaction phase combination includes a second mergeable transaction phase combination, wherein the write-back transaction is in the second transaction phase, the listen transaction is in the third transaction phase, and the sending time of the write-back transaction is earlier than the receiving time of the listen transaction. When the write-back transaction and the listener transaction are in the second mergeable transaction phase combination, determining the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listener response path corresponding to the listener transaction based on the transaction phase combination includes: The write-back path is determined as the target transmission path, and the listening response path is determined as a non-target transmission path; The process of transmitting the cache line data to the second chip node through the target transmission path, and generating a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, to proxies the completion of the write-back transaction and the listen transaction, includes: Stop sending the listening transaction to the requesting node of the first chip node, and receive the completion response returned by the second chip node for the write-back transaction; Based on the completion response, it is determined that the cache line data has been sent to the second chip node through the write-back path; Based on the completion response, a listener response is generated indicating that the corresponding cache behavior in the requesting node is invalid and does not carry the cache line data. The listener response is then sent to the second chip node to proxies the completion of the listener transaction.

8. The method according to claim 3, characterized in that, The preset mergeable transaction phase combination includes a third mergeable transaction phase combination, wherein the write-back transaction is in the first transaction phase, the listener transaction is in the third transaction phase, and the listener transaction is received before the write-back transaction. When the write-back transaction and the listener transaction are in the third mergeable transaction phase combination, determining the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listener response path corresponding to the listener transaction based on the transaction phase combination includes: The listening response path is determined as the target transmission path, and the write-back path is determined as the non-target transmission path; The process of transmitting the cache line data to the second chip node through the target transmission path, and generating a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, to proxies the completion of the write-back transaction and the listen transaction, includes: Send the listening transaction to the requesting node of the first chip node, receive the listening response carrying the cache line data returned by the requesting node, and send the listening response to the second chip node through the listening response path; After the listening response is sent to the second chip node, a data buffer identifier is sent to the requesting node, and the cache line data sent by the requesting node for the write-back transaction is received; Since the cache line data has been sent to the second chip node through the listen response path, the sending of the write-back transaction and the cache line data to the second chip node through the write-back path is stopped, so that the write-back transaction is completed by proxy.

9. A device for handling cache consistency transaction conflicts, characterized in that, The device includes: The input / output module is configured to acquire first transaction information of a write-back transaction and second transaction information of a listener transaction received from a second chip node, wherein the write-back transaction is used to write back the cache line data held by the requesting node of the first chip node to the second chip node, and the listener transaction is used to listen to the cache line held by the requesting node. The processing module is configured to determine, based on the first transaction information and the second transaction information, whether the write-back transaction and the listening transaction hit the same cache line, and to determine the transaction stage of each of the write-back transaction and the listening transaction; if the write-back transaction and the listening transaction hit the same cache line, and the transaction stages of the write-back transaction and the listening transaction constitute a mergeable transaction stage combination, then, based on the transaction stage combination, determine the target transmission path corresponding to the second chip node from the write-back path corresponding to the write-back transaction and the listening response path corresponding to the listening transaction; transmit the cache line data to the second chip node through the target transmission path, and generate a protocol response for the transaction corresponding to the non-target transmission path based on the transaction processing result of the target transmission path, so as to proxies the completion of the write-back transaction and the listening transaction.

10. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a computer, cause the computer to perform a method for handling cache consistency transaction conflicts as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Coherency control with writeback ordering

    CN102541465A

  • Data processing method for cache and related elements, equipment and system

    CN109840216A