Data transmission method and device, hardware processing device and storage medium
Through the coordinated work of the monitoring unit and the main interface processing unit, the problem of low data transmission efficiency in the producer-consumer model is solved, and the accuracy and efficiency of data transmission are improved.
Patent Information
- Application Number
- CN202410961771.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-12
AI Technical Summary
In the existing producer-consumer model, data transmission efficiency is low due to the serial issuance of data streams, making it difficult to ensure the correctness of data transmission.
The monitoring unit determines the accumulated value of the write request command and the write response command, and sends the accumulated value to the on-chip interconnect network. The main interface processing unit performs command mapping, and synchronizes the mapping results to the on-chip interconnect network, so that consumers can accurately Get target data.
Improve the accuracy and efficiency of data transmission and improve the execution efficiency of producer-consumer model.
Smart Images

Figure CN118945228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data transmission method, device, hardware processing device and storage medium. Background Art
[0002] The Producer-Consumer Model is an abstract model used in computer science to describe task synchronization and resource sharing problems in concurrent systems. In this model, the producer is responsible for writing data into the buffer, while the consumer reads data from the buffer. The producer usually uses the same device ID to send the data stream to ensure the correctness and order of the data stream. According to the bus protocol specification, the same device is strictly executed in sequence on the on-chip interconnection network. The current write command must wait until the response from the previous slave device is received before it can be sent, resulting in the serial sending of the data stream, which greatly affects the execution efficiency of the producer-consumer model. Since the data stream can be executed out of order, it is difficult to ensure the correctness of the producer-consumer model, which affects the efficiency of data transmission. Summary of the invention
[0003] In view of this, the present invention provides a data transmission method, device, hardware processing device and storage medium to solve the problem of low data transmission accuracy, which leads to low transmission efficiency.
[0004] In a first aspect, the present invention provides a data transmission method, the method comprising:
[0005] Based on the monitoring unit, the write request command and the corresponding write response command issued by the single producer are monitored to determine the write request command cumulative value and the write response command cumulative value, and the write request command cumulative value is sent to the on-chip interconnection network, and the write response command cumulative value is sent to the main interface processing unit;
[0006] storing notification data based on the cache state of the cache unit, and sending the notification data to the main interface processing unit, the notification data at least including a write request command and an accumulated value of the write request command;
[0007] The main interface processing unit reads the notification data in the cache unit, and performs command mapping based on the notification data to obtain a mapping result, wherein the mapping result at least includes a write request command corresponding to each consumer;
[0008] The mapping result is synchronized to an on-chip interconnection network, so that each consumer obtains corresponding notification data from the on-chip interconnection network, and the consumer obtains target data based on the notification data.
[0009] In an optional implementation, the monitoring unit monitors the write request command and the corresponding write response command issued by the single producer to determine the write request command cumulative value and the write response command cumulative value, and sends the write request command cumulative value to the on-chip interconnection network, and sends the write response command cumulative value to the main interface processing unit, including:
[0010] Based on the listening unit receiving the write request command sent by the single producer, and accumulating the write request command, determining the write request command accumulation value;
[0011] Sending the write request command accumulated value to the hardware interface write request channel of the single producer, and sending the write request command accumulated value to the on-chip interconnection network;
[0012] receiving a write response command fed back by the single producer based on the write request command accumulated value, and accumulating the write response command to determine the write response command accumulated value;
[0013] The write response command accumulated value is sent to the main interface processing unit.
[0014] In an optional implementation, storing notification data based on the cache state of the cache unit and sending the notification data to the main interface processing unit includes:
[0015] When the cache state of the cache unit is not full, based on the slave interface processing unit acquiring notification data from the on-chip interconnect network and storing the notification data in the cache unit, the slave interface processing unit is connected to the on-chip interconnect network and the cache unit respectively;
[0016] When the cache state of the cache unit is not empty, the host interface processing unit reads the notification data from the cache unit.
[0017] In an optional implementation, the master interface processing unit includes at least a comparison unit, a command mapping unit, a consumer cache unit, and a master interface unit.
[0018] In an optional implementation manner, the main interface processing unit reads the notification data in the cache unit, and performs command mapping based on the notification data to obtain a mapping result, including:
[0019] The main interface processing unit reads the notification data in the cache unit, and compares the write request command accumulated value and the write response command accumulated value in the notification data based on the comparison unit to obtain a comparison result;
[0020] reading a write request command in the notification data based on the comparison result, the cache status of the cache unit, and the cache status of the consumer cache unit;
[0021] Command mapping is performed on the write request command to obtain a mapping result, wherein the mapping result includes at least the write request command corresponding to each consumer.
[0022] In an optional implementation, the reading the write request command in the notification data based on the comparison result, the cache status of the cache unit, and the cache status of the consumer cache unit includes:
[0023] When the write response command accumulated value is not less than the write request command accumulated value, acquiring the cache state of the cache unit and the cache state of the consumer cache unit;
[0024] When the cache state of the cache unit is not empty and the cache state of the consumer cache unit is not full, reading the write request command in the notification data, the write request command including the consumer number and the first address corresponding to each of the write request commands;
[0025] The command mapping is performed on the write request command to obtain a mapping result, wherein the mapping result includes at least the write request command corresponding to each consumer, including:
[0026] Based on the command mapping unit, the actual address and the device identification number are respectively searched in a preset database based on the consumer number corresponding to each write request command and the first address, the actual address corresponds to the first address, and the device identification number corresponds to the consumer number;
[0027] Determine a mapping result based on the query result, wherein the mapping result includes an actual address and a device identification number of the consumer corresponding to each write request command;
[0028] storing the mapping result based on the consumer cache unit, the consumer cache unit being connected to the command mapping unit and the master interface unit respectively;
[0029] In response to a read request initiated by the master interface unit, the mapping result is written into the master interface unit.
[0030] In an optional implementation, synchronizing the mapping result to an on-chip interconnect network includes:
[0031] When the cache state of the consumer cache unit is not empty and the on-chip interconnect network is idle, the mapping result is sent to the on-chip interconnect network.
[0032] In a second aspect, the present invention provides a data transmission device, the device comprising:
[0033] A data monitoring module, used for monitoring the write request command and the corresponding write response command issued by a single producer based on the monitoring unit to determine the write request command cumulative value and the write response command cumulative value, and sending the write request command cumulative value to the on-chip interconnection network, and sending the write response command cumulative value to the main interface processing unit;
[0034] A cache module, used for storing notification data based on a cache state of a cache unit, and sending the notification data to a main interface processing unit, wherein the notification data includes at least a write request command and an accumulated value of the write request command;
[0035] A command mapping module, used for the main interface processing unit to read the notification data in the cache unit, and perform command mapping based on the notification data to obtain a mapping result, wherein the mapping result at least includes a write request command corresponding to each consumer;
[0036] The result synchronization module is used to synchronize the mapping result to the on-chip interconnection network, so that each consumer obtains the corresponding notification data from the on-chip interconnection network, and the consumer obtains the target data based on the notification data.
[0037] In a third aspect, the present invention provides a hardware processing device for executing the data transmission method of the first aspect or any corresponding embodiment thereof, comprising: a monitoring unit, one end of which is connected to a hardware interface of a single producer, and the other end of which is connected to a main interface processing unit;
[0038] a cache unit, the cache unit being connected to the slave interface processing unit, and the slave interface processing unit being connected to an on-chip interconnect network;
[0039] A main interface processing unit is connected to the cache unit and to the on-chip interconnect network.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data transmission method of the first aspect or any corresponding embodiment thereof.
[0041] The data transmission method provided in this embodiment monitors the write request command and the corresponding write response command issued by a single producer based on a monitoring unit, and sends the accumulated value of the write request command to the on-chip interconnection network, sends the accumulated value of the write response command to the main interface processing unit, stores notification data and sends the notification data to the main interface processing unit, reads the notification data and maps the command through the main interface processing unit to obtain the mapping result, and synchronizes the mapping result to the on-chip interconnection network so that consumers can obtain the corresponding notification data and obtain the target data according to the notification data. This method is equivalent to storing, monitoring and command mapping the notification messages sent by a single producer to multiple consumers and then forwarding them to the corresponding consumers, thereby improving the accuracy of consumers obtaining target data and improving the efficiency of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a schematic diagram of a producer-consumer model according to an embodiment of the present invention;
[0044] Figure 2 is a schematic diagram of a hardware processing device and external interconnection structure according to an embodiment of the present invention;
[0045] Figure 3 is a flow chart of a data transmission method according to an embodiment of the present invention;
[0046] Figure 4 is a schematic diagram of a main interface processing unit according to an embodiment of the present invention;
[0047] Figure 5 is a schematic diagram of a single producer data flow according to an embodiment of the present invention;
[0048] Figure 6 is a schematic diagram of a single producer hardware interface write command flow according to an embodiment of the present invention;
[0049] Figure 7 is a schematic diagram of a cache unit data format according to an embodiment of the present invention;
[0050] Figure 8 is a schematic diagram of accumulated values of a write response command according to an embodiment of the present invention;
[0051] Fig. 9 is a schematic diagram of a consumer cache unit data format according to an embodiment of the present invention;
[0052] Fig.10 is a structural block diagram of a data transmission device according to an embodiment of the present invention;
[0053] Fig.11 It is a schematic diagram of a hardware processing method of a single producer-multiple consumers model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0055] The producer-consumer pattern is a classic multithreaded design pattern used to solve data sharing and collaboration problems between multiple threads. In the producer-consumer pattern, there are two types of threads: producer threads and consumer threads. They collaborate by sharing a buffer (or queue). The producer puts data into the buffer, and the consumer takes data from the buffer and processes it. See Figure 1 The producer-consumer model is a schematic diagram of a single producer and four consumer models. The single producer generates data for consumers and notifies consumers in sequence according to the data flow of 1->2->3->4->5->6->7->8 (number 1 indicates generating data for consumer 0, number 2 indicates notifying consumer 0 that data has been generated, ..., number 7 indicates generating data for consumer 3, and number 8 indicates notifying consumer 3 that data has been generated). In the single producer-multiple consumer model, the single producer usually uses the same device ID to send the data stream to ensure the correctness and sequence of the data stream. Its hardware processing method can be abstracted as a master device using the same device ID to initiate write requests to different slave devices. According to the bus protocol specification, the same device ID is strictly executed in sequence in the on-chip interconnection network. The current write command must wait until the response of the previous slave device is received before it can be sent. The serial sending of the data stream may affect the execution efficiency of the producer-consumer model, and it is difficult to ensure the correctness of the producer-consumer model.
[0056] Based on this, an embodiment of the present invention provides a data transmission method, which is applied to a hardware processing device of a single producer-multiple consumer model, and the hardware processing device is suitable for a single producer-multiple consumer model. Specifically, it includes: a monitoring unit, a cache unit, a master interface processing unit and a slave interface processing unit, one end of the monitoring unit is connected to the hardware interface of the single producer, and the other end of the monitoring unit is connected to the master interface processing unit; the cache unit is connected to the slave interface processing unit, and the slave interface processing unit is connected to the on-chip interconnection network; the master interface processing unit is connected to the cache unit and connected to the on-chip interconnection network. The outside of the hardware processing device includes modules such as a single producer hardware interface, a consumer hardware interface, a cache area hardware interface, and an interconnection network on the on-chip interconnection network. Figure 2 Schematic diagram of the hardware processing device and external interconnection structure of the single producer-multiple consumers model.
[0057] The single producer hardware interface is a master device interface of the on-chip interconnection network, which is connected to the on-chip interconnection network and is responsible for writing data into the cache area and writing notification message data into the hardware processing device of the single producer-multiple consumer model (the software configures the address of the notification message data sent by the single producer to each consumer as the address of the hardware processing device of the single producer-multiple consumer model; the hardware processing device of the single producer-multiple consumer model then performs address conversion before sending it to each consumer).
[0058] The consumer hardware interface is a master device interface and a slave device interface of the on-chip interconnect network, connected to the on-chip interconnect network. As a slave device, it is responsible for receiving notification message data sent by the hardware processing device of the single producer-multiple consumer model; as a master device, it is responsible for reading data from the cache area for subsequent processing. The on-chip interconnect network connects a total of M (M≥1) consumer hardware interfaces.
[0059] The cache hardware interface is a slave device interface of the on-chip interconnect network, responsible for receiving data sent by a single producer hardware interface. The on-chip interconnect network connects a total of N (N≥1) cache hardware interfaces.
[0060] The on-chip interconnect network is used to realize the interconnection communication between the single producer hardware interface, the multi-consumer hardware interface, the cache hardware interface and the hardware interface of the hardware processing device of the single producer-multi-consumer model. Among them, the Resp Channel of the single producer hardware interface supports the reorder buffer mechanism. The reorder buffer is a buffer mechanism used in computer architecture and network communication, which aims to solve the problem of inconsistency between the transmission order and the reception order of data packets. Data packets will arrive at the destination in an order different from the order in which they are sent. The reorder buffer ensures the orderly processing of data by storing these out-of-order response data packets and feeding them back to the upper layer protocol or application in the order in which the data packets are sent when appropriate.
[0061] According to an embodiment of the present invention, a data transmission method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] In this embodiment, a data transmission method is provided. Figure 3 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0063] Step S101, based on the monitoring unit, monitors the write request command and the corresponding write response command issued by a single producer to determine the write request command cumulative value and the write response command cumulative value, and sends the write request command cumulative value to the on-chip interconnection network, and sends the write response command cumulative value to the main interface processing unit.
[0064] When a single producer needs to send target data to a consumer, it will then send a request to write the data, i.e., a write request command. The target data will be stored in the corresponding cache area of the consumer through the on-chip interconnection network, and then the request class command will be sent to the listening unit. The write request command may include information such as the address of the consumer to which the target data is to be written and the number of the consumer. After listening to the write request command, the listening unit will count the number of write request commands, obtain the accumulated value of the write request command, and send the accumulated value of the write request command to the single producer through the write request channel of the single producer hardware interface, indicating that the write request command has been received. The single producer then sends a write response command to the listening unit through the response channel. The listening unit receives the write response command, accumulates the write response command, and determines the accumulated value of the write response command. After obtaining the accumulated value of the write request command and the accumulated value of the write response command, the accumulated value of the write request command is sent to the on-chip interconnection network, and the accumulated value of the write response command is passed to the main interface processing unit.
[0065] Step S102: storing notification data based on the cache state of the cache unit, and sending the notification data to the main interface processing unit.
[0066] The notification data at least includes a write request command and a write request command accumulated value.
[0067] The on-chip interconnect network stores notification data. When the cache state of the cache unit indicates that data can be cached, the cache unit can obtain the notification data from the on-chip interconnect network through the slave interface processing unit and store it. After caching the notification data, the cache unit can transmit the notification data to the master interface processing unit.
[0068] Step S103: the main interface processing unit reads the notification data in the cache unit, and performs command mapping based on the notification data to obtain a mapping result.
[0069] The mapping result at least includes the write request command corresponding to each consumer.
[0070] The main interface processing unit can read the notification data from the cache unit and perform command mapping on the notification data. The command mapping can map the consumer address and device number of the write request command in the notification data, thereby determining the actual address and device identification number of the consumer corresponding to each write request command, and then determining the write request command corresponding to the consumer.
[0071] Step S104 , synchronizing the mapping result to the on-chip interconnection network, so that each consumer obtains the corresponding notification data from the on-chip interconnection network, and the consumer obtains the target data based on the notification data.
[0072] The mapping result is sent to the on-chip interconnection network, so that the consumer can receive the corresponding write request command. The consumer can obtain the target data from the corresponding cache area according to the data in the write request command. The target data is the data corresponding to the write request command and is the data that needs to be transmitted to the consumer.
[0073] In some optional implementations, when the cache state of the consumer cache unit is not empty and the on-chip interconnect network is idle, the mapping result may be sent to the on-chip interconnect network.
[0074] The data transmission method provided in this embodiment monitors the write request command and the corresponding write response command issued by a single producer based on a monitoring unit, and sends the accumulated value of the write request command to the on-chip interconnection network, sends the accumulated value of the write response command to the main interface processing unit, stores notification data and sends the notification data to the main interface processing unit, reads the notification data and maps the command through the main interface processing unit to obtain the mapping result, and synchronizes the mapping result to the on-chip interconnection network so that consumers can obtain the corresponding notification data and obtain the target data according to the notification data. This method is equivalent to storing, monitoring and command mapping the notification messages sent by a single producer to multiple consumers and then forwarding them to the corresponding consumers, thereby improving the accuracy of consumers obtaining target data and improving the efficiency of data transmission.
[0075] In this embodiment, a data transmission method is provided, and the method comprises the following steps:
[0076] Step S201, based on the monitoring unit, monitors the write request command and the corresponding write response command issued by a single producer to determine the write request command cumulative value and the write response command cumulative value, and sends the write request command cumulative value to the on-chip interconnection network, and sends the write response command cumulative value to the main interface processing unit.
[0077] Specifically, the above step S201 includes:
[0078] Step S2011, based on the listening unit receiving the write request command sent by the single producer, and accumulating the write request command, to determine the accumulated value of the write request command.
[0079] The monitoring unit receives the write request command (Req Command) issued by the single producer, and accumulates the number of the write request commands to obtain the accumulated value of the write request commands.
[0080] Step S2012, sending the accumulated value of the write request command to the hardware interface write request channel of the single producer, and sending the accumulated value of the write request command to the on-chip interconnection network.
[0081] Output the accumulated value of the number of write request commands, pass it to the single producer hardware interface write request channel (Req Channel) in a signal that complies with the bus protocol, and send it synchronously to the on-chip interconnect network through the write request channel Req Channel. Among them, the accumulated value of the write request commands that comply with the bus protocol is Command User (Command User ≥ 0).
[0082] Step S2013, receiving the write response command fed back by the single producer based on the write request command accumulated value, and accumulating the write response command to determine the write response command accumulated value.
[0083] After receiving the accumulated value of the write request command in step S2012, the single producer sends a write response command (RespCommand), and the monitoring unit accumulates the received write response commands (Resp Command) to obtain the accumulated value of the write response command (Resp_Cnt, Resp_Cnt≥0).
[0084] Step S2014, sending the write response command accumulated value to the main interface processing unit.
[0085] The monitoring unit outputs the accumulated value of the write response command and passes it to the main interface processing unit.
[0086] Step S202: storing notification data based on the cache state of the cache unit, and sending the notification data to the main interface processing unit.
[0087] The notification data at least includes a write request command and a write request command accumulated value.
[0088] Specifically, the above step S202 includes:
[0089] Step S2021, when the cache state of the cache unit is not full, based on the slave interface processing unit acquiring notification data from the on-chip interconnect network and storing the notification data in the cache unit, the slave interface processing unit is connected to the on-chip interconnect network and the cache unit respectively;
[0090] Step S2022: when the cache state of the cache unit is not empty, the main interface processing unit reads the notification data from the cache unit.
[0091] As a slave device interface of the on-chip interconnect network, the slave interface processing unit is responsible for receiving commands and data issued by the single producer hardware interface. The slave interface processing unit receives the write request channel information issued by the on-chip Internet, that is, notification data, which specifically includes at least the write request command, the write request command accumulated value (Command User), etc. After receiving the data, it responds to the write request channel of the on-chip interconnect network and feeds it back to the on-chip interconnect network through the corresponding channel.
[0092] The slave interface processing unit reads the cache status of the cache unit. When the cache status of the cache unit is not full, the notification data is sent to the cache unit. The cache unit includes a cache with a depth of x (x ≥ 1) to store the notification data sent by the slave interface processing unit. The cache unit can be used for (2) maintaining the cache status. The cache status includes but is not limited to the cache empty status and the cache full status. When the cache status of the cache unit is not empty, the cached notification data can be sent to the master interface unit. Specifically, the master interface unit can initiate a request to the cache unit. When reading the notification data, it can first obtain part of the data in the notification data (for example, the accumulated value of the write request command) and then obtain the write request command.
[0093] Step S203: the main interface processing unit reads the notification data in the cache unit, and performs command mapping based on the notification data to obtain a mapping result.
[0094] The mapping result at least includes the write request command corresponding to each consumer.
[0095] In some optional implementations, the main interface processing unit includes at least a comparison unit, a command mapping unit, a consumer cache unit, and a main interface unit. Figure 4 shown.
[0096] Specifically, the above step S203 includes:
[0097] Step S2031: the host interface processing unit reads the notification data in the cache unit, and compares the write request command accumulated value and the write response command accumulated value in the notification data based on the comparison unit to obtain a comparison result.
[0098] The notification data includes the write request command accumulated value. The main interface processing unit receives the write response command accumulated value Resp_Cnt sent by the monitoring unit and the write request command accumulated value Command User read from the cache unit, compares the sizes of the two, and obtains a comparison result.
[0099] Step S2032: read the write request command in the notification data based on the comparison result, the cache status of the cache unit, and the cache status of the consumer cache unit.
[0100] Obtain the cache status of the cache unit and the cache status of the consumer cache unit. When the cache status of the cache unit indicates that data can be obtained by the main interface processing unit and the cache status of the consumer cache unit indicates that data can be cached, read the write request command in the notification data according to the comparison result.
[0101] Step S2033: perform command mapping on the write request command to obtain a mapping result, where the mapping result includes at least the write request command corresponding to each consumer.
[0102] Furthermore, the above steps S2032 to S2033 specifically include the following steps:
[0103] Step a1: when the accumulated value of the write response command is not less than the accumulated value of the write request command, the cache status of the cache unit and the cache status of the consumer cache unit are obtained.
[0104] Step a2: when the cache state of the cache unit is not empty and the cache state of the consumer cache unit is not full, read the write request command in the notification data.
[0105] The write request command includes a consumer number and a first address corresponding to each write request command.
[0106] The comparison unit receives the accumulated value of the number of write response commands Resp_Cnt and CommandUser read from the cache unit for comparison. When Resp_Cnt≥Command User is satisfied, the write request command in the notification data is read according to the cache state of the cache unit and the cache state of the consumer cache unit.
[0107] Step a3, based on the command mapping unit, querying the actual address and the device identification number in the preset database based on the consumer number and the first address corresponding to each write request command, the actual address corresponds to the first address, and the device identification number corresponds to the consumer number;
[0108] Step a4: determining a mapping result based on the query result, wherein the mapping result includes the actual address and device identification number of the consumer corresponding to each write request command.
[0109] The command mapping unit maps the write request command. Specifically, a preset database is pre-stored in the command mapping unit. The preset database stores the correspondence between the first address and the actual address of each consumer, the device identification number and the consumer number. The mapping is performed according to the first address and the consumer number in the write request command to determine the corresponding actual address and device number (Device ID, 0≦Device ID≦M-1). The mapping result includes the write request command, the actual address, the device number, etc.
[0110] Step a5, storing the mapping result based on a consumer cache unit, wherein the consumer cache unit is connected to the command mapping unit and the main interface unit respectively.
[0111] The consumer cache unit contains a cache with a depth of y, which stores the mapped results sent by the command mapping unit.
[0112] In addition, the consumer cache unit is used to maintain the cache state, and the cache state of the consumer cache unit includes but is not limited to a cache empty state and a cache full state.
[0113] Step a6: in response to a read request initiated by the main interface unit, write the mapping result into the main interface unit.
[0114] The consumer cache unit responds to the read request initiated by the master interface unit and writes the consumer cache information into the master interface unit. The master interface unit, as a master device interface of the on-chip interconnect network, is responsible for sending notification consumption to each consumer.
[0115] Step S204: synchronizing the mapping result to the on-chip interconnection network, so that each consumer obtains corresponding notification data from the on-chip interconnection network, and the consumer obtains target data based on the notification data.
[0116] For details, please see Figure 3 Step S104 of the illustrated embodiment will not be described in detail here.
[0117] In this embodiment, a data transmission method is provided. Taking a single producer, four consumers and four buffer areas as an example, this embodiment is specifically described. The operation of the Resp Channel of each device hardware interface and the main interface of each consumer are not described. The corresponding method flow chart is as follows: Fig.11 As shown in the figure, the dotted line part is the input characteristic of the single producer hardware interface in the on-chip interconnection network, and the solid line part is the hardware processing method of the single producer-multiple consumer model proposed by the present invention. Among them, the write command mapping includes at least two, one is to map the received write address to multiple consumer addresses, and the other is to map different device IDs according to the consumer number.
[0118] This method realizes the storage-forwarding of notification messages by defining a monitoring unit, a cache unit, a slave interface processing unit, and a master interface processing unit module. On the basis of improving the hardware processing efficiency of the single producer-multiple consumer model, the hardware synchronization mechanism of the producer-consumer model is realized. In addition to supporting the single producer-multiple consumer model, it can also support the single producer-single consumer model or a complex model composed of multiple single producers-single consumers, etc., and has certain scalability. It can be integrated at any position of the on-chip interconnection network and has certain flexibility. On the basis of ensuring the data consistency and integrity of the producer-consumer model, the execution efficiency of the producer-consumer model is improved.
[0119] 1. Single producer data flow
[0120] A single producer establishes a producer-consumer model with consumers 0 to 3 in turn. The data flow is as follows: Figure 5 shown.
[0121] 2. Single producer hardware interface sends write request
[0122] When a single producer hardware interface sends a write request, the hardware processing device of the single producer-multiple consumer model monitors the Req Channel and sends the accumulated value of the Req Channel command to the on-chip interconnect network together with the write command of the Command User synchronous single producer hardware interface Req Channel, such as Figure 6Among them, write device-0 to write device-3 represent write commands sent to the hardware devices of the single producer-multiple consumer model, and represent notification message data sent to consumers 0 to 3 in sequence.
[0123] 3. The hardware processing device of the single producer-multiple consumer model receives write commands and writes data
[0124] The hardware device of the single producer-multiple consumer model receives the write command and write data and saves them to the cache unit. The data format saved in the cache unit is as follows: Figure 7 The information stored in the write command at least includes the write address (Address0 to Address3) and Command User.
[0125] 4. The hardware processing device of the single producer-multiple consumer model monitors the single producer hardware interface RespChannel and generates Resp_Cnt, such as Figure 8 shown.
[0126] 5. The hardware processing device of the single producer-multiple consumer model saves the mapped information to the consumer cache unit after comparison and command mapping.
[0127] (1) When the cache status of the cache unit is not empty and the cache status of the consumer cache unit is not full, read the data of the cache unit. Take the first cache data as an example: compare the value of Command User: 1 and the value of Resp_Cnt. When Resp_Cnt (≥1) ≥ Command User (=1) (indicating that cache area 0 has saved all the data sent by the single producer hardware interface), write the read data to the consumer cache unit after command mapping. Similarly, when the cache status of the cache unit is not empty and the cache status of the consumer cache unit is not full, read the data of the cache unit, and when Resp_Cnt ≥ 3, write the read data to the consumer cache unit after command mapping; when Resp_Cnt ≥ 5, write the read data to the consumer cache unit after command mapping; when Resp_Cnt ≥ 7, write the read data to the consumer cache unit after command mapping.
[0128] (2) The hardware processing device of the single producer-multiple consumer model performs command mapping and saves the mapped data to the consumer cache unit. The command mapping at least includes address mapping, that is, mapping Address to consumer address, and mapping Device ID according to consumer number, that is, mapping different Device IDs to different consumers. The data format saved in the consumer cache unit is as follows: Fig. 9 shown.
[0129] 6. The hardware processing device of the single producer-multiple consumer model sends a write request to the consumer
[0130] When the cache state of the consumer cache unit is not empty and the on-chip interconnect network is idle, the data of the consumer cache unit is read and sent to the on-chip interconnect network using the bus protocol of the write request. The sent write request is finally sent to the four consumers through the on-chip interconnect network. After each consumer receives the notification message data, it reads the data from the corresponding cache area and performs subsequent operations.
[0131] The method utilizes the reorder buffer mechanism of the on-chip interconnect network to store and monitor the notification message request issued by a single producer, and then sends it to the consumer through the on-chip interconnect network after command mapping. On the basis of ensuring the data consistency and integrity of the producer-consumer model, the producer-consumer execution efficiency is improved. The device realizes the storage-forwarding of notification messages by defining a monitoring unit, a cache unit, a slave interface processing unit and a master interface processing unit module. On the basis of improving the hardware processing efficiency of the single producer-multiple consumer model, the hardware synchronization mechanism of the producer-consumer model is realized. In addition to supporting the single producer-multiple consumer model, it can also support the single producer-single consumer model or a complex model composed of multiple single producers-single consumers, etc., and has certain scalability. It can be integrated at any position of the on-chip interconnect network and has certain flexibility. On the basis of ensuring the data consistency and integrity of the producer-consumer model, the execution efficiency of the producer-consumer model is improved.
[0132] The hardware processing method and device of the single producer-multiple consumer model proposed in the present invention can be widely applied to fields with producer-consumer models. The hardware processing method and device of the single producer-multiple consumer model proposed in the present invention are only for the convenience of understanding the implementation mode of the present invention, and are not used to limit the present invention. Any modifications and changes made without departing from the design and scope of the present invention are within the protection scope of the present invention.
[0133] In this embodiment, a data transmission device is also provided, which is used to implement the above-mentioned embodiments and implementation methods, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0134] This embodiment provides a data transmission device, such as Fig.10 As shown, including:
[0135] The data monitoring module 301 is used to monitor the write request command and the corresponding write response command issued by the single producer based on the monitoring unit to determine the write request command cumulative value and the write response command cumulative value, and send the write request command cumulative value to the on-chip interconnection network, and send the write response command cumulative value to the main interface processing unit;
[0136] The cache module 302 is used to store notification data based on the cache state of the cache unit and send the notification data to the main interface processing unit, wherein the notification data at least includes a write request command and an accumulated value of the write request command;
[0137] A command mapping module 303 is used for the main interface processing unit to read the notification data in the cache unit, and perform command mapping based on the notification data to obtain a mapping result, wherein the mapping result at least includes a write request command corresponding to each consumer;
[0138] The result synchronization module 304 is used to synchronize the mapping result to the on-chip interconnection network, so that each consumer obtains the corresponding notification data from the on-chip interconnection network, and the consumer obtains the target data based on the notification data.
[0139] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0140] The hardware processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0141] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0142] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data transmission method, characterized in that: The method comprises: Based on the monitoring unit, the write request command and the corresponding write response command issued by the single producer are monitored to determine the write request command cumulative value and the write response command cumulative value, and the write request command cumulative value is sent to the on-chip interconnection network, and the write response command cumulative value is sent to the main interface processing unit; storing notification data based on the cache state of the cache unit, and sending the notification data to the main interface processing unit, the notification data at least including a write request command and an accumulated value of the write request command; The main interface processing unit reads the notification data in the cache unit, and performs command mapping based on the notification data to obtain a mapping result, wherein the mapping result at least includes a write request command corresponding to each consumer; The mapping result is synchronized to an on-chip interconnection network, so that each consumer obtains corresponding notification data from the on-chip interconnection network, and the consumer obtains target data based on the notification data.
2. The method according to claim 1, characterized in that The monitoring unit monitors the write request command and the corresponding write response command issued by the single producer to determine the write request command cumulative value and the write response command cumulative value, and sends the write request command cumulative value to the on-chip interconnection network, and sends the write response command cumulative value to the main interface processing unit, including: Based on the listening unit receiving the write request command sent by the single producer, and accumulating the write request command, determining the write request command accumulation value; Sending the write request command accumulated value to the hardware interface write request channel of the single producer, and sending the write request command accumulated value to the on-chip interconnection network; receiving a write response command fed back by the single producer based on the write request command accumulated value, and accumulating the write response command to determine the write response command accumulated value; The write response command accumulated value is sent to the main interface processing unit.
3. The method according to claim 1, characterized in that The storing notification data based on the cache state of the cache unit and sending the notification data to the main interface processing unit includes: When the cache state of the cache unit is not full, based on the slave interface processing unit acquiring notification data from the on-chip interconnect network and storing the notification data in the cache unit, the slave interface processing unit is connected to the on-chip interconnect network and the cache unit respectively; When the cache state of the cache unit is not empty, the host interface processing unit reads the notification data from the cache unit.
4. The method according to claim 1, characterized in that: The main interface processing unit at least includes a comparison unit, a command mapping unit, a consumer cache unit and a main interface unit.
5. The method according to claim 4, characterized in that The main interface processing unit reads the notification data in the cache unit, and performs command mapping based on the notification data to obtain a mapping result, including: The main interface processing unit reads the notification data in the cache unit, and compares the write request command accumulated value and the write response command accumulated value in the notification data based on the comparison unit to obtain a comparison result; reading a write request command in the notification data based on the comparison result, the cache status of the cache unit, and the cache status of the consumer cache unit; Command mapping is performed on the write request command to obtain a mapping result, wherein the mapping result includes at least the write request command corresponding to each consumer.
6. The method according to claim 5, characterized in that The reading the write request command in the notification data based on the comparison result, the cache state of the cache unit, and the cache state of the consumer cache unit includes: When the write response command accumulated value is not less than the write request command accumulated value, acquiring the cache state of the cache unit and the cache state of the consumer cache unit; When the cache state of the cache unit is not empty and the cache state of the consumer cache unit is not full, reading the write request command in the notification data, the write request command including the consumer number and the first address corresponding to each of the write request commands; The command mapping is performed on the write request command to obtain a mapping result, wherein the mapping result includes at least the write request command corresponding to each consumer, including: Based on the command mapping unit, the actual address and the device identification number are respectively searched in a preset database based on the consumer number corresponding to each write request command and the first address, the actual address corresponds to the first address, and the device identification number corresponds to the consumer number; Determine a mapping result based on the query result, wherein the mapping result includes an actual address and a device identification number of the consumer corresponding to each write request command; storing the mapping result based on the consumer cache unit, the consumer cache unit being connected to the command mapping unit and the master interface unit respectively; In response to a read request initiated by the master interface unit, the mapping result is written into the master interface unit.
7. The method according to claim 4, characterized in that The step of synchronizing the mapping result to an on-chip interconnection network comprises: When the cache state of the consumer cache unit is not empty and the on-chip interconnect network is idle, the mapping result is sent to the on-chip interconnect network.
8. A data transmission device, characterized in that: The device comprises: A data monitoring module, used for monitoring the write request command and the corresponding write response command issued by a single producer based on the monitoring unit to determine the write request command cumulative value and the write response command cumulative value, and sending the write request command cumulative value to the on-chip interconnection network, and sending the write response command cumulative value to the main interface processing unit; A cache module, used for storing notification data based on a cache state of a cache unit, and sending the notification data to a main interface processing unit, wherein the notification data includes at least a write request command and an accumulated value of the write request command; A command mapping module, used for the main interface processing unit to read the notification data in the cache unit, and perform command mapping based on the notification data to obtain a mapping result, wherein the mapping result at least includes a write request command corresponding to each consumer; The result synchronization module is used to synchronize the mapping result to the on-chip interconnection network, so that each consumer obtains the corresponding notification data from the on-chip interconnection network, and the consumer obtains the target data based on the notification data.
9. A hardware processing device, characterized in that: The hardware processing device is used to execute the data transmission method according to any one of claims 1 to 7, and the hardware processing device includes: A monitoring unit, one end of which is connected to the hardware interface of the single producer, and the other end of which is connected to the main interface processing unit; a cache unit, the cache unit being connected to the slave interface processing unit, and the slave interface processing unit being connected to an on-chip interconnect network; A main interface processing unit is connected to the cache unit and to the on-chip interconnect network.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data transmission method according to any one of claims 1 to 7.
