Protocol conversion method and device, equipment, program product and readable storage medium
By judging the packet conditions in the central processor, stopping unnecessary transmissive actions, and using the data of the second type of packet as the first type of packet, the problem of low conversion efficiency of cache coherence protocol in the prior art is solved. , achieving more efficient protocol conversion and energy consumption reduction.
Patent Information
- Application Number
- CN202411291164.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-06
AI Technical Summary
The lack of mature cache coherence protocol conversion methods in the prior art, resulting in redundant and cumbersome protocol conversion actions, reducing work efficiency and increasing energy consumption.
In the central processor, by determining whether the received message meets the preset conditions, if it is satisfied, the transmissible action will be stopped, and the data of the second type of message is used as the data of the first type of message will be eliminated. Convert and transfer work.
Improves work efficiency, reduces energy consumption, and simplifies the protocol conversion process.
Smart Images

Figure CN119094628A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of integrated circuit design, and in particular to a protocol conversion method, device, equipment, program product and readable storage medium. Background Art
[0002] In order to maintain the cache consistency within the central processing unit and the cache consistency between the central processing unit and other processors outside the chip (including the central processing unit and accelerators, etc.), it is usually necessary to convert the messages transmitted between the chip and the outside (messages sent from the chip to the outside or from the outside to the chip) into a cache consistency protocol and then transmit them transparently. However, the related technology lacks a mature cache consistency protocol conversion method, which makes the protocol conversion action redundant and cumbersome, which not only reduces work efficiency but also increases energy consumption.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention
[0004] The purpose of the present invention is to provide a protocol conversion method, device, equipment, program product and readable storage medium, which can use the data corresponding to the received second-class message as the data corresponding to the first-class message, and stop executing the transparent transmission action of the second-class message, thereby eliminating the protocol conversion and message transmission work of a message, thereby improving work efficiency and reducing energy consumption.
[0005] In order to solve the above technical problems, the present invention provides a protocol conversion method, which is applied to a central processing unit, comprising:
[0006] When receiving a first-class message sent from a first-class node to a second-class node, determining whether a second-class message sent from a second-class node to a first-class node and satisfying a first preset condition has been received before this moment, wherein the first-class node refers to: one of an on-chip node and an off-chip node, the second-class node refers to: the other of an on-chip node and an off-chip node, the first-class message refers to: one of a write request message and a listen request message, the second-class message refers to: the other of a write request message and a listen request message, and the first preset condition refers to: the first-class message and the second-class message carry the same memory address;
[0007] If it has been received, stop executing the transparent transmission action of the first type of message sent by the first type node to the second type node, and use the data corresponding to the second type of message sent by the second type node to the first type node that has been received as the data corresponding to the first type of message sent by the first type node to the second type node.
[0008] On the other hand, in the on-chip cache coherence protocol of the CPU, the write data corresponding to the write request message is sent independently of the write request message;
[0009] When the first type of message is a listen request message and the first type of node is an off-chip node:
[0010] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0011] Sending a write response message to the sender of the received second-class message, and receiving a write data message sent by the sender of the second-class message;
[0012] Sending the write data in the write data message corresponding to the received second-class message to the sender of the first-class message in the form of a monitoring response message;
[0013] Stop transparent transmission of received monitoring request messages.
[0014] On the other hand, when the first type of message is a write request message and the first type of node is an on-chip node:
[0015] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0016] Extracting the monitoring response data in the monitoring response message sent by the destination party of the received second type message;
[0017] Converting the domain information of the sniff response message sent by the destination of the second type of message from the on-chip protocol to the off-chip protocol, wherein the on-chip protocol refers to: a cache consistency protocol used on the chip, and the off-chip protocol refers to: a cache consistency protocol used off the chip;
[0018] The intercept response message obtained by assembling the converted domain information and the intercept response data is sent to the sender of the second type of message;
[0019] A write response message is sent to a sender of the first type of message, and a write data message sent by the sender of the first type of message is received, so as to ignore the write data message.
[0020] On the other hand, when the first type of message is a monitoring request message and the first type of node is an intra-chip node:
[0021] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0022] Sending the write data carried by the received second-class message to the sender of the first-class message in the form of a monitoring response message;
[0023] When receiving a write response message sent by the sender of the first type of message, the write data carried by the received second type of message is sent to the sender of the first type of message in the form of a write data message;
[0024] A write response message of the second type of message is sent to the sender of the received second type of message.
[0025] On the other hand, when the first type of message is a write request message and the first type of node is an off-chip node:
[0026] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0027] Storing write data carried by the first type of message;
[0028] Converting the domain information of the monitoring response message sent by the destination of the second type of message from the off-chip protocol to the on-chip protocol;
[0029] The monitoring response message obtained by assembling the converted domain information and the write data carried by the first-class message is sent to the sender of the second-class message;
[0030] After receiving the first type of message, a write response message is sent to the sender of the first type of message.
[0031] On the other hand, the protocol conversion method also includes:
[0032] receiving a first target message sent by a third type of node outside the chip;
[0033] Converting the domain information of the first target message from an off-chip protocol to an on-chip protocol;
[0034] Packaging the domain information after the protocol conversion to obtain a first target message after the protocol conversion;
[0035] If the CPU includes a fourth-type node in the chip, the first target message after the protocol conversion is sent to the fourth-type node in the chip, wherein the third-type node refers to: one of the request node and the master node, the fourth-type node refers to: the other of the request node and the master node, the on-chip protocol refers to: a cache consistency protocol used in the chip, and the off-chip protocol refers to: a cache consistency protocol used outside the chip;
[0036] If the CPU includes a plurality of fourth-type nodes in the chip, based on the preset first corresponding relationship, determining the target node identifier corresponding to the memory address carried by the first target message;
[0037] The first target message after the protocol conversion is sent to a target node located in the slice, wherein the target node refers to: a node to which the target node identifier belongs.
[0038] On the other hand, when the third type of node is the master node and the fourth type of node is the request node:
[0039] If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include:
[0040] If the CPU chip includes a plurality of fourth-type nodes, a first sub-correspondence relationship is determined;
[0041] Based on the first sub-correspondence relationship, determine the target node identifier corresponding to the memory address carried by the first target message;
[0042] The first sub-correspondence relationship refers to the correspondence relationship between the memory address and the request node identifier.
[0043] On the other hand, when the third type of node is the request node and the fourth type of node is the master node:
[0044] If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include:
[0045] If the CPU chip includes a plurality of fourth-type nodes, a second sub-correspondence relationship is determined;
[0046] Based on the second sub-correspondence relationship, determine the target node identifier corresponding to the memory address carried by the first target message;
[0047] The second sub-correspondence relationship refers to the correspondence relationship between the memory address and the master node identifier.
[0048] On the other hand, if the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include:
[0049] If the CPU includes multiple nodes of the fourth type, determining whether a first corresponding relationship preset in the CPU can be obtained;
[0050] If it can be obtained, then based on the preset first corresponding relationship, determine the target node identifier corresponding to the memory address carried by the first target message;
[0051] If it cannot be obtained, the alarm will be controlled to sound an alarm.
[0052] On the other hand, if the CPU includes a plurality of fourth-type nodes in the chip, after determining whether the first corresponding relationship preset in the CPU can be obtained, the protocol conversion method further includes:
[0053] If it cannot be obtained, the first target message after protocol conversion is broadcasted within the chip.
[0054] On the other hand, determining whether the first corresponding relationship preset in the central processor can be obtained includes:
[0055] Determine whether the first sub-condition and the second sub-condition are simultaneously satisfied, wherein the first sub-condition refers to: a preset first corresponding relationship exists in the central processing unit, and the second sub-condition refers to: access rights to the first corresponding relationship exist;
[0056] If both are true, it is determined that the first corresponding relationship preset in the central processing unit can be obtained;
[0057] If both conditions are not met at the same time, it is determined that the first corresponding relationship preset in the central processing unit cannot be obtained.
[0058] On the other hand, the protocol conversion method also includes:
[0059] Converting the domain segment information of the received second target message sent by the first type of node to the second type of node from the first protocol to the second protocol, wherein the first protocol refers to: a cache consistency protocol corresponding to the node type of the first type of node, and the second protocol refers to: a cache consistency protocol corresponding to the node type of the second type of node;
[0060] Binding and storing the first identification information in the second target message before protocol conversion and the second identification information in the second target message after protocol conversion, wherein the first identification information refers to: the source node identification and the transmission message identification, and the second identification information refers to: the target node identification and the transmission message identification;
[0061] Packaging the domain segment information after the protocol conversion to obtain a second target message of the second protocol, sending the message to the second type of node, and receiving a response message from the second type of node to the second target message;
[0062] Determine currently stored binding data that meets a second preset condition, wherein the second preset condition refers to: the second identification information in the binding data is consistent with the first identification information in the response message of the second target message, and the binding data refers to: the first identification information and the second identification information in a binding storage state;
[0063] Using the source node identifier in the first identifier information in the binding data that meets the second preset condition as the target node of the response message of the second target message;
[0064] After converting the response message of the second target message from the second protocol to the first protocol, the response message is sent to the target node of the response message of the second target message.
[0065] On the other hand, it is applied to any central processing unit in a server;
[0066] Wherein, the server includes a multi-channel central processing unit.
[0067] On the other hand, after determining whether a second type of message sent by the second type of node to the first type of node and meeting the first preset condition has been received before this moment, the protocol conversion method further includes:
[0068] If it has been received, clear the count value;
[0069] If not received, the count value is increased by one and it is determined whether the count value reaches a preset threshold;
[0070] If it is reached, the control indicator will indicate an abnormality.
[0071] On the other hand, the on-chip protocol includes a coherent hub interconnection protocol, and the off-chip protocol includes a cache consistency interconnection protocol for an accelerator, wherein the on-chip protocol refers to: a cache consistency protocol within a central processing unit chip, and the off-chip protocol refers to: a cache consistency protocol outside a central processing unit chip;
[0072] The protocol conversion method also includes:
[0073] After receiving the first write request message sent by the on-chip node, sending a write response message to the sender of the first write request message;
[0074] receiving a first write data message sent by a sender of a first write request message;
[0075] Sending the write data in the first write data message to the outside of the chip in the form of a first write request message of the off-chip protocol;
[0076] After receiving the second write request message sent by the off-chip node, send a write request message to the target node of the second write request message located in the chip;
[0077] After receiving the write response message returned by the target node of the second write request message, the write data in the second write request message is sent to the target node of the second write request message in the form of a second write request message of the on-chip protocol.
[0078] In order to solve the above technical problems, the present invention also provides a protocol conversion device, which is applied to a central processing unit, comprising:
[0079] A first judgment module is used to judge whether a second-class message sent from the second-class node to the first-class node and meeting the first preset condition has been received before the first-class message is received, and if so, trigger the first action module;
[0080] The first type of node refers to: one of an on-chip node and an off-chip node, the second type of node refers to: the other of an on-chip node and an off-chip node, the first type of message refers to: one of a write request message and a listen request message, the second type of message refers to: the other of a write request message and a listen request message, and the first preset condition refers to: the first type of message and the second type of message carry the same memory address;
[0081] The first action module is used to stop the transparent transmission action of the first type of message sent from the first type of node to the second type of node, and use the data corresponding to the second type of message sent from the second type of node to the first type of node as the data corresponding to the first type of message sent from the first type of node to the second type of node.
[0082] In order to solve the above technical problems, the present invention also provides a protocol conversion device, comprising:
[0083] Memory for storing computer programs;
[0084] A processing device is used to implement the steps of the protocol conversion method described above when executing the computer program.
[0085] In another aspect, the processing device comprises:
[0086] The message scheduling and preprocessing module is used to determine whether a second-class message sent from the second-class node to the first-class node and meeting the first preset condition has been received before the first-class message is received, and if it has been received, stop the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and use the data corresponding to the received second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node;
[0087] The message scheduling and preprocessing module is also used to control the memory to store the data carried by the specified message;
[0088] The message conversion module is used to convert the domain information of the message between the on-chip protocol and the off-chip protocol under the control of the message scheduling and pre-processing module, wherein the on-chip protocol refers to: the cache consistency protocol used on the chip, and the off-chip protocol refers to: the cache consistency protocol used off the chip;
[0089] The message generation module is used to package the domain segment information and its corresponding data output by the message conversion module into a message and send it out.
[0090] To solve the above technical problem, the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above protocol conversion method when executed by a processor.
[0091] To solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above protocol conversion method are implemented.
[0092] Technical effect: The present invention provides a protocol conversion method. Considering that if the write request message and the listen request message belonging to the on-chip node and the off-chip node carry the same memory address, the data corresponding to the two messages are consistent. In theory, only one copy needs to be transmitted. Therefore, in the present invention, when a first-class message (one of the write request message and the listen request message) is received from the first-class node (one of the on-chip node and the off-chip node) to the second-class node (the other of the on-chip node and the off-chip node), it is determined whether a second-class message (the other of the write request message and the listen request message) sent from the second-class node to the first-class node and meeting the first preset condition has been received before this moment. If it has been received, the data corresponding to the received second-class message can be used as the data corresponding to the first-class message, and the transparent transmission action of the second-class message is stopped, thereby eliminating the protocol conversion and message transmission work of one message, which not only improves work efficiency but also reduces energy consumption.
[0093] The present invention also provides a protocol conversion device, a computer program product and a computer-readable storage medium, which have the same beneficial effects as the above protocol conversion method. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0095] Figure 1 A schematic diagram of a protocol conversion method provided by the present invention;
[0096] Figure 2 A schematic flow chart of a first message conflict handling method provided by the present invention;
[0097] Figure 3 A schematic flow chart of a second message conflict handling method provided by the present invention;
[0098] Figure 4 A schematic diagram of a flow chart of a third message conflict handling method provided by the present invention;
[0099] Figure 5 A schematic diagram of a flow chart of a fourth message conflict handling method provided by the present invention;
[0100] Figure 6 A schematic diagram of the structure of a protocol conversion device provided by the present invention;
[0101] Figure 7 A schematic diagram of the structure of a protocol conversion device provided by the present invention;
[0102] Figure 8 A schematic diagram of the structure of a processing device provided by the present invention;
[0103] Fig. 9 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0104] The core of the present invention is to provide a protocol conversion method, device, equipment, program product and readable storage medium, which can use the data corresponding to the received second-class message as the data corresponding to the first-class message, and stop executing the transparent transmission action of the second-class message, thereby eliminating the protocol conversion and message transmission work of a message, which not only improves work efficiency but also reduces energy consumption.
[0105] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0106] Please refer to Figure 1 , Figure 1 A schematic flow chart of a protocol conversion method provided by the present invention, the protocol conversion method is applied to a central processing unit, comprising:
[0107] S101: upon receiving a first-type message sent from a first-type node to a second-type node, determining whether a second-type message sent from a second-type node to a first-type node and satisfying a first preset condition has been received before this moment, wherein the first-type node refers to: one of an on-chip node and an off-chip node, the second-type node refers to: the other of an on-chip node and an off-chip node, the first-type message refers to: one of a write request message and a listen request message, the second-type message refers to: the other of a write request message and a listen request message, and the first preset condition refers to: the first-type message and the second-type message carry the same memory address;
[0108] Specifically, the protocol conversion method in the embodiment of the present invention can process various messages sent from within the chip to outside the chip and from outside the chip to within the chip, that is, "various messages sent from within the chip to outside the chip and from outside the chip to within the chip" can first reach the "virtual module corresponding to the protocol conversion method" and be processed by the "virtual module corresponding to the protocol conversion method".
[0109] Specifically, taking into account the technical problems in the background technology as mentioned above, and considering that if the write request message and the listen request message belonging to the on-chip node and the off-chip node carry the same memory address, then the data corresponding to the two messages are consistent, and theoretically only one copy needs to be transmitted. Therefore, based on this logic, the present invention can determine whether a second type of message sent from the second type of node to the first type of node and meeting the first preset condition has been received before when a first type of message is received from the first type of node to the second type of node. For example, when a write request message is received from the on-chip node to the off-chip node, it can be determined whether a listen request message sent from the off-chip node to the on-chip node and meeting the first preset condition (the write request message and the listen request message carry the same memory address) has been received before.
[0110] Among them, the above-mentioned first-category nodes and second-category nodes belong to one of "on-chip nodes and off-chip nodes", and the first-category messages and the second-category messages belong to one of "write request messages and listen request messages", that is, the specific identity combinations of the first-category nodes and the second-category nodes include two, and the specific identity combinations of the first-category messages and the second-category messages also include two.
[0111] S102: If it has been received, stop executing the transparent transmission action of the first type of message sent from the first type of node to the second type of node, and use the data corresponding to the second type of message sent from the second type of node to the first type of node as the data corresponding to the first type of message sent from the first type of node to the second type of node.
[0112] Specifically, in the case of having been received, it means that the corresponding data in the processing process of the received second-class message is theoretically consistent with the "data corresponding to the first-class message". Therefore, in theory, there is no need to transparently transmit the first-class message to the destination node, and the data corresponding to the second-class message can be used as the data corresponding to the first-class message. Therefore, in an embodiment of the present invention, the transparent transmission action of the first-class message sent from the first-class node to the second-class node can be stopped, and the data corresponding to the second-class message sent from the second-class node to the first-class node that has been received can be used as the data corresponding to the first-class message sent from the first-class node to the second-class node. Based on the above actions, on the one hand, the protocol conversion (conversion between on-chip protocol and off-chip protocol) that needs to be performed before the transparent transmission of the first-class message is omitted, and on the other hand, part of the message transmission work is omitted, which is beneficial to improving work efficiency and reducing energy consumption.
[0113] The data corresponding to the message refers to the data to which the message is responded, or the data carried by the message itself. For example, a write request message may carry data, and a monitoring response message of a monitoring request message may carry the data to be monitored.
[0114] The present invention provides a protocol conversion method. Considering that if the write request message and the monitor request message belonging to the on-chip node and the off-chip node carry the same memory address, the data corresponding to the two messages are consistent. In theory, only one copy is required to be transmitted. Therefore, in the present invention, when a first-class message (one of the write request message and the monitor request message) is received from the first-class node (one of the on-chip node and the off-chip node) to the second-class node (the other of the on-chip node and the off-chip node), it is determined whether a second-class message (the other of the write request message and the monitor request message) sent from the second-class node to the first-class node and meeting the first preset condition has been received before this moment. If it has been received, the data corresponding to the received second-class message can be used as the data corresponding to the first-class message, and the transparent transmission action of the second-class message is stopped, thereby eliminating the protocol conversion and message transmission work of one message, which not only improves work efficiency but also reduces energy consumption.
[0115] As an optional embodiment, in a cache coherence protocol within a CPU chip, write data corresponding to a write request message is sent independently of the write request message;
[0116] When the first type of message is a listen request message and the first type of node is an off-chip node:
[0117] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0118] Sending a write response message to the sender of the received second-class message, and receiving a write data message sent by the sender of the second-class message;
[0119] Sending the write data in the write data message corresponding to the received second-class message to the sender of the first-class message in the form of a monitoring response message;
[0120] Stop transparent transmission of received monitoring request messages.
[0121] Specifically, considering that in some on-chip cache consistency protocols, write request data is not attached to the write request message, but is independently transmitted through the write data message, the embodiment of the present invention introduces a conflict handling method between the first type of message and the second type of message for this type of on-chip cache consistency protocol. The conflict between the first type of message and the second type of message refers to the situation mentioned above that when the first type of message is received, the second type of message that meets the first preset condition has been received.
[0122] Specifically, the embodiment of the present invention focuses on the situation that "the first type of message is a monitoring request message and the first type of node is an off-chip node". In order to better illustrate the embodiment of the present invention, please refer to Figure 2 , Figure 2 The flowchart of the first message conflict handling method provided by the present invention is shown in the protocol conversion method applied to the 0th processor. It can be seen that "for the protocol conversion method", when the listening request message from the off-chip node (the node in the 1st processor) is received, the write request message from the on-chip node has been received (the write request message meets the first preset condition), so the write data corresponding to the write request message can be returned to the off-chip node in the form of a listening response message; first of all, it is worth noting that the protocol conversion method of the 0th processor does not transparently transmit the listening request message to the request node in the chip, which saves the message transparent transmission and the protocol conversion work before the message transparent transmission. Secondly, since in the cache consistency protocol in the chip, the write request data is not attached to the write request message, but is transmitted independently through the write data message, so in the embodiment of the present invention, for the write request message sent by the on-chip node, the write response message can be first returned to the on-chip node (the request node in the chip) so that the request node sends a write data message carrying the write data.
[0123] The request node refers to RN (Request Node), which is used to initiate a cache coherence request.
[0124] As an optional embodiment, when the first type of message is a write request message and the first type of node is an on-chip node:
[0125] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0126] Extracting the monitoring response data in the monitoring response message sent by the destination party of the received second type message;
[0127] Converting the domain information of the sniff response message sent by the destination of the second type of message from the on-chip protocol to the off-chip protocol, wherein the on-chip protocol refers to: a cache consistency protocol used on the chip, and the off-chip protocol refers to: a cache consistency protocol used off the chip;
[0128] The intercept response message obtained by assembling the converted domain information and the intercept response data is sent to the sender of the second type of message;
[0129] A write response message is sent to a sender of the first type of message, and a write data message sent by the sender of the first type of message is received, so as to ignore the write data message.
[0130] Specifically, the embodiment of the present invention focuses on the situation that "the first type of message is a write request message and the first type of node is an on-chip node". In order to better illustrate the embodiment of the present invention, please refer to Figure 3 , Figure 3 The flowchart of the second message conflict handling method provided by the present invention is shown in which the protocol conversion method is applied to the 0th processor. It can be seen that "for the protocol conversion method", when a write request message sent by an in-chip node (in this case, a request node in the chip) is received, a listen request message from an out-chip node has been received (the listen request message meets the first preset condition). Therefore, the listen request message can be transparently transmitted to the request node in the chip after protocol conversion, and a listen response message (carrying the monitored data) sent by the request node in the chip is received. Then, the listen response message can be transparently transmitted to the sender of the listen request message (in this case, the 1st processor) after protocol conversion. Since the listen response message carries the same "memory address" as the write request message, the data carried in the listen response message is the data corresponding to the write request message. At this time, the write request is no longer transparently transmitted to the outside of the chip, thereby eliminating the work of protocol conversion and message sending.
[0131] Among them, since in the cache consistency protocol within the chip, the write request data is not attached to the write request message, but is transmitted independently through the write data message, the protocol conversion method can return a write response message to the sending node of the write request message so that the requesting node can send a write data message. However, at this time, the write data message needs to be ignored and does not need to be sent out of the chip.
[0132] As an optional embodiment, when the first type of message is a monitoring request message and the first type of node is an on-chip node:
[0133] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0134] Sending the write data carried by the received second-class message to the sender of the first-class message in the form of a monitoring response message;
[0135] When receiving a write response message sent by the sender of the first type of message, the write data carried by the received second type of message is sent to the sender of the first type of message in the form of a write data message;
[0136] A write response message of the second type of message is sent to the sender of the received second type of message.
[0137] Specifically, the embodiment of the present invention focuses on the situation where "the first type of message is a write request message and the first type of node is an on-chip node". In order to better illustrate the embodiment of the present invention, please refer to Figure 4 , Figure 4 The flowchart of the third message conflict handling method provided by the present invention is that the protocol conversion method is applied to the 0th processor. It can be seen that "for the protocol conversion method", when the listening request message sent by the in-chip node (that is, the main node in the chip) to the node in the 1st processor outside the chip is received, the write request message sent by the 1st processor to the 0th processor has been received, and the write request message can be normally transmitted to the main node in the 0th processor, and a write response message can be returned to the first processor (the sender of the write request message) to indicate that the write request is completed; and for the listening request message sent by the in-chip node, since the memory address carried by the listening request message is the same as that carried by the write request message, the data carried by the write request message can be used as the response data of the listening request message, so the write data carried by the write request message can be directly used as the data in the listening response message, and the listening response message is sent to the in-chip node, without the need to transparently transmit the listening request message to the destination node in the 1st processor, thereby avoiding the protocol conversion and transmission of the listening request message.
[0138] The master node refers to RN (Home Node), which is used to process cache consistency requests.
[0139] Among them, since in the cache consistency protocol within the chip, the write request data is not attached to the write request message, but is transmitted independently through the write data message, after the write request message is transmitted to the master node in the 0th processor, it can also receive the write response message sent by the node within the chip, and then send the write data to the node within the chip in the form of a write data message.
[0140] As an optional embodiment, when the first type of message is a write request message and the first type of node is an off-chip node:
[0141] Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes:
[0142] Storing write data carried by the first type of message;
[0143] Converting the domain information of the monitoring response message sent by the destination of the second type of message from the off-chip protocol to the on-chip protocol;
[0144] The monitoring response message obtained by assembling the converted domain information and the write data carried by the first-class message is sent to the sender of the second-class message;
[0145] After receiving the first type of message, a write response message is sent to the sender of the first type of message.
[0146] Specifically, the embodiment of the present invention focuses on the situation where "the first type of message is a write request message and the first type of node is an off-chip node". In order to better illustrate the embodiment of the present invention, please refer to Figure 5 , Figure 5 The flowchart of the fourth message conflict handling method provided by the present invention is that the protocol conversion method is applied to the 0th processor. It can be seen that "for the protocol conversion method", when receiving the write request message sent by the off-chip node of the 1st processor to the on-chip node of the 0th processor (that is, the main node in the chip), the listen request message sent by the on-chip node of the 0th processor to the node in the off-chip 1st processor has been received, and the memory address carried by the write request message and the listen request message is the same. At this time, the listen request message can be transparently transmitted to the 1st processor, and the listen response message returned by the 1st processor can be received. Since the memory address carried by the write request message is the same as that carried by the listen request message, the write data carried in the write request message is theoretically consistent with the data that the listen request message wants to listen to. Therefore, the write data carried by the write request message can be stored. After receiving the listen response message, the write data is transmitted to the on-chip node of the 0th processor in the form of a listen response message. Since the write data carried in the write request message is theoretically consistent with the data that the listen request message wants to listen to, there is no need to transparently transmit the write request message to the master node in the 0th processor, and the write response message can be directly returned to the node in the 1st processor.
[0147] As an optional embodiment, the protocol conversion method further includes:
[0148] receiving a first target message sent by a third type of node outside the chip;
[0149] Converting the domain information of the first target message from an off-chip protocol to an on-chip protocol;
[0150] Packaging the domain information after the protocol conversion to obtain a first target message after the protocol conversion;
[0151] If the CPU includes a fourth-type node in the chip, the first target message after the protocol conversion is sent to the fourth-type node in the chip, wherein the third-type node refers to: one of the request node and the master node, the fourth-type node refers to: the other of the request node and the master node, the on-chip protocol refers to: a cache consistency protocol used in the chip, and the off-chip protocol refers to: a cache consistency protocol used outside the chip;
[0152] If the CPU includes a plurality of fourth-type nodes in the chip, based on the preset first corresponding relationship, determining the target node identifier corresponding to the memory address carried by the first target message;
[0153] The first target message after the protocol conversion is sent to a target node located in the slice, wherein the target node refers to a node to which the target node identifier belongs.
[0154] The target node identifier refers to TgtID (Target ID), which means the routing destination node ID (Identity Document) of the message.
[0155] Specifically, considering that the number of request nodes and master nodes in the central processing unit may be various, the request node usually sends a read request message, a write request message, and a no-data request message to the master node, and the master node sends a monitoring request message to the request node. Therefore, when the off-chip node sends a message to the chip, it is necessary to determine which destination node in the central processing unit is (it may be a request node or a master node), and the number of request nodes and master nodes in the central processing unit may be various. Therefore, it is necessary to determine a solution for "smoothly sending the off-chip message to the destination node". Therefore, in the embodiment of the present invention, when receiving the message from the off-chip node, After the third type node outside the chip sends the first target message, the field segment information of the first target message is converted from the off-chip protocol to the on-chip protocol, and then the first target message after the protocol conversion is obtained based on the field segment information package after the protocol conversion, ready to be sent. At this time, if the central processing unit includes a fourth type node in the chip, the first target message after the protocol conversion is sent to the fourth type node in the chip. If the central processing unit includes multiple fourth type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined, and then the first target message after the protocol conversion is sent to the target node located in the chip.
[0156] Among them, a specific example is that when receiving a listening request message sent by a master node outside the chip, the listening request message is first subjected to protocol conversion (converted into a cache consistency protocol within the chip) for sending. At this time, if there is only one request node in the chip, the listening request message after the protocol conversion can be sent to the request node in the chip; if there are multiple request nodes in the chip, the target node identifier corresponding to the memory address carried by the listening request message can be determined based on the first corresponding relationship, and then the target node identifier can be used to determine which target node the listening request message corresponds to, and then the listening request message after the protocol conversion can be sent to the target node.
[0157] In addition, when a message sent by a request node outside the chip is received (which may be a read request, write request, or no data request message, etc.), the master node within the chip that is the target node (of the message sent from outside the chip) can be determined according to the above principle.
[0158] As an optional embodiment, when the third type of node is a master node and the fourth type of node is a requesting node:
[0159] If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include:
[0160] If the CPU chip includes a plurality of fourth-type nodes, a first sub-correspondence relationship is determined;
[0161] Based on the first sub-correspondence relationship, determine the target node identifier corresponding to the memory address carried by the first target message;
[0162] The first sub-correspondence relationship refers to the correspondence relationship between the memory address and the request node identifier.
[0163] Specifically, considering that when the type of the determined target node identifier is different, the corresponding relationship to be used should also be different, the first corresponding relationship in the embodiment of the present invention includes a first sub-correspondence relationship, and the first sub-correspondence relationship is the correspondence relationship between the memory address and the request node identifier. The first sub-correspondence relationship can be stored as a "cache consistency directory module". Therefore, when the fourth type of node is a request node, the target node identifier corresponding to the memory address carried by the first target message can be determined based on the first sub-correspondence relationship.
[0164] As an optional embodiment, when the third type of node is a requesting node and the fourth type of node is a master node:
[0165] If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include:
[0166] If the CPU chip includes a plurality of fourth-type nodes, a second sub-correspondence relationship is determined;
[0167] Based on the second sub-correspondence relationship, determine the target node identifier corresponding to the memory address carried by the first target message;
[0168] The second sub-correspondence relationship refers to the correspondence relationship between the memory address and the master node identifier.
[0169] Specifically, considering that when the type of the determined target node identifier is different, the corresponding relationship to be used should also be different, the first corresponding relationship in the embodiment of the present invention also includes a second sub-correspondence relationship, and the second sub-correspondence relationship is the correspondence between the memory address and the master node identifier. The second sub-correspondence relationship can be called SAM (SystemAddress Map, system address mapping table). Therefore, when the fourth type of node is the master node, the target node identifier corresponding to the memory address carried by the first target message can be determined based on the second sub-correspondence relationship.
[0170] As an optional embodiment, if the central processing unit includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, determining the target node identifier corresponding to the memory address carried by the first target message includes:
[0171] If the CPU includes multiple nodes of the fourth type, determining whether a first corresponding relationship preset in the CPU can be obtained;
[0172] If it can be obtained, then based on the preset first corresponding relationship, determine the target node identifier corresponding to the memory address carried by the first target message;
[0173] If it cannot be obtained, the alarm will be controlled to sound an alarm.
[0174] Specifically, considering the possibility that the virtual module corresponding to the protocol conversion method "cannot obtain the first corresponding relationship preset in the central processing unit", the embodiment of the present invention can first determine whether the first corresponding relationship preset in the central processing unit can be obtained. If it can be obtained, the target node identifier corresponding to the memory address carried by the first target message can be determined based on the preset first corresponding relationship. If it cannot be obtained, the alarm can be controlled to sound an alarm so that the staff can deal with the abnormal situation in time.
[0175] The alarm may be of various types, such as an audible and visual alarm, etc., which is not limited in the embodiment of the present invention.
[0176] As an optional embodiment, if the central processing unit includes a plurality of fourth-type nodes in the chip, after determining whether the first corresponding relationship preset in the central processing unit can be obtained, the protocol conversion method further includes:
[0177] If it cannot be obtained, the first target message after protocol conversion is broadcasted within the chip.
[0178] Specifically, considering that each node within the chip can confirm whether it is the recipient of the message by receiving the "target node identifier" in the message, in an embodiment of the present invention, when the first corresponding relationship cannot be obtained, the first target message after protocol conversion can be broadcast within the chip, and the first target message after protocol conversion can also be smoothly sent to its target node.
[0179] As an optional embodiment, determining whether the first corresponding relationship preset in the central processor can be obtained includes:
[0180] Determine whether the first sub-condition and the second sub-condition are simultaneously satisfied, wherein the first sub-condition refers to: a preset first corresponding relationship exists in the central processing unit, and the second sub-condition refers to: access rights to the first corresponding relationship exist;
[0181] If both are true, it is determined that the first corresponding relationship preset in the central processing unit can be obtained;
[0182] If both conditions are not met at the same time, it is determined that the first corresponding relationship preset in the central processing unit cannot be obtained.
[0183] Specifically, considering that the central processing unit may lack the first corresponding relationship, or the virtual module corresponding to the protocol conversion method does not have access rights to the first corresponding relationship, the first corresponding relationship cannot be obtained in both cases. Therefore, in the embodiment of the present invention, it can be determined whether the first sub-condition and the second sub-condition are met at the same time, wherein the first sub-condition refers to: there is a preset first corresponding relationship in the central processing unit, and the second sub-condition refers to: there is access rights to the first corresponding relationship. When both are met, it can be determined that the preset first corresponding relationship in the central processing unit can be obtained.
[0184] As an optional embodiment, the protocol conversion method further includes:
[0185] Converting the domain segment information of the received second target message sent by the first type of node to the second type of node from the first protocol to the second protocol, wherein the first protocol refers to: a cache consistency protocol corresponding to the node type of the first type of node, and the second protocol refers to: a cache consistency protocol corresponding to the node type of the second type of node;
[0186] Binding and storing the first identification information in the second target message before protocol conversion and the second identification information in the second target message after protocol conversion, wherein the first identification information refers to: the source node identification and the transmission message identification, and the second identification information refers to: the target node identification and the transmission message identification;
[0187] Packaging the domain segment information after the protocol conversion to obtain a second target message of the second protocol, sending the message to the second type of node, and receiving a response message from the second type of node to the second target message;
[0188] Determine currently stored binding data that meets a second preset condition, wherein the second preset condition refers to: the second identification information in the binding data is consistent with the first identification information in the response message of the second target message, and the binding data refers to: the first identification information and the second identification information in a binding storage state;
[0189] Using the source node identifier in the first identifier information in the binding data that meets the second preset condition as the target node of the response message of the second target message;
[0190] After converting the response message of the second target message from the second protocol to the first protocol, the response message is sent to the target node of the response message of the second target message.
[0191] The source node identifier refers to SrcID (Source ID), which is the initiating node ID of the message, and the transmission message identifier refers to TxnID (Transaction ID), which is used to distinguish different requests initiated by the same source node.
[0192] Specifically, considering that the messages transmitted between the chip and the outside of the chip need to be "converted between the inside-chip protocol and the outside-chip protocol", during the "conversion between the inside-chip protocol and the outside-chip protocol", the relevant information in the message will change, and some messages may have corresponding response messages, and the response messages usually also need to be transferred from the outside of the chip to the inside of the chip. In order to enable the response message to successfully find the destination node, the embodiment of the present invention, after "converting the domain segment information of the received second target message sent from the first type of node to the second type of node from the first protocol to the second protocol", can bind and store the first identification information in the second target message before the protocol conversion and the second identification information in the second target message after the protocol conversion (wherein, the first The first identification information refers to: the source node identification and the transmission message identification, and the second identification information refers to: the target node identification and the transmission message identification); based on this, after receiving the response message of the second target message, determine the currently stored binding data that meets the second preset condition (wherein, the second preset condition refers to: the second identification information in the binding data is consistent with the first identification information in the response message of the second target message, and the binding data refers to: the first identification information and the second identification information in the binding storage state), and then use the source node identification in the first identification information in the binding data that meets the second preset condition as the target node of the response message of the second target message, so that the target node can be found for the response message by tracing the source.
[0193] Among them, this method can efficiently and accurately trace the target node of the response message through a small amount of data storage.
[0194] Of course, in addition to this method, there may be other types of methods for determining a target node in response to power saving, which are not limited in the embodiment of the present invention.
[0195] As an optional embodiment, it is applied to any central processor in the server;
[0196] The server includes a multi-channel central processing unit.
[0197] Specifically, considering that there is a frequent conversion demand for on-chip and off-chip cache coherence protocols in a server with multiple CPUs (Central Processing Units), the embodiment of the present invention can be applied to any CPU in a server with multiple CPUs.
[0198] Of course, in addition to this specific scenario, the application scenarios of the protocol conversion method in the embodiment of the present invention may also be other types, and the embodiment of the present invention is not limited here.
[0199] As an optional embodiment, after determining whether a second type of message sent by the second type of node to the first type of node and meeting the first preset condition has been received before this moment, the protocol conversion method further includes:
[0200] If it has been received, clear the count value;
[0201] If not received, the count value is increased by one and it is determined whether the count value reaches a preset threshold;
[0202] If it is reached, the control indicator will indicate an abnormality.
[0203] Specifically, considering that under normal circumstances, the central processing unit will frequently encounter the situation of "when receiving a first type of message sent from a first type of node to a second type of node, a second type of message sent from a second type of node to the first type of node and satisfying a first preset condition has been received before this moment", therefore, an embodiment of the present invention can clear the count value when this situation occurs, and accumulate the count value when this situation does not occur, so that when the count value is greater than a preset threshold, an abnormal prompt is issued so that the staff can inspect the module corresponding to the protocol conversion method of the central processing unit.
[0204] The preset threshold value may be set independently, and the embodiment of the present invention does not limit this.
[0205] As an optional embodiment, the on-chip protocol includes a coherent hub interconnection protocol, and the off-chip protocol includes a cache consistency interconnection protocol for an accelerator, wherein the on-chip protocol refers to: a cache consistency protocol within a central processing unit chip, and the off-chip protocol refers to: a cache consistency protocol outside a central processing unit chip;
[0206] The protocol conversion method also includes:
[0207] After receiving the first write request message sent by the on-chip node, sending a write response message to the sender of the first write request message;
[0208] receiving a first write data message sent by a sender of a first write request message;
[0209] Sending the write data in the first write data message to the outside of the chip in the form of a first write request message of the off-chip protocol;
[0210] After receiving the second write request message sent by the off-chip node, send a write request message to the target node of the second write request message located in the chip;
[0211] After receiving the write response message returned by the target node of the second write request message, the write data in the second write request message is sent to the target node of the second write request message in the form of a second write request message of the on-chip protocol.
[0212] Specifically, the on-chip protocol in the embodiment of the present invention may be CHI (Coherent Hub Interconnect), and the off-chip protocol may be CCIX (Cache Coherent Interconnect for Accelerators). The two protocols belong to the same manufacturer, thereby facilitating simple and accurate conversion between protocols.
[0213] Among them, since CHI stipulates that write data is not sent together with the write request message, but is sent independently through the write data message, therefore, in an embodiment of the present invention, after receiving the first write request message sent by the on-chip node, a write response message can be sent to the sender of the first write request message, and the first write data message sent by the sender of the first write request message can be received, and the write data in the first write data message can be sent to the outside of the chip in the form of a first write request message of the off-chip protocol; and after receiving the second write request message sent by the off-chip node, a write request message is sent to the target node of the second write request message located in the chip, and after receiving the write response message returned by the target node of the second write request message, the write data in the second write request message can be sent to the target node of the second write request message in the form of a second write request message of the on-chip protocol.
[0214] Of course, in addition to this specific example, the on-chip protocol and the off-chip protocol may also be of other types, which are not limited in the embodiments of the present invention.
[0215] Please refer to Figure 6 , Figure 6A schematic diagram of the structure of a protocol conversion device provided by the present invention, the protocol conversion device comprising:
[0216] The first judgment module 61 is used to determine whether a second-type message sent from the second-type node to the first-type node and meeting the first preset condition has been received before the first type message is received, and if so, trigger the first action module 62;
[0217] The first type of node refers to: one of an on-chip node and an off-chip node, the second type of node refers to: the other of an on-chip node and an off-chip node, the first type of message refers to: one of a write request message and a listen request message, the second type of message refers to: the other of a write request message and a listen request message, and the first preset condition refers to: the first type of message and the second type of message carry the same memory address;
[0218] The first action module 62 is used to stop executing the transparent transmission action of the first type of message sent from the first type of node to the second type of node, and use the data corresponding to the second type of message sent from the second type of node to the first type of node as the data corresponding to the first type of message sent from the first type of node to the second type of node.
[0219] Based on the above embodiments:
[0220] As an optional embodiment, in a cache coherence protocol within a CPU chip, write data corresponding to a write request message is sent independently of the write request message;
[0221] When the first type of message is a listen request message and the first type of node is an off-chip node:
[0222] The first action module 62 includes:
[0223] A first sending module, used to send a write response message to the sender of the received second-category message, and receive a write data message sent by the sender of the second-category message;
[0224] A second sending module is used to send the write data in the write data message corresponding to the received second-class message to the sender of the first-class message in the form of a monitoring response message;
[0225] The first stopping module is used to stop executing the transparent transmission action for the received monitoring request message.
[0226] As an optional embodiment, when the first type of message is a write request message and the first type of node is an on-chip node:
[0227] The first action module 62 includes:
[0228] A first extraction module, used for extracting the intercept response data in the intercept response message sent by the destination party of the received second type message;
[0229] A first conversion module is used to convert the domain segment information of the monitoring response message sent by the destination of the second type of message from the on-chip protocol to the off-chip protocol, wherein the on-chip protocol refers to: a cache consistency protocol used on the chip, and the off-chip protocol refers to: a cache consistency protocol used off the chip;
[0230] The first packetizing module is used to send the interception response message obtained by packetizing according to the converted domain information and the interception response data to the sender of the second type of message;
[0231] The third sending module is used to send a write response message to the sender of the first category message, and receive a write data message sent by the sender of the first category message, so as to ignore the write data message.
[0232] As an optional embodiment, when the first type of message is a monitoring request message and the first type of node is an intra-chip node:
[0233] The first action module 62 includes:
[0234] A fourth sending module, used for sending the write data carried by the received second-category message to the sender of the first-category message in the form of a monitoring response message;
[0235] a fifth sending module, configured to, upon receiving a write response message sent by a sender of the first category message, send the write data carried by the received second category message to the sender of the first category message in the form of a write data message;
[0236] The sixth sending module is used to send a write response message of the second type of message to the sender of the received second type of message.
[0237] As an optional embodiment, when the first type of message is a write request message and the first type of node is an off-chip node:
[0238] The first action module 62 includes:
[0239] A first storage module, used to store write data carried by the first type of message;
[0240] A second conversion module, used for converting the domain information of the monitoring response message sent by the destination of the second type of message from the off-chip protocol to the on-chip protocol;
[0241] The second packetizing module is used to send the monitoring response message obtained by packetizing according to the converted domain information and the write data carried by the first type of message to the sender of the second type of message;
[0242] The seventh sending module is used to send a write response message to the sender of the first category message after receiving the first category message.
[0243] As an optional embodiment, the protocol conversion device also includes:
[0244] A first receiving module, used for receiving a first target message sent by a third type of node outside the chip;
[0245] A third conversion module, used to convert the domain information of the first target message from an off-chip protocol to an on-chip protocol;
[0246] A third packet grouping module is used to group packets based on the domain segment information after the protocol conversion to obtain a first target message after the protocol conversion;
[0247] an eighth sending module, configured to send the first target message after protocol conversion to the fourth type node in the chip if the chip of the central processing unit includes a fourth type node in the chip, wherein the third type node refers to: one of the request node and the master node, the fourth type node refers to: the other of the request node and the master node, the in-chip protocol refers to: a cache consistency protocol used in the chip, and the out-of-chip protocol refers to: a cache consistency protocol used outside the chip;
[0248] A first determination module is used to determine the target node identifier corresponding to the memory address carried by the first target message based on a preset first corresponding relationship if the central processing unit includes multiple fourth-type nodes in the chip;
[0249] The ninth sending module is used to send the first target message after the protocol conversion to the target node located in the chip, wherein the target node refers to: the node to which the target node identifier belongs.
[0250] As an optional embodiment, when the third type of node is a master node and the fourth type of node is a requesting node:
[0251] The first determination module includes:
[0252] A first determination submodule, configured to determine a first sub-correspondence relationship if the CPU chip includes a plurality of fourth-type nodes;
[0253] A second determination submodule, configured to determine, based on the first sub-correspondence, a target node identifier corresponding to the memory address carried by the first target message;
[0254] The first sub-correspondence relationship refers to the correspondence relationship between the memory address and the request node identifier.
[0255] As an optional embodiment, when the third type of node is a requesting node and the fourth type of node is a master node:
[0256] The first determination module includes:
[0257] A third determination submodule, configured to determine a second sub-correspondence relationship if the CPU chip includes a plurality of fourth-type nodes;
[0258] A fourth determination submodule, configured to determine, based on the second sub-correspondence, a target node identifier corresponding to the memory address carried by the first target message;
[0259] The second sub-correspondence relationship refers to the correspondence relationship between the memory address and the master node identifier.
[0260] As an optional embodiment, the first determining module includes:
[0261] a second judgment module, configured to judge whether the first corresponding relationship preset in the central processing unit can be obtained if the central processing unit includes a plurality of fourth-type nodes in the chip, and trigger the fifth determination submodule if it can be obtained, and trigger the first control module if it cannot be obtained;
[0262] A fifth determination submodule, configured to determine, based on a preset first corresponding relationship, a target node identifier corresponding to the memory address carried by the first target message;
[0263] The first control module is used to control the alarm to sound.
[0264] As an optional embodiment, the second judgment module is further used to trigger the first broadcast module when the first corresponding relationship preset in the central processor cannot be obtained;
[0265] The protocol conversion device also includes:
[0266] The first broadcast module is used to broadcast the first target message after the protocol conversion within the chip.
[0267] As an optional embodiment, the second judgment module includes:
[0268] A first judgment submodule is used to judge whether the first subcondition and the second subcondition are simultaneously satisfied, wherein the first subcondition refers to: the existence of a preset first corresponding relationship in the central processing unit, and the second subcondition refers to: the existence of access rights to the first corresponding relationship. If both conditions are satisfied, the first judgment module is triggered; if both conditions are not satisfied, the second judgment module is triggered;
[0269] A first determination module, used for determining whether a first corresponding relationship preset in the central processing unit can be obtained;
[0270] The second determination module is used to determine that the first corresponding relationship preset in the central processing unit cannot be obtained.
[0271] As an optional embodiment, the protocol conversion device also includes:
[0272] a fourth conversion module, configured to convert the domain segment information of the second target message received from the first type of node to the second type of node from the first protocol to the second protocol, wherein the first protocol refers to: a cache consistency protocol corresponding to the node type of the first type of node, and the second protocol refers to: a cache consistency protocol corresponding to the node type of the second type of node;
[0273] A second storage module is used to bind and store the first identification information in the second target message before the protocol conversion and the second identification information in the second target message after the protocol conversion, wherein the first identification information refers to: a source node identification and a transmission message identification, and the second identification information refers to: a target node identification and a transmission message identification;
[0274] a tenth sending module, configured to obtain a second target message of the second protocol by grouping the domain segment information after the protocol conversion, send the message to the second type of node, and receive a response message from the second type of node to the second target message;
[0275] a second determination module, configured to determine currently stored binding data that meets a second preset condition, wherein the second preset condition refers to: the second identification information in the binding data is consistent with the first identification information in the response message of the second target message, and the binding data refers to: the first identification information and the second identification information in a binding storage state;
[0276] A third determination module, configured to use the source node identifier in the first identification information in the binding data that meets the second preset condition as the target node of the response message of the second target message;
[0277] The eleventh sending module is used to convert the response message of the second target message from the second protocol to the first protocol, and then send the response message to the target node of the response message of the second target message.
[0278] As an optional embodiment, the first judgment module is further used to trigger the second action module when the signal has been received, and to trigger the third judgment module when the signal has not been received;
[0279] The protocol conversion device also includes:
[0280] The second action module is used to clear the count value;
[0281] A third judgment module is used to increase the count value by one and judge whether the count value reaches a preset threshold value, and if so, trigger the second control module;
[0282] The second control module is used to control the indicator to indicate abnormality.
[0283] As an optional embodiment, the on-chip protocol includes a coherent hub interconnection protocol, and the off-chip protocol includes a cache consistency interconnection protocol for an accelerator, wherein the on-chip protocol refers to: a cache consistency protocol within a central processing unit chip, and the off-chip protocol refers to: a cache consistency protocol outside a central processing unit chip;
[0284] The protocol conversion device also includes:
[0285] A twelfth sending module, configured to send a write response message to a sender of the first write request message after receiving the first write request message sent by the intra-chip node;
[0286] A second receiving module, used for receiving a first write data message sent by a sender of the first write request message;
[0287] A thirteenth sending module, configured to send the write data in the first write data message to an off-chip in the form of a first write request message of an off-chip protocol;
[0288] A fourteenth sending module is used to send a write request message to a target node located in the chip of the second write request message after receiving the second write request message sent by the off-chip node;
[0289] The fifteenth sending module is used to send the write data in the second write request message to the target node of the second write request message in the form of a second write request message of the on-chip protocol after receiving the write response message returned by the target node of the second write request message.
[0290] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of a protocol conversion device provided by the present invention, the protocol conversion device comprising:
[0291] A memory 71, used for storing computer programs;
[0292] The processing device 72 is used to implement the steps of the protocol conversion method in the above-mentioned embodiment when executing the computer program.
[0293] As an optional embodiment, the processing device 72 includes:
[0294] The message scheduling and preprocessing module is used to determine whether a second-class message sent from the second-class node to the first-class node and meeting the first preset condition has been received before the first-class message is received, and if it has been received, stop the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and use the data corresponding to the received second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node;
[0295] The message scheduling and preprocessing module is also used to control the memory to store the data carried by the specified message;
[0296] The message conversion module is used to convert the domain information of the message between the on-chip protocol and the off-chip protocol under the control of the message scheduling and pre-processing module, wherein the on-chip protocol refers to: the cache consistency protocol used on the chip, and the off-chip protocol refers to: the cache consistency protocol used off the chip;
[0297] The message generation module is used to package the domain segment information and its corresponding data output by the message conversion module into a message and send it out.
[0298] To better illustrate the embodiments of the present invention, please refer to Figure 8 , Figure 8 A schematic diagram of the structure of a processing device provided by the present invention, Figure 8 The off-chip request buffer in the chip can store several off-chip request messages to be sent to the processing device, and the on-chip request buffer can store several on-chip request messages to be sent to the processing device. In short, the message scheduling and preprocessing (module) can read and manage each message sent to the processing device, store the data carried by the message into the memory, schedule the message, etc. The message conversion module can, under the control of the message scheduling and preprocessing (module), based on the "internal to external protocol table and internal to external protocol table", convert the domain information of the message between the on-chip protocol and the off-chip protocol, and then send the converted domain information to the message generation module. The message generation module can package the domain information and its corresponding data output by the message conversion module into a message, send it out, and manage the output queue of the message.
[0299] Among them, for the data in the memory used in the packet assembly process of the message generation module, the message generation module can send "data identifier release information" containing the data identifier of the used data to the message scheduling and preprocessing (module) to indicate that the data corresponding to the data identifier has been released from the memory.
[0300] Specifically, the internal-to-external parsing table refers to the parsing table required to "convert domain segment information from the on-chip protocol to the off-chip protocol", and the external-to-internal protocol is similar, referring to the parsing table required to "convert domain segment information from the off-chip protocol to the on-chip protocol".
[0301] For an introduction to the protocol conversion device provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the protocol conversion method, and the embodiment of the present invention will not be described in detail here.
[0302] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the protocol conversion method in the above-mentioned embodiment when executed by a processor.
[0303] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the protocol conversion method, and the embodiment of the present invention will not be described in detail here.
[0304] Please refer to Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. A computer program 92 is stored on the computer-readable storage medium 91. When the computer program 92 is executed by a processor, the steps of the protocol conversion method in the aforementioned embodiment are implemented.
[0305] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the protocol conversion method, and the embodiment of the present invention will not be described in detail here.
[0306] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the element.
[0307] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A protocol conversion method, characterized in that: Applied to CPU, including: When receiving a first-class message sent from a first-class node to a second-class node, determining whether a second-class message sent from a second-class node to a first-class node and satisfying a first preset condition has been received before this moment, wherein the first-class node refers to: one of an on-chip node and an off-chip node, the second-class node refers to: the other of an on-chip node and an off-chip node, the first-class message refers to: one of a write request message and a listen request message, the second-class message refers to: the other of a write request message and a listen request message, and the first preset condition refers to: the first-class message and the second-class message carry the same memory address; If it has been received, stop executing the transparent transmission action of the first type of message sent by the first type node to the second type node, and use the data corresponding to the second type of message sent by the second type node to the first type node that has been received as the data corresponding to the first type of message sent by the first type node to the second type node.
2. The protocol conversion method according to claim 1, characterized in that: In the on-chip cache coherence protocol of the central processing unit, the write data corresponding to the write request message is sent independently of the write request message; When the first type of message is a listen request message and the first type of node is an off-chip node: Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes: Sending a write response message to the sender of the received second-class message, and receiving a write data message sent by the sender of the second-class message; Sending the write data in the write data message corresponding to the received second-class message to the sender of the first-class message in the form of a monitoring response message; Stop transparent transmission of received monitoring request messages.
3. The protocol conversion method according to claim 2, characterized in that: When the first type of message is a write request message and the first type of node is an on-chip node: Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes: Extracting the monitoring response data in the monitoring response message sent by the destination party of the received second type message; Converting the domain information of the sniff response message sent by the destination of the second type of message from the on-chip protocol to the off-chip protocol, wherein the on-chip protocol refers to: a cache consistency protocol used on the chip, and the off-chip protocol refers to: a cache consistency protocol used off the chip; The intercept response message obtained by assembling the converted domain information and the intercept response data is sent to the sender of the second type of message; A write response message is sent to a sender of the first type of message, and a write data message sent by the sender of the first type of message is received, so as to ignore the write data message.
4. The protocol conversion method according to claim 2, characterized in that: When the first type of message is a monitoring request message and the first type of node is an intra-chip node: Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes: Sending the write data carried by the received second-class message to the sender of the first-class message in the form of a monitoring response message; When receiving a write response message sent by the sender of the first type of message, the write data carried by the received second type of message is sent to the sender of the first type of message in the form of a write data message; A write response message of the second type of message is sent to the sender of the received second type of message.
5. The protocol conversion method according to claim 2, characterized in that: When the first type of message is a write request message and the first type of node is an off-chip node: Stopping the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and using the received data corresponding to the second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node includes: Storing write data carried by the first type of message; Converting the domain information of the monitoring response message sent by the destination of the second type of message from the off-chip protocol to the on-chip protocol; The monitoring response message obtained by assembling the converted domain information and the write data carried by the first-class message is sent to the sender of the second-class message; After receiving the first type of message, a write response message is sent to the sender of the first type of message.
6. The protocol conversion method according to claim 1, characterized in that: The protocol conversion method also includes: receiving a first target message sent by a third type of node outside the chip; Converting the domain information of the first target message from an off-chip protocol to an on-chip protocol; Packaging the domain information after the protocol conversion to obtain a first target message after the protocol conversion; If the CPU includes a fourth-type node in the chip, the first target message after the protocol conversion is sent to the fourth-type node in the chip, wherein the third-type node refers to: one of the request node and the master node, the fourth-type node refers to: the other of the request node and the master node, the on-chip protocol refers to: a cache consistency protocol used in the chip, and the off-chip protocol refers to: a cache consistency protocol used outside the chip; If the CPU includes a plurality of fourth-type nodes in the chip, based on the preset first corresponding relationship, determining the target node identifier corresponding to the memory address carried by the first target message; The first target message after the protocol conversion is sent to a target node located in the slice, wherein the target node refers to: a node to which the target node identifier belongs.
7. The protocol conversion method according to claim 6, characterized in that: When the third type of node is the master node and the fourth type of node is the request node: If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include: If the CPU chip includes a plurality of fourth-type nodes, a first sub-correspondence relationship is determined; Based on the first sub-correspondence, determine the target node identifier corresponding to the memory address carried by the first target message; The first sub-correspondence relationship refers to the correspondence relationship between the memory address and the request node identifier.
8. The protocol conversion method according to claim 6, characterized in that: When the third type of node is a requesting node and the fourth type of node is a master node: If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include: If the CPU chip includes a plurality of fourth-type nodes, a second sub-correspondence relationship is determined; Based on the second sub-correspondence relationship, determine the target node identifier corresponding to the memory address carried by the first target message; The second sub-correspondence relationship refers to the correspondence relationship between the memory address and the master node identifier.
9. The protocol conversion method according to claim 6, characterized in that: If the CPU includes multiple fourth-type nodes in the chip, based on the preset first corresponding relationship, the target node identifier corresponding to the memory address carried by the first target message is determined to include: If the CPU includes multiple nodes of the fourth type, determining whether a first corresponding relationship preset in the CPU can be obtained; If it can be obtained, then based on the preset first corresponding relationship, determine the target node identifier corresponding to the memory address carried by the first target message; If it cannot be obtained, the alarm will be controlled to sound an alarm.
10. The protocol conversion method according to claim 9, characterized in that: If the CPU includes multiple fourth-type nodes in the chip, after determining whether the first corresponding relationship preset in the CPU can be obtained, the protocol conversion method further includes: If it cannot be obtained, the first target message after protocol conversion is broadcasted within the chip.
11. The protocol conversion method according to claim 9, characterized in that: Determining whether the first corresponding relationship preset in the central processing unit can be obtained includes: Determine whether the first sub-condition and the second sub-condition are simultaneously satisfied, wherein the first sub-condition refers to: a preset first corresponding relationship exists in the central processing unit, and the second sub-condition refers to: access rights to the first corresponding relationship exist; If both are true, it is determined that the first corresponding relationship preset in the central processing unit can be obtained; If both conditions are not met at the same time, it is determined that the first corresponding relationship preset in the central processing unit cannot be obtained.
12. The protocol conversion method according to claim 1, characterized in that: The protocol conversion method also includes: Converting the domain segment information of the received second target message sent by the first type of node to the second type of node from the first protocol to the second protocol, wherein the first protocol refers to: a cache consistency protocol corresponding to the node type of the first type of node, and the second protocol refers to: a cache consistency protocol corresponding to the node type of the second type of node; Binding and storing the first identification information in the second target message before protocol conversion and the second identification information in the second target message after protocol conversion, wherein the first identification information refers to: the source node identification and the transmission message identification, and the second identification information refers to: the target node identification and the transmission message identification; Packaging the domain segment information after the protocol conversion to obtain a second target message of the second protocol, sending the message to the second type of node, and receiving a response message from the second type of node to the second target message; Determine currently stored binding data that meets a second preset condition, wherein the second preset condition refers to: the second identification information in the binding data is consistent with the first identification information in the response message of the second target message, and the binding data refers to: the first identification information and the second identification information in a binding storage state; Using the source node identifier in the first identifier information in the binding data that meets the second preset condition as the target node of the response message of the second target message; After converting the response message of the second target message from the second protocol to the first protocol, the response message is sent to the target node of the response message of the second target message.
13. The protocol conversion method according to claim 1, characterized in that: Applies to any central processing unit in a server; Wherein, the server includes a multi-channel central processing unit.
14. The protocol conversion method according to claim 1, characterized in that: After determining whether a second type of message sent by the second type of node to the first type of node and meeting the first preset condition has been received before this moment, the protocol conversion method further includes: If it has been received, clear the count value; If not received, the count value is increased by one and it is determined whether the count value reaches a preset threshold; If it is reached, the control indicator will indicate an abnormality.
15. The protocol conversion method according to any one of claims 1 to 14, characterized in that: The on-chip protocol includes a coherent hub interconnection protocol, and the off-chip protocol includes a cache consistency interconnection protocol for an accelerator, wherein the on-chip protocol refers to: a cache consistency protocol within a central processing unit chip, and the off-chip protocol refers to: a cache consistency protocol outside a central processing unit chip; The protocol conversion method also includes: After receiving the first write request message sent by the on-chip node, sending a write response message to the sender of the first write request message; receiving a first write data message sent by a sender of a first write request message; Sending the write data in the first write data message to the outside of the chip in the form of a first write request message of the off-chip protocol; After receiving the second write request message sent by the off-chip node, send a write request message to the target node of the second write request message located in the chip; After receiving the write response message returned by the target node of the second write request message, the write data in the second write request message is sent to the target node of the second write request message in the form of a second write request message of the on-chip protocol.
16. A protocol conversion device, characterized in that: include: A first judgment module is used to judge whether a second-class message sent from the second-class node to the first-class node and meeting the first preset condition has been received before the first-class message is received, and if so, trigger the first action module; The first type of node refers to: one of an on-chip node and an off-chip node, the second type of node refers to: the other of an on-chip node and an off-chip node, the first type of message refers to: one of a write request message and a listen request message, the second type of message refers to: the other of a write request message and a listen request message, and the first preset condition refers to: the first type of message and the second type of message carry the same memory address; The first action module is used to stop the transparent transmission action of the first type of message sent from the first type of node to the second type of node, and use the data corresponding to the second type of message sent from the second type of node to the first type of node as the data corresponding to the first type of message sent from the first type of node to the second type of node.
17. A protocol conversion device, characterized in that: include: Memory for storing computer programs; A processing device, used to implement the steps of the protocol conversion method as claimed in any one of claims 1 to 15 when executing the computer program.
18. The protocol conversion device according to claim 17, characterized in that: The processing device comprises: The message scheduling and preprocessing module is used to determine whether a second-class message sent from the second-class node to the first-class node and meeting the first preset condition has been received before the first-class message is received, and if it has been received, stop the transparent transmission action of the first-class message sent from the first-class node to the second-class node, and use the data corresponding to the received second-class message sent from the second-class node to the first-class node as the data corresponding to the first-class message sent from the first-class node to the second-class node; The message scheduling and preprocessing module is also used to control the memory to store the data carried by the specified message; The message conversion module is used to convert the domain information of the message between the on-chip protocol and the off-chip protocol under the control of the message scheduling and pre-processing module, wherein the on-chip protocol refers to: the cache consistency protocol used on the chip, and the off-chip protocol refers to: the cache consistency protocol used off the chip; The message generation module is used to package the domain segment information and its corresponding data output by the message conversion module into a message and send it out.
19. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the protocol conversion method as claimed in any one of claims 1 to 15 are implemented.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the protocol conversion method according to any one of claims 1 to 15 are implemented.
