Field of the Invention
This invention relates to a data communication system and a method of prioritizing and controlling the transfer of data to and from a plurality of communication channels of the data communication system.
Background of the Invention
In serial data communication systems, data is transferred between a serial communication bus and devices, such as memory, terminals, under the control of a controlling processor. In order to ensure efficient data transfer, typically a plurality of communication channels are utilised for queuing data. A common method of managing the data queues is to map each queue into one of a plurality of First-In-First-Out (FIFO) memories.
In systems which are served by one processor, the plurality of communication channels are prioritized; a communication channel having a higher priority than another communication channel will be serviced by the one processor before the lower priority communication channels. Typically, the lower priority communication channels require larger FIFO memories, since the lower priority communication channels are serviced only after the higher priority communication channels have been serviced. The larger FIFO memories require greater silicon area which can be a significant disadvantage in some applications. Another disadvantage with such a priority scheme is that the design of the communication channels varies according to their respective priorities and so its implementation is not straight forward. Also, the speed of such priority schemes is limited.
Round Robin priority schemes which prioritize the servicing of the communication channels are also well known. Although such schemes allow the communication channels to be identical which helps to simplify the design, Round Robin schemes are significantly more complex to implement. A further disadvantage is that the Round Robin priority scheme is not suitable for some applications. For example, in applications where some communication channels need higher priority than the other communication channels in the communication system. This is the case when the communication channels support different data rates.
Summary of the Invention
In accordance with a first aspect of the present invention there is provided a method of prioritizing and controlling the transfer of data to and from a plurality of communication channels of a data communication system, each communication channel comprising data buffer means for holding data to be transferred, the method comprising the steps of:
assigning a different priority level to each one of the plurality of communication channels;
defining a predetermined data threshold level for the data buffer means of each communication channel;
generating a service request signal for a communication channel when the respective data buffer means holds data to be transferred;
generating a threshold signal for a communication channel when the data held in the respective data buffer means reaches the predetermined data threshold level of the data buffer means;
comparing the priority levels of the communication channels which generate threshold signals and service request signals to determine the highest priority communication channel; and
servicing the determined highest priority communication channel having a threshold signal generating data buffer means whereby data is transferred thereto or therefrom.
In accordance with a second aspect of the present invention there is provided a data communication system comprising:
a control processor;
a plurality of peripheral devices;
a plurality of communication channels for transferring data between the control processor and the plurality of peripheral devices, each communication channel of the plurality of communication channels being assigned a predetermined priority level and comprising:
data buffer means for holding data to be transferred, the data buffer means of each of the communication channels being assigned a predetermined data threshold level,
means for generating a service request signal when the data buffer means holds data to be transferred, and
means for generating a threshold signal having a first logic value when the data held in the data buffer means reaches the predetermined data threshold level; and
logic means coupled to receive the service request signals, the priority levels and the threshold signals of each of the plurality of communication channels for comparing the priority levels of the communication channels which generate service request signals and threshold signals to determine the highest priority communication channel and to indicate to the control processor the determined communication channel such that the control processor services the determined highest priority communication channel to transfer data thereto or therefrom.
Brief Description of the Drawings
A data communication system and method of prioritising and controlling the transfer of data to and from a plurality of communication channels of the data communication system in accordance with the present invention will now be described, by way of example only, with reference to the accompanying drawings in which:
FIG. 1 is a block schematic diagram of a data communication system incorporating a preferred embodiment of the present invention;
FIG. 2 is a representation of a priority scheme which is implemented in the preferred embodiment of a present invention;
FIG. 3 is a schematic diagram of a plurality of data buffers, in accordance with the present invention, of a plurality of communication channels;
FIG. 4 is a block schematic diagram of a priority logic circuit in accordance with the present invention; and
FIG. 5 is block diagram of an arbitration block of the priority logic of FIG. 4.
Detailed Description of the Drawings
Referring first to FIG. 1, a data communication system 2 incorporating a preferred embodiment of the present invention comprises a control processor 22, such as a RISC processor, coupled to a plurality of communication channels (only six (6-11) are illustrated herin) via a serial communication bus 4. Data is transferred between the serial communication bus 4 and respective devices 12, 13, 14, and 15 under the control of the control processor 22. The transfer may be in one direction only or two-directions as determined by the device. Depending on the system, the devices may include a modem, memory, input/output terminals. As shown in FIG. 1, the communication channels 6, 8, and 10 are transmitting communication channels in that they transmit data to the devices 12, 13 and 14 and communication channels 7, 9 and 11 are receiving channels in that they receive data from the devices 12, 13 and 14. The invention is not, however, limited to the arrangement of communication channels shown in FIG. 1.
Each communication channel comprises a data buffer 16-21 respectively for holding the data to be transferred between the serial communication bus 4 and a respective device 12-15. In the preferred embodiment, the data buffers are implemented using FIFO memory. The FIFO memory buffers of the plurality of communication channels in accordance with the present invention are all the same size regardless of the priority assigned to each communication channel and the data rate.
In operation, data is transferred simultaneously between the devices 12-15 and the respective FIFO memory buffers 16-21. Once a transmitting FIFO memory buffer 16, 18 or 20 has transmitted all the received data to the respective device, it requires servicing by the control processor 22 for data to be transferred from the communication bus 4 to the transmitting channel. Similarly, once a receiving FIFO memory buffer 17, 19 or 21 is full, it requires servicing by the control processor 22 so that the held data may be transmitted to the serial communication bus 4. The servicing scheme of the present invention will be described in detail below.
Each one of the communication channels is assigned a priority level. As shown in FIG. 2, for a n-channel system, channel 6 is assigned a higher priority level than channel 7, etc. and channel n is assigned the lowest priority level. In the preferred embodiment, predetermined emergency threshold levels are also set for each FIFO memory buffer of each communication channel. The predetermined emergency threshold levels of the FIFO memory buffers are defined such that the level varies between communication channels: the lower priority communication channels have smaller emergency threshold levels than the higher priority communication channels. Preferably, the emergency threshold levels are staggered as shown in FIG. 2. In the preferred embodiment, the emergency threshold levels are programmable in order to allow for the adjustment of the architecture to a specific application.
In operation, a communication channel (transmitting or receiving) generates a service request signal as soon as its FIFO memory buffer is not empty This is sent to the control processor 22 on control bus 24. Control bus 24 and serial communication bus 4 may be part of the same bus. Once the data transfer of the communication channel is such that the predetermined emergency threshold level of its FIFO memory buffer is reached, the communication channel enters an emergency state and generates an emergency signal. For a transmitting channel, such as channel 6, the emergency signal is generated when the number of empty entries in the communication channel's FIFO memory buffer exceeds the emergency threshold level of the buffer. For a receiving channel, such as channel 7, the emergency signal is generated when the number of full FIFO entries reaches the emergency threshold level of the buffer. The emergency threshold level of the transmitting FIFO memory buffer 16 is indicated at point X in FIG. 3 and the emergency threshold level of the receiving FIFO memory buffer 17 is indicated at point Y in FIG. 3. Thus, an emergency signal and service request signal are sent to the control processor 22 on bus 24 for all communication channels whose FIFO memory buffer count has reached its predefined emergency threshold level.
Priority logic 26 in the control processor 22 receives the emergency signals and determines which communication channel, of all the communication channels which have entered the emergency state, has the highest priority level. The control processor 22 in response to the priority logic 26 then services the highest priority communication channel that has entered the emergency state. Communication channels which are not in the emergency state do not participate in the arbitration for service. If none of the communication channels enter the emergency state, the arbitration for service is carried out normally using the assigned priority levels.
The emergency threshold levels are preferably staggered so that the lower priority communication channel will enter the emergency state earlier than a higher priority communication channel because the higher priority communication channel will be serviced faster once it enters the emergency state.
Priority logic 26, in accordance with a preferred embodiment of the invention, is shown in FIGS. 4 and 5. Priority logic 26 comprises arbitration logic 28 coupled to each of the plurality of communication channels to receive the emergency signals and the service request signals, and to a priority encoder 30. In the preferred embodiment, each communication channel generates an emergency signal having a first inactive logic state. On entering the emergency state, the emergency signal is switched to a second active logic state. The arbitration logic 28 determines which communication channels are in the emergency state by detecting emergency signals having the active state.
The arbitration logic 28 comprises n arbitration blocks 32 of logic gates coupled to the n communication channels. The arrangement of the logic gates in each arbitration block 32 is shown in FIG. 5. Each arbitration block 32 has two inputs, "in" and "em", for receiving the service request signal and emergency signal respectively, and an output "rq" which is coupled to the priority encoder 30. The plurality of arbitration blocks 32 are intercoupled by inhibit inputs "enl" and inhibit outputs "enO".
If none of the emergency signals received at the inputs "em" have the active state, each arbitration block 32 passes the service request signal at its input "in" transparently to its output "rq" and hence to the priority encoder 30. If at least one of the emergency signals has the active state, the respective arbitration block 32 inhibits all the arbitration blocks above it via its inhibit output "enO", except for those arbitration blocks which have also received emergency signals having the active state. The service request signals received by the inhibited arbitration blocks 32 are not coupled to the priority encoder 30. The service request signals, which are fed from the uninhibited arbitration blocks 32 to the priority encoder 30, are used by the priority encoder 30 to determine which communication channel of the emergency state communication channels should be serviced next.
In summary, the priority scheme in accordance with the present invention provides an improved scheme for prioritizing a plurality of communication channels in a data communication system, which efficiently reduces the occurrence of transmitter underrun or receive overrun. The priority scheme in accordance with the present invention improves the performance of the channels, but does not require significant silicon area to implement. Furthermore, the priority scheme can support different data rates and so is suitable for a large number of applications. In addition, all the communication channels can have the same design so that one design can be duplicated several times.
A further advantage of the priority scheme in accordance with the present invention is that it avoids the need for large FIFO memory buffers for the lower priority channels and thus, saves silicon area.