Communication device, data storage method, chip, electronic device

By implementing multiple virtual channels sharing storage resources in the communication device and further dividing the virtual channels into sub-channels, the problems of low storage resource utilization and virtual channel congestion are solved, thereby improving communication efficiency.

CN120880929BActive Publication Date: 2026-04-10MOORE THREADS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In the prior art, the independent setting of storage resources for each virtual transmission channel in the communication device leads to low storage resource utilization, and the unreasonable blocking of virtual channels reduces communication efficiency.

Method used

By implementing multiple virtual channels sharing storage resources in the communication device, and further splitting the virtual input/output channels into virtual input sub-channels/virtual output sub-channels, the problems of low storage resource utilization and virtual channel congestion are solved.

Benefits of technology

It improves the utilization rate of storage resources within the communication device, reduces unreasonable congestion of virtual channels, increases the number of storage resources available for storing new message packets, and enhances communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120880929B_ABST
    Figure CN120880929B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of communication, and provides a communication device, a data storage method, a chip and an electronic device. The device comprises a buffer, a control and storage module and a plurality of virtual input channels. The control and storage module comprises a plurality of entries, at least one of which is shared by the plurality of virtual input channels, and each entry corresponds to an index. The device receives a message packet through any one of the virtual input channels. The buffer is configured to provide an index for the message packet. The control and storage module is configured to determine an entry for storing the message packet according to the index, and store the message packet in the corresponding entry. In the communication device of the present disclosure, the plurality of virtual channels can share the storage resources of the communication device, thereby improving the utilization rate of the storage resources in the communication device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communications, and more particularly to a communication device, a data storage method, a chip, and an electronic device. Background Technology

[0002] Network on Chip (NoC) is a system within a chip used to implement communication between multiple masters and multiple slaves. NoC includes several communication devices, and physical transmission channels exist between these devices. To improve the utilization of these physical transmission channels, existing technologies have proposed Virtual-Channel (VC) technology. Through time-division multiplexing, the physical transmission channel is divided into multiple independent virtual transmission channels, allowing each virtual transmission channel to use the physical transmission channel in different time slices.

[0003] However, to ensure the independence of multiple virtual transmission channels, existing communication devices require dedicated storage resources for each virtual transmission channel to store the data transmitted through that channel. If only one virtual transmission channel is used within a certain period, the storage resources corresponding to the other virtual transmission channels will be idle, reducing the utilization rate of storage resources within the communication device. Summary of the Invention

[0004] In view of this, the present disclosure provides a communication device, a data storage method, a chip, and an electronic device. In the communication device of the embodiments of the present disclosure, multiple virtual channels can share the storage resources of the communication device, thereby improving the utilization rate of storage resources within the communication device.

[0005] According to one aspect of this disclosure, a communication device is provided, the device including a buffer, a control and storage module, and multiple virtual input channels, the control and storage module including multiple entries, wherein at least one entry is shared by the multiple virtual input channels, and each entry corresponds to an index; the device receives a message packet through any one of the virtual input channels; the buffer is used to provide an index for the message packet; the control and storage module is used to determine the entry for storing the message packet according to the index, and store the message packet into the corresponding entry.

[0006] In one possible implementation, the message packet includes first data and second data, wherein the first data is the metadata of the message packet and the second data is the payload data of the message packet.

[0007] In a possible implementation, the device further comprises a plurality of physical input ports, a plurality of physical output ports, a plurality of virtual output channels, the communication device is connected with a lower-level communication device through the physical output port, each virtual input channel comprises a plurality of virtual input sub-channels, and each virtual input sub-channel corresponds to one physical output port of the device; each virtual output channel comprises a plurality of virtual output sub-channels, and each virtual output sub-channel corresponds to one physical output port of the lower-level communication device; the message packet is received through one of the plurality of virtual input sub-channels, and the control and storage module is further configured to, when storing the first data, write, into an entry storing the first data, an identifier of a virtual input sub-channel and a virtual output sub-channel corresponding to the message packet; select a first target entry from entries storing valid first data, determine a virtual output sub-channel according to the first target entry, and output data stored in the first target entry through the virtual output sub-channel; release the first target entry, and output an index corresponding to the first target entry to the buffer.

[0008] In a possible implementation, the control and storage module comprises a control queue and a storage, the control queue comprises a plurality of first entries, the storage comprises a plurality of second entries, each index corresponds to one first entry and one second entry, the control queue is configured to determine, according to the index, a first entry storing the first data, and store the first data in the corresponding first entry, and the storage is configured to determine, according to the index, a second entry storing the second data, and store the second data in the corresponding second entry.

[0009] In a possible implementation, the control queue is further configured to take, as a second target entry, a second entry corresponding to the first target entry, control the storage to read out second data stored in the second target entry, and the control queue is specifically configured to, after merging the first data stored in the first target entry and the second data stored in the second target entry, output the merged data through the virtual output sub-channel, and the control queue is further configured to, when releasing the first target entry, control the storage to release the second target entry.

[0010] In a possible implementation, the apparatus further comprises a topology storage module configured to store a topology of a network-on-chip to which the communication device belongs, the first data comprises a source device identifier and a destination device identifier, and the control and storage module is specifically configured to, when storing the first data, determine, according to the first data and the topology, a position of the communication device on a transmission path of the message packet and a maximum number of physical input / output ports of all communication devices in the topology; and determine, according to the position, the maximum number, and a number of a virtual input channel corresponding to the message packet, an identifier of a virtual input subchannel corresponding to the message packet and an identifier of a virtual output subchannel corresponding to the message packet, and write the identifier of the virtual input subchannel corresponding to the message packet and the identifier of the virtual output subchannel corresponding to the message packet into an entry storing the first data.

[0011] In a possible implementation, the plurality of virtual output subchannels of the communication device are virtual input subchannels of the lower-level communication device, and the apparatus further comprises a statistics module configured to count a number of idle entries shared by all virtual input subchannels in the lower-level communication device and a number of idle entries private to each virtual input subchannel in the lower-level communication device; and the control and storage module is specifically configured to: filter, from entries storing valid first data, an entry satisfying a first preset condition to obtain a first candidate group, the first preset condition being that a data retention period stored in the current entry is greater than that of another entry storing an identifier of a same virtual input subchannel; filter, from the first candidate group, an entry satisfying a second preset condition according to an identifier of a virtual output subchannel stored in each entry and a result of the statistics, to obtain a second candidate group, the second preset condition being that a number of idle entries available to a virtual input subchannel corresponding to the identifier of the virtual output subchannel stored in the current entry in the lower-level communication device is greater than a number of entries used to store a message packet corresponding to the current entry; and select at least one entry in the second candidate group as the first target entry.

[0012] In a possible implementation, the first data comprises a data retention period, and the control and storage module is specifically configured to: group entries storing valid first data, and entries in each group store an identifier of a same virtual input subchannel; and filter, from each group, an entry with a maximum data retention period to obtain a first candidate group.

[0013] In a possible implementation, in the entries storing the valid first data, the entries corresponding to the same virtual input sub-channel belong to the linked list corresponding to the virtual input sub-channel, and the control and storage module is further configured to, when storing the first data, take the entry storing the first data as the tail of the linked list corresponding to the determined virtual input sub-channel; and the control and storage module is specifically configured to obtain the first candidate group according to the entry at the head of each linked list.

[0014] In a possible implementation, the idle entries available to any virtual input sub-channel include all or part of the idle entries shared by all virtual input sub-channels and the idle entries private to the virtual input sub-channel.

[0015] In a possible implementation, the idle entries available to any virtual input sub-channel include the idle entries shared by all virtual input sub-channels.

[0016] In a possible implementation, the idle entries available to any virtual input sub-channel include the idle entries private to the virtual input sub-channel.

[0017] In a possible implementation, the control and storage module is specifically configured to determine a first value X and a second value Y according to the maximum number, X is the minimum bit width of the physical input / output port of all communication devices, Y = 2^X, X and Y are positive integers; when the communication device is the first communication device on the transmission path of the message packet, multiply the number of the virtual input channel corresponding to the message packet by the second value, and the product is the identifier of the virtual input sub-channel corresponding to the message packet; when the communication device is not the first communication device on the transmission path of the message packet, take the identifier of the virtual output sub-channel corresponding to the message packet in the upper-level communication device as the identifier of the virtual input sub-channel corresponding to the message packet.

[0018] In a possible implementation, the control and storage module is specifically configured to determine a first value X and a second value Y according to the maximum number, X is the minimum bit width of the physical input / output port of all communication devices, Y = 2^X, X and Y are positive integers; when the communication device is the last communication device on the transmission path of the message packet, multiply the number of the virtual input channel corresponding to the message packet by the second value, and the product is the identifier of the virtual output sub-channel corresponding to the message packet; when the communication device is not the last communication device on the transmission path of the message packet, multiply the number of the virtual input channel corresponding to the message packet by the second value, and then add the number of the physical output port used by the lower-level communication device on the transmission path of the message packet to serve as the identifier of the virtual output sub-channel corresponding to the message packet.

[0019] According to another aspect of the present disclosure, a data storage method is provided, which is applied to a communication device, the device comprising a buffer, a control and storage module, a plurality of virtual input channels, the control and storage module comprising a plurality of entries, at least one entry being shared by a plurality of virtual input channels, each entry corresponding to an index; the device receiving a message packet through any one of the virtual input channels, the method comprising: using the buffer to provide an index for the message packet; using the control and storage module to determine an entry for storing the message packet according to the index, and storing the message packet in the corresponding entry.

[0020] In a possible implementation, the message packet comprises first data and second data, wherein the first data is metadata of the message packet, and the second data is payload data of the message packet.

[0021] In a possible implementation, the device further comprises a plurality of physical input ports, a plurality of physical output ports, and a plurality of virtual output channels, the communication device being connected to a subordinate communication device through the physical output ports, each virtual input channel comprising a plurality of virtual input sub-channels, each virtual input sub-channel corresponding to a physical output port of the device; each virtual output channel comprising a plurality of virtual output sub-channels, each virtual output sub-channel corresponding to a physical output port of the subordinate communication device; the message packet being received through one of the plurality of virtual input sub-channels, the method further comprising: when storing the first data, the control and storage module writing, to the entry storing the first data, an identifier of the virtual input sub-channel and the virtual output sub-channel corresponding to the message packet; the control and storage module selecting a first target entry from the entries storing valid first data, determining a virtual output sub-channel according to the first target entry, and outputting the data stored in the first target entry through the virtual output sub-channel; the control and storage module releasing the first target entry, and outputting the index corresponding to the first target entry to the buffer.

[0022] In a possible implementation, the control and storage module comprises a control queue and a storage, the control queue comprising a plurality of first entries, and the storage comprising a plurality of second entries, each index corresponding to a first entry and a second entry; the storing of the message packet in the corresponding entry comprising: the control queue determining a first entry for storing the first data according to the index, and storing the first data in the corresponding first entry; the storage determining a second entry for storing the second data according to the index, and storing the second data in the corresponding second entry.

[0023] In a possible implementation, the method further includes: the control queue controls the memory to read out second data stored in a second target entry corresponding to the first target entry; and the outputting the data stored in the first target entry via the virtual output sub-channel includes: the control queue merges the first data stored in the first target entry and the second data stored in the second target entry, and then outputs the merged data via the virtual output sub-channel.

[0024] In a possible implementation, the apparatus further includes a topology storage module configured to store a topology of a network-on-chip in which the communication device is located, and the first data includes a source device identifier and a destination device identifier; and the writing, when the first data is stored, the identifiers of the virtual input sub-channel and the virtual output sub-channel corresponding to the message packet into an entry storing the first data includes: determining, when the first data is stored, a position of the communication device on a transmission path of the message packet according to the first data and the topology, and a maximum number of physical input / output ports of all communication devices in the topology; and determining, according to the position, the maximum number, and a number of a virtual input channel corresponding to the message packet, the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet, and writing, into the entry storing the first data, the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet.

[0025] In a possible implementation, the plurality of virtual output sub-channels of the communication device serve as the plurality of virtual input sub-channels of the subordinate communication device, and the apparatus further includes a statistics module; the method further includes: using the statistics module to count a number of idle entries shared by all virtual input sub-channels in the subordinate communication device, and a number of idle entries private to each virtual input sub-channel in the subordinate communication device; and the selecting the first target entry from the entries storing valid first data includes: screening, from the entries storing valid first data, entries meeting a first preset condition to obtain a first candidate group, the first preset condition being that a data storage duration of a current entry is greater than that of another entry storing an identifier of a same virtual input sub-channel as the current entry; screening, from the first candidate group, entries meeting a second preset condition according to identifiers of virtual output sub-channels stored in the entries and a result of the counting by the statistics module to obtain a second candidate group, the second preset condition being that a number of idle entries available to a virtual input sub-channel corresponding to an identifier of a virtual output sub-channel stored in a current entry in the subordinate communication device is greater than a number of entries used to store a message packet corresponding to the current entry; and selecting at least one entry in the second candidate group as the first target entry.

[0026] In one possible implementation, the first data includes a data duration, and the step of filtering entries that meet a first preset condition from the entries storing valid first data to obtain a first candidate group includes: grouping the entries storing valid first data, with each group storing the same identifier for a virtual input sub-channel; and filtering the entries with the longest data duration in each group based on the data duration of each entry to obtain a first candidate group.

[0027] In one possible implementation, among the entries storing valid first data, entries corresponding to the same virtual input sub-channel belong to the linked list corresponding to that virtual input sub-channel. The method further includes: when storing the first data, using the entry storing the first data as the tail of the linked list corresponding to the determined virtual input sub-channel; the step of filtering entries that meet the first preset condition from the entries storing valid first data to obtain the first candidate group includes: obtaining the first candidate group based on the entries at the head of each linked list.

[0028] In one possible implementation, the available free entries for any virtual input subchannel include all or part of the free entries shared by all virtual input subchannels, as well as the free entries private to that virtual input subchannel.

[0029] In one possible implementation, any virtual input subchannel may have available free entries, including free entries shared by all virtual input subchannels.

[0030] In one possible implementation, any virtual input subchannel may have available free entries, including free entries private to that virtual input subchannel.

[0031] In one possible implementation, determining the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet based on the location, the maximum quantity, and the number of the virtual input channel corresponding to the message packet includes: determining a first value X and a second value Y based on the maximum quantity, where X is the minimum bit width of the physical input / output ports of all communication devices, Y = 2^X, and X and Y are positive integers; when the communication device is the first communication device on the transmission path of the message packet, multiplying the number of the virtual input channel corresponding to the message packet by the second value, and the product is the identifier of the virtual input sub-channel corresponding to the message packet; when the communication device is not the first communication device on the transmission path of the message packet, using the identifier of the virtual output sub-channel corresponding to the message packet in the upstream communication device as the identifier of the virtual input sub-channel corresponding to the message packet.

[0032] In a possible implementation, the determining, according to the position, the maximum number, and the number of the virtual input channel corresponding to the message packet, the identifier of the virtual input subchannel and the identifier of the virtual output subchannel corresponding to the message packet comprises: determining a first value X and a second value Y according to the maximum number, X being the minimum bit width of the physical input / output port of all the communication devices, Y = 2^X, X and Y being positive integers; when the communication device is the last communication device on the transmission path of the message packet, multiplying the number of the virtual input channel corresponding to the message packet by the second value, and the product being the identifier of the virtual output subchannel corresponding to the message packet; when the communication device is not the last communication device on the transmission path of the message packet, multiplying the number of the virtual input channel corresponding to the message packet by the second value, and then adding the number of the physical output port used by the subordinate communication device on the transmission path of the message packet to obtain the identifier of the virtual output subchannel corresponding to the message packet.

[0033] According to another aspect of the present disclosure, a chip is provided, comprising the communication device described above.

[0034] According to another aspect of the present disclosure, an electronic device is provided, comprising the chip described above.

[0035] The communication device according to the embodiments of the present disclosure comprises a buffer, a control and storage module, and a plurality of virtual input channels, the control and storage module comprises a plurality of entries, at least one of which is shared by the plurality of virtual input channels, that is, the device supports storage resource sharing of the plurality of virtual channels. Each entry corresponds to an index, the device receives a message packet through any virtual input channel, the buffer is used to provide the index for the message packet, and the control and storage module is used to determine the entry storing the message packet according to the index and store the message packet into the corresponding entry. Under the premise of resource sharing of the plurality of virtual channels, the device can accurately find the storage position of the message packet and ensure the smooth storage of the message packet; compared with the prior art communication device, the storage resource available for a single virtual input channel is increased, and the utilization rate of the storage resource in the communication device is improved.

[0036] The communication device according to the embodiments of the present disclosure further splits the virtual input channel / virtual output channel into a virtual input subchannel / virtual output subchannel corresponding to different physical input ports / physical output ports, so that when a certain virtual output subchannel is blocked and cannot be used at the corresponding physical output port, other virtual output subchannels can still be normally used when the corresponding physical output port is unblocked, thereby solving the unreasonable blocking problem of the virtual channel and increasing the number of storage resources available for storing new message packets.

[0037] Other features and aspects of the present disclosure will become apparent from the following detailed description of the exemplary embodiments with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0038] The accompanying drawings, which are incorporated in and form a part of the specification, illustrate the exemplary embodiments, features, and aspects of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0039] Figure 1 A schematic diagram showing the structure of a communication apparatus using the application channel virtualization technology of the prior art.

[0040] Figure 2 An exemplary application scenario of a communication apparatus according to an embodiment of the present disclosure is shown.

[0041] Figure 3 A schematic diagram showing the topology of a network-on-chip according to an embodiment of the present disclosure is shown.

[0042] Figure 4 A schematic diagram showing the structure of a communication apparatus according to an embodiment of the present disclosure is shown.

[0043] Figure 5 A schematic diagram showing the correspondence between entries and indexes in a control and storage module according to an embodiment of the present disclosure is shown.

[0044] Figure 6 A schematic diagram showing the setting manner of a first selector in a control and storage module according to an embodiment of the present disclosure is shown.

[0045] Figure 7a A schematic diagram showing the splitting of a virtual input channel according to an embodiment of the present disclosure is shown.

[0046] Figure 7b A schematic diagram showing the splitting of a virtual output channel according to an embodiment of the present disclosure is shown.

[0047] Figure 7c A schematic diagram showing the structure of a control and storage module according to an embodiment of the present disclosure is shown.

[0048] Figure 7d A schematic diagram showing the correspondence between an index, a first entry, and a second entry according to an embodiment of the present disclosure is shown.

[0049] Figure 7e A schematic diagram showing the setting manner of a third selector in a memory according to an embodiment of the present disclosure is shown.

[0050] Figure 8 A schematic diagram showing the structure of a communication apparatus according to an embodiment of the present disclosure is shown.

[0051] Figure 9 A schematic diagram showing the data storage of a control and storage module according to an embodiment of the present disclosure is shown.

[0052] Figure 10A diagram showing a data storage situation of a control and storage module according to an embodiment of the present disclosure.

[0053] Figure 11 A diagram showing a flow of a data storage method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0054] Various exemplary embodiments, features, and aspects of the present disclosure will be explained in detail below with reference to the accompanying drawings. Like reference numerals in the drawings denote like elements or features. Although various aspects of embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless specifically noted.

[0055] As used herein, the terms "comprise", "comprising", "have", "having", "include", "including", "contain", "containing", or variants thereof are open-ended, and include one or more stated features, integers, elements, steps, components or functions but do not preclude the presence or addition of one or more other features, integers, elements, steps, components, functions or groups thereof. The terms "a", "an" and "the" used in the description are used in the sense of "one or more", unless specifically noted. It is understood that various embodiments can be implemented in combination with each other where appropriate, and that a person skilled in the art would understand and appreciate the various embodiments different from the example details. In certain embodiments, well-known structures, components, signals, computer program instructions and techniques have not been shown in detail in order not to obscure the methodology described herein.

[0056] The use of the term "automatic" in the present disclosure can relate to fully automatic or semi-automatic implementation of certain aspects of the implementation by a user or administrator, depending on the specific implementation of the present disclosure by a person skilled in the art. Different terms in the present disclosure, such as module, or element, or NoC component, or network element, or router, or switch, or network interface, or link, or low-power module, are all interchangeable and considered as NoC components.

[0057] When an element is referred to as being "connected", "coupled", "responsive", or "in communication" to another element, it can be directly connected, coupled, or responsive to the other element, or intervening elements can be present.

[0058] Although the terms first, second, third, etc. can be used herein to describe various elements / operations, these elements / operations should not be limited by these terms. These terms are only used to distinguish one element / operation from another element / operation. Thus, a first element / operation in some embodiments could be termed a second element / operation in other embodiments without departing from the teachings of the present inventive concept.

[0059] The word "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations.

[0060] In addition, for a better understanding of the present disclosure, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present disclosure can be practiced without certain specific details. In some instances, well-known methods, procedures, elements, and circuits have not been described in detail so as not to obscure the underlying principles of the present disclosure.

[0061] Figure 1 A schematic diagram showing the structure of a communication device using the application channel virtualization technology.

[0062] As shown in Figure 1 The communication device 200 comprises input units 210-1 to 210-N (collectively referred to as input units 210, N is an integer greater than 1), output units 230-1 to 230-M (collectively referred to as output units 230, M is an integer greater than 1), a routing table 220, a VC allocator 222, a switch allocator 224, and a switch 226. Each input unit 210 is used to connect to an output unit (not shown) of another communication device. Each output unit 230 is used to connect to an input unit of another communication device. A physical transmission channel is formed between the connected input unit and output unit. For the input unit, the physical transmission channel can be a physical input channel, and for the output unit, the physical transmission channel can be a physical output channel.

[0063] The channel virtualization of the communication device 200 is as follows: sufficient storage resources are reserved in the input unit 210 for the physical input channel to which the input unit 210 belongs, so that the physical input channel can be time-multiplexed into multiple virtual input channels, and the storage resources of each virtual input channel are independent and used to store message packets input through the virtual input channel and state information of the virtual input channel, etc. In the output unit 230, sufficient storage resources are reserved for the physical output channel to which the output unit 230 belongs, so that the physical output channel can be time-multiplexed into multiple virtual output channels, and the storage resources of each virtual output channel are independent and used to store state information of the virtual output channel, the number of available credits, etc.

[0064] When a message packet is received through a virtual input channel, the message packet will be stored in the storage resources corresponding to the virtual input channel; when the communication device determines that the message packet needs to be output through any output unit, according to the state information stored in the output unit, a virtual output channel time-multiplexed from the physical output channel can be selected to output the message packet.

[0065] For example, the input unit 210 includes input state machine sets 214-1 to 214-N (collectively referred to as input state machine sets 214, including one or more input state machines) and VC buffer sets 212-1 to 212-N (collectively referred to as VC buffer sets 212, including one or more VC buffers). The input state machine sets 214 store state information of the input unit, such as idle, requesting from the routing table, requesting from the VC allocator, requesting from the switch allocator, etc. The VC buffer sets 212 store information of message packets and control modes input by each virtual input channel associated with the input unit 210 to which the VC buffer sets 212 belong, and the information of different virtual input channels and control modes are stored in different VC buffers.

[0066] The output unit 230 includes output state machine sets 234-1 to 234-M (collectively referred to as output state machine sets 234, including one or more output state machines) and VC buffer state register sets 232-1 to 232-M (collectively referred to as VC buffer state register sets 232, including one or more VC buffer state registers). The output state machine sets 234 store state information of the output unit, such as idle, allocated, etc. The VC buffer state register sets 232 store information of the number of credits available for each virtual output channel associated with the output unit 230 to which the VC buffer state register sets 232 belong, wherein the virtual output channel of the current communication device serves as a virtual input channel of a lower-level communication device, and thus the number of credits available for the virtual output channel can indicate the number of storage resources (e.g., VC buffers) available for the virtual output channel when it serves as a virtual input channel in the lower-level communication device. The information of different virtual output channels and control modes are stored in different VC buffer state registers. If the number of credits available for the virtual output channel is insufficient, the message packet cannot be output via the virtual output channel.

[0067] The message packet is received and stored by any one of the input units 210. The routing table 220 is used to find the corresponding output unit 230 of the communication device 200 for the message packet according to the destination device identifier in the message packet (i.e., which output unit 230 the message packet needs to be output via). The VC allocator 222 is used to allocate a virtual output channel for the message packet according to the corresponding output unit 230 of the message packet. The switch allocator 224 is used to allocate a time slice for the virtual output channel of the message packet, and the switch 226 is connected between the input unit 210 and the output unit 230 of the message packet during the time slice, so that the message packet is output via the allocated virtual output channel.

[0068] The disadvantages of the communication device are as follows:

[0069] In one aspect, the purpose of setting the virtual input / output channel is to improve the utilization rate of the physical transmission channel, so the more virtual input / output channels are used, the greater the utilization rate of the physical transmission channel. If only one virtual input channel is used in a certain period of time, the storage resources corresponding to other virtual input channels are idle, resulting in a decrease in the utilization rate of the storage resources of the communication device.

[0070] On the other hand, the communication device in the prior art outputs the message packets in the order of receiving the message packets, and if message packet 1 and message packet 2 received by the current communication device need to be output to the same communication device through the same output unit, the virtual output channels allocated by the current communication device for the two message packets also correspond to the same output unit. If the two message packets are allocated to the same virtual output channel, and the first received message packet 1 is blocked at the physical output port in the lower-level communication device, the first received message packet 1 cannot be output. Even if the second received message packet 2 is unblocked at the physical output port in the lower-level communication device, the second received message packet 2 cannot be output because the first received message packet 1 is the message packet that needs to be output preferentially by the virtual output channel. This reduces the communication efficiency of the communication device. In addition, the blocking of the output unit also causes the resources of the VC buffer to be occupied by the message packet that cannot be output for a long time, and the storage resources available for storing new message packets decrease.

[0071] Therefore, the present disclosure provides a communication device, a data storage method, a chip and an electronic device. In the communication device of the present disclosure, a plurality of virtual channels can share the storage resources of the communication device, thereby improving the utilization rate of the storage resources in the communication device.

[0072] Further, the communication device of the present disclosure further splits the virtual input channel / virtual output channel into virtual input sub-channels / virtual output sub-channels corresponding to different physical input ports / physical output ports, so that when a certain virtual output sub-channel is blocked at the corresponding physical output port and cannot be used, other virtual output sub-channels can still be used normally when the corresponding physical output port is unblocked. This solves the problem of unreasonable blocking of the virtual channel and increases the number of storage resources available for storing new message packets.

[0073] Figure 2 An exemplary application scenario of the communication device according to an embodiment of the present disclosure is shown.

[0074] As Figure 2As shown, the computing system 100 is on-chip, including an on-chip network 110, for connecting a memory controller 150 (Memory Controller) as a slave, an interconnect link 160 (Interconnect Link), and a plurality of clients as masters. The clients include a central processing unit 140 (CPU Complex), a graphics processing unit 142 (GPU), and a hub 144 (Hub). The memory controller 150 is an interface for connecting a memory 152 (Memory). The interconnect link 160 is for interconnection between chips, which can be, for example, NvLink, Peripheral Component Interconnect Express (PCIe), Compute Express Link (CXL), etc. The hub 144 is for exchanging information with a multimedia engine 146 (Multimedia Engine). Embodiments of the present disclosure are not limited to specific numbers and types of masters and slaves. For example, the clients can also include a display (Display), one or more input / output peripherals (I / O), a network card, etc.

[0075] The on-chip network 110 uses system-level network technology to transfer data within a chip. Compared with a traditional bus architecture, the on-chip network 110 provides a high-bandwidth, low-latency, scalable switching network. In some implementations, the topology of the on-chip network 110 can be Butterfly, Ring, Mesh, Torus, etc.

[0076] Figure 3 A schematic diagram showing the topology of an on-chip network according to an embodiment of the present disclosure.

[0077] As Figure 3 shown, the on-chip network 110 can include communication devices 602, 604, 606, 608, 612, 614, 616, 618, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, where the communication devices 602, 604, 606, 608 are connected to the masters, and the communication devices 612, 614, 616, 618 are connected to the slaves. The communication devices can be routers, etc., and embodiments of the present disclosure are not limited to specific types of communication devices.

[0078] A master can generate a message packet to be sent to a slave, where the master is the source device of the message packet, and the slave is the destination device of the message packet. The message packet can be input into the on-chip network through a communication device connected to the master, output to a communication device connected to the slave through the communication devices in the on-chip network, and then output to the slave through the communication device.

[0079] For example, the graphics processor 142 can generate a message packet to be sent to the memory controller 150. Assuming the graphics processor 142 is connected to the communication device 602, and the memory controller 150 is connected to the communication device 616, the message packet can be input into the network-on-chip through the communication device 602, output through the communication devices 602, 622, 628, 642, 638, to the communication device 616, and then output to the memory controller 150 through the communication device 616. The memory controller 150 can further output the message packet to be stored at the memory 152.

[0080] Figure 4 A schematic diagram showing the structure of a communication device according to an embodiment of the present disclosure.

[0081] As Figure 4 shown in one possible implementation, the present disclosure proposes a communication device, which comprises a buffer, a control and storage module, a plurality of virtual input channels,

[0082] The control and storage module comprises a plurality of entries, at least one of which is shared by the plurality of virtual input channels, and each entry corresponds to an index;

[0083] The device receives a message packet through any one of the virtual input channels;

[0084] The buffer is configured to provide the message packet with an index;

[0085] The control and storage module is configured to determine the entry in which the message packet is to be stored according to the index, and store the message packet in the corresponding entry.

[0086] For example, the communication device can comprise a plurality of virtual input channels, which can be obtained by time division multiplexing using channel virtualization technology as in the prior art. The device can receive a message packet through any one of the virtual input channels.

[0087] In one possible implementation, the message packet comprises first data and second data. The first data is metadata of the message packet, and the second data is payload data of the message packet. The present disclosure does not limit the specific content of the first data and the second data. An exemplary data structure of the first data is given below.

[0088] The communication device further comprises a buffer, a control and storage module. The control and storage module comprises a plurality of entries. The entries can be implemented using static random access memory (SRAM) or a register array.

[0089] In the control and storage module, each entry corresponds to an index, and the buffer provides an index for a message packet, and the control and storage module determines the entry storing the message packet according to the index.

[0090] The amount of data that can be received by the virtual input channel in each clock cycle is limited, and if the message packet is too large, the message packet can be received in multiple clock cycles. The buffer provides an index for the message packet in each clock cycle, and the maximum number of indexes provided by the buffer in each clock cycle depends on the amount of data that can be received by the virtual input channel in each clock cycle and the amount of data that can be stored in each entry. For example, if the amount of data that can be received by the virtual input channel in each clock cycle is equal to K times the amount of data that can be stored in a single entry (K is a positive integer), the maximum number of indexes provided by the buffer in each clock cycle can be equal to K.

[0091] In an example, the correspondence between the entries and the indexes in the control and storage module can be set in a direct mapping manner. Figure 5 A schematic diagram showing the correspondence between the entries and the indexes in the control and storage module according to an embodiment of the present disclosure is shown.

[0092] As shown in Figure 5 the buffer includes 16 third entries (C1-C16), and each third entry stores an index. The control and storage module includes 16 entries (A1-A16). When the value of the index is i (0

[0093] Those skilled in the art should understand that the present embodiment of the present disclosure does not limit the setting manner of the correspondence between the entries and the indexes in the control and storage module as long as different indexes correspond to different entries in the control and storage module. Those skilled in the art should understand that the buffer and the control and storage module can include more or fewer entries, and the present embodiment of the present disclosure does not limit this.

[0094] In an example, the buffer uses a pointer to allocate an index for a message packet. When the message packet is input, the index pointed to by the pointer is the index provided for the message packet. The buffer can be a sequential stack buffer, and in the initial state, the pointer can point to the first third entry C1. After the index stored in the jth third entry (0 Figure 5 As shown in

[0095] Those skilled in the art should understand that if the pointer initially points to the 16th third entry C16, then after providing the index of the jth third entry to the message packet, the pointer can be moved to point to the (j-1)th third entry. This embodiment of the present disclosure does not restrict the direction of pointer movement.

[0096] Some operations may cause a reset, such as restarting the communication device. After a reset, the pointer returns to its initial state, and the index stored in each entry of the buffer is reset to the value corresponding to the entry's number. For example, after a reset, the index stored in entry C1 of the buffer is 1, and the index stored in entry C2 is 2.

[0097] The buffer can output the index provided to the message packet to the control and storage module. The control and storage module can determine the entry for storing the message packet based on the index and store the message packet in the determined entry. In this way, the communication device can complete the storage of message packets.

[0098] In one example, the control and storage module may be equipped with a first selector, which can be used to determine the entry for storing message packets and store the message packets into the determined entry.

[0099] The following describes an exemplary method of using a first selector to determine the entry for storing the message packet and storing the message packet into the determined entry.

[0100] Figure 6 A schematic diagram showing the configuration of a first selector in a control and storage module according to an embodiment of the present disclosure is provided.

[0101] like Figure 6 As shown, the first selector is located in the control and storage module. The input of the first selector is used to receive message packets, and the 16 outputs are connected to 16 entries A1-A16 respectively.

[0102] The first selector decodes the index into a 16-bit mask. When the index value is i, it determines that the entry for storing the message packet is the i-th entry. The i-th bit of the mask is decoded as 1, and the other bits are decoded as 0. The value of the i-th bit of the mask determines the connection state between the input and the i-th output of the first selector. When the value is 0, the input and the i-th output of the first selector are disconnected; when the value is 1, the input and the i-th output are connected, and the message packet can be stored in the i-th entry. In this case, the first selector can store the message packet in the determined entry according to the index.

[0103] Those skilled in the art should understand that the structure of the first selector and the decoding manner should not be limited to the above examples, as long as the first selector in the control and storage module can determine the entry for storing the message packet, and the message packet is stored in the determined entry. The control and storage module can also determine the entry for storing the message packet in other manners, and the message packet is stored in the determined entry, and the embodiments of the present disclosure do not limit this.

[0104] The at least one entry included in the control and storage module is shared by the plurality of virtual input channels. Those skilled in the art should understand that the shared entry does not need to be fixed, as long as there are enough entries that can be shared. For example, assuming that there are two virtual input channels IVC1 and IVC2, IVC1 and IVC2 share 8 entries, IVC1 has 4 private entries, and IVC2 has 4 private entries, then only IVC1 is used in a certain period of time, and there are 12 entries that can be used, and there are only 4 idle entries. If the prior art scheme is used, when there are 16 VC buffers, 8 VC buffers correspond to IVC1, and 8 VC buffers correspond to IVC2, there are 8 VC buffers that can be used, and there are 8 idle VC buffers. Obviously, the storage resources that can be used in the communication device of the embodiments of the present disclosure are more, and the idle storage resources are less, thereby improving the utilization rate of the storage resources in the communication device.

[0105] According to the communication device of the embodiments of the present disclosure, the communication device includes a buffer, a control and storage module, and a plurality of virtual input channels, the control and storage module includes a plurality of entries, and at least one entry is shared by the plurality of virtual input channels, that is, the device supports a plurality of virtual channels sharing storage resources. Each entry corresponds to an index, the device receives a message packet through any virtual input channel, the buffer is used to provide the index for the message packet, and the control and storage module is used to determine the entry for storing the message packet according to the index and store the message packet in the corresponding entry. Under the premise of sharing of the plurality of virtual channel resources, the device can accurately find the storage position of the message packet, and the smooth storage of the message packet is ensured. Compared with the communication device of the prior art, the storage resources that can be used by a single virtual input channel are increased, and the utilization rate of the storage resources in the communication device is improved.

[0106] In a possible implementation manner, the device further includes a plurality of physical input ports, a plurality of physical output ports, and a plurality of virtual output channels, the communication device is connected with a lower-level communication device through the physical output port,

[0107] Each virtual input channel includes a plurality of virtual input sub-channels, and each virtual input sub-channel corresponds to a physical output port of the device;

[0108] Each virtual output channel includes a plurality of virtual output sub-channels, and each virtual output sub-channel corresponds to a physical output port of the lower-level communication device;

[0109] The message packet is received through one of multiple virtual input sub-channels, and the control and storage module is also used for...

[0110] When storing the first data, the identifiers of the virtual input sub-channel and virtual output sub-channel corresponding to the message packet are written to the entry storing the first data;

[0111] Select a first target entry from the entries storing valid first data, determine a virtual output sub-channel based on the first target entry, and output the data stored in the first target entry through the virtual output sub-channel;

[0112] Release the first target entry and output the index corresponding to the first target entry to the buffer.

[0113] For example, a communication device may include multiple physical input ports, multiple physical output ports, and multiple virtual output channels. The multiple virtual output channels may be obtained through time-division multiplexing using channel virtualization technology, as is currently available. Multiple virtual input channels can be multiplexed for each physical input port, and multiple virtual output channels can be multiplexed for each physical output port.

[0114] As described above, any physical input port on the communication device may communicate with any physical output port on the same communication device. Therefore, for each virtual input channel, multiple virtual input sub-channels can be further subdivided, so that each virtual input sub-channel corresponds to a physical output port.

[0115] Figure 7a A schematic diagram illustrating the splitting of a virtual input channel according to an embodiment of this disclosure is shown.

[0116] by Figure 3 Taking the communication device 622 shown as an example, the communication device 622 includes two physical output ports q0 and q1. Figure 7a As shown, assuming the communication device 622 also includes virtual input channels IVC1 and IVC2, virtual input channel IVC1 can be further subdivided into two virtual input sub-channels IVC1_1 and IVC1_2. Virtual input channel IVC2 can be further subdivided into two virtual input sub-channels IVC2_1 and IVC2_2. IVC1_1 and IVC2_1 can correspond to physical output port q0, and IVC1_2 and IVC2_2 can correspond to physical output port q1.

[0117] Any physical output port on a communication device is connected to a physical input port of a lower-level communication device. However, within the lower-level communication device, that physical input port may communicate with any physical output port on that lower-level communication device. Therefore, each virtual output channel of the current-level communication device can be further subdivided into multiple virtual output sub-channels, such that each virtual output sub-channel corresponds to a physical output port of the lower-level communication device.

[0118] Figure 7b A schematic diagram illustrating the splitting of virtual output channels according to an embodiment of this disclosure is shown.

[0119] by Figure 3 Taking the communication device 622 shown as an example, the lower-level communication device of communication device 622 is communication device 628, which includes two physical output terminals p0 and p1. Figure 7b As shown, assuming the communication device 622 also includes virtual output channels OVC1 and OVC2, virtual output channel OVC1 can be further subdivided into two virtual output sub-channels OVC1_1 and OVC1_2. Virtual output channel OVC2 can be further subdivided into two virtual output sub-channels OVC2_1 and OVC2_2. OVC1_1 and OVC2_1 can correspond to physical output port p0, and OVC1_2 and OVC2_2 can correspond to physical output port p1.

[0120] The message packet received by the local communication device through any virtual input channel may be received through one of the multiple virtual input sub-channels included in that virtual input channel. The control and storage module is further configured to, when storing the first data, write the identifiers of the virtual input sub-channel (i.e., the virtual input sub-channel in the local communication device that receives the message packet) and the virtual output sub-channel (i.e., the virtual output sub-channel in the local communication device that outputs the message packet) corresponding to the message packet into the entries stored in the first data. An example of determining the identifiers of the virtual input sub-channel and virtual output sub-channel corresponding to the message packet is given later.

[0121] It should be understood that as long as an entry stores valid first data, it means that the communication device at this level has a message packet to be sent. Therefore, the control and storage module is also used to select a first target entry from the entries storing valid first data, determine a virtual output sub-channel based on the selected first target entry, and output the data stored in the first target entry through the virtual output sub-channel. An exemplary method for selecting a first target entry from the entries storing valid first data is given below.

[0122] The selected first target entry stores the identifier of the virtual output sub-channel, and the determined virtual output sub-channel can be indicated by this identifier.

[0123] Once the entry stored data is output, the entry stored data becomes invalid data, and thus the control and storage module can release the selected first target entry, and output the number of the released first target entry as an index to the buffer.

[0124] After the buffer receives the index from the control and storage module, it can determine that the entry corresponding to the index in the control and storage module has been released. When the pointer points to the first third entry in the initial state and the pointer currently points to the jth third entry, the pointer can be moved to point to the j-1th third entry. Meanwhile, the received index is written into the j-1th third entry. As shown in Figure 5 the pointer currently points to the 8th third entry C8, if the received index is 5 (not shown), the pointer can be moved to point to the 7th third entry C7, and the index 5 is written into the entry C7.

[0125] Those skilled in the art should understand that if the pointer points to the 16th third entry in the initial state and the pointer currently points to the jth third entry, after the index stored in the jth third entry is provided to the message packet, the pointer can be moved to point to the j+1th third entry, and the disclosed embodiments do not limit the moving direction of the pointer.

[0126] In this case, if the message packet 1 and the message packet 2 received by the communication device in the current stage successively need to be output to the communication device in the next stage through the same physical output port but are output through different output ports in the communication device in the next stage, the virtual output sub-channels allocated by the communication device in the current stage for the two message packets are different. Even if the physical output port of the message packet 1 received first is blocked in the communication device in the next stage, as long as the physical output port of the message packet 2 received later is unblocked in the communication device in the next stage, the communication device in the current stage can output the message packet 2 using the virtual output sub-channel allocated for the message packet 2, thereby improving the communication efficiency of the communication device. The storage resource for storing the message packet 2 in the communication device in the current stage can be released in time, and the storage resource for storing new message packets is increased.

[0127] The exemplary data structure of the first data is described below.

[0128] In a possible implementation, the first data includes one or more of a source device identifier, a destination device identifier, a message packet priority, a quality of service parameter, a data length, and a data duration.

[0129] For example, the message packet is first sent by a host, the host acts as a source device, and the first data can include a source device identifier. It is known to which slave the message packet is sent, the slave acts as a destination device, and the first data can include a destination device identifier.

[0130] Some message packets are more important, and such message packets can have higher priority, so the first data can include the priority of the message packet. Message packets with higher priority can be output first.

[0131] The Quality of Service (QoS) parameter of the message packet can further include various types of parameters related to the transmission quality of the message packet, such as bandwidth, delay, packet loss rate, etc. Message packets with better quality of service parameters can be output first.

[0132] The data length of the message packet is not fixed, so the first data can include the data length of the message packet.

[0133] The generation time of the message packet is not the same, and the data duration can be recorded to record the existence time of the message packet. Message packets with greater data duration can be output first.

[0134] Those skilled in the art should understand that the first data can also include more or less content, and the embodiments of the present disclosure do not limit the specific content included in the first data.

[0135] Figure 7c A schematic diagram showing the structure of the control and storage module according to an embodiment of the present disclosure.

[0136] As Figure 7c shown, in one possible implementation, the control and storage module includes a control queue and a memory, the control queue includes a plurality of first entries, and the memory includes a plurality of second entries, each index corresponding to a first entry and a second entry;

[0137] The control queue is used to determine the first entry storing the first data according to the index, and store the first data into the corresponding first entry;

[0138] The memory is used to determine the second entry storing the second data according to the index, and store the second data into the corresponding second entry.

[0139] For example, the control and storage module can include a control queue and a memory. The control queue includes a plurality of first entries, and the memory includes a plurality of second entries. Each index corresponds to a first entry and a second entry.

[0140] The control queue is used to determine the first entry storing the first data according to the index, and store the first data into the corresponding first entry. The memory is used to determine the second entry storing the second data according to the index, and store the second data into the corresponding second entry.

[0141] The maximum number of indexes provided by the buffer per clock cycle depends on the amount of data that can be received by the virtual input channel per clock cycle and the amount of data that can be stored by the second entries. For example, if the amount of data that can be received by the virtual input channel per clock cycle is equal to K times the amount of data that can be stored by the second entries (K is a positive integer), the maximum number of indexes provided by the buffer per clock cycle can be equal to K.

[0142] In one example, the correspondence between the indexes, the first entries and the second entries can be set in a direct mapping manner. Figure 7d A schematic diagram of the correspondence between the indexes, the first entries and the second entries according to an embodiment of the present disclosure is shown.

[0143] As shown in Figure 7d The buffer includes 16 third entries (C1-C16), each of which stores an index. The control queue includes 16 first entries (D1-D16) in total, and the memory includes 16 second entries (B1-B16) in total. When the value of the index is i (0 < i ≤ 16, i is an integer), the index corresponds to the i-th first entry and the i-th second entry.

[0144] Those skilled in the art should understand that, as long as different indexes correspond to different first entries and different second entries, the present embodiment does not limit the setting manner of the indexes, the first entries and the second entries. Those skilled in the art should understand that the buffer, the control queue and the memory can include more or fewer entries, and the present embodiment does not limit this.

[0145] In one example, the buffer uses a pointer to assign an index to a message packet. The exemplary implementation manner has been described above and will not be described here again.

[0146] The buffer can output the index provided to the message packet to the control queue and the memory respectively. The control queue can determine the first entry storing the first data according to the index, and store the first data into the determined first entry. The memory can determine the second entry storing the second data according to the index, and store the second data into the determined second entry. In this way, the communication device can complete the storage of the message packet.

[0147] In one example, a first selector can be arranged in the control queue, and the first selector can be used to determine the first entry storing the first data, and store the first data into the determined first entry. A first selector can be arranged in the memory, and the first selector can be used to determine the second entry storing the second data, and store the second data into the determined second entry.

[0148] The exemplary manner of using the first selector to determine the entry storing the data and storing the data into the entry can be referred to Figure 6 and the related description, which will not be described here again.

[0149] The at least one first entry included in the control queue is shared by the plurality of virtual input channels, and the at least one second entry included in the memory is shared by the plurality of virtual input channels. It should be understood by those skilled in the art that the shared first entry / second entry does not need to be fixed, as long as there are enough first entries / second entries that can be shared.

[0150] In a possible implementation, the control queue is further configured to control the memory to read out second data stored in the second target entry as the second target entry corresponding to the first target entry.

[0151] The control queue is specifically configured to output, after merging the first data stored in the first target entry and the second data stored in the second target entry, the merged data through the virtual output sub-channel.

[0152] The control queue is further configured to control the memory to release the second target entry when the first target entry is released.

[0153] For example, since the first entry is the entry storing the first data, and the second entry does not store the first data, the control queue can select the first target entry from the entries storing the valid first data. In addition, the control queue can be further configured to control the memory to read out second data stored in the second target entry as the second target entry corresponding to the first target entry.

[0154] For example, according to the correspondence relationship shown in Figure 7d , the control queue can output the number of the selected first target entry as an index to the memory. The memory can further include a third selector, and the third selector can be used to determine the output of the second target entry according to the index from the control queue, and read out the second data stored in the second target entry.

[0155] An exemplary manner of using the third selector to determine the output of the second entry storing the second data is described below.

[0156] Figure 7e A schematic diagram showing a manner of setting the third selector in the memory according to an embodiment of the present disclosure is shown.

[0157] As shown in Figure 7e , the third selector is set in the memory, and 16 input ends of the third selector are respectively connected to 16 second entries B1-B16, and an output end is used to output the second data.

[0158] The third selector can decode the index from the control queue into a 16-bit mask, when the value of the index is i, determine the second data stored in the i th second entry as the output, and decode the i th bit of the mask as 1 and the other bits of the mask as 0. The value of the i th bit of the mask determines the connection state between the i th input and the output of the third selector, when the value is 0, the i th input and the output of the third selector are disconnected, and when the value is 1, the i th input and the output of the third selector are connected, and the second data is output from the i th second entry. In this case, the third selector can output the determined second data stored in the second entry according to the number.

[0159] Once the stored second data is output, the data stored in the second entry and the corresponding first entry becomes invalid data, and therefore the control queue can release the selected first target entry, and when the first target entry is released, the control memory releases the second target entry. Since the index of the first target entry is the same as the index of the second target entry, the index of the first target entry can be output to the buffer by the control queue.

[0160] After the buffer receives the index from the control queue, the buffer can update the stored index and move the pointer. The exemplary implementation has been described above and will not be described here.

[0161] By storing the first data and the second data in the control queue and the memory respectively, the timing of the communication device is better and the efficiency is higher.

[0162] The following describes an exemplary manner of determining the identifiers of the virtual input sub-channels and the virtual output sub-channels corresponding to the message packet.

[0163] Figure 8 A schematic diagram showing the structure of a communication device according to an embodiment of the present disclosure.

[0164] As shown in Figure 8 In a possible implementation, the device further includes a topology storage module configured to store a topology structure of an on-chip network in which the communication device is located, the first data includes a source device identifier and a destination device identifier, and the control and storage module is specifically configured to,

[0165] When the first data is stored, the position of the communication device on the transmission path of the message packet and the maximum number of physical input / output ports of all the communication devices in the topology structure are determined according to the first data and the topology structure;

[0166] According to the position, the maximum number, and the number of the virtual input channel corresponding to the message packet, the identifier of the virtual input sub-channel corresponding to the message packet and the identifier of the virtual output sub-channel corresponding to the message packet are determined, and the identifiers of the virtual input sub-channel and the virtual output sub-channel corresponding to the message packet are written into the entry in which the first data is stored.

[0167] For example, the communication device can comprise a topology storage module for storing a topology of a network-on-chip in which the communication device is located, and the topology can be as shown in Figure 3 .

[0168] The first data comprises a source device identifier and a destination device identifier, and according to the first data and the topology, the control and storage module can determine a position of the communication device on a transmission path of the message packet, and a maximum number of physical input / output ports of all communication devices in the topology. In Figure 3 an example, the maximum number of physical input / output ports of all communication devices in the topology is 2.

[0169] The number of the virtual input channel corresponding to the message packet is known. According to the determined position, the determined maximum number, and the number of the virtual input channel corresponding to the message packet, an identifier of a virtual input sub-channel corresponding to the message packet and an identifier of a virtual output sub-channel corresponding to the message packet can be determined. The determined identifiers can be written into an entry in which the first data is stored.

[0170] The virtual input sub-channel and the virtual output sub-channel of the communication device according to the embodiments of the present disclosure are determined based on Next-hop-Output Queueing (NOQ). A hop refers to a transmission path passing through one communication device.

[0171] An example way of determining the identifier of the virtual input sub-channel corresponding to the message packet is given below.

[0172] In a possible implementation, the control and storage module is specifically configured to,

[0173] According to the maximum number, a first value X and a second value Y are determined, X is a minimum bit width of the physical input / output ports of all communication devices, Y = 2^X, and X and Y are positive integers;

[0174] When the communication device is the first communication device on the transmission path of the message packet, the number of the virtual input channel corresponding to the message packet is multiplied by the second value, and the product is the identifier of the virtual input sub-channel corresponding to the message packet;

[0175] When the communication device is not the first communication device on the transmission path of the message packet, the identifier of the virtual output sub-channel corresponding to the message packet in the upper-level communication device is taken as the identifier of the virtual input sub-channel corresponding to the message packet.

[0176] For example, as Figure 3As shown, assuming that the source device of the message packet is the communication device 602 and the destination device is the communication device 616, the transmission path of the message packet can be 602-622-628-642-638-616. Assuming that the number of the virtual input channel corresponding to the message packet is 1.

[0177] The maximum number of physical input / output ports of all the communication devices is 2. First, according to the maximum number, a first value X can be determined, X being the minimum bit width of the physical input / output ports of all the communication devices. According to the first value X, a second value Y can be determined, Y being the alignment value of the maximum number, Y = 2^X. For example, when the maximum number is 2, since 2^1 ≥ 2 > 2^0, X can be equal to 1 and Y can be equal to 2.

[0178] When the communication device is the first communication device on the transmission path of the message packet, the number of the virtual input channel corresponding to the message packet is multiplied by the second value, and the product is the identification of the virtual input sub-channel corresponding to the message packet. For example, when the communication device 602 is the first communication device on the transmission path of the message packet as the current-level communication device, the identification of the virtual input sub-channel of the message packet in the communication device 602 can be 1 x 2 = 2.

[0179] Since the virtual output sub-channel of the current-level communication device also serves as the virtual input sub-channel of the lower-level communication device, when the current-level communication device is not the first communication device on the transmission path of the message packet, the virtual output sub-channel determined by the message packet after entering the upper-level communication device can be determined as the virtual input sub-channel of the message packet in the current-level communication device. In this case, the identification of the virtual output sub-channel corresponding to the message packet in the upper-level communication device can be directly used as the identification of the virtual input sub-channel corresponding to the message packet. For example, when the communication device 622 is not the first communication device on the transmission path of the message packet as the current-level communication device, the upper-level communication device of the communication device 622 is the communication device 602, and the identification of the virtual input sub-channel of the message packet in the communication device 622 can be the same as the identification of the virtual output sub-channel of the message packet in the communication device 602.

[0180] In this way, the identification of the virtual input sub-channel corresponding to the message packet in each communication device can be accurately calculated.

[0181] An exemplary way of determining the identification of the virtual output sub-channel corresponding to the message packet is given below.

[0182] In a possible implementation, the control and storage module is specifically configured to,

[0183] According to the maximum number, a first value X and a second value Y are determined, X being the minimum bit width of the physical input / output ports of all the communication devices, Y = 2^X, X and Y being positive integers;

[0184] When the communication device is the last communication device on the transmission path of the message packet, the number of the virtual input channel corresponding to the message packet is multiplied by the second value, and the product is the identification of the virtual output sub-channel corresponding to the message packet.

[0185] When the communication device is not the last communication device on the transmission path of the message packet, the number of the virtual input channel corresponding to the message packet is multiplied by the second value, and then added to the number of the physical output port used by the lower-level communication device on the transmission path of the message packet, as the identification of the virtual output sub-channel corresponding to the message packet.

[0186] For example, as shown in FIG. 6, it is assumed that the transmission path of the message packet is 602-622-628-642-638-616. It is assumed that the number of the virtual input channel corresponding to the message packet is 1. Figure 3

[0187] The maximum number of physical input / output ports of all communication devices is 2. At this time, the first value X can be equal to 1, and the second value Y can be equal to 2. The exemplary determination manner of X and Y has been described above, and will not be described here again.

[0188] When the communication device is the last communication device on the transmission path of the message packet, the number of the virtual input channel corresponding to the message packet is multiplied by the second value, and the product is the identification of the virtual output sub-channel corresponding to the message packet. For example, the communication device 616 is the last communication device on the transmission path of the message packet when it is the current-level communication device, and the identification of the virtual output sub-channel of the message packet in the communication device 616 can be 1x2=2.

[0189] When the communication device is not the last communication device on the transmission path of the message packet, the number of the virtual input channel corresponding to the message packet is multiplied by the second value, and then added to the number of the physical output port used by the lower-level communication device on the transmission path of the message packet, as the identification of the virtual output sub-channel corresponding to the message packet. For example, the communication device 622 is not the first communication device on the transmission path of the message packet when it is the current-level communication device, the lower-level communication device is the communication device 628, and the physical output port p0 is used by the message packet on the communication device 628, and the identification of the virtual output sub-channel of the message packet in the communication device 622 can be 1x2+0=2.

[0190] In this way, the identification of the virtual output sub-channel corresponding to the message packet in each communication device can be accurately calculated.

[0191] ​By analogy, assuming that message packet 1 is transmitted through transmission path 602-622-628-642-638-616, the identification of the corresponding virtual input subchannel and virtual output subchannel of message packet 1 in each communication device is as follows:

[0192] The identification of the corresponding virtual input subchannel of message packet in communication device 602 can be 1x2=2; message packet is output through physical output port q1 in lower-level communication device 622 of communication device 602, and the identification of the corresponding virtual output subchannel of message packet in communication device 602 can be 1x2+1=3;

[0193] The identification of the corresponding virtual input subchannel of message packet in communication device 622 can be 3; message packet is output through physical output port p0 in lower-level communication device 628 of communication device 622, and the identification of the corresponding virtual output subchannel of message packet in communication device 622 can be 1x2+0=2;

[0194] The identification of the corresponding virtual input subchannel of message packet in communication device 628 can be 2; there is only one physical output port in lower-level communication device 642 of communication device 628, and the number of the physical output port is 0 by default. The identification of the corresponding virtual output subchannel of message packet in communication device 628 can be 1x2+0=2;

[0195] The identification of the corresponding virtual input subchannel of message packet in communication device 642 can be 2; there is only one physical output port in lower-level communication device 638 of communication device 642, and the number of the physical output port is 0 by default. The identification of the corresponding virtual output subchannel of message packet in communication device 642 can be 1x2+0=2;

[0196] The identification of the corresponding virtual input subchannel of message packet in communication device 638 can be 2; there is only one physical output port in lower-level communication device 616 of communication device 638, and the number of the physical output port is 0 by default. The identification of the corresponding virtual output subchannel of message packet in communication device 638 can be 1x2+0=2;

[0197] The identification of the corresponding virtual input subchannel of message packet in communication device 616 can be 2; communication device 616 is the last communication device on the transmission path, and the identification of the corresponding virtual output subchannel of message packet in communication device 616 can be 1x2=2.

[0198] The following describes an exemplary manner of selecting a first target entry by the control and storage module.

[0199] In a possible implementation manner, the plurality of virtual output subchannels of the communication device serve as the plurality of virtual input subchannels of the lower-level communication device,

[0200] The device further comprises a statistics module configured to count the number of idle entries shared by all virtual input sub-channels in the subordinate communication device and the number of idle entries private to each virtual input sub-channel in the subordinate communication device.

[0201] The control and storage module is specifically configured to filter, from the entries storing valid first data, entries satisfying a first preset condition to obtain a first candidate group, the first preset condition being that the data retention period stored in a current entry is greater than that of other entries storing the same identifier of a virtual input sub-channel as the current entry.

[0202] According to the identifier of the virtual output sub-channel stored in each entry and the counting result of the statistics module, the control and storage module filters, from the first candidate group, entries satisfying a second preset condition to obtain a second candidate group, the second preset condition being that the number of idle entries available to a virtual input sub-channel corresponding to the identifier of the virtual output sub-channel stored in a current entry in the subordinate communication device is greater than the number of entries used to store a message packet corresponding to the current entry.

[0203] The control and storage module selects at least one entry in the second candidate group as a first target entry.

[0204] For example, as shown in FIG. 1, the device further comprises a statistics module configured to count the number of idle entries shared by all virtual input sub-channels in the subordinate communication device and the number of idle entries private to each virtual input sub-channel in the subordinate communication device. Figure 8 Since only one virtual output sub-channel can use the physical output port at the same time, the control and storage module can first filter, from the entries storing valid first data, entries satisfying a first preset condition to obtain a first candidate group, the first preset condition being that the data retention period stored in a current entry is greater than that of other entries storing the same identifier of a virtual input sub-channel as the current entry.

[0205] Next, an exemplary manner of filtering entries satisfying the first preset condition is described.

[0206] In a possible implementation, the first data includes a data retention period, and the control and storage module is specifically configured to:

[0207] The entries storing valid first data are grouped, and the entries in each group store the same identifier of a virtual input sub-channel.

[0208] According to the data retention period stored in each entry, the control and storage module filters, from each group, an entry with the greatest data retention period to obtain a first candidate group.

[0209] According to the data retention period stored in each entry, the control and storage module filters, from each group, an entry with the greatest data retention period to obtain a first candidate group.

[0210] For example, since the control and storage module writes the identifier of the virtual input sub-channel to the entry when storing the first data, the entries storing valid first data can be grouped according to the identifier of the virtual input sub-channel, so that the entries in each group store the same identifier of the virtual input sub-channel, and the entries in different groups store different identifiers of the virtual input sub-channel.

[0211] Figure 9 A schematic diagram illustrating the data storage of the control and storage module according to an embodiment of the present disclosure is shown.

[0212] like Figure 9 As shown, in the control and storage module, entries A2, A4, A6-A9, A11, and A13 store valid first data. The virtual input sub-channels stored in entries A2, A4, A6, and A8 are identified as IVC0, and the virtual input sub-channels stored in entries A7, A9, A11, and A13 are identified as IVC1. The virtual output sub-channels stored in entries A2, A6, A9, and A13 are identified as OVC0, and the virtual output sub-channels stored in entries A4, A7, A8, and A11 are identified as OVC1.

[0213] In this case, two groups can be obtained. Entries A2, A4, A6, and A8 form the first group, corresponding to the virtual input sub-channel IVC0, while entries A7, A9, A11, and A13 form the second group, corresponding to the virtual input sub-channel IVC1.

[0214] The first data includes the data duration, which can be used to filter out the entries with the longest data duration stored in each group to obtain the first candidate group.

[0215] like Figure 9 As shown, the data duration of item A2 in the first group is the longest, and the data duration of item A13 in the second group is the longest. Therefore, the first candidate group may include items A2 and A13.

[0216] In this scenario, for the same virtual transmission sub-channel, the first data of a message packet with a longer data duration input through that virtual transmission sub-channel can be output earlier. Furthermore, there is no need to establish additional relationships between entries, reducing the implementation complexity of the control and storage modules.

[0217] The following describes another exemplary method for filtering entries that meet the first preset condition.

[0218] In one possible implementation, among the entries storing valid first data, entries corresponding to the same virtual input sub-channel belong to the linked list corresponding to that virtual input sub-channel.

[0219] The control and storage module is further configured to, when storing the first data, take an entry storing the first data as a tail of a linked list corresponding to a determined virtual input sub-channel.

[0220] The control and storage module is specifically configured to obtain the first candidate group according to the entry at the head of each linked list.

[0221] For example, the control and storage module can establish an association relationship for the entries storing the valid data, so that the entries corresponding to the same virtual input sub-channel belong to the linked list corresponding to the virtual input sub-channel.

[0222] When storing the first data, a virtual input sub-channel is determined according to the first data, and the entry storing the first data is taken as the tail of the linked list corresponding to the virtual input sub-channel.

[0223] Figure 10 A schematic diagram showing the data storage of the control and storage module according to an embodiment of the present disclosure is shown.

[0224] As shown in Figure 10 , in the control and storage module, entries A2, A4, A6-A9, A11 and A13 store valid first data. The entries A2, A4, A6 and A8 store the identifier of the virtual input sub-channel as IVC0, and the entries A7, A9, A11 and A13 store the identifier of the virtual input sub-channel as IVC1. The entries A2, A6, A9 and A13 store the identifier of the virtual output sub-channel as OVC0, and the entries A4, A7, A8 and A11 store the identifier of the virtual output sub-channel as OVC1.

[0225] In this case, there are two linked lists in the control and storage module, the first linked list corresponds to the virtual input sub-channel IVC0 and includes entries A2, A4, A6 and A8, wherein the entry A2 is the head and the entry A8 is the tail. The second linked list corresponds to the virtual input sub-channel IVC1 and includes entries A7, A9, A11 and A13, wherein the entry A13 is the head and the entry A7 is the tail.

[0226] Since the entry storing the first data is taken as the tail of the linked list when storing the first data, the data retention period of the entry at the head of the linked list must be greater than that of other entries in the linked list, and the entry at the head of each linked list is the entry satisfying the first preset condition. When filtering the entries satisfying the first preset condition, the entries at the heads of the linked lists can be directly found. As shown in Figure 10 , the entries A2 and A13 are the heads of the linked lists, and the first candidate group can include the entry A2 and the entry A13.

[0227] In this way, the way of screening the entries satisfying the first preset condition is simpler. The first data can not include data retention period, reducing the storage cost of the control and storage module.

[0228] As shown in Figure 9 and Figure 10 Since the identification of the virtual input subchannel is added when storing the first data, the entries corresponding to the same virtual input subchannel can be discontinuous entries.

[0229] The virtual output subchannel of the current communication device is the virtual input subchannel of the lower-level communication device, that is, the message packet output through the virtual output subchannel of the current communication device should be stored in the idle entry available to the virtual input subchannel corresponding to the virtual output subchannel after inputting the lower-level communication device. In this case, if the virtual output subchannel of the current communication device has insufficient idle entries available to the virtual input subchannel corresponding to the virtual output subchannel in the lower-level communication device, the message packet output by the virtual output subchannel of the current communication device will block the physical output port of the current communication device.

[0230] Based on this, the entries satisfying the second preset condition can be screened from the first candidate group according to the identification of the virtual output subchannel stored by each entry and the statistical result of the statistical module, and the second candidate group is obtained, and the second preset condition is that the number of idle entries available to the virtual input subchannel corresponding to the identification of the virtual output subchannel stored by the current entry in the lower-level communication device is greater than the number of entries used to store the message packet corresponding to the current entry.

[0231] The number of idle entries available to the virtual input subchannel has various calculation methods.

[0232] The first exemplary calculation method of the number of idle entries available to the virtual input subchannel is introduced below.

[0233] In a possible implementation, the idle entries available to any virtual input subchannel include all or part of the idle entries shared by all virtual input subchannels and the idle entries private to the virtual input subchannel.

[0234] For example, assuming that the idle entries shared by all virtual input subchannels are 4, the idle entries private to the virtual input subchannel IVC0 are 1, and all shared idle entries and all idle entries private to IVC0 can be used by IVC0, the number of idle entries available to IVC0 can be 5. If a certain entry in the first candidate group belongs to message packet 1, the virtual input subchannel corresponding to the identification of the virtual output subchannel stored by the entry is IVC0, and 4 entries are needed to store message packet 1, since 5>4, the entry satisfies the second preset condition.

[0235] For example, assume that there are 4 free entries shared by all virtual input sub-channels, and 1 free entry private to virtual input sub-channel IVC0. If only half of the total free entries shared can be used by IVC0, and all of the total free entries private to IVC0 can be used by IVC0, then the number of free entries available to IVC0 can be 3. If an entry in the first candidate group belongs to message packet 1, and the virtual input sub-channel corresponding to the identification of the virtual output sub-channel stored in the entry is IVC0, and 4 entries are needed to store message packet 1, since 3 < 4, the entry does not satisfy the second preset condition.

[0236] The second exemplary calculation of the number of free entries available to a virtual input sub-channel is described below.

[0237] In a possible implementation, the free entries available to any virtual input sub-channel include the free entries shared by all virtual input sub-channels.

[0238] For example, at least one entry can be shared by multiple virtual input channels, and the virtual input channels include virtual input sub-channels, so at least one entry can be shared by multiple virtual input sub-channels.

[0239] For example, assume that there are 4 free entries shared by all virtual input sub-channels, and no free entry is private to virtual input sub-channel IVC0. If all of the total free entries shared can be used by IVC0, then the number of free entries available to IVC0 can be 4. If an entry in the first candidate group belongs to message packet 1, and the virtual input sub-channel corresponding to the identification of the virtual output sub-channel stored in the entry is IVC0, and 4 entries are needed to store message packet 1, since 4 = 4, the entry satisfies the second preset condition.

[0240] The third exemplary calculation of the number of free entries available to a virtual input sub-channel is described below.

[0241] In a possible implementation, the free entries available to any virtual input sub-channel include the free entries private to the virtual input sub-channel.

[0242] For example, assuming that the number of free entries shared by all virtual input sub-channels is 4, the number of free entries private to virtual input sub-channel IVC0 is 1, and only the free entries private to IVC0 can be used by IVC0, the number of free entries available to IVC0 can be 1. If an entry in the first candidate group belongs to message packet 1, the virtual input sub-channel corresponding to the identification of the virtual output sub-channel stored in the entry is IVC0, and 4 entries are required to store message packet 1, since 1 < 4, the entry does not satisfy the second preset condition.

[0243] In this way, the manner of calculating the number of free entries available to the virtual input sub-channel is more flexible.

[0244] Those skilled in the art should understand that the number of free entries available to the virtual input sub-channel can also be calculated in other manners, for example, the free entries available to the virtual input sub-channel can include part of the free entries shared by all virtual input sub-channels, etc., and the embodiments of the present disclosure do not limit the specific calculation manner of the number of free entries available to the virtual input sub-channel.

[0245] The entries in the second candidate group can be selected for output. Optionally, the entries with higher message packet priority / better quality of service parameter / longer data survival period can be preferentially selected. The number of selected entries can be less than or equal to the maximum number of indexes provided by the buffer of the lower-level communication device per clock cycle. The embodiments of the present disclosure do not limit the specific manner and specific number of entries selected from the second candidate group.

[0246] Those skilled in the art should understand that the manner of selecting entries by the control and storage module should not be limited to the above examples, for example, if the control and storage module cannot determine the data survival period of the data stored in the entry, the entries satisfying the second preset condition can also be filtered from the entries storing valid first data, and the entries can be further filtered from the entries satisfying the second preset condition according to the priority information, etc., and the embodiments of the present disclosure do not limit the specific manner of selecting entries by the control and storage module.

[0247] The entries can be selected by the control queue. The control and storage module can include a scheduler (not shown), which can be arranged outside the control queue, and the entries can be selected by the scheduler. The embodiments of the present disclosure do not limit the specific object in the control and storage module that undertakes the task of selecting entries.

[0248] The above-mentioned selecting entries, merging data, outputting data (message packet), releasing entries, transmitting the indexes of released entries to the buffer, and updating the index storage of the buffer can be completed in one clock cycle. An interface (not shown) can be arranged between the buffer, the control queue, and the memory, and the interface includes one or more buffers to receive and deliver data.

[0249] Figure 11 A schematic diagram showing a flow of a data storage method according to an embodiment of the present disclosure.

[0250] As Figure 11 shown, the present disclosure also proposes a data storage method, which is applied to a communication device, the device comprising a buffer, a control and storage module, a plurality of virtual input channels,

[0251] The control and storage module comprises a plurality of entries, at least one of which is shared by a plurality of virtual input channels, each entry corresponding to an index;

[0252] The device receives a message packet through any one of the virtual input channels, and the method comprises:

[0253] Step S21, using the buffer to provide an index for the message packet;

[0254] Step S22, using the control and storage module to determine an entry for storing the message packet according to the index, and storing the message packet in the corresponding entry.

[0255] In a possible implementation, the message packet comprises first data and second data, wherein the first data is metadata of the message packet, and the second data is payload data of the message packet.

[0256] In a possible implementation, the device further comprises a plurality of physical input ports, a plurality of physical output ports, and a plurality of virtual output channels, the communication device being connected to a lower-level communication device through the physical output ports, each virtual input channel comprising a plurality of virtual input sub-channels, each virtual input sub-channel corresponding to a physical output port of the device; each virtual output channel comprising a plurality of virtual output sub-channels, each virtual output sub-channel corresponding to a physical output port of the lower-level communication device; the message packet being received through one of the plurality of virtual input sub-channels, the method further comprising: the control and storage module writing, when storing the first data, the identification of the virtual input sub-channel and the virtual output sub-channel corresponding to the message packet into the entry storing the first data; the control and storage module selecting a first target entry from the entries storing valid first data, determining a virtual output sub-channel according to the first target entry, and outputting the data stored in the first target entry through the virtual output sub-channel; and the control and storage module releasing the first target entry and outputting the index corresponding to the first target entry to the buffer.

[0257] In a possible implementation, the control and storage module includes a control queue and a storage, the control queue includes a plurality of first entries, the storage includes a plurality of second entries, each index corresponds to a first entry and a second entry; the storing the message packet into the corresponding entry includes: the control queue determines the first entry storing the first data according to the index, and stores the first data into the corresponding first entry; the storage determines the second entry storing the second data according to the index, and stores the second data into the corresponding second entry.

[0258] In a possible implementation, the method further includes: the control queue controls the storage to read out the second data stored in the second target entry corresponding to the first target entry; and the outputting the data stored in the first target entry via the virtual output sub-channel includes: the control queue merges the first data stored in the first target entry and the second data stored in the second target entry, and then outputs the merged data via the virtual output sub-channel; and the method further includes: when the control queue releases the first target entry, the control queue controls the storage to release the second target entry.

[0259] In a possible implementation, the apparatus further includes a topology storage module configured to store a topology of a network-on-chip in which the communication device is located, the first data includes a source device identifier and a destination device identifier, and the writing, when storing the first data, the identifier of the virtual input sub-channel and the virtual output sub-channel corresponding to the message packet into the entry storing the first data includes: determining, when storing the first data, a position of the communication device on a transmission path of the message packet according to the first data and the topology, and a maximum number of physical input / output ports of all communication devices in the topology; determining, according to the position, the maximum number, and a number of a virtual input channel corresponding to the message packet, the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet, and writing, into the entry storing the first data, the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet.

[0260] In a possible implementation, the plurality of virtual output sub-channels of the communication device are virtual input sub-channels of the lower-level communication device, and the device further comprises a statistics module, and the method further comprises: using the statistics module to count the number of idle entries shared by all virtual input sub-channels in the lower-level communication device and the number of idle entries private to each virtual input sub-channel in the lower-level communication device; and the selecting the first target entry from the entries storing valid first data comprises: screening entries that satisfy a first preset condition from the entries storing valid first data to obtain a first candidate group, the first preset condition being that the data retention period stored in a current entry is greater than that of another entry storing the same identifier of a virtual input sub-channel as the current entry; screening entries that satisfy a second preset condition from the first candidate group according to the identifiers of virtual output sub-channels stored in each entry and the counting result of the statistics module to obtain a second candidate group, the second preset condition being that the number of idle entries available to a virtual input sub-channel corresponding to the identifier of the virtual output sub-channel stored in the current entry in the lower-level communication device is greater than the number of entries used to store a message packet corresponding to the current entry; and selecting at least one entry in the second candidate group as the first target entry.

[0261] In a possible implementation, the first data comprises a data retention period, and the screening entries that satisfy the first preset condition from the entries storing valid first data to obtain a first candidate group comprises: grouping the entries storing valid first data, and the entries in each group store the same identifier of a virtual input sub-channel; and screening an entry with the largest data retention period in each group according to the data retention period stored in each entry to obtain the first candidate group.

[0262] In a possible implementation, the entries corresponding to the same virtual input sub-channel in the entries storing valid first data belong to a linked list corresponding to the virtual input sub-channel, and the method further comprises: when storing the first data, using the entry storing the first data as the tail of the linked list corresponding to the determined virtual input sub-channel; and the screening entries that satisfy the first preset condition from the entries storing valid first data to obtain a first candidate group comprises: obtaining the first candidate group according to the entry at the head of each linked list.

[0263] In a possible implementation, the idle entries available to any virtual input sub-channel comprise all or part of the idle entries shared by all virtual input sub-channels and the idle entries private to the virtual input sub-channel.

[0264] In a possible implementation, the idle entries available to any virtual input sub-channel comprise the idle entries shared by all virtual input sub-channels.

[0265] In a possible implementation, the free entries available for any virtual input sub-channel include free entries private to the virtual input sub-channel.

[0266] In a possible implementation, the determining of the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet according to the position, the maximum number, and the number of the virtual input channel corresponding to the message packet includes: determining a first value X and a second value Y according to the maximum number, X being the minimum bit width of the physical input / output port of all communication devices, Y = 2^X, X and Y being positive integers; when the communication device is the first communication device on the transmission path of the message packet, multiplying the number of the virtual input channel corresponding to the message packet by the second value, the product being the identifier of the virtual input sub-channel corresponding to the message packet; when the communication device is not the first communication device on the transmission path of the message packet, taking the identifier of the virtual output sub-channel corresponding to the message packet in the upper-level communication device as the identifier of the virtual input sub-channel corresponding to the message packet.

[0267] In a possible implementation, the determining of the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet according to the position, the maximum number, and the number of the virtual input channel corresponding to the message packet includes: determining a first value X and a second value Y according to the maximum number, X being the minimum bit width of the physical input / output port of all communication devices, Y = 2^X, X and Y being positive integers; when the communication device is the last communication device on the transmission path of the message packet, multiplying the number of the virtual input channel corresponding to the message packet by the second value, the product being the identifier of the virtual output sub-channel corresponding to the message packet; when the communication device is not the last communication device on the transmission path of the message packet, multiplying the number of the virtual input channel corresponding to the message packet by the second value, and adding the number of the physical output port used by the lower-level communication device on the transmission path of the message packet to the product, as the identifier of the virtual output sub-channel corresponding to the message packet.

[0268] The chip according to the embodiments of the present disclosure is not limited to a specific type of chip, as long as the chip is provided with or connected to a host and a slave that need to communicate.

[0269] The electronic device according to the embodiments of the present disclosure is not limited to a specific type of electronic device, and can be a terminal device or a server.

[0270] The computer program product of the present disclosure can be a computer program product, which is a machine-readable medium (media) having instances of the software embodied thereon, such as computer software, firmware, wireless application protocol, middleware or microcode. For example, a computer program product can be a floppy disk, a CD-ROM, a DVD, a Blu-ray Disc™, a flash drive, a memory stick, a magnetic tape, or a hard disk drive. The machine-readable medium can be a single medium, or multiple media, of the same or different type. The computer program product can be one or more computer program components, which are stored and / or executed on a hardware-based system such as a microprocessor. Those skilled in the art will appreciate that the computer program product described herein can be implemented using software, hardware, and / or any combination of software and / or hardware.

[0271] While the application is susceptible to various modifications and alternative forms, specific embodiments are shown by way of example in the drawings and are herein described in detail. It should be understood however that the drawings and detailed description thereto are not intended to limit the application to the particular form disclosed but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the application as defined by the appended claims. Notably, the inclusion of and positional relationships between the various modular components of the figures are exemplary and can be varied. Using the computing system 100 as an example, certain components are described in the figures as being within the communication device, but in other embodiments one or more of these components can be used external to the communication device. For example, in certain embodiments one or more of these components, including the topology storage module, the statistics module, etc. Thus, the further description provided in the figures also applies to circuitry and hardware / software control logic external to the communication device.

[0272] Embodiments of the present disclosure have been described above, with examples of the specification being exemplary and not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of words in this document is intended to best explain the principles of the embodiments, practical application, or improvement to the art in the marketplace, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein.

Claims

1. A communication device, characterized by The device comprises a buffer, a control and storage module, a plurality of virtual input channels, The device further comprises a plurality of physical input ports, a plurality of physical output ports, a plurality of virtual output channels, and the communication device is connected with a lower-level communication device through the physical output ports, Each virtual input channel comprises a plurality of virtual input sub-channels, and each virtual input sub-channel corresponds to one physical output port of the device; Each virtual output channel comprises a plurality of virtual output sub-channels, and each virtual output sub-channel corresponds to one physical output port of a lower-level communication device; The control and storage module comprises a plurality of entries, at least one of which is shared by a plurality of virtual input channels, and each entry corresponds to an index; The device receives a message packet through any virtual input channel; The buffer is used to provide an index for the message packet; The control and storage module is used to determine the entry storing the message packet according to the index, and store the message packet in the corresponding entry.

2. The device of claim 1, wherein The message packet comprises first data and second data, wherein the first data is metadata of the message packet, and the second data is payload data of the message packet.

3. The device of claim 2, wherein The message packet is received through one of the plurality of virtual input sub-channels, and the control and storage module is further used to When storing the first data, write the identification of the virtual input sub-channel and the virtual output sub-channel corresponding to the message packet to the entry storing the first data; Select a first target entry from the entries storing valid first data, determine a virtual output sub-channel according to the first target entry, and output the data stored in the first target entry through the virtual output sub-channel; Release the first target entry, and output the index corresponding to the first target entry to the buffer.

4. The apparatus of claim 3, wherein, The control and storage module comprises a control queue and a storage, the control queue comprises a plurality of first entries, and the storage comprises a plurality of second entries, each index corresponding to one first entry and one second entry; The control queue is used to determine the first entry storing the first data according to the index, and store the first data in the corresponding first entry; The storage is used to determine the second entry storing the second data according to the index, and store the second data in the corresponding second entry.

5. The device of claim 4, wherein The control queue is further used to take the second entry corresponding to the first target entry as a second target entry, and control the storage to read out the second data stored in the second target entry; The control queue is specifically used to output the first data stored in the first target entry and the second data stored in the second target entry after merging them, through the virtual output sub-channel; The control queue is further used to control the storage to release the second target entry when the first target entry is released.

6. The apparatus of claim 3 or 5, wherein, The device further comprises a topology storage module configured to store a topology of a network-on-chip to which the communication device belongs, the first data comprises a source device identifier and a destination device identifier, and the control and storage module is specifically configured to, when storing the first data, determine, according to the first data and the topology, a position of the communication device on a transmission path of the message packet and a maximum number of physical input / output ports of all communication devices in the topology; determine, according to the position, the maximum number, and a number of a virtual input channel corresponding to the message packet, an identifier of a virtual input sub-channel corresponding to the message packet and an identifier of a virtual output sub-channel corresponding to the message packet, and write the identifier of the virtual input sub-channel and the identifier of the virtual output sub-channel corresponding to the message packet into an entry storing the first data.

7. The apparatus of claim 3 or 5, wherein, The plurality of virtual output sub-channels of the communication device serve as a plurality of virtual input sub-channels of the lower-level communication device, The device further comprises a statistics module configured to count a number of idle entries shared by all virtual input sub-channels in the lower-level communication device and a number of idle entries private to each virtual input sub-channel in the lower-level communication device; The control and storage module is specifically configured to: filter, from the entries storing valid first data, an entry satisfying a first preset condition to obtain a first candidate group, the first preset condition being that a data retention period stored in the current entry is greater than that of another entry storing an identifier of the same virtual input sub-channel as the current entry; filter, from the first candidate group, an entry satisfying a second preset condition according to an identifier of a virtual output sub-channel stored in each entry and a result of the statistics, to obtain a second candidate group, the second preset condition being that a number of idle entries available to a virtual input sub-channel corresponding to the identifier of the virtual output sub-channel stored in the current entry in the lower-level communication device is greater than a number of entries used to store a message packet corresponding to the current entry; select at least one entry in the second candidate group as the first target entry.

8. The apparatus of claim 7, wherein, The first data comprises a data retention period, and the control and storage module is specifically configured to, group the entries storing valid first data, and entries in each group store an identifier of the same virtual input sub-channel; filter, from each group, an entry with a maximum data retention period to obtain a first candidate group according to the data retention period stored in each entry.

9. The apparatus of claim 7, wherein, In the entries storing valid first data, entries corresponding to the same virtual input sub-channel belong to a linked list corresponding to the virtual input sub-channel, The control and storage module is further configured to, when storing the first data, take an entry storing the first data as a tail of the linked list corresponding to the determined virtual input sub-channel; The control and storage module is specifically configured to obtain a first candidate group according to an entry at a head of each linked list.

10. The apparatus of claim 7, wherein, Idle entries available to any virtual input sub-channel include all or part of idle entries shared by all virtual input sub-channels and idle entries private to the virtual input sub-channel.

11. The apparatus of claim 7, wherein, The free entries available to any one of the virtual input sub-channels include the free entries shared by all the virtual input sub-channels.

12. The apparatus of claim 7, wherein, The free entries available to any one of the virtual input sub-channels include the free entries private to the virtual input sub-channel.

13. The apparatus of claim 6, wherein, The control and storage module is specifically configured to, determine a first value X and a second value Y according to the maximum number, X being the minimum bit width of the physical input / output ports of all the communication devices, Y = 2^X, X and Y being positive integers; when the communication device is the first communication device on the transmission path of the message packet, multiply the number of the virtual input channel corresponding to the message packet by the second value, the product being the identification of the virtual input sub-channel corresponding to the message packet; when the communication device is not the first communication device on the transmission path of the message packet, take the identification of the virtual output sub-channel corresponding to the message packet in the upper-level communication device as the identification of the virtual input sub-channel corresponding to the message packet.

14. The apparatus of claim 6, wherein, The control and storage module is specifically configured to, determine a first value X and a second value Y according to the maximum number, X being the minimum bit width of the physical input / output ports of all the communication devices, Y = 2^X, X and Y being positive integers; when the communication device is the last communication device on the transmission path of the message packet, multiply the number of the virtual input channel corresponding to the message packet by the second value, the product being the identification of the virtual output sub-channel corresponding to the message packet; when the communication device is not the last communication device on the transmission path of the message packet, multiply the number of the virtual input channel corresponding to the message packet by the second value, and then add the number of the physical output port used by the lower-level communication device on the transmission path of the message packet, as the identification of the virtual output sub-channel corresponding to the message packet.

15. A data storage method, characterized by, The method is applied to a communication device, the device comprising a buffer, a control and storage module, a plurality of virtual input channels, the device further comprising a plurality of physical input ports, a plurality of physical output ports, a plurality of virtual output channels, the communication device being connected to a lower-level communication device through the physical output ports, each virtual input channel comprising a plurality of virtual input sub-channels, each virtual input sub-channel corresponding to one physical output port of the device; each virtual output channel comprising a plurality of virtual output sub-channels, each virtual output sub-channel corresponding to one physical output port of a lower-level communication device; the control and storage module comprising a plurality of entries, at least one entry being shared by a plurality of virtual input channels, each entry corresponding to an index; the device receiving a message packet through any one of the virtual input channels, the method comprising: providing the message packet with an index using the buffer; determining an entry storing the message packet according to the index using the control and storage module, and storing the message packet in the corresponding entry.

16. A chip, characterized by The communication device of any one of claims 1-14.

17. An electronic device, comprising: The chip of claim 16.

Citation Information

Patent Citations

  • Circuit module, credit control method, integrated circuit, and storage medium

    CN114490456A

  • Transmission of address translation type packets

    CN117716679A