Interface circuit for data transfer between processor and input/output device

Abstract: An interface circuit for transferring data between an input/output device with an n-bit data bus and a processor having an m x n-bit data bus uses a register system to store prefetched data in separate fields from the input/output device along the n-bit data bus for transfer in a single operation to the processor along the m x n-bit data bus and to burst write multiple fields of data from the processor to the register system along the m x n-bit data bus for later transfer of the fields separately to the input/output device along the n-bit data bus.

Description: This invention relates to data processing system interfaces in general, and more particularly to an arrangement for interfacing a device having an n-bit Input/Output data bus to an m x n-bit I/O data bus. Today's processor development is far exceeding the development of I/O device support. It is common place now for personal, mini and micro computers to have thirty-two bit processor units that can execute instructions in the tens of nanoseconds and have I/O data bus widths of thirty-two bits, while only recently such processors had executed instructions in tens of microseconds and had I/O data bus widths of eight bits. The I/O device technology, however, is developing at a much slower pace. Because optimal utilization of these new high performance processors is highly I/O intensive (i.e., they spend much of their time accessing disks, communication ports, etc.) users have often not been able to realize the full potential of their processing power due to the low bandwidth of their I/O buses. Many of the available I/O devices for use with state of the art computers do not fully exploit the bandwidth of the I/O buses supported by their processors. As the processor technology has rapidly progressed from eight bit I/O buses to sixteen bits and now thirty-two bit data buses, the peripheral device development support has been much slower such that many of these devices still provide only eight bit data buses. One of the reasons for the slower device development has been the cost of the I/O devices themselves. Another reason has been the packaging of these devices, due to the larger data bus pin out required. By way of example, no present Universal Asynchronous Receiver/Transmitter (UART) exists which has a thirty-two bit I/O bus, although there is a real need for such a device to fully utilize the potential of the newest processors which have thirty-two bit I/O buses. The traditional solution to this problem has been to effectively operate the processor as if it, too, was limited to an eight bit bus while it communicated with the eight bit UART. The performance compromises involved with this solution are well understood. It would, therefore, be of great benefit to have the capability to interface the newer processors having wider buses to the existing I/O devices having narrower buses while operating the processor as if it were communicating with an I/O device having a bus width equal to its own. Such interfaces are disclosed in an article "I/O Channel For Computer" (R A Palm et al, IBM Technical Disclosure Bulletin, Vol 14 No 3, August 1971, pp 799 - 800) and in an article "Direct Memory Access Controller" (S E Edick, IBM Technical Disclosure Bulletin, Vol 26, No 10A, March 1984 pp 5199 - 5206). However, neither of these interfaces apply any intelligence to the assembly of the data for transfer. According to the invention, there is provided an interface circuit for transferring data between a processor having an n x m bit processor data bus and an input/output device having an n bit input/output data bus comprising a register system for temporarily storing groups of m fields of data and control logic means operable to prefetch a group of said fields, a field at a time, from the n bit input/output data bus, to store the group in the register system, and to transfer each stored group from the register system to the processor data bus in a single read by the processor characterised in that: said control logic means is responsive to a control service request from an input/output device to prefetch an interrupt field from said device for storage in a first register of said register system as part of a first group and to identify the type of interrupt from said interrupt field, and is further operable to prefetch a second group of fields of data, selected in dependence on the type of interrupt identified, for storage in a second register of said register systems. According to the invention, there is also provided a method of communicating data as claimed in claim 8. In an embodiment of the invention, to be detailed later, an I/0 bus expansion interface technique is disclosed which enables an I/0 device having an n-bit data bus to be interfaced to an m times n-bit I/O data bus of a host processor. This I/O bus expansion circuit is an interface which maximizes the computer processor's performance by providing full I/O data bus bandwidth and allowing overlap of processor execution and I/O bus expansion interface circuit operation. This is accomplished by: 1) prefetching multiple control and/or data fields from the I/O device and presenting that information to the host without delay and 2) burst writing multiple fields from the host to the bus expansion interface circuit, without delay of the host, and thereafter making these fields individually available to the I/O device. The bus expansion circuit is composed of a set of registers and control logic with which a host computer communicates through the m times n-bit I/O bus associated with the host computer. This bus expansion circuit then communicates with the n-bit bus of the external I/O device, such as a UART. The processor writes out as much as m times n bits to a write register in one operation. Then, in a succession of operations of the bus expansion circuit, n-bit portions of this data is communicated to the external I/O device. As a complement of this operation, the control logic of the bus expansion circuit is able to load an m times n bit wide read register through a succession of n-bit reads of the I/O device so that the host computer processor can then execute a single read operation to read the m times n bits. The control logic is further operable to allow direct host computer to I/O device communication for transfer of I/O device control information of less than m times n bits. Accordingly, the system provides a simple means to multiplex data and control information from a device having an n-bit (e.g., eight bit) I/O bus onto a processor's I/O data bus which can be any multiple of n bits wide, for example, thirty-two bits. This I/O bus expansion circuit provides an inexpensive yet effective means to gain back the I/O bus bandwidth for processors with data buses that are larger than n bits. The circuit may be used on the processor boards, on nonintelligent adapters and on intelligent adapters which also contain processors with I/O data buses greater than n bits. For example, the circuit can be used with eight bit UARTs, eight bit diskette controllers, eight bit hard file controllers, and eight bit time-of-day clocks which provide multiple bytes of data, as well as floating point math processors. The embodiment will now be described in detail with reference to the accompany drawings, in which: Fig. 1 is a block diagram of the I/O bus expansion circuit embodying the invention; Fig. 2 is an implementation of the bus expansion circuit in which an eight bit UART is interfaced to a 32 bit computer I/O data bus; Figs. 3-7 are flow diagrams of the operation of the devices in Fig. 2 for efficiently interfacing a UART having an eight bit I/O data bus to a thirty-two bit computer I/O data bus. Referring now to Fig. 1, one or more I/O devices 1 and 2 having n-bit data buses communicate via an n- bit data bus to a set of Interface Registers 3, 4, and 5 within the I/O Bus Expansion Circuit 10 of this invention. As will be described in detail below, the registers 3-5 communicate with a host computer's I/O Data Bus 8 which may be m times n bits wide. Also contained within the I/O Bus Expansion Circuit 10 is an I/O Address and Control Decode Logic Unit 7 which communicates with the host computer's I/O Address Bus 9, as described below. The I/O devices 1 and 2, the Interface registers 3, 4, and 5, and the I/O Address and Control Decode Logic Unit 7 are also communicated directly with, by a Device Control Logic Unit 6. The width of the Interface Registers 3, 4, and 5 is equal to the width of the I/O Data Bus 8. Each register is composed of n-bit segments which are separately gatable within the Bus Expansion Circuit. These registers may be gated to or from the I/O Data Bus 8 at the full width of the Data Bus 8. Each of these registers is uniquely addressable by the I/O bus. A Device Interrupt Interface Register 3 is loaded by the Device Control Logic Unit 6 when a device requires service. The format of this register is both device and data bus width dependent. The purpose of this register is to allow the Bus Expansion Circuit to gate additional data to the I/O data bus than simply the device n-bit service request. In the case in which an n-bit UART is one of devices 1-2, this register contains an identifier of the UART requesting service and the actual service request as read by the Device Control Logic Unit 6 from the UART. A Device Read Data Interface Register 4 is loaded by the Device Control Logic Unit 6 when a device service request indicates that there is data available for the processor. The Device Control Logic Unit 6 will automatically read the data from the device and gate the data into the proper n-bit segment of this register before interrupting the processor with the service request. It is possible that this Device Read Data Register 4 can be duplicated multiple times for a particular implementation. For example, if the device is capable of buffering or fetching more than one times the I/O data bus width then it may be advantageous to have more than one Device Read Data Register all of which are separately addressable from the I/O bus. This feature of the I/O Bus Expansion Circuit 10 is to have the data available at the time of the processor interrupt and not cause the processor or I/O bus to wait for the data. It also provides for full utilization of the I/O bus bandwidth on read operations. An additional feature that is provided in this generalized example is that the Device Control Logic Unit 6 can prefetch more data from the I/O device 1 or 2 while the host processor processes the data that was previously read. There are multiple addresses to the Device Write Data Interface Register 5. The number of these addresses is dependent on the number of devices being supported and the width of the two data buses. In the example of an n-bit device 1 or 2 communicating with an m times n bit wide host computer I/O bus there are four separate addresses for each device 1 or 2 to the Device Data Write Register 5. One of the addresses to these registers indicates a four byte write, a second of the addresses indicates a three byte write, another of the addresses indicates a two byte write and a fourth of these addresses indicates a one byte write. The Device Control Logic Unit 6 gates the I/O bus to the appropriate Device Write Data Register 5 address when it decodes an I/O bus write operation. It can then gate the proper number of data bytes to the n-bit device. This feature allows the host processor to fully utilize the I/O bus bandwidth for write operations and allows the Device Control Logic Unit 6 to gate the data in one byte operations to the device while the processor is left free to do additional work. The Device Control Logic Unit 6 provides the necessary function to respond to interrupts from the devices 1 or 2 and to read and write requests from the I/O buses 8 and 9. When the device 1 or 2 requests service via an interrupt the Device Control Logic Unit 6 reads the service request from the device and gates it and additional data as required to the Device Interrupt Register 3. It then may optionally interrupt the processor depending on the type of service request made by the device. When the Device Control Logic Unit 6 is notified by the Address and Control Decode Logic Unit 7 that the Write Data Register 5 has been written it then moves this data from the register to the device. When the device 1 or 2 makes a request indicating that it has data for the host this logic can read the data from the device and gate it to the proper n- bit segment of the Read Data Register 4. This feature allows the I/O Bus Expansion Circuit to work asynchronously with the processor. The Device Control Logic Unit 6 also provides the synchronization between the two I/O data buses to insure that no data is lost. The Address and Control Decode Logic Unit 7 provides the necessary controls to gate data to the Write Data Register 5 during I/O write operations. It also provides the logic to gate the Read Data Register 4 and Device Interrupt Register 3 to the I/O data bus for host processor read operations. Fig. 2 shows an implementation of the I/O Bus Expansion Circuit for interfacing a National Semiconductor eight bit UART, part number NS16550A to a 32 bit I/O data bus. Those skilled in art will recognize that while a particular eight bit UART has been chosen for this example, the invention taught and claimed herein may be utilized to interface any of a multitude of other devices having n-bit I/O buses to other buses which are m times n bits wide. In this implementation the device control logic consists of UART Control Logic 12, a 32 bit to 8 bit Multiplexor (MPX) 14 and a UART ID Register 16. This implementation converts the UART's Interrupt Identification Register, Line Status Register and Receiver Buffer and Transmit Holding Register data from the UART's eight bit bus to the host processor's thirty-two bit bus. The functions of the UART Control Logic 12 are to: 1) select the UART 0-N to be serviced, 2) gate the data to and from the 8 bit bus to the proper segment of a Port Read Data Register 19 and a Write Data Register 20 by directing the multiplexor 14, 3) sense the UART interrupt lines and interpret the contents of the Interrupt Identification Register, and create an interrupt to the host processor when the proper conditions have been met. The UART ID Register 16 provides the mechanism to latch up the ID of the current UART that is being serviced. It also provides the priority selection of UART's in the case that multiple UART's request service at the same time. The Port Interrupt Register 18 is a single thirty-two bit wide register that is loaded by the UART Control Logic 12 with: 1) the contents of the UART ID Register 16 (two bytes) and 2) the contents of the Interrupt Identification Register from the UART which requires service. The Port Read Data Register 19 is a single thirty-two bit wide register to which the contents of the Receiver Buffer and Line Status Registers for the UART requiring receive data service are gated. There is only one physical Port Write Data Register 20 per UART; however it can be addressed four times for each UART that is installed. The four addresses per UART are used to to inform the UART Control Logic 12 of the number of valid bytes of data that were placed on the I/O bus. For example, address x indicates that four bytes of data were placed on the I/O bus, address x+1 indicates that three bytes of data were placed on the I/O bus, address x+2 indicates that two bytes of data were placed on the I/O bus, and address x+3 indicates that one byte of data was placed on the I/O bus. The I/O Address and Control Decode Logic 17 decodes the I/O read and write control lines and gates data to or from the selected register and decodes the I/O addresses to select the proper register. Reference is now made to the flow diagrams of Figs. 3-7 which show the operation of the devices in Fig. 2 as this invention is utilized for efficiently interfacing an eight bit I/O UART to a thirty-two bit computer I/O bus. The decision blocks 31-33 of Fig. 3 represent the three conditions under which the UART Control Logic 12 of Fig. 2 responds to the UARTs 0-N or the Host Computer I/O Bus 21 in Fig. 2. In Fig. 3 at 31, assume that one of the UARTs 0-N has issued an interrupt. The operation then proceeds to the interrupt service routine depicted in Fig. 4. In Fig. 4 at 40 the I/O Bus Control Logic 17 is enabled to block I/O accesses from or to the thirty-two bit I/O Bus 21 of the host computer from interfering with the current process. Concurrently, the identifier presently resident in the UART Identification Register 16 is latched to enable the logic to know which of the UARTs 0-N is issuing the interrupt. At 41, the UART Control Logic 12 reads the interrupt identification register of the particular UART whose identifier is currently latched in the UART ID Register 16. The contents of the UART interrupt instruction register tell the logic what type of UART interrupt is pending, such as "transmit holding register empty", "modem status", or a "receive" type interrupt, as described in detail below. These contents are then gated to the proper segment of the Port Interrupt Register 18. At 42 the contents of the UART ID Register 16 are gated to the proper segment of the Port Interrupt Register 18. At 43 a test is made by the UART Control Logic 12 to determine if an I/O write from the host computer bus is pending. If so, a flag is set at 44 to suspend this UART interrupt process to prevent undue delay in the host computer's I/O write from its data bus. Assuming at 43 that an I/O write is not pending, at 45 a test is made to determine if an I/O read is pending. If so, at 46 a flag is set to suspend the interrupt process to allow the host computer to proceed immediately with reading data from the UART and bus expansion circuit so as not to delay the host computer. Assuming that an I/O read was not pending at 45, at 47 a test is made to determine if the UART interrupt is a receive type interrupt. Assuming that the UART interrupt is not a receive type interrupt, at 48 the UART Control Logic 12 generates a processor interrupt which is conveyed back to the thirty-two bit Host Computer I/O Bus 21. Thereafter, at 49 I/O reads and writes can be unblocked by the I/O Bus Control Logic 17. Assume now that at 47 the UART interrupt was a receive type interrupt. "Receive line status", "receive data available", and "character timeout" are examples of receive type interrupts. The operation then proceeds as described in the flow chart of Fig. 5. At block 51 the contents of the line status register of the UART are read and gated to the proper segment of the Port Read Data Register 19. The contents of the line status register comprise eight bits. The UART address for this operation is known from the contents of the UART ID Register 16. At 52, the contents of the UART receive buffer are read and gated to the proper segment of the Port Read Data Register 19. This operation loads an eight bit data byte into the Port Read Data Register 19. At 53 the line status register of the UART is again read and its contents are gated to the proper segment of the Port Read Data Register 19. At 54 the UART receive buffer is again read and its contents are gated to the proper segment of the Port Read Data Register 19. The Port Read Data Register 19 now contains thirty-two bits. At block 55 an interrupt is issued to the host computer's thirty-two bit I/O Bus 21 and at 56 I/O reads and writes are unblocked by the I/O Bus Control Logic 17. Thereafter, the operation proceeds back to the three decisions of Fig. 3. In Fig. 3, assume now that at block 32 an I/O read is detected which indicates that the host processor is ready to read data from the bus expansion circuit. The operation then proceeds to the flow chart of Fig. 6. In Fig. 6, when an I/O read is detected, at 61 the UART Control Logic 12 blocks any UART interrupts from further affecting the I/O bus expansion circuit. At 62 a test is made to determine if this I/O read from the host computer is a system read of the Port Interrupt Register 18. If so, the contents of the Port Interrupt Register 18 are gated to the host computer's thirty-two bit I/O Bus 21 through the I/O Bus Data Drivers and Receivers 24. If the I/O read is not a request for a system read of the Port Interrupt Register 18, at 64 the specific UART register is gated from the UART to the I/O Bus 21. At 68, if this I/O read occurs during the suspension of the servicing of a UART interrupt (block 46, Fig. 4), the operation proceeds back to block 47, Fig. 4 to resume the servicing of the UART interrupt. Otherwise, the operation proceeds to 69 to re-enable the UART Control Logic 12 to receive UART interrupts which were previously blocked at 61, at the beginning of the I/O read service. In the I/O read operation of Fig. 6, an alternative to a system read of the Port Interrupt Register 18 (block 63) or a read of a specific UART register (block 64) is a system read of the Port Read Data Register 19. If this service is requested at block 65, the operation proceeds to 66 at which point the contents of the Port Read Data Register 19 are gated through the I/O Bus Data Drivers and Receivers 24 to the Host Computer thirty-two bit I/O Bus 21. If, however, the last UART line status register indicates that there is more received data in the UART, at 67 after gating the contents of the Port Read Data Register 19 to the host computer, the operation jumps to the handling of the receive interrupt which was described above in Fig. 5. Referring back to Fig. 3, if an I/O write is detected at 33, indicating that the host computer is ready to write data out to a UART, the operation proceeds to 71, Fig. 7, wherein further UART interrupts are blocked by the UART Control Logic 12 from entering the bus expansion circuit. At 72, if the host system is requesting to write data to the Port Write Data Register 20, the appropriate Port Write Data Register is selected at 75. At 76, the data is gated from the host computer to the selected Port Write Data Register 20 and at 77 the proper number of bytes (depending on the selected address at 75 to which the data was gated at 76) is gated from the Port Write Data Register 20 to the selected UART. Thereafter, the UART interrupts blocked at 71 are unblocked at 78. If, at 72 the request from the host computer system was not to write data to the Port Write Data Register 20 but, instead, was a request to write directly to a UART (e.g., a control byte), then at 73 the proper UART is selected by the UART Control Logic 12 and at 74 the data is gated directly to the UART. Thereafter, at 78 the UART interrupts, blocked at 71, are unblocked and the operation proceeds back to Fig. 3 to await further UART interrupts or I/O read or write requests. In summary, an I/O bus expansion interface technique has been shown to enable an I/O device having an n-bit data bus to be interfaced to an m times n-bit I/O data bus of a host processor. The I/O bus expansion circuit disclosed herein is an interface which maximizes the computer processor's performance by providing full I/O data bus bandwidth and allowing overlap of processor execution and I/O bus expansion interface circuit operation. This is accomplished by: 1) prefetching multiple control and/or data fields from the I/O device and presenting that information to the host without delay and 2) burst writing multiple bytes from the host to the bus expansion interface circuit, without delay of the host, and thereafter making these bytes individually available to the I/O device.

Claims: An interface circuit for transferring data between a processor having an n x m bit processor data bus (21) and an input/output device having an n bit input/output data bus comprising a register system (18,19,20) for temporarily storing groups of m fields of data and control logic means (12,16,17) operable to prefetch a group of said fields, a field at a time, from the n bit input/output data bus, to store the group in the register system, and to transfer each stored group from the register system to the processor data bus in a single read by the processor, characterised in that: said control logic means (12) is responsive to a control service request from an input/output device to prefetch an interrupt field from said device for storage in a first register (18) of said register system as part of a first group and to identify the type of interrupt from said interrupt field, and is further operable to prefetch a second group of fields of data, selected in dependence on the type of interrupt identified, for storage in a second register (19) of said register system. A circuit as claimed in claim 1 in which, if the interrupt is a receive type interrupt, said control logic means is operable to prefetch and store (51-54) associated interrupt data fields from the interrupting input/output device as part of said second group. A circuit as claimed in claim 2 in which the control logic means is responsive to a control service request to store the identity (16) of the interrupting device in said first register (18) of said register system as part of said first group. An interface circuit according to any preceding claim in which the control logic means is further operable, in response to a control service request from an input/output device, to generate a processor interrupt. An interface circuit according to any preceding claim in which said control logic means is further operable to write a group of m fields of data into said register system from the processor data bus in a single write operation of the processor, and to transfer the stored group from the processor to the input/output data bus a field at a time. An interface circuit according to claim 5 in which said control logic means is further operable, on reception of a data service request interrupt from the input/output device, to initiate the prefetching of said group from the processor. An interface circuit according to claim 6, in which said control logic means is operable to suspend the prefetching of said group from the processor on receipt of a read request or a write request from the processor and to resume the prefetching on completion of a corresponding read or write operation. A method of communicating data between an input/output device having an n bit data bus and a processor having an m x n bit data bus (21), comprising the steps of: prefetching a group of m fields of data, a field at a time, from the input/output device along the n bit data bus; storing said fields in a register system; and transferring said fields, in a single operation, to the processor along the m x n bit data bus, characterised in that said method further comprises: in response to a control service request from an input/output device, prefetching (41) an interrupt field from said device and storing it in a first register (18) of said system as part of a first group; identifying (47) the type of interrupt from said interrupt field and prefetching a second group of fields of data, selected in dependence on the type of interrupt identified and storing said second group in a second register (19) of said register system. A method as claimed in claim 8 including the further step of, if the interrupt is a receive type interrupt, prefetching and storing (51-54) associated interrupt data from the interrupting input/output device as part of said second group. A method according to either one of claims 8 and 9 comprising the steps of: transferring a group of fields of data simultaneously from the processors to the register system along the m x n data bus; storing the transferred group in the register system; and transferring the group, a field at a time, from the register system to the input/output device along the n bit data bus.

Inventors: POGORZELSKI JAMES STANLEY, SHEMPERT CRAIG HENRY, POGORZELSKI, JAMES STANLEY, SHEMPERT, CRAIG HENRY
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1988
Main classification: G06F13
IPC codes: G06F13