This invention relates to data buses, and more particularly to controls for data buses used in integrated circuits.
Data buses are used in integrated circuits (ICs) to transfer data between master devices, such as user-controlled microprocessors, and slave devices that control peripheral devices, such as memories or the like. To avoid overlapping data messages that may lead to error in data transmission between the master and slave devices, it is common to employ an arbiter to arbitrate message traffic on the bus. One such bus design is an Advanced High-performance Bus (AHB) from ARM Limited of Cambridge, England. The AHB bus design is a form of an Advanced Microcontroller Bus Architecture (AMBA). The AHB bus provides high performance, high clock frequency data transfer between multiple bus master devices and multiple bus slave devices through use of an arbiter. The AHB bus is particularly useful in integrated circuits, including single-chip processors, to couple the processors to on-chip memories and to off-chip external memory interfaces.
Many bus designs, including the AHB bus, are capable of single data word transfers and bursts of multiple data words between the master and slave devices. Each data transfer includes an address and control cycle, which is followed by one or more data cycles. During the address and control cycle, the master device transmits the address for the next data transfer and control signals providing information such as the transfer type, the direction of the transfer (read or write), the size of the transfer, whether the transfer is a single transfer or a burst of multiple transfers. In the case of a burst, the control signals indicate the type of burst. For example in the AMBA AHB bus, several types of burst can be specified such as 4, 8 and 16-beat bursts and bursts of unspecified length.
In some bus designs, the master device can selectively stall transfers in the middle of a burst if the master device is not ready for further transfers. For example on an AHB bus, a master device can initiate a “BUSY” transfer type in the middle of a burst to insert one or more idle cycles during the burst. The BUSY transfer type is sent to the slave device to indicate that the master device is continuing with a burst of transfers, but the next transfer cannot take place immediately. In response to a BUSY transfer type, the slave device must stall subsequent transfers of data words in the burst until the master device is ready to continue with further transfers.
These operations are handled by interface circuitry in the slave device, which is configured to implement the bus protocol. These interface circuits can become very complex and difficult to design, particularly for complex protocols and operations such as master-induced stalls in the middle of burst-type transfers. Although simplified protocols exist for many bus designs, including an AHB-LITE protocol that implements a subset of the full AHB bus protocol, these simplified protocols have not reduced the difficulty of implementing master-induced stalls during burst-type transfers.
Simplified interface circuits are therefore desired that are capable of maintaining full compliance with the bus protocol but reduce the complexity in accommodating master-induced stalls during burst-type transfers.
One embodiment of the present invention is directed to a bridge circuit for coupling a slave device with a data bus in a system in which data words are transferred between a master device and the slave device over the data bus. The bridge circuit removes master-induced stalls of burst transfers by converting those burst transfers into a plurality of separate, independent sub-bursts.
Another embodiment of the present invention is directed to a process of transferring data words between a master device and a slave device over a data bus. The process includes: (a) initiating a burst type transfer command over the data bus for transferring multiple data words in a burst; (b) successively transferring individual ones of the multiple data words in the burst between the master device and the slave device in response to the burst type transfer command; (c) selectively inducing a stall of further transfers within the burst during step (b) by the master device; and (d) in response to step (c), dividing the burst into a plurality of separate, independent sub-bursts, wherein each sub-burst includes at least one of the data words in the burst.
Another embodiment of the present invention is directed to a data bus bridge for coupling to a data bus between a master device and a slave device in a system in which data words are transferred between a master device and the slave device in a burst over the data bus. The bridge includes a circuit for receiving a stall command for the burst from the master device and for dividing the burst into a plurality of separate, independent sub-bursts, in response to the stall command.
Yet another embodiment of the present invention is directed to a bridge circuit for coupling between a first data bus and a simplified, second data bus. The first and second data buses include a data field, an address field, and a transfer type field. The transfer type field of the first data bus identifies one of the following transfer types: (a) a non-sequential transfer type used for single data word transfers and for a first of a plurality of successive data word transfers in a burst; (b) a sequential transfer type used for all subsequent transfers in the burst; (c) a busy transfer type indicating the burst transfer is continuing on the first bus, but a next transfer in the burst is stalled; and (d) an idle transfer type indicating no transfers are required over the first bus. The bridge circuit further includes a transfer type conversion circuit and a modified transfer type output, which is coupled to the transfer type field of the second data bus. The conversion circuit replaces any of the busy transfer types received on the transfer type input with the idle transfer type on the modified transfer type output.
In the example illustrated in
One feature of the data bus system 10 illustrated in
With the present invention, one or more of the slave devices 14 can include a bridge circuit 20 that allows a non-compliant slave interface circuit to become compliant with the bus protocol without the need for complex circuitry. Upon receiving a master-initiated stall during a burst transfer, bridge circuit 20 converts subsequent transfers of data in that burst into one or more separate, independent bursts. For example, all remaining transfers in the stalled burst are converted into single transfers (bursts of single data words). This allows the slave device 14 to remove the complexity of implementing such stalls while maintaining full compliance with the bus protocol. A data word can include any number of bits in alternative embodiments of the present invention, and the size of each data word can depend on the width of the bus.
In an alternative embodiment, bridge 20 can be coupled to the outputs of one of more master devices 12, which are capable of inducing stalls during burst transfers, as shown in phantom in
In the embodiment shown in
A write data bus HWDATA (line 26) is used to transfer data from a master device 12 to a slave device 14. A read data bus HRDATA (line 28) is used to transfer data from slave device 14 to master device 12. All transfers are synchronized with a clock signal HCLK (line 34). When access is granted to a master device 12, the master device initiates a transfer by driving an address on address bus HADDR (line 36) and appropriate control signals or commands on transfer type output HTRANS (line 38), transfer size output HSIZE (line 40), transfer direction output HWRITE (line 42), and burst type output HBURST (line 43). Other control signals can also be used.
In one embodiment, address bus HADDR is 32 bits wide and represents the address in a slave device or peripheral where the next data transfer is to be read or written. The transfer size output HSIZE is 3 bits wide, for example, and represents the size of the transfer in bits. The transfer direction output HWRITE has a single bit and represents whether the master device is requesting a read or a write operation.
The burst type output HBURST indicates whether the transfer is a single transfer or part of a burst of multiple data words. In the case of a multiple word burst, HBURST can indicate whether the burst is an incrementing burst or wrapping burst and the length of the burst.
The transfer type output HTRANS is a 2-bit code, for example, which identifies the type of transfer that will occur in the next clock cycle. For example, the transfer types can include IDLE, BUSY, SEQUENTIAL (SEQ), and NON-SEQUENTIAL (NONSEQ) transfer types.
The IDLE type of transfer indicates that no data transfer is required in the next cycle. The IDLE signal is initiated by master device 12 when the master device is granted access to the bus, but does not wish to perform a data transfer. The BUSY transfer type allows master device 12 to insert an IDLE cycle between successive transfers in a particular burst. The BUSY signal indicates that master device 12 is continuing with a burst of transfers, but the next transfer cannot take place immediately. When master device 12 issues the BUSY signal, the address and control signals issued with the transfer type indicate the next transfer in the burst. In response, slave device 14 stalls the next transfer of data within the burst.
The NONSEQ transfer type indicates that the next data transfer is the first transfer of a burst or is a single transfer. With a NONSEQ transfer type, the address and control signals are unrelated to and independent of the previous transfer. Single transfers are treated as bursts of one data word and therefore carry the NONSEQ transfer type.
The SEQ transfer type is used for the remaining transfers in a burst since they are sequential, and the associated address and control signals are related to the previous transfer. For example, the address HADDR can be incremented by an appropriate amount with each transfer in the burst. The remaining control signals can be identical to that provided in the previous transfer.
During each burst, arbiter 18 supplies a master identification code, or tag, HMASTER (line 44), which identifies the master device 12 that is using the bus. This code is sent to all of the slave devices 14. In the case of a system with sixteen master devices 12, the master identification code is a 4-bit code representing the individual master device.
Each master transaction generates a response from one of the slave devices 12, namely the slave device containing the address where the data is to be read or written. In one embodiment, the response includes a 1-bit ready signal HREADY and a 2-bit response signal HRESP. The HREADY signal indicates the slave device is ready to perform the transfer. The HRESP signal represents the status of the transfer, such as OKAY, ERROR, RETRY or SPLIT. The OKAY response indicates that the previous transfer has completed. For example, the write command and data transfer were accepted by the slave device or the read data is available on read data bus HRDATA (line bus 28). The ERROR response indicates an error has occurred. The RETRY response indicates the transfer did not complete, and master station 12 should retry the transfer. The SPLIT response indicates the master device should retry the transfer the next time that master device is granted access to the bus. The HREADY signal can be used by slave device 14 in connection with the HRESP signals to selectively insert wait states on the bus to allow additional cycles for a particular transaction.
Upon receipt of a command from master device 12, slave device 14 records the master identification code HMASTER in a master ID queue. If slave device 14 decides it will handle the transaction, it issues an OKAY response on HRESP bus 48. If the command is a write command, or if it is a read command and the read data is available on HRDATA bus 28, the slave device also asserts HREADY signal 46 and the transaction is completed. Otherwise, the slave device de-asserts the HREADY signal 46 to insert a wait cycle in the transaction. When read data becomes available on HRDATA bus 28, slave device 12 asserts HREADY signal 46 and the transaction is completed.
The above operations become more complex for a typical slave device when the master device initiates a BUSY signal in the middle of transfers in a burst. Bridge circuit 20 simplifies these operations in the slave device by removing the BUSY signals from HTRANS (line 38) and replacing them with IDLE signals to form a modified transfer type HTRANS—NEW, which is passed to the slave device. As discussed in more detail below, this has the effect of splitting the burst into two or more independent, sub-bursts of one or more data words each. The data words that were transferred prior to the BUSY signal form a first sub-burst, and the data words that are transferred after the BUSY signal form one or more additional sub-bursts. These sub-bursts can be independent single transfers or burst of multiple transfers.
In the example described above with reference to
In either case, the bus protocol is maintained even though the BUSY signals have been removed. In this manner, the interface circuit in the slave device does not require the complex operations that would otherwise be required to accommodate a master-induced BUSY signal.
Since BURST 1 is a 4-beat incrementing burst, the burst type HBURST[2:0] has a pattern indicating “INCR4”. The address and control phase of the first transfer begins in the first cycle of HCLK in
Since the slave device is ready for the transfer, HREADY=1, and the master device transmits the first data word, DATA0 on HWDATA[31:0] during the second cycle of HCLK. The address and control phase of the second transfer in BURST 1 begins during the second cycle of HCLK. In this cycle, the master device sets HTRANS[1:0] to “SEQ” since this transfer is sequential with the previous transfer and provides the next address ADDR1 on HADDR[31:0]. The second data word, DATA1, is transferred during the third cycle of HCLK in
The address and control phase of the third transfer would normally begin in the third cycle of HCLK. As before, the master device supplies the next address ADDR2 on HADDR[31:0]. However in this example, the master device initiates a BUSY transfer type on HTRANS[1:0] since it cannot perform the next data transfer during the next clock cycle. In the fourth clock cycle, the master device becomes ready to begin the address and control phase of the next transfer, and sets HTRANS[1:0] to “SEQ” and again provides the next address ADDR2 on HADDR[31:0]. The master device transmits the third data word, DATA2, during the fifth cycle of HCLK. For the final transfer of BURST 1, the master device again sets HTRANS[1:0] to “SEQ” and supplies the last address, ADDR3, on HADDR[31:0] during the fifth clock cycle. The master device transmits the last data word, DATA3, during the sixth clock cycle.
Bridge circuit 20 receives the original transfer type HTRANS[1:0] from the master device. In order to simplify the command, bridge circuit 20 selectively modifies the transfer type to generate a new type HTRANS—NEW[1:0] that is passed to the slave device. If bridge circuit 20 receives a BUSY transfer type on HTRANS[1:0], the bridge circuit converts the transfer type into an IDLE type as shown by arrow 60. For the remainder of the burst, bridge circuit 20 also converts each subsequent “SEQ” type into a “NONSEQ” type, as shown by arrows 61 and 62.
Inserting an IDLE transfer type in the middle of BURST 1 has the effect of splitting the burst into two or more sub-bursts, with each sub-burst having one or more transfers. In this example, the first sub-burst terminates after the first two data transfers, DATA0 and DATA1, in response to the “IDLE” transfer type presented on HTRANS—NEW[1:0], and all subsequent transfers in BURST 1 are treated as single transfers. The address and control phase of the next sub-burst following the IDLE cycle (e.g., a single transfer) begins as a new independent transfer during the fourth clock cycle. In order to comply with the bus protocol, the transfer type of the first transfer of an independent burst is converted to “NONSEQ”. The third and fourth data words DATA2 and DATA3 are converted into independent, single transfers.
In an alternative embodiment, bridge circuit 20 converts only the next subsequent “SEQ” transfer type following a BUSY transfer into a NONSEQ type and leaves the remaining transfer types of that burst as sequential SEQ types. In such an embodiment, the subsequent data transfers (DATA2 and DATA3) would be transferred as a 2-beat sub-burst.
In another alternative embodiment, all sequential SEQ transfer types are converted into non-sequential NONSEQ transfer types, regardless of whether a BUSY transfer type has been detected within a burst. However, this would have the effect of converting all burst transfers into single transfers, which would have a negative effect on system performance.
With the example shown above, only those burst transfers during which the master device initiates a BUSY command are divided into separate sub-burst transfers. In a typical system, a master device initiates a BUSY command relatively infrequently. Therefore, splitting these bursts into separate bursts does not have a significant negative impact on system performance, but results in a great simplification of the slave interface circuitry. This allows the slave interface circuitry to be designed to accommodate a subset of the bus protocol while maintaining full protocol compliance.
An additional effect of splitting a burst into sub-bursts is “early burst termination”. In the example shown in
State machine 70 is implemented with register 80, inverter 81, logic AND gates 82 and 83 and logic OR gate 84. Register 80 stores the current state (STATE) of the state machine. Based on the pattern formed by HTRANS[1:0], the new state, STATE—NEW, that will be latched into register 80 during the next clock cycle is determined by the following equation (where H0=HTRANS[0] and H1=HTRANS [1]:
(STATE)(H0)+(H1)′(H0)=STATE—NEW
STATE—NEW is high anytime the BUSY transfer type is detected (BUSY=1) or anytime STATE=1 and the transfer type is not IDLE or NONSEQ. If BUSY=0 and the transfer type is IDLE or NONSEQ, STATE—NEW becomes zero.
Bridge circuit 20 further includes logic OR gate 85, inverter 86 and logic AND gate 87 for detecting the state of BUSY and the state of state machine 70. Based on the transfer type and the current state of the state machine, bridge circuit 20 selectively modifies the least significant bit HTRANS[0] to generate HTRANS—NEW[0]. The most significant bit, HTRANS[1] passes through bridge circuit 20 unchanged. HTRANS—NEW[0] is forced to zero when HTRANS[0] is zero or when STATE=1 or BUSY=1. Therefore, if HTRANS[1:0] has the bit pattern “01” (BUSY), then HTRANS—NEW[1:0] has the pattern “00” (IDLE). If HTRANS[1:0] has the bit pattern “11” (SEQ) and if STATE=1, then HTRANS—NEW[1:0] has the pattern “10” (NONSEQ). Thus, the SEQ transfer types are only converted to NONSEQ transfer types if a BUSY has been detected during the current burst.
Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention.
Number | Name | Date | Kind |
---|---|---|---|
5566304 | Regal | Oct 1996 | A |
5893917 | Derr | Apr 1999 | A |
6205153 | Shaffer et al. | Mar 2001 | B1 |
6233656 | Jones et al. | May 2001 | B1 |
6618790 | Talreja et al. | Sep 2003 | B1 |
Number | Date | Country | |
---|---|---|---|
20040205267 A1 | Oct 2004 | US |