Communication device, electronic device, and communication method
By using the counting module and the first communication module in the on-chip interconnect network to arbitrate request priority, the problem of unbalanced data transmission path between the host and the slave is solved, and the utilization rate of the bus and data transmission efficiency are improved.
Patent Information
- Application Number
- CN202510725668.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In the prior art, the data transmission paths of multiple hosts in the on-chip interconnect network are unbalanced, resulting in low bus utilization and the data transmission paths of some hosts are prone to congestion.
The counting module is used to record the number or number of data transmission cycles between the slave and each host. The first communication module arbitrates the priority of requests based on these numerical values to ensure that requests with high priority are transmitted first, and balance the load of the data transmission path between the master and the slave.
It reduces the congestion level of data transmission paths, balances the load gap between data transmission paths of different hosts, and improves the utilization rate of the bus.
Smart Images

Figure CN120234293B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a communication device, an electronic device, and a communication method. Background Art
[0002] In existing on-chip interconnect networks, a single communication bus / interconnect node often connects multiple masters and slaves. The master, typically a processor core, can issue requests; the slave, typically a memory device, can respond to requests and return data. Requests and data are transmitted via separate pathways. Multiple masters may simultaneously issue requests to the same slave. To fairly allocate bus request bandwidth, arbitration is required to determine which master obtains bus access.
[0003] The existing arbitration method involves multiple hosts taking turns acquiring bus access rights. In actual chip operation, multiple hosts may work asynchronously, and the frequency with which each host acquires bus access rights may vary significantly. A host that acquires bus access more frequently will receive a larger amount of data from the slaves, which can easily cause congestion in the data transmission path corresponding to that host. This leads to uneven loads on the data transmission paths of different hosts, reducing bus utilization. Summary of the Invention
[0004] In view of this, the present disclosure provides a communication device, electronic device, and communication method. The communication device of the present disclosure can reduce data transmission path congestion, balance the load differences between data transmission paths of different hosts, and improve bus utilization when implementing communication between the host and slave devices.
[0005] According to one aspect of the present disclosure, a communication device is provided, which connects N hosts and slaves, where N is an integer greater than 1, and the slaves are used to respond to requests issued by the hosts; the device includes a counting module and a first communication module, and the counting module is used to record N first values related to the slaves, where the i-th first value is the number of transmission cycles or the number of requests issued by the i-th host and received but not responded to by the slave, and the number of transmission cycles is the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed, 1≤i≤N, and i is an integer; the first communication module is used to receive a request from the host, and in a current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtain the first value from the counting module, and transmit the request arbitrated according to the first value to the slave.
[0006] In one possible implementation, the first communication module is specifically used to determine the priority of the request to be transmitted to the slave machine based on the first value, and use the request with the highest priority as the arbitrated request; wherein, the smaller the i-th first value, the higher the priority of the request issued by the i-th host to be transmitted to the slave machine.
[0007] In one possible implementation, the first communication module is further used to update the i-th first value when the arbitrated request comes from the i-th host, wherein, when the i-th first value is the number of transmission cycles of the request issued by the i-th host and received and not responded by the slave, the i-th first value is increased by K, K is the number of cycles from the slave to transmit data to the host in response to the arbitrated request until the data transmission is completed, and K is a positive integer; when the i-th first value is the number of requests issued by the i-th host and received and not responded by the slave, the i-th first value is increased by 1.
[0008] In one possible implementation, the first communication module includes N first demultiplexers and a first multiplexer, the i-th first demultiplexer is connected to the first multiplexer and the i-th host, and the first multiplexer is connected to all the first demultiplexers and the slave; the i-th first demultiplexer is used to receive a request issued by the i-th host, and when determining that the request is to be transmitted to the slave, transmit the request to the first multiplexer; the first multiplexer is used to, in the current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtain the first value from the counting module, and transmit the request arbitrated according to the first value to the slave.
[0009] In a possible implementation manner, the i-th first value is updated by the first multiplexer or the first demultiplexer.
[0010] In a possible implementation, the device further includes a second communication module, the second communication module including a second demultiplexer and N second multiplexers, the second demultiplexer connecting all the second multiplexers and the slaves, and the i-th second multiplexer connecting the second demultiplexer and the i-th host;
[0011] The second demultiplexer is used to receive data sent by the slave, and when it is determined that the data is to be transmitted to the i-th host, transmit the data to the i-th second multiplexer; the i-th second multiplexer is used to transmit the received data to the i-th host.
[0012] In one possible implementation, the second communication module is further used to update the i-th first value recorded by the counting module after receiving data to be sent to the i-th host, wherein when the i-th first value is the number of transmission cycles of the request issued by the i-th host and received and not responded by the slave, the i-th first value is reduced by L, where L is the number of cycles from the start of transmission of the received data to the host to the completion of data transmission, and L is a positive integer; when the i-th first value is the number of requests issued by the i-th host and received and not responded by the slave, the i-th first value is reduced by 1.
[0013] In a possible implementation manner, the i-th first value is updated by the second multiplexer or the second demultiplexer.
[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising the above communication device.
[0015] According to another aspect of the present disclosure, a communication method is provided, which is applied to a communication device, wherein the device is connected to N hosts and slaves, where N is an integer greater than 1, and the slaves are used to respond to requests issued by the hosts; the device includes a counting module and a first communication module, and the method includes: using the counting module to record N first values related to the slaves, the i-th first value being the number of transmission cycles or the number of requests issued by the i-th host and received but not responded to by the slave, the number of transmission cycles being the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed, 1≤i≤N, i is an integer; using the first communication module to receive a request from the host, and in a current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtaining the first value from the counting module, and transmitting the request arbitrated according to the first value to the slave.
[0016] In one possible implementation, transmitting the request arbitrated according to the first numerical value to the slave device includes: determining the priority of the request to be transmitted to the slave device according to the first numerical value, and taking the request with the highest priority as the arbitrated request; wherein, the smaller the i-th first numerical value, the higher the priority of the request issued by the i-th host to be transmitted to the slave device.
[0017] In one possible implementation, the method further includes: when the arbitrated request comes from the i-th host, using the first communication module to update the i-th first value, wherein, when the i-th first value is the number of transmission cycles of the request issued by the i-th host and received and not responded by the slave, the i-th first value is increased by K, K is the number of cycles from the slave to transmit data to the host in response to the arbitrated request until the data transmission is completed, and K is a positive integer; when the i-th first value is the number of requests issued by the i-th host and received and not responded by the slave, the i-th first value is increased by 1.
[0018] In one possible implementation, the first communication module includes N first demultiplexers and a first multiplexer, the i-th first demultiplexer is connected to the first multiplexer and the i-th host, and the first multiplexer is connected to all the first demultiplexers and the slave; the receiving a request from the host, in a current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtaining the first value from the counting module, and transmitting the request arbitrated according to the first value to the slave, includes: using the i-th first demultiplexer to receive the request issued by the i-th host, and when determining that the request is to be transmitted to the slave, transmitting the request to the first multiplexer; using the first multiplexer, in a current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtaining the first value from the counting module, and transmitting the request arbitrated according to the first value to the slave.
[0019] In a possible implementation manner, the i-th first value is updated by the first multiplexer or the first demultiplexer.
[0020] In one possible implementation, the device also includes a second communication module, the second communication module includes a second demultiplexer and N second multiplexers, the second demultiplexer connects all the second multiplexers and the slaves, and the i-th second multiplexer connects the second demultiplexer and the i-th host; the method also includes: using the second demultiplexer to receive data sent by the slave, and when determining that the data is to be transmitted to the i-th host, transmitting the data to the i-th second multiplexer; using the i-th second multiplexer to transmit the received data to the i-th host.
[0021] In one possible implementation, the method further includes: using the second communication module to update the i-th first value recorded by the counting module after receiving data to be sent to the i-th host, wherein, when the i-th first value is the number of transmission cycles of the request issued by the i-th host and received and not responded by the slave, the i-th first value is reduced by L, where L is the number of cycles from the start of transmission of the received data to the host to the completion of the data transmission, and L is a positive integer; when the i-th first value is the number of requests issued by the i-th host and received and not responded by the slave, the i-th first value is reduced by 1.
[0022] In a possible implementation manner, the i-th first value is updated by the second multiplexer or the second demultiplexer.
[0023] According to an embodiment of the present disclosure, a communication device is connected to N hosts and slaves, where N is an integer greater than 1, and the slave is used to respond to a request issued by the host. The device includes a counting module and a first communication module. The counting module records N first values related to the slave, where the i-th first value is the number of transmission cycles or the number of requests issued by the i-th host and received but not responded to by the slave. The number of transmission cycles is the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed, 1≤i≤N, and i is an integer; the first communication module receives a request from the host, and in the current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtains a first value from the counting module, and transmits the request arbitrated according to the first value to the slave. The i-th first value is the number of transmission cycles or the number of requests sent by the i-th host and received but not responded by the slave. Therefore, the first value can reflect the load of the data transmission path between the slave and each host. After the request is arbitrated according to the first value, when the slave returns data in response to the arbitrated request, it can reduce the congestion of the data transmission path, balance the load differences of the data transmission paths of different hosts, and improve the utilization of the bus.
[0024] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0026] Figure 1 A schematic diagram showing a conventional arbitration method for a host's bus usage rights.
[0027] Figure 2 An exemplary application scenario of the communication device according to an embodiment of the present disclosure is shown.
[0028] Figure 3 A schematic diagram showing the structure of a communication device according to an embodiment of the present disclosure.
[0029] Figure 4 A schematic diagram showing the structure of a first communication module according to an embodiment of the present disclosure.
[0030] Figure 5 A schematic diagram showing the structure of a first multiplexer according to an embodiment of the present disclosure.
[0031] Figure 6 A schematic diagram illustrating a host's arbitration method for bus usage rights according to an embodiment of the present disclosure.
[0032] Figure 7 A schematic diagram showing the structure of a communication device according to an embodiment of the present disclosure.
[0033] Figure 8 A schematic diagram illustrating the structure of a second communication module according to an embodiment of the present disclosure.
[0034] Figure 9 A schematic diagram showing the flow of a communication method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
[0036] As used herein, the terms "comprises," "comprising," "having," or variations thereof are open ended and include one or more stated features, integers, elements, steps, parts, or functions, but do not preclude the presence or addition of one or more other features, integers, elements, steps, parts, functions, or groups thereof.
[0037] When an element is referred to as being "connected," "coupled," "responsive" or variations thereof to another element, it can be directly connected, coupled or responsive to the other element or intervening elements may be present.
[0038] Although the terms first, second, third, etc. may 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. Therefore, without departing from the teachings of the present invention, the first element / operation in some embodiments may be referred to as the second element / operation in other embodiments.
[0039] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0040] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.
[0041] Figure 1 A schematic diagram showing a conventional arbitration method for a host's bus usage rights.
[0042] like Figure 1 As shown, hosts A, B, C, and D can all issue requests to a specific slave. Taking polling arbitration as an example, assuming the slave returns an equal amount of data in response to each request, if, in the first arbitration cycle, only host A issues a request to the slave, it can be determined that host A obtains bus access to the slave. In the second arbitration cycle, hosts A and D issue requests to the slave. Since neither host B nor host C issues a request to the slave, according to the polling mechanism, host D obtains bus access to the slave. In the third arbitration cycle, hosts A and B issue requests to the slave, and according to the polling mechanism, host A obtains bus access to the slave.
[0043] Similarly, if master A obtains bus access more frequently, the amount of data returned by slaves to master A will also increase. Similarly, the amount of data returned by other slaves to master A may also increase, which can easily lead to congestion in the data transmission path corresponding to master A. At the same time, the data transmission paths corresponding to other masters may be idle, resulting in uneven load on the data transmission paths of different masters, reducing bus utilization.
[0044] In view of this, the present disclosure provides a communication device, electronic device, and communication method. The communication device of the present disclosure can reduce data transmission path congestion, balance the load differences between data transmission paths of different hosts, and improve bus utilization when implementing communication between the host and slave devices.
[0045] Figure 2 An exemplary application scenario of the communication device according to an embodiment of the present disclosure is shown.
[0046] like Figure 2As shown, a communication device can be provided on a chip and connect multiple hosts and slaves on the chip. A request from any host that requires a response from a specific slave can be sent to the corresponding slave via the communication device's request transmission path (not shown). After the request enters the slave, the slave responds to the request and returns data to the communication device. If the request is a read request, the data can be read data; if the request is a write request, the data can be a write completion indicator. This data is data that needs to be received by the host that issued the request. This data can be sent to the corresponding host via the communication device's data transmission path (not shown).
[0047] For example, the host may be a processor core or other component capable of issuing a request. The slave may be a memory or other device capable of storing data. The embodiments of the present disclosure do not limit the specific types of the host and slave.
[0048] Figure 3 A schematic diagram showing the structure of a communication device according to an embodiment of the present disclosure.
[0049] like Figure 3 As shown, in a possible implementation, the device is connected to N hosts and slaves, where N is an integer greater than 1, and the slaves are used to respond to requests sent by the hosts;
[0050] The device includes a counting module and a first communication module.
[0051] The counting module is used to record N first values related to the slave, where the i-th first value is the number of transmission cycles or the number of requests sent by the i-th host and received but not responded by the slave, and the number of transmission cycles is the number of cycles from the slave transmitting data to the master in response to the request to the completion of the data transmission, 1≤i≤N, where i is an integer;
[0052] The first communication module is configured to receive a request from the host, obtain a first value from the counting module in response to a request to be transmitted to the slave in a current arbitration cycle, and transmit the request arbitrated according to the first value to the slave.
[0053] For example, the communication device may include a counting module. The counting module is configured to record N first values associated with slave devices connected to the communication device. The i-th first value is the number of transmission cycles or the number of requests sent by the i-th master that the slave device has received but not responded to. The transmission cycle number is the number of cycles from the slave device transmitting data to the master in response to the request until the data transmission is completed. The number of transmission cycles is proportional to the amount of data transmitted. For example, if the data transmitted by the slave device to the master in response to a request requires four transmission cycles to complete, the transmission cycle number for the request may be 4.
[0054] In one example, the counting module may include N counters associated with the slave, with the i-th counter recording the i-th first value. There may be more than one request issued by the i-th master that the slave has received but not responded to. When the i-th first value is the number of transmission cycles for requests issued by the i-th master that the slave has received but not responded to, the i-th first value may be equal to the sum of the number of cycles from transmitting data to the master in response to all requests issued by the i-th master that the slave has received but not responded to, until the data transmission is completed.
[0055] The first communication module is configured to receive requests from the master and, when requests to be transmitted to the slave exist in a current arbitration cycle (including requests issued by the master in the current arbitration cycle and requests issued by the master in earlier arbitration cycles but not transmitted to the slave), arbitrate the existing requests to be transmitted to the slave and transmit the arbitrated requests to the slave. If no requests to be transmitted to the slave exist in a particular arbitration cycle, the first communication module does not need to arbitrate the requests to be transmitted to the slave in the current arbitration cycle.
[0056] The first communication module may obtain a first value from the counting module, and complete the requested arbitration according to the obtained first value.
[0057] In one example, the first communication module may directly obtain N first values related to the slave, find a corresponding first value from the N first values based on the source (master) of a request to be transmitted to the slave in the current arbitration cycle, and complete arbitration based on the found first value.
[0058] In another example, the first communication module can obtain the corresponding first value from the counting module based on the source (master) of the request to be transmitted to the slave in the current arbitration cycle. For example, if the request to be transmitted to the slave includes a request from the first master and a request from the Nth master, only the first and Nth first values need to be obtained. This approach reduces data transmission costs between the first communication module and the counting module.
[0059] If the request sent by the host in a certain arbitration cycle does not become the request arbitrated in the arbitration cycle, the request may also participate in the arbitration in the next arbitration cycle. In this case, among the requests that exist in the current arbitration cycle and are to be transmitted to the slave, there may be multiple requests from the same host. For example, when the first communication module arbitrates, the smallest of the corresponding first numerical values can be determined, the host corresponding to the first numerical value can be determined, and the request from the host can be used as the arbitrated request. Furthermore, if there are multiple requests from the host, the earliest request issued can be used as the arbitrated request. For example, when the requests to be transmitted to the slave include request 0 and request 1 issued by the first host, and request 2 issued by the Nth host, assuming that the first first numerical value is 4 and the Nth first numerical value is 8, the arbitrated request can be one of request 0 and request 1. Assuming that request 0 is issued earlier than request 1, the arbitrated request can be request 0.
[0060] It should be understood that the smaller the i-th first value, the lighter the load on the data transmission path from the slave to the i-th master. In this case, when the slave returns data in response to an arbitrated request, it transmits it through the least loaded data transmission path. This can reduce congestion in the data transmission path, balance the load differences between the data transmission paths of different masters, and improve bus utilization.
[0061] The first communication module can transmit the arbitrated request to the slave. After receiving the request, the slave can respond to the request and return the corresponding data to the host that issued the request. The method for returning the data is described later.
[0062] It should be understood that when the communication device is connected to multiple slaves, the counting module can record N first values associated with each slave for each slave. For example, when the communication device is connected to four slaves, the counting module can include four groups of counters, each corresponding to one of the four slaves. Each group of counters includes N counters, and records the N first values associated with the slave corresponding to the group of counters. During each arbitration cycle, requests received from the four slaves can be arbitrated synchronously. When arbitrating a request from each slave, the first value associated with that slave can be used.
[0063] According to an embodiment of the present disclosure, a communication device is connected to N hosts and slaves, where N is an integer greater than 1, and the slave is used to respond to a request issued by the host. The device includes a counting module and a first communication module. The counting module records N first values related to the slave, where the i-th first value is the number of transmission cycles or the number of requests issued by the i-th host and received but not responded to by the slave. The number of transmission cycles is the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed, 1≤i≤N, and i is an integer; the first communication module receives a request from the host, and in the current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtains a first value from the counting module, and transmits the request arbitrated according to the first value to the slave. The i-th first value is the number of transmission cycles or the number of requests sent by the i-th host and received but not responded by the slave. Therefore, the first value can reflect the load of the data transmission path between the slave and each host. After the request is arbitrated according to the first value, when the slave returns data in response to the arbitrated request, it can reduce the congestion of the data transmission path, balance the load differences of the data transmission paths of different hosts, and improve the utilization of the bus.
[0064] An exemplary structure of the first communication module is introduced below. Figure 4 A schematic diagram showing the structure of a first communication module according to an embodiment of the present disclosure.
[0065] like Figure 4 As shown, in a possible implementation, the first communication module includes N first demultiplexers and a first multiplexer, the i-th first demultiplexer is connected to the first multiplexer and the i-th host, and the first multiplexer is connected to all the first demultiplexers and the slaves;
[0066] The i-th first demultiplexer is used to receive a request sent by the i-th host, and when determining that the request is to be transmitted to the slave, transmit the request to the first multiplexer;
[0067] The first multiplexer is configured to, in a current arbitration cycle, in response to a request to be transmitted to the slave, obtain a first value from the counting module and transmit the request arbitrated according to the first value to the slave.
[0068] For example, each host may send a request to a slave, and for this purpose, each host may be connected to a first demultiplexer. A slave may receive a request from any host, and for this purpose, the slave may be connected to a first multiplexer.
[0069] The i-th first demultiplexer can be connected to the i-th host, the first multiplexer can be connected to the slave, and the i-th first demultiplexer is also connected to the first multiplexer.
[0070] In this case, the request sent by the i-th host to the slave can be output to the slave via the i-th first demultiplexer and the first multiplexer.
[0071] The arbitration may be performed by the first multiplexer. In this case, the i-th first demultiplexer may be configured to receive a request from the i-th host and, when determining that the request is to be transmitted to the slave, transmit the request to the first multiplexer.
[0072] Accordingly, each first multiplexer is further connected to the counting module. The first multiplexer can be used to, in the current arbitration cycle, in response to a request to be transmitted to the slave, obtain a first value from the counting module and transmit the request arbitrated according to the first value to the slave.
[0073] Figure 5 A schematic diagram showing the structure of a first multiplexer according to an embodiment of the present disclosure.
[0074] like Figure 5 As shown, the first multiplexer may include a multiplexer unit and an arbitration logic unit. The multiplexer unit connects all first demultiplexers, slaves, and the arbitration logic unit. The arbitration logic unit is connected to the counting module. The arbitration logic unit is responsible for arbitrating requests based on the first value obtained from the counting module and outputting a strobe signal indicating the arbitrated request to the multiplexer unit. The multiplexer unit can determine the arbitrated request based on the strobe signal and transmit the request to the connected slave.
[0075] The first demultiplexer can be implemented based on existing technologies, and the structure of the first demultiplexer will not be described in detail here.
[0076] In this way, the implementation of the first demultiplexer is made simpler.
[0077] It should be understood that when the communication device is connected to multiple slaves, the communication device may include multiple first multiplexers, each connected to the multiple slaves. In this case, each first demultiplexer may be connected to all the first multiplexers.
[0078] In one possible implementation, the first communication module is specifically used to determine the priority of the request to be transmitted to the slave machine based on the first numerical value, and to use the request with the highest priority as the arbitrated request; wherein, the smaller the i-th first numerical value, the higher the priority of the request issued by the i-th host to be transmitted to the slave machine.
[0079] For example, when the first first value is smaller than other first values, the priority of the first host is higher than that of other hosts, and the priority of the request issued by the first host to be transmitted to the slave is also higher than the priority of the request issued by other hosts to be transmitted to the slave.
[0080] If the first request sent by the master to be transmitted to the slave includes request 0 and request 1, and request 0 is sent earlier than request 1, request 0 has a higher priority than request 1. In this case, among the requests to be transmitted to the slave in the current arbitration cycle, the one with the highest priority is request 0, and request 0 is determined to be the arbitrated request.
[0081] In this way, the load on the data transmission path of the data returned in response to the arbitrated request is reduced.
[0082] To ensure the accuracy of the first value recorded by the counting module, when a new request is received by the slave, the first value recorded by the counting module needs to be updated in a timely manner. In this scenario, the updating of the counting module can be completed by the first communication module.
[0083] In a possible implementation, the first communication module is further configured to update the i-th first value when the arbitrated request comes from the i-th host, wherein:
[0084] When the i-th first value is the number of transmission cycles of the request sent by the i-th master and received but not responded by the slave, the i-th first value is increased by K, where K is the number of cycles from the slave transmitting data to the master in response to the arbitrated request until the data transmission is completed, and K is a positive integer;
[0085] When the i-th first value is the number of requests sent by the i-th host and received but not responded by the slave, the i-th first value increases by 1.
[0086] For example, when the request arbitrated by the first communication module is transmitted to the slave, if the request comes from the i-th master, it can be determined that the i-th first value needs to be updated.
[0087] If the i-th first value is the number of transmission cycles of the request issued by the i-th host and received but not responded by the slave, and the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed is K, then the i-th first value can be increased by K.
[0088] If the i-th first value is the number of requests sent by the i-th host and received but not responded by the slave, then the i-th first value can be directly increased by 1.
[0089] In this way, the accuracy of the first value recorded by the counting module can be guaranteed.
[0090] In a possible implementation, the i-th first value recorded by the counting module is updated by the first multiplexer or the first demultiplexer.
[0091] In one example, when a new request is received by the slave, the counting module can be updated by the first multiplexer. After the first multiplexer outputs the request sent by the i-th host to the slave, it can directly update the i-th first value recorded by the counting module.
[0092] In this way, the first value recorded by the counting module is made more real-time.
[0093] In another example, when a new request is received by a slave, the counting module can be updated by the first demultiplexer. After the first multiplexer transmits the request from the i-th master to the slave, it can send a feedback signal to the i-th first demultiplexer. The feedback signal can indicate that the i-th master's request has been received by the slave. If the i-th first value is the number of transmission cycles for the request issued by the i-th master that the slave has received but not responded to, the feedback signal can also indicate the number of cycles K from which the slave transmitted data to the master in response to the request until the data transmission was completed. In response to the feedback signal, the i-th first demultiplexer can update the i-th first value recorded in the counting module.
[0094] In this way, the implementation of the first multiplexer is made simpler.
[0095] The first multiplexer / demultiplexer can update the first value of the counting module based on existing technologies. In one example, the first multiplexer / demultiplexer can output a control signal to the counting module to control the counting module to update the recorded first value. The embodiments of the present disclosure do not limit the specific manner in which the first multiplexer / demultiplexer updates the first value of the counting module.
[0096] Figure 6 A schematic diagram illustrating a host's arbitration method for bus usage rights according to an embodiment of the present disclosure.
[0097] like Figure 6 As shown, host 1, host 2, host 3, and host 4 can all send requests to the slave. The four first values recorded by the counting module are all 0. The i-th first value is the number of requests sent by the i-th host that the slave has received but not responded to. Assume that the requests received by the first communication module in each arbitration cycle and to be transmitted to the slave are as follows:
[0098] In the first arbitration cycle, request 1 is received from host 1;
[0099] In the second arbitration cycle, request 2 is received from host 1 and request 3 is received from host 4.
[0100] In the third arbitration cycle, request 4 is received from host 1, request 5 is received from host 3, and request 6 is received from host 4.
[0101] In the fourth arbitration cycle, request 7 is received from host 1, request 8 is received from host 2, request 9 is received from host 3, and request 10 is received from host 4.
[0102] Assume that before the start of the first arbitration cycle, all first values are 0. Then the arbitration result of the first communication module and the update of the first value are as follows:
[0103] In the first arbitration cycle, the only request to be transmitted to the slave is request 1, and the arbitrated request is request 1. The first first value is updated to 0+1=1, and the four first values are 1, 0, 0, and 0 respectively.
[0104] In the second arbitration cycle, the requests to be transmitted to the slave are request 2 and request 3. Request 2 comes from master 1, and request 3 comes from master 4. The four first values are 1, 0, 0, and 0, respectively. Therefore, master 4 has a higher priority than master 1, and the arbitrated request is request 3. The fourth first value is updated to 0 + 1 = 1, and the four first values are 1, 0, 0, and 1, respectively.
[0105] In the third arbitration cycle, the requests to be transmitted to the slave include request 2 (received in the second arbitration cycle), request 4, request 5, and request 6. Requests 2 and 4 come from master 1, request 5 comes from master 3, and request 6 comes from master 4. The four first values are 1, 0, 0, and 1, respectively. Therefore, master 3 has higher priority than master 1 and master 4, and the arbitrated request is request 5. The third first value is updated to 0 + 1 = 1, and the four first values are 1, 0, 1, and 1, respectively.
[0106] In the fourth arbitration cycle, the requests to be transmitted to the slave include request 2 (received in the second arbitration cycle), request 4 (received in the third arbitration cycle), request 6 (received in the third arbitration cycle), request 7, request 8, request 9, and request 10.
[0107] Requests 2, 4, and 7 come from host 1, request 8 comes from host 2, request 9 comes from host 3, and requests 6 and 10 come from host 4. The four first values are 1, 0, 1, and 1, respectively. Therefore, host 2 has a higher priority than the other hosts, and the arbitrated request is request 8. The second first value is updated to 0 + 1 = 1, and the four first values are 1, 1, 1, and 1, respectively.
[0108] It can be seen that the load of the data transmission path from the slave to each host is balanced.
[0109] According to the polling arbitration scheme of the existing technology, requests are arbitrated in the order of host 1, host 2, host 3, and host 4. After a request from a host is arbitrated in the current arbitration cycle, arbitration is continued in the next arbitration cycle from the host next to the host from which the request arbitrated in the current arbitration cycle came.
[0110] Referring to the example of requests received in each arbitration cycle to be transmitted to the slave, according to the polling arbitration scheme of the prior art, in the first arbitration cycle, request 1 is arbitrated. Request 1 comes from master 1. Then, the second arbitration cycle begins with master 2, and the polling arbitration proceeds in the order of master 2, master 3, master 4, and master 1. Since there are no requests from master 2 or master 3, the arbitrated request is request 3 from master 4. In the third arbitration cycle, the polling arbitration proceeds from master 1, and the order of master 1, master 2, master 3, and master 4 is followed. The arbitrated request is request 2. It can be seen that, starting from the third arbitration cycle, the balanced performance of the polling arbitration scheme of the prior art begins to deteriorate compared to the arbitration scheme of the communication device of the present disclosure.
[0111] Figure 7 A schematic diagram showing the structure of a communication device according to an embodiment of the present disclosure.
[0112] like Figure 7 As shown, in addition to transmitting requests, the communication device can also transmit responses to requests (i.e., data). The transmission paths for requests and data are independent of each other. Therefore, the communication device can also include a second communication module for transmitting data sent by the slave to the host.
[0113] Figure 8 A schematic diagram illustrating the structure of a second communication module according to an embodiment of the present disclosure.
[0114] like Figure 8 As shown, in a possible implementation, the second communication module includes a second demultiplexer and N second multiplexers, the second demultiplexer connects all the second multiplexers and the slaves, and the i-th second multiplexer connects the second demultiplexer and the i-th host;
[0115] The second demultiplexer is used to receive data sent by the slave, and when it is determined that the data is to be transmitted to the i-th host, transmit the data to the i-th second multiplexer;
[0116] The i-th second multiplexer is used to transmit the received data to the i-th host.
[0117] For example, a slave may send data to any master in response to a request from that master. To this end, the slave may be connected to a second demultiplexer. Each master may receive a request from a slave. To this end, each master may be connected to a second multiplexer.
[0118] The second demultiplexer can be connected to the slave, the i-th second multiplexer can be connected to the i-th host, and the i-th second multiplexer is further connected to the second demultiplexer.
[0119] In this case, the data sent from the slave to the i-th host can be output to the i-th host via the second demultiplexer and the i-th second multiplexer.
[0120] The second multiplexer and the second demultiplexer can be implemented based on existing technologies, and the structures of the second multiplexer and the second demultiplexer are not described in detail here.
[0121] It should be understood that when the communication device is connected to multiple slaves, the communication device may include multiple second demultiplexers, each connected to the multiple slaves. In this case, each second multiplexer may be connected to all the second demultiplexers.
[0122] To ensure the accuracy of the first value recorded by the counting module, when the slave sends new data, the first value recorded by the counting module needs to be updated in a timely manner. In this scenario, the update of the counting module can be completed by the second communication module.
[0123] In a possible implementation, the second communication module is further configured to update the i-th first value recorded by the counting module after receiving data to be sent to the i-th host, wherein:
[0124] When the i-th first value is the number of transmission cycles of the request sent by the i-th host and received but not responded by the slave, the i-th first value is reduced by L, where L is the number of cycles from the start of transmission of the received data to the host to the completion of the data transmission, and L is a positive integer;
[0125] When the i-th first value is the number of requests sent by the i-th host and received but not responded by the slave, the i-th first value is reduced by 1.
[0126] For example, when the second communication module receives data sent by the slave, if the data is a response to a request sent by the i-th host, it can be determined that the i-th first value needs to be updated.
[0127] If the i-th first value is the number of transmission cycles of the request sent by the i-th host and received but not responded by the slave, and L is the number of cycles from the start of transmission of received data to the host to the completion of data transmission, then the i-th first value can be reduced by L.
[0128] If the i-th first value is the number of requests sent by the i-th host and received but not responded by the slave, the i-th first value can be reduced by 1.
[0129] In this way, the accuracy of the first value recorded by the counting module can be guaranteed.
[0130] In a possible implementation, the i-th first value recorded by the counting module is updated by the second multiplexer or the second demultiplexer.
[0131] In one example, when the slave sends new data, the counting module can be updated by the second demultiplexer. When the second demultiplexer receives the data sent by the slave, it can directly update the i-th first value recorded by the counting module.
[0132] In this way, the first value recorded by the counting module is made more real-time.
[0133] In another example, when the slave sends new data, the counting module can be updated by the second multiplexer. When the i-th second multiplexer receives the data sent by the slave, it can directly update the i-th first value recorded by the counting module.
[0134] In this way, the implementation of the second demultiplexer is made simpler.
[0135] The second multiplexer / demultiplexer can update the first value based on existing technologies. In one example, the second multiplexer / demultiplexer can output a control signal to the counting module to control the counting module to update the recorded first value. The embodiments of the present disclosure do not limit the specific manner in which the second multiplexer / demultiplexer updates the first value of the counting module.
[0136] The present disclosure also provides an electronic device including the aforementioned communication device. The electronic device may be a terminal device or a server, and may further include a host device, a slave device, etc. The present disclosure does not limit the specific type and structure of the electronic device.
[0137] The embodiment of the present disclosure also provides a communication method. Figure 9 A schematic diagram showing the flow of a communication method according to an embodiment of the present disclosure.
[0138] like Figure 9 As shown, in one possible implementation, the method is applied to a communication device, the device is connected to N masters and slaves, N is an integer greater than 1, and the slave is used to respond to a request sent by the master;
[0139] The device includes a counting module and a first communication module, and the method includes:
[0140] Using a counting module to record N first values related to the slave (step S81), the i-th first value is the number of transmission cycles or the number of requests sent by the i-th master and received but not responded by the slave, the number of transmission cycles being the number of cycles from the slave transmitting data to the master in response to the request until the data transmission is completed, 1≤i≤N, where i is an integer;
[0141] A request from the host is received using the first communication module (step S82). In the current arbitration cycle, in response to a request to be transmitted to the slave, a first value is obtained from the counting module (step S83). The request arbitrated according to the first value is transmitted to the slave (step S84).
[0142] In one possible implementation, transmitting the request arbitrated according to the first numerical value to the slave device includes: determining the priority of the request to be transmitted to the slave device according to the first numerical value, and taking the request with the highest priority as the arbitrated request; wherein, the smaller the i-th first numerical value, the higher the priority of the request issued by the i-th host to be transmitted to the slave device.
[0143] In one possible implementation, the method further includes: when the arbitrated request comes from the i-th host, using the first communication module to update the i-th first value, wherein, when the i-th first value is the number of transmission cycles of the request issued by the i-th host and received and not responded by the slave, the i-th first value is increased by K, K is the number of cycles from the slave to transmit data to the host in response to the arbitrated request until the data transmission is completed, and K is a positive integer; when the i-th first value is the number of requests issued by the i-th host and received and not responded by the slave, the i-th first value is increased by 1.
[0144] In one possible implementation, the first communication module includes N first demultiplexers and a first multiplexer, the i-th first demultiplexer is connected to the first multiplexer and the i-th host, and the first multiplexer is connected to all the first demultiplexers and the slave; the receiving a request from the host, in a current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtaining the first value from the counting module, and transmitting the request arbitrated according to the first value to the slave, includes: using the i-th first demultiplexer to receive the request issued by the i-th host, and when determining that the request is to be transmitted to the slave, transmitting the request to the first multiplexer; using the first multiplexer, in a current arbitration cycle, in response to the existence of a request to be transmitted to the slave, obtaining the first value from the counting module, and transmitting the request arbitrated according to the first value to the slave.
[0145] In a possible implementation manner, the i-th first value is updated by the first multiplexer or the first demultiplexer.
[0146] In one possible implementation, the device also includes a second communication module, the second communication module includes a second demultiplexer and N second multiplexers, the second demultiplexer connects all the second multiplexers and the slaves, and the i-th second multiplexer connects the second demultiplexer and the i-th host; the method also includes: using the second demultiplexer to receive data sent by the slave, and when determining that the data is to be transmitted to the i-th host, transmitting the data to the i-th second multiplexer; using the i-th second multiplexer to transmit the received data to the i-th host.
[0147] In one possible implementation, the method further includes: using the second communication module to update the i-th first value recorded by the counting module after receiving data to be sent to the i-th host, wherein, when the i-th first value is the number of transmission cycles of the request issued by the i-th host and received and not responded by the slave, the i-th first value is reduced by L, where L is the number of cycles from the start of transmission of the received data to the host to the completion of the data transmission, and L is a positive integer; when the i-th first value is the number of requests issued by the i-th host and received and not responded by the slave, the i-th first value is reduced by 1.
[0148] In a possible implementation manner, the i-th first value is updated by the second multiplexer or the second demultiplexer.
[0149] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0150] While various embodiments of the present disclosure have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A communication device, characterized in that: The device is connected to N hosts and slaves, where N is an integer greater than 1, and the slaves are used to respond to requests sent by the hosts; The device includes a counting module and a first communication module. The counting module is configured to record N first values associated with the slave, wherein the i-th first value is the number of transmission cycles or the number of requests sent by the i-th host and received but not responded by the slave, and the number of transmission cycles is the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed, 1≤i≤N, where i is an integer; The first communication module is configured to receive a request from the host, and in a current arbitration cycle, in response to a request to be transmitted to the slave, obtain the first value from the counting module, and transmit the request arbitrated according to the first value to the slave; The first communication module is specifically used to determine the priority of the request to be transmitted to the slave machine based on the first value, and to use the request with the highest priority as the arbitrated request; wherein, the smaller the i-th first value, the higher the priority of the request issued by the i-th host to be transmitted to the slave machine.
2. The device according to claim 1, characterized in that The first communication module is further configured to update the i-th first value when the arbitrated request comes from the i-th host, wherein: When the i-th first value is the number of transmission cycles of the request sent by the i-th host and received but not responded by the slave, the i-th first value is increased by K, where K is the number of cycles from the slave transmitting data to the host in response to the arbitrated request until the data transmission is completed, and K is a positive integer; When the i-th first value is the number of requests sent by the i-th host and received but not responded by the slave, the i-th first value increases by 1.
3. The device according to claim 2, characterized in that The first communication module includes N first demultiplexers and a first multiplexer, the i-th first demultiplexer is connected to the first multiplexer and the i-th host, and the first multiplexer is connected to all the first demultiplexers and the slaves; The i-th first demultiplexer is used to receive a request sent by the i-th host, and when determining that the request is to be transmitted to the slave, transmit the request to the first multiplexer; The first multiplexer is configured to, in a current arbitration cycle, in response to a request to be transmitted to the slave, obtain the first value from the counting module and transmit the request arbitrated according to the first value to the slave.
4. The device according to claim 3, characterized in that The i-th first value is updated by the first multiplexer or the first demultiplexer.
5. The device according to claim 1, characterized in that The device further includes a second communication module, the second communication module including a second demultiplexer and N second multiplexers, the second demultiplexer connecting all the second multiplexers and the slaves, and the i-th second multiplexer connecting the second demultiplexer and the i-th host; The second demultiplexer is used to receive data sent by the slave, and when determining that the data is to be transmitted to the i-th host, transmit the data to the i-th second multiplexer; The i-th second multiplexer is used to transmit the received data to the i-th host.
6. The device according to claim 5, characterized in that The second communication module is further configured to update the i-th first value recorded by the counting module after receiving data to be sent to the i-th host, wherein: When the i-th first value is the number of transmission cycles of the request sent by the i-th host and received but not responded by the slave, the i-th first value is reduced by L, where L is the number of cycles from the start of transmission of the received data to the host to the completion of the data transmission, and L is a positive integer; When the i-th first value is the number of requests sent by the i-th host and received but not responded by the slave, the i-th first value is reduced by 1.
7. The device according to claim 6, characterized in that The i-th first value is updated by the second multiplexer or the second demultiplexer.
8. An electronic device, characterized in that: The communication device comprises the communication device according to any one of claims 1 to 7.
9. A communication method, characterized in that: Applied to a communication device, the device is connected to N hosts and slaves, where N is an integer greater than 1, and the slaves are used to respond to requests sent by the hosts; The device includes a counting module and a first communication module, and the method includes: Using the counting module to record N first values related to the slave, the i-th first value is the number of transmission cycles or the number of requests sent by the i-th host and received but not responded by the slave, the transmission cycle number is the number of cycles from the slave transmitting data to the host in response to the request until the data transmission is completed, 1≤i≤N, i is an integer; receiving a request from the host using the first communication module, obtaining the first value from the counting module in response to a request to be transmitted to the slave in a current arbitration cycle, and transmitting a request arbitrated according to the first value to the slave; The transmitting of the request arbitrated according to the first numerical value to the slave device includes: determining the priority of the request to be transmitted to the slave device according to the first numerical value, and taking the request with the highest priority as the arbitrated request; wherein, the smaller the i-th first numerical value, the higher the priority of the request issued by the i-th host and to be transmitted to the slave device.
Citation Information
Patent Citations
Multifunctional arbiter, arbitration method, chip and product
CN114138706A
Bus arbitration method and device, computer readable storage medium and main control chip
CN114911727A