Fair arbitration scheme

Abstract: A method and apparatus for selecting a particular node from a plurality of nodes connected to a common bus to allow the node to use the bus. The nodes have a pre­ determined priority. After initially enabling the nodes, the bus is monitored for a bus idle condition. It is then determined which of the nodes are enabled message nodes, which are enabled nodes that have a message to send on the bus. There is then arbitration between the enabled message nodes after the bus is in the bus idle condition for a first period of time, such that the enabled message node having the highest pre-determined priority among the enabled message nodes is disabled for arbitration purposes, and also at the same time selects a target and performs a transfer. This procedure is repeated until all the enabled message nodes have been disabled. Thereafter, all of the nodes on the bus are enabled when the bus is in the bus idle condition for a second period of time, which is longer than the first period of time.

Description: Field of the Invention The present invention relates to the field of interconnect buses for computers and more particularly, to a fair arbitration scheme for determining which of a plurality of nodes attached to the bus may take control of the bus. Background of the Invention In an arrangement in which a plurality of nodes are connected to a common bus, some kind of scheme is needed to select which node will be able to use the bus at any given time. One scheme which has been used in prior systems is to assign a fixed priority to each of the nodes connected to the bus so that if two of the nodes desire to use the bus at the same time, the node having the higher priority will win every time. The advantage of using a fixed priority is that the nodes which need to use the bus the most have the most opportunity to do so. The scheme has an inherent disadvantage in that the higher priority nodes can effectively monopolize the use of the bus so that lower priority nodes may never have the opportunity to use the bus. Another scheme which has been used in the past is a round robin arbitration. Each node is sequentially enabled in round robin fashion so that there is an equal sharing of the bus between the nodes. Although this provides equal access to all of the nodes, the scheme can be inefficient since nodes which need to use the bus more often than other modes have to wait for the round robin to complete before being able to use the bus again. However, the nodes which use the bus less frequently are less likely to actually use the bus during their turn, so there is often a waste of the time reserved for nodes which use the bus less frequently. Publication by El-Gohary et al.: "Method and Apparatus for Controlled Access of a Network Transmission Bus Between a Plurality of Spaced Apart Computer Stations", U.S. Patent No. 4,456,956, teaches a computer system which implements a method of passing control over a bi-directional bus between a plurality of computer stations coupled to the bus. In the described computer system, access to the bus is controlled by the computer stations themselves through an adapter unit located at each computer station. In the described system, during election mode, the adapter unit with the highest priority will always be the winner of the election process. El-Gohary et al. makes no distinction between live adapters with messages to send and live adapters without messages to send as all live adapter units participate in the arbitration process. Accordingly, the arbitration scheme in the El-Gohary et al. patent requires control of the bus to be passed to adapter units, in numerical sequence, even when the live units do not have messages to send thus resulting in wasted bus bandwidth whenever an adapter without a message to send is given control of the bus during the arbitration process. Also, publication by Yokogawa Denki Seisakusho K.K. and Toshio Ogawa: "Controlling Method of Bus Use Right", Patent Abstracts of Japan, vol. 7, no. 270 (P-240) [1415], corresponding to JP-A-58 149 531, discloses a method of controlling bus use wherein one bus use signal line is connected in common to plural devices having a common bus. Summary of the Invention It is therefore an objective of the present invention to provide a fair arbitration scheme in which all of the nodes connected to a bus have an equal opportunity to use the bus, but without the inefficiencies created by reserving time for each node to use the bus. This and other objectives are achieved by the present invention by the provision of a method as claimed in claim 1. Further embodiments are disclosed in claims 2 to 11. According to the present invention there is provided a bus system as claimed in claim 12 and a computer system as claimed in claim 13. Brief Description of the Drawings Figure 1 shows a block diagram of the present invention. Figure 2 is a phase diagram showing the various phases of the bus of Figure 1 according to the present invention. Detailed Description An embodiment of the present invention is illustrated in Figure 1, in which a storage interconnect bus 10 is connected to four nodes 12, 14, 16 and 18. These nodes 12-18 can be different types of devices, such as central processing units, peripheral memory storage units, etc. Although four nodes are shown in this exemplary embodiment, different numbers of nodes can be used without departing from the scope of the invention. Each of the nodes 12, 14, 16 and 18 includes an arbitrator 20, 22, 24 and 26 and a monitor and enabler unit 28, 30, 32 and 34. Each of the nodes 12, 14, 16 and 18 is assigned a priority, which fixes the priority of the nodes for arbitration purposes. In the illustrated example, node 12 has the highest priority, node 14 the next lower, node 16 the next lower and node 18 the lowest priority. Thus, during an arbitration in which node 12 and node 16 are both attempting to use the bus 10, node 12 will win because it is the higher priority node. The present invention overcomes the disadvantages of the prior art fixed priority and round robin arbitration schemes discussed above by the use of a fair arbitration scheme. The invention implements the fair arbitration scheme by enabling and disabling the nodes 12, 14, 16 and 18 for purposes of arbitration. Basically, only enabled nodes can participate in arbitration for the bus, and once a node wins an arbitration and takes control of the bus 10, the node becomes disabled and cannot participate in an arbitration until all of the other enabled nodes connected to the bus have had an opportunity to use the bus. The operation of the fair arbitration scheme of the present invention will be described using the state diagram of Figure 2. Initially, it is assumed that all of the enable flags of the nodes 12-18 are set so that all of the nodes 12-18 are enabled and able to participate in arbitration. Nodes 12-18 continuously monitor the state of the bus 10 with the monitor and enabler units 28, 30, 32 and 34. Since we have started our example from the beginning of operation, the bus will be in a bus idle state as shown by box 40. This state is detected by each of the monitor and enabler units 28-34. The enabled nodes 12-18 assert a bus busy signal and their priority when they have a need to use the bus 10, i.e. when an enabled node wants to have a transfer of information with another node, so that these are now enabled message nodes. For now, it is assumed that only enabled nodes 12 and 16 have a need to use the bus. Since both of the nodes 12 and 16 are enabled message nodes, the phase of the bus 10 follows along an enabled path 42, which in the described embodiment takes 800 nsec (t₁), to the arbitration block 46. The other devices 14 and 18 have not asserted their busy signal and priority will continue monitoring the bus which is no longer idle due to the busy signals asserted by nodes 12 and 16. In the arbitration block 46, the nodes 12-18 determine which of the nodes 12 and 16 wins the control of the bus 10. This is done by comparing in the arbitrators 20-26 the priority asserted by the nodes 12 and 16. Since node 12 has a higher priority, it is the winner of the arbitration and takes control of the bus 10 which now enters the selection phase block 50. All the losers of the arbitration (in this case node 16) enter a wait phase 48 and monitor the bus 10 for the bus idle condition to re-appear. The winner of the arbitration, node 12, clears its own enable flag upon winning the arbitration so that the node 12 will be disabled from arbitrating until it becomes enabled. Although it is now disabled for purposes of arbitration, node 12 continues to proceed with a selection and transfer process over the bus 10. When the bus enters the selection phase 50, node 12 selects another node, i.e. a target node, for a transfer of data. The bus 10 then enters the transfer phase 52 and node 12 receives a transfer from the target node. Regardless of the success of the transfer, the now disabled node 12 will enter the wait phase 48 if it has a message to send, i.e. is a disabled message node. Now assume that the now disabled message node 12 and enabled nodes 14 and 16 ali desire to take control of the bus 10. Upon a bus idle condition being detected for 800 nsec (t₁), the arbitration phase 46 is entered by nodes 14 and 16. Node 12, which is disabled, must wait until the bus is idle for a longer time span t₂ (shown by path 44, in the example 1600 nsec), before again becoming enabled to enter arbitration. The two nodes 14 and 16 (the enabled message nodes) arbitrate as described before after the first time period t₁, with node 14 winning the arbitration. After the transfer involving node 14 has been completed, it too is disabled and must wait until the bus is idle for 1600 nsec (t₂) before it is enabled again. However, the bus will not be idle for this longer time span since the enabled message node 16 will enter into arbitration after the bus is idle for 800 nsec (t₁). Since there are no other higher priority enabled nodes which desire to control the bus, node 16 wins with the transfer operating as described above. At this point in the example, the three nodes 12-16 are all disabled, while node 18 is enabled. If node 18 needed to take control of the bus, it could do so after node 16 completes its transfer and the bus 10 is idle again for the first time period t₁. However, assume that the node 18 does not need to take control of the bus at this time. All of the devices 12-18 continue to monitor the bus and since no enabled node has taken control of the bus after the bus idle condition has been detected for a period of 1600 nsec (t₂), all the disabled nodes 12-16 once again become enabled and therefore are able to participate in an arbitration. The operation of the bus then proceeds again as described above. As one can see, if all of the devices are enabled and want to take control of the bus, the fair arbitration scheme acts as a pure round robin scheme since the highest priority nodes will be disabled in turn after they control the bus, until each of the nodes has had an opportunity to take control of the bus. The fair arbitration scheme is more efficient, however, since nodes which use the bus more frequently are not forced to wait through time periods reserved for nodes which do not wish to take control of the bus.

Claims: A method for selecting a particular node from a plurality of nodes coupled to a bus, each node having a predetermined priority, to allow said particular node to use the bus, and for enabling the plurality of nodes after each of the nodes has had an opportunity to use the bus to allow a subsequent selection of a particular node, said method comprising the steps of: a. enabling for arbitration each of said nodes (12,14,16,18) having a message to send on the bus (10), wherein such enabling is performed by each node (12,14,16,18) itself; b. monitoring the bus (10) for a bus idle condition; c. determining which of said nodes (12,14,16,18) are enabled message nodes; d. arbitrating between said enabled message nodes after the bus (10) has been in a bus idle condition for a first period of time, to select the enabled message node having a highest pre-determined priority among said enabled message nodes to use the bus; e. disabling said selected enabled message node from arbitration, wherein such disabling is performed by each selected enabled message node itself; f. repeating steps b, c, d and e until all said enabled message nodes have been disabled from arbitration; and g. thereafter enabling all said nodes (12,14,16,18) for arbitration when the bus has been in a bus idle condition for a second period of time which is longer than the first period of time, while the plurality of nodes and said bus are running and stable. The method of claim 1, further comprising the step of monitoring time elapsed after the bus enters into the bus idle condition. The method of claim 1, wherein step (a) includes the step of setting an internal enable flag in each said node. The method of claim 3, wherein step (e) includes the step of clearing said internal enable flag of said selected enabled message node. The method of claim 4, wherein step (c) includes determining which of said enabled nodes have asserted a busy signal which indicates said enabled node has a message to send. The method of claim 1, wherein step (d) includes comparing a priority asserted by each said enabled message node, and selecting said enabled message node which has asserted a highest priority. The method of claim 1, wherein step (a) includes the step of setting an internal enable flag in each said node. The method of claim 7, wherein step (e) includes the step of clearing said internal enable flag of said selected enabled message node. The method of claim 1, wherein step (c) includes determining which of said enabled nodes have asserted a busy signal which indicates said enabled node has a message to send. The method of claim 1, wherein step (d) includes comparing a priority identification bit asserted by each said enabled message node, and selecting an enabled message node which has asserted a corresponding priority identification bit that has a highest priority among the asserted priority identification bits. The method of claim 1, wherein said first period of time is approximately 800 nsec, and said second period of time is approximately 1600 nsec. An apparatus for implementing decentralized arbitration in a bus system, having a bus (10) and a plurality of nodes (12,14, 16,18) coupled to the bus, each node having a predetermined priority, the apparatus comprising a plurality of arbitration devices (20,22,24,26), one provided for each node (12,14,16,18) and coupled to the bus (10), each device comprising: means for self-enabling the node corresponding to the arbitration device for arbitration; means for monitoring the bus (10) to detect a bus idle condition and for measuring an amount of time elapsed after the bus enters into the bus idle condition; means for determining whether the node (12,14,16,18) corresponding to the arbitration device (20,22,24,26) is an enabled message node, an enabled message node being an enabled node that has a message to send on the bus (10); means for interacting with other arbitration devices when the node corresponding to the arbitration device is an enabled message node to arbitrate and select an enabled message node after the bus (10) is in the bus idle condition for a first period of time, such that the enabled message node having a highest pre-determined priority among the enabled message nodes is selected to use the bus (10); and means for self-disabling the node corresponding to the arbitration device from arbitration once the node is selected; said means for enabling being responsive to the bus being in an idle condition for a second period of time which is longer than the first period of time to enable the node corresponding to the arbitration device for arbitration, while the plurality of nodes and said bus are running and stable. A computer system comprising: (a) a bus (10); (b) a plurality of nodes (12,14,16,18) coupled to the bus; (c) each one of said plurality of nodes (12,14,16,18) comprising: (i) an enabler (28,30,32,34) to controllably enable and disable the node for arbitration, said enabler enabling said node if said node has a message to send on the bus; (ii) a monitor (28,30,32,34) to monitor the bus (10) for a bus idle condition; and (iii) an arbitrator (20,22,24,26), responsive to said monitor indicating a bus idle condition subsisting on the bus for a first period of time, to determine if 1) the node is enabled for arbitration, and, 2) the node has a highest predetermined priority among all enabled nodes coupled to the bus and seeking to send a message on the bus (10); (iv) the arbitrator being adapted to take control of the bus (10) when the node has the highest predetermined priority, is enabled for arbitration and has a message to send on the bus (10); (v) the enabler operating to disable the node from arbitration in the event that the node takes control of the bus; (vi) the monitor indicating when a bus idle condition has subsisted on the bus for a second period of time, the second period of time being longer than the first period of time; and (vii) the enabler being responsive to an indication of the second period of time to enable the node for arbitration.

Inventors: FRAME ROBERT C, ZAYAS FERNANDO A, FRAME, ROBERT C., ZAYAS, FERNANDO A.
Applicants: DIGITAL EQUIPMENT CORP, DIGITAL EQUIPMENT CORPORATION
Application year: 1989
Main classification: G06F13
IPC codes: G06F13