TECHNICAL FIELD
The present invention relates to bus arbitration systems, and more particularly to a bus arbitration system using dedicated bus request and bus grant lines for bus masters.
BACKGROUND ART
In digital computer systems having a plurality of modules, such as processor modules, controller modules, communications interface or relay modules, etc., a medium is employed whereby these modules can transfer data among each other. Typically, the medium employed is a physical data channel known as a bus. The bus is connected to a communications port on each module. Each module is a potential bus master that needs the bus to communicate with other modules. It is possible that more than one potential bus master may request to use the bus simultaneously; therefore, there must be a bus arbiter to choose a winning bus master for bus grant. When the winning bus master finishes using the bus, the bus arbiter chooses the next winner, and so on. There are several well known bus allocation (arbitration) policies: fixed priority, rotating priority, round robin, least recently used policy, and first come first served scheme.
One of the most well known bus arbitration systems is the typical centralized bus arbiter with independent (dedicated) bus request and bus grant lines as shown in FIG. 1. Each potential bus master 105 has an independent bus request line 115 connected to a centralized bus arbiter 100 and an independent bus grant line 120 coming from centralized bus arbiter 100. A bus busy line 130 is shared by all potential bus masters 105. All bus masters 105 have interfaces with a bus 110. The protocol of allocating bus 110 is as follows: Masteri 105 (i=1,2, . . . , or n) requests access to bus 110 by activating its dedicated bus request line BR i 115. If bus busy line 130 is active indicating bus 110 is busy, i.e., being used by a bus master 105, Masteri keeps activating its dedicated bus request line BRi until it is granted access to bus 110. This can be done by pulling low bus request line BRi if bus request signal on bus request line BRi is active low.
If bus busy line 130 is passive, i.e., no master is using bus 110, centralized bus arbiter 100 immediately allocates bus 110 to Masteri by activating Masteri's dedicated grant line BGi 120. Masteri then deactivates its request line BRi and activates bus busy line 130. When Masteri finishes using bus 110, Masteri deactivates bus busy line 130 so that centralized bus arbiter 100 knows that it can select another winning bus master 105 for bus grant.
When bus busy line 130 is active, centralized bus arbiter 100 does not accept any bus requests. When several request lines are active when bus busy line 130 becomes passive, centralized bus arbiter 100 can use any of the bus allocation policies mentioned above to choose a winner among the requesting bus masters 105.
Although the centralized bus arbiter with independent bus request and bus grant lines in FIG. 1 has faster arbitration time compared with daisy-chained arbiters, it requires a large number of bus arbitration lines (bus request lines, bus grant lines, bus busy lines). Therefore, it is an object of the present invention to propose a bus arbitration system and method that require fewer bus arbitration lines to implement the centralized bus arbiter with independent bus request and bus grant lines.
SUMMARY OF THE INVENTION
The bus arbitration system and method of the present invention achieve the stated object by assuming that each operation using the bus takes from one to five bus clock cycles. Each potential bus master has its dedicated bus request line and a dedicated bus grant line, both of which are connected to a centralized bus arbiter in the bus arbitration system of the present invention. When a potential bus master wants to use the bus for, for instance, three bus clock cycles, the potential bus master activates its dedicated bus request line for the same number of bus clock cycles as it would need of bus use (i.e. three bus clock cycles). This three clock wide bus request pulse is recorded in a bus request recording circuit in the centralized bus arbiter. Access to the bus can be granted by the centralized bus arbiter to a winning bus master under any bus arbitration policy. If a potential bus master is chosen to be the winning bus master, the centralized bus arbiter activates the winning bus master's dedicated bus grant line for the same number of bus clock cycles as requested by the bus master, i.e. for three bus clock cycles. So, the bus master will have sufficient use of the bus for its desired operation. After that, the arbiter chooses the next winning bus master and activates its dedicated grant line in the same manner as described above, and so on. No bus busy line is needed in the bus arbitration system of the present invention.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is the block diagram of a typical bus arbitration system as known in the prior art having a centralized bus arbiter with independent bus request and bus grant lines for each potential bus master.
FIG. 2 is the block diagram of a bus arbitration system of the present invention.
FIG. 3 is a timing diagram of bus request and bus grant pulses in the bus arbitration system of FIG. 2 according to a first preferred embodiment of the present invention.
FIG. 4 is another timing diagram of bus request and bus grant pulses in the bus arbitration system of FIG. 2 according to the first preferred embodiment of the present invention.
FIG. 5 is a timing diagram of bus request and bus grant pulses in the bus arbitration system of FIG. 2 according to a second preferred embodiment of the present invention.
BEST MODE FOR CARRYING OUT THE INVENTION
With reference to FIG. 2, the bus arbitration system 200 of the present invention comprises a centralized bus arbiter 260 which has a bus request recording circuit 220 and an arbitration circuit 240. Bus request recording circuit 220 and arbitration circuit 240 are coupled together via a connection 230.
Arbitration circuit 240 of centralized bus arbiter 260 has a plurality of bus grant lines 280 connecting to a plurality of potential bus masters 270. Each bus grant line 280 is dedicated to a potential bus master 270. Arbitration circuit 240 uses bus grant lines 280 to send bus grant signals one at a time to bus masters 270.
Bus request recording circuit 220 of centralized bus arbiter 260 has a plurality of bus request lines 290 coming from potential bus masters 270. Each bus request line 290 is dedicated to a potential bus master 270. Centralized bus arbiter 260 uses bus request lines 290 to receive bus request signals from potential bus masters 270.
Each bus master 270 connects to a shared bus 300. Bus 300 is used for communication and data transfer between bus masters 270.
Bus arbitration system 200 works as follows. Bus masters 270, if need be, send their bus requests to bus request recording circuit 220 via bus request lines 290. In a first preferred embodiment of the present invention, each bus request is a pulse whose width is equal to the number of bus clock cycles needed by the bus master 270 which made the bus request. For example, if a bus master 270 needs to use bus 300 for three bus clock cycles, it sends a pulse which is three bus clock cycles wide to bus request recording circuit 220 via its own bus request line 290. In other words, BUS MASTERi 270 (i=1 to n) activates its bus request line BusReqi 290 for three bus clock cycles. If the bus request signals are active low, for instance, BUS MASTERi 270 can pull its own bus request line BusReqi 290 low for three bus clock cycles as shown in FIG. 3. In FIG. 3, character # indicates that bus request signal BusReqi# is active low.
In the first preferred embodiment of the present invention, the function of bus arbitration system 200 is based on the assumption that each bus operation takes from one to five bus clock cycles. However, any other number other than five can be used in the assumption above.
Bus request recording circuit 220 receives all the incoming bus requests from requesting bus masters 270 and records these bus requests along with their desired bus use in terms of the number of bus clock cycles requested. In the first preferred embodiment, bus request recording circuit 220 has counters 222 and memory 224 to record the numbers of requested bus clock cycles of the incoming bus requests from the bus masters 270. If BUS MASTERi 270 activates bus request line BusReqi 290, a counter 222 assigned to bus request line BusReqi 290 counts until BUS MASTERi 270 deactivates bus request line BusReqi 290. The count value representing the number of bus clock cycles requested is stored in some memory 224 in bus request recording circuit 220 for later use by arbitration circuit 240 in selecting a winning bus master 270 and granting bus access to that winning bus master 270.
Accessing the information stored in bus request recording circuit 220 via connection 230, arbitration circuit 240 selects a winning bus master 270 among bus masters 270 that have unfulfilled bus requests and grant it bus access. The selection can be under any arbitration policies: fixed priority, rotating priority, round robin, least recently used policy, first come first served scheme, etc.
Arbitration circuit 240 makes the bus grant by sending a bus grant signal to the winning bus masters 270 via the bus grant line 280 of that winning bus master 270. In the first preferred embodiment, the bus grant signal to the winning bus masters 270 is a pulse having the same width as the bus request signal previously made by that winning bus master 270. In the example above, the bus grant signal should be a pulse three bus clock cycles wide. In other words, if BUS MASTERi is the winning bus master, arbitration circuit 240 activates the bus grant line BusGri of BUS MASTERi for three bus clock cycles. If the bus grant signals are active low, for instance, arbitration circuit 240 can pull low the bus grant line BusGri of the winning BUS MASTERi for three bus clock cycles as shown in FIG. 3. In FIG. 3, character # indicates that bus grant signal BusGri# is active low.
At the end of the three bus clock cycles of bus use granted to the current winning bus master, using the information stored in bus request recording circuit 220, arbitration circuit 240 selects the next winning bus master 270 among bus masters 270 that have unfulfilled bus requests and grant it bus access in the same manner described above.
With reference to FIG. 3, a bus request signal BusReqi# is the signal transmitted on bus request line BusReqi. The character # indicates that bus request signal BusReqi# is active low. Similarly, bus grant signal BusGri# is the signal transmitted on bus grant line BusGri and is active low. In FIG. 3, BusReqi# is low for three bus clock cycles (i.e. a pulse three bus clock cycles wide). This means that the BUS MASTER i 270 which sends this bus request signal BusReqi# is requesting three bus clock cycles of bus use. Assuming that BUS MASTER i 270 is chosen by arbitration circuit 240 (FIG. 2) for bus access, arbitration circuit 240 activates bus grant line BusGri of BUS MASTER i 270 by pulling bus grant line BusGri low for the same number of bus clock cycles as previously requested by BUS MASTER i 270, i.e. three bus clock cycles.
With reference again to FIG. 3, there is a delay of one bus clock cycle between the time BUS MASTERi starts sending bus request signal BusReqi# to bus request recording circuit 220 and the time arbitration circuit 240 starts sending bus grant signal BusGri# to BUS MASTERi. This is the case when there is only one bus master (BUS MASTERi) requesting access to bus 300. Arbitration circuit 240 recognizes this bus request signal right away via connection 230 and responds by activating bus grant line BusGr i 280 of BUS MASTER i 270 by pulling bus grant line BusGri low. When BUS MASTERi deactivates (pulling up) its bus grant line BusGri, arbitration circuit 240 recognizes this deactivation right away via connection 230 and responds by deactivating bus grant line BusGr i 280 of BUS MASTER i 270 by pulling bus grant line BusGri high. If more than one bus master 270 requests access to bus 300, some bus master 270 must wait for a while for its turn to use bus 300. Bus grant signals BusGri# (i=1−n) can be used as chip select signal or transfer enable signal for BUS MASTERi 270 (i=1−n).
With reference to FIG. 4, at time t0 (at reset), BUS MASTER 1 270 wants to use bus 300 for three bus clock cycles and sends a bus request to bus request recording circuit 220 by pulling down its bus request line BusReq1 for three bus clock cycles. As the result, the bus request signal BusReq1# on bus request line BusReq1 goes low at t0, stays low for three bus clock cycles, and goes high at t2.
Supposing at t0, BUS MASTER 2 270 wants to use bus 300 for five bus clock cycles and sends a bus request to bus request recording circuit 220 by pulling down its bus request line BusReq2 for five bus clock cycles. As the result, the bus request signal BusReq2# on bus request line BusReq2 goes low at t0, stays low for five bus clock cycles, and goes high at t3.
Centralized bus arbiter 260 (FIG. 2) recognizes these bus request signals BusReq1# and BusReq2# right away and arbitration is carried out. Assuming that BUS MASTER2 has higher priority. At t1 (i.e. a delay of one bus clock cycle) centralized bus arbiter 260 sends a bus grant signal BusGr2# on bus grant line BusGr2 of BUS MASTER2. The bus grant signal BusGr2# is a pulse which is five bus clock cycles wide from t1 to t4.
In the mean time, the bus request signal BusReq1# on bus request line BusReq1 is recorded by bus request recording circuit 220 and later at the end of the five bus clock cycles of bus use granted to BUS MASTER2, i.e., at time t4, centralized bus arbiter 260 sends a bus grant signal BusGr1# on the bus grant line BusGr1 of BUS MASTER1. The bus grant signal BusGr1# is a pulse which is three bus clock cycles wide from t4 to t5.
With the bus arbitration system 200 of the present invention in FIG. 2, there is no need for a bus busy line. Moreover, there is no need for a quota system because each bus operation never exceeds five bus clock cycles of bus use. Therefore, no bus cycles is wasted on switching between processes which happens in prior art bus arbitration systems when a process exceeds its bus time quota.
With reference to FIG. 5, instead of being a pulse as in the first preferred embodiment, each bus request may be a series of pulses according to a second preferred embodiment. The number of pulses in the series specifies the number of bus clock cycles of bus use requested by the requesting bus master 270. Each pulse in the series corresponds to one bus clock cycle. As shown in FIG. 5, assuming BUS MASTERi wants three bus clock cycles of bus use and sends a bus request to centralized bus arbiter 260 (FIG. 2) by sending a series of three consecutive pulses from time t0 to t2. Centralized bus arbiter 260 records this number of pulses and responds by sending a bus grant signal BusGri# on the bus grant line BusGri of BUS MASTERi. The bus grant signal BusGri# is a pulse which is three bus clock cycles wide from t1 to t4. Bus request recording circuit 220 should have counters 222 for counting the pulses of the incoming bus requests and some memory 224 for recording these counter values for later use by arbitration circuit 240 in selecting a winning bus master 270 and granting bus access to that winning bus master 270.