Disclosure of Invention
The invention provides an on-chip network communication interface and a communication method, which can solve the problem of compatibility of the on-chip network communication interface and reduce the resource occupation of a processor unit.
In one aspect, the present invention provides an on-chip network communication interface, including: the system comprises an IP unit interface module, a network-on-chip routing interface module, a memory interface module, a bus interface module, a function register module, an interface controller module and an interface data transceiving module;
the IP unit interface module is used for connecting a general IP core and a special IP core in a local IP;
the network-on-chip routing interface module is used for connecting network nodes of a network-on-chip;
the memory interface module is used for accessing a data memory of a local IP unit through a data bus in the IP unit interface module and performing data interaction with the interface data transceiver module under the control of the interface controller module;
the bus interface module is used for communicating with a local IP through the IP unit interface module and performing read-write control on the function register module under the control of the local IP;
the function register module is used for configuring and storing the routing information of the data packet in the network on chip and the working state of the interface controller module;
the interface controller module is used for reading the state value of the function register module and controlling the work of the interface data transceiver module;
the interface data transceiver module is used for completing the packing and unpacking of input and output data packets and transceiving data packets under the control of the interface controller module;
the IP unit interface module is respectively connected with the memory interface module and the bus interface module, the bus interface module is connected with the function register module, the memory interface module is respectively connected with the interface controller module and the interface data transceiver module, the interface controller module is connected with the interface data transceiver module, and the network-on-chip routing interface module is connected with the interface data transceiver module.
Further, the interface data transceiver module comprises a data transmitting unit and a data receiving unit;
the data sending unit is used for packing the data packet to be sent according to a specified microchip format and sending the data packet to the network node in the network-on-chip route;
and the data receiving unit is used for analyzing the data packets of different packet types and storing the received data packets to the local IP according to the analysis result.
Further, the network-on-chip communication interface is used for transmitting and receiving data packets in a network-on-chip.
Further, the data packet is decomposed into a plurality of flits, and the flit category of the data packet of the network-on-chip communication interface includes: head microchip, body information microchip, body microchip and tail microchip;
the head flit is used for establishing a communication link and comprises routing information and instruction information, the body information flit comprises transmission data length and address information, the body flit comprises transmission data information, and the tail flit is used for releasing the communication link.
In another aspect, the present invention provides a communication method of an on-chip network communication interface, configured to send a data packet, where the method includes:
detecting whether the on-chip network communication interface is idle;
if yes, packing the data packet to be sent according to a specified microchip format;
detecting whether the link resource requested by the network on chip is idle;
and if so, sending the packed data packet to a network node of the network on chip.
Further, the method further comprises:
judging whether the data packet is sent completely according to an on-chip network routing interface module in the on-chip network communication interface;
if so, setting the flag position of a functional register module in the network-on-chip communication interface to be idle, and waiting for next data transmission;
otherwise, the step of detecting whether the link resource requested by the network on chip is idle is repeatedly executed.
In another aspect, the present invention provides a method for communicating on-chip network communication interfaces, which is used for receiving data packets, and includes:
detecting whether the on-chip network communication interface is idle;
if yes, extracting the packet type of the data packet to be received;
analyzing the data packet to be received according to different packet types;
and storing the data packet to be received to a local IP according to the analysis result.
Further, the extracting the packet type of the data packet to be received includes:
analyzing the head microchip information of the data packet to be received according to an interface data transceiving module in the network-on-chip communication interface;
and extracting the type of the data packet according to the header flit information.
Further, the packet types include a control instruction type packet and a data type packet, and parsing the data packet to be received according to different packet types includes:
when the packet type is a control instruction type packet, decoding the control instruction in the data packet to be received according to an interface data transceiver module in the network-on-chip communication interface to obtain a decoding result;
and when the packet type is a data packet, analyzing the data packet information in the data packet to be received according to an interface data transceiver module in the network-on-chip communication interface to obtain an analysis result.
Further, the method further comprises:
and setting the flag position of a functional register module in the network-on-chip communication interface to be idle, and waiting for next data reception.
According to the technical scheme, the on-chip network communication interface and the communication method provided by the invention have the advantages that data interaction, register reading and writing and state conversion are carried out under the control of the general IP core and the special IP core in the local IP, and the transceiving data is unpacked and packed through the interface data transceiving module to carry out data packet transceiving according to the switching technology of the on-chip network. Compared with the network-on-chip communication interface in the prior art, the network communication interface realizes the separation of communication and calculation, because the network-on-chip communication interface participates in the unique component of the communication process, the communication process is transparent to the processing unit, and the communication performance of the multi-core system is improved.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a block diagram illustrating components of a network-on-chip communication interface according to an embodiment of the present invention, where as shown in fig. 1, the network-on-chip communication interface includes: an IP unit interface module 11, a network-on-chip routing interface module 12, a memory interface module 13, a bus interface module 14, a function register module 15, an interface controller module 16 and an interface data transceiver module 17;
the IP unit interface module 11 may be configured to connect a general IP core and a special IP core in a local IP;
the network-on-chip routing interface module 12 may be configured to connect network nodes of a network-on-chip;
the memory interface module 13 may be configured to access a data memory of a local IP unit through a data bus in the IP unit interface module 11, and perform data interaction with the interface data transceiver module 17 under the control of the interface controller module 16;
the bus interface module 14 may be configured to communicate with a local IP through the IP unit interface module 11, and perform read-write control on the function register module 15 under the control of the local IP;
the function register module 15 may be configured and used to configure and store the routing information of the data packet in the network on chip and the working state of the interface controller module 16;
the interface controller module 16 may be configured to read a state value of the function register module and control the operation of the interface data transceiver module 17;
the interface data transceiver module 12 may be configured to complete packing and unpacking of input and output data packets and transceiving data packets under the control of the interface controller module 16;
the IP unit interface module 11 is connected to the memory interface module 13 and the bus interface module 14, the bus interface module 14 is connected to the function register module 15, the memory interface module 13 is connected to the interface controller module 16 and the interface data transceiver module 17, the interface controller module 16 is connected to the interface data transceiver module 17, and the network-on-chip routing interface module 12 is connected to the interface data transceiver module 17.
Further, the interface data transceiver module 17 includes a data receiving unit 171 and a data transmitting unit 172;
the data sending unit 172 may be configured to package a data packet to be sent according to a specified flit format and send the data packet to a network node in the network-on-chip route;
the data receiving unit 171 may be configured to parse data packets of different packet types, and store the received data packets in the local IP according to a parsing result.
In summary, the network-on-chip communication interface provided in the embodiments of the present invention performs data interaction, register read-write, and state conversion under the control of the general IP core and the special IP core in the local IP, and performs unpacking and packing on the transceiving data through the interface data transceiving module to perform transceiving of data packets according to the switching technology of the network-on-chip. Compared with the network-on-chip communication interface in the prior art, the network communication interface realizes the separation of communication and calculation, because the network-on-chip communication interface participates in the unique component of the communication process, the communication process is transparent to the processing unit, and the communication performance of the multi-core system is improved.
The network-on-chip communication interface may receive and transmit a data packet in a network-on-chip, where the data packet is decomposed into a plurality of flits, and fig. 2 shows a data packet format schematic diagram according to an embodiment of the present invention, and as shown in fig. 2, the types of the flits of the data packet of the network-on-chip communication interface include: the system comprises a head microchip, a body information microchip, a body microchip and a tail microchip, wherein the head microchip can be used for establishing a communication link, the information can comprise routing information and instruction information, the body information microchip can comprise transmission data length and address information, the body microchip can comprise transmission data information, and the tail microchip can be used for releasing the communication link.
Fig. 3 shows a schematic diagram of a flit format of a data packet according to an embodiment of the present invention, as shown in fig. 3, a header flit therein has 34 bits, two high bits, namely 33 th to 32 th bits, identify an identification bit of the header flit, 31 th to 24 th bits identify coordinates of a destination node of the data packet, 23 th to 16 th bits represent coordinates of a source node of the data packet, and 15 th to 0 th bits represent instruction operations required by the current data packet; the volume information flit has 34 bits in total, the high two bits, namely 33 th to 32 th bits of information are identification bits of the volume information flit, the 31 th to 16 th bits represent memory addresses stored in a destination node of a data packet, and the 15 th to 0 th bits represent the number of bytes of data contained in the current data packet; the volume microchip has 34 bits in total, the high two bits, namely 33 th to 32 th bit information are identification bits of the volume microchip, and the 31 st to 0 th bits represent data contents needing to be transmitted in the current data packet; the tail microchip has 34 bits in total, the high two bits, namely 33 th to 32 th bit information are identification bits of the tail microchip, and 31 th to 0 th bits are idle bits.
Fig. 4 is a flowchart illustrating a communication method of a network-on-chip communication interface according to another embodiment of the present invention, which is specifically used for sending a network-on-chip data packet, and as shown in fig. 4, the method includes:
401. and detecting whether the network-on-chip communication interface is idle.
The on-chip network communication interface is a functional component responsible for connecting the on-chip network routing node and the local IP unit, and in general, before sending a data packet, the local IP unit sends a request signal through the data packet sent by the local IP unit interface module, where the request signal is a request signal for requesting to send the data packet from the local IP unit to the on-chip network routing node, and further, after receiving the request signal for sending the data packet by the local IP unit, the interface controller module determines whether the working state of the on-chip network communication interface is idle by reading the functional register module, and if so, executes step 402, otherwise, sends a request to wait.
The data packet is to divide the data to be sent into different groups according to a certain standard, and the grouped data becomes the data packet.
402. If yes, packing the data packet to be sent according to the prescribed flit format.
For the embodiment of the present invention, the interface controller module reads the data packet to be sent into the interface data transceiver module by controlling the memory interface module, and further packs the data packet to be sent according to the specified flit format through the data sending unit in the interface data transceiver module, where different flit formats have different packing modes, and the types of the flits of the data packet of the network-on-chip communication interface include: for example, if the flit format of the data packet is a head flit, the data packet is written into each bit of the head flit according to the format of the head flit, and the embodiment of the present invention is not limited.
403. It is detected whether the link resources requested by the network on chip are free.
The network-on-chip request is that the network-on-chip routing interface module requests network link resources from the network-on-chip after receiving the data packet flits, and further judges whether the network-on-chip link resources are idle, if so, the network-on-chip routing interface module indicates that the current link resources are idle and can store the sent data packets, and if not, the network-on-chip routing interface module indicates that the current link resources are occupied and cannot store the sent data packets.
404. And if so, sending the packed data packet to a network node of the network on chip.
For the embodiment of the invention, when detecting that the link resource requested by the network on chip is idle, the network on chip indicates that the current network on chip has the idle link resource, the packed data packet is further injected into the network on chip, and specifically, the received data packet flits can be sequentially injected into the network on chip through the network on chip routing interface module.
It should be noted that, after the data packet is sent to the network node of the network on chip, the embodiment of the present invention may further determine whether the data packet is sent completely according to the network on chip routing interface module in the network on chip communication interface, and if the data packet is sent completely, set the flag bit of the functional register module in the network on chip communication interface to be idle, and wait for the next data transmission. Of course, if the sending is not finished, whether the link resource requested by the network on chip is idle is detected again.
In another communication method of a network-on-chip communication interface according to an embodiment of the present invention, when it is detected that the network-on-chip communication interface is idle, a data packet to be sent is packed according to a prescribed flit format, and then, when a network-on-chip link resource is idle, the packed data packet is injected to a network node of a network-on-chip. Compared with the communication method of the network-on-chip communication interface in the prior art, the network-on-chip communication interface in the embodiment of the invention realizes the separation of communication and calculation, because the network-on-chip communication interface participates in the only part of the communication process, the communication process is transparent to the processing unit, which is beneficial to improving the communication performance of the multi-core system, and meanwhile, the network-on-chip communication interface in the embodiment of the invention has the advantages of simple design structure, less occupied resources, good compatibility and easy expansion.
Fig. 5 is a flowchart illustrating a communication method of a network-on-chip communication interface according to another embodiment of the present invention, specifically for receiving a network-on-chip data packet, as shown in fig. 5, the method includes:
501. and detecting whether the network-on-chip communication interface is idle.
The on-chip network communication interface is a functional component responsible for connecting the on-chip network routing node and the local IP unit, and in general, before sending a data packet, the on-chip network routing node sends a request signal through the data packet sent by the on-chip network routing module, where the request signal is a request signal for requesting to send the data packet from the on-chip network routing node to the local IP unit, and further, after receiving the request signal for sending the data packet by the on-chip network routing node, the interface controller module judges whether the working state of the on-chip network communication interface is idle by reading the functional register module, if so, step 402 is executed, otherwise, the request is sent to wait.
The data packet is to divide the data to be sent into different groups according to a certain standard, and the grouped data becomes the data packet.
502. If so, the packet type of the data packet to be received is extracted.
For the embodiment of the present invention, the header flit information of the received data packet may be analyzed by a data receiving unit in the interface transceiving data module, and the packet type of the data packet to be received is determined according to the header flit information, where the analysis manners required for different packet types are different, and the packet type of the data packet may include a control-class instruction packet and a data-class packet, which is not limited in the embodiment of the present invention.
503. And analyzing the data packet to be received according to different packet types.
For the embodiment of the present invention, when the packet type is the control instruction type packet, the control instruction in the data packet to be received may be decoded according to the interface data transceiver module in the network-on-chip communication interface to obtain the decoding result, and the decoding result is sent to the interface controller module.
For the embodiment of the invention, when the packet type is the data packet, the data packet information in the data packet to be received can be analyzed according to the interface data transceiver module in the network-on-chip communication interface to obtain the analysis result, and the analysis result is sent to the memory interface module.
504. And storing the data packet to be received to a local IP according to the analysis result.
For the embodiment of the invention, when the packet type is the control instruction type packet, after the interface controller receives the decoding result, the interface controller executes the command according to the received decoding result, and stores the data packet to be received to the local IP.
For the embodiment of the invention, when the packet type is a data packet, after the memory interface module receives the analysis result, the data packet to be received is sent to the local IP through the IP unit interface module according to the received analysis result.
It should be noted that, in order to ensure stability of data reception, in the embodiment of the present invention, after the data packet to be received is stored in the local IP, the flag bit of the function register module in the network-on-chip communication interface may be set to be idle, and the next data reception is waited.
According to the communication method of the network-on-chip communication interface provided by the embodiment of the invention, when the network-on-chip communication interface is detected to be idle, the packet type of the data packet to be received is extracted, the data packet to be received is analyzed according to different packet types, and the data packet to be received is stored to the local IP according to the analysis result, so that the flexibility of receiving the data of the network-on-chip communication interface is improved. Compared with the communication method of the network-on-chip communication interface in the prior art, the network-on-chip communication interface in the embodiment of the invention realizes the separation of communication and calculation, because the network-on-chip communication interface participates in the only part of the communication process, the communication process is transparent to the processing unit, which is beneficial to improving the communication performance of the multi-core system, and meanwhile, the network-on-chip communication interface in the embodiment of the invention has the advantages of simple design structure, less occupied resources, good compatibility and easy expansion.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions.