The present invention relates to a data buffer space configuration method; more particularly relates to a data buffer space configuring method adapted to a bus controller.
In a PCI (Peripheral Component Interconnect) bus system as depicted in
During the data transmission from the target device 11 to the master device 10, the target device 11 could not realize the data length read by the master device 10 as the conventional data request issued by the master device 10 does not contain such information. Even if the data request might contain the information of requested data length, a considerable latency for the target device 11 to fetch corresponding data would be inevitable. Therefore, a pre-fetch method is adopted to solve the above-mentioned problems.
According to the pre-fetch method, data will be fetched in advance and temporarily stored in a data buffer 120 of the bus controller 12 for subsequent data transmission. On the condition that the PCI bus 1 is capable of supporting a plurality of bus devices serving as the master device 10, and the data buffer 120 includes a plurality of baskets for storing data of the corresponding master device 10.
For example, assuming that the PCI bus 1 is capable of supporting four master devices 10 and the data buffer 120 includes eight baskets (not shown), the data buffer space with two baskets is contributed to each master device averagely. However, if the latency of a certain master device is too long, the data buffer space with two baskets are not sufficient for buffering the data. Once the data buffer space is full, the certain master device has to release the bus to other master devices. If there are 3 or more master devices coupled to the PCI bus 1 at the same time, when the master device releases the use of the PCI bus 1, there is a great chance that another master device could use the PCI bus 1 immediately, so the bus utilization is high. However, if there are just a few master devices coupled to the PCI bus 1, for example only one or two, the bus utilization would be significantly reduced due to the idle bus resulting from the facts that the master device with data buffer space fully occupied releases the use of the bus but no other master device would use the bus instead.
A configuration method of data buffer space applied to a master device coupled to a bus for buffering the data requested from a target device, includes: detecting a device count of the master devices coupled to the bus; detecting a device count of the master device coupled to the bus, and them configuring a first data buffer space to the master device when the device count is not greater than a threshold, on the other hand configuring a second data buffer space to the master device when the device count is greater than the threshold.
A bus controller for configuring data buffer space for a master device coupled to a bus for buffering the data requested from a target device includes: a data buffer having a plurality of buffer sets for providing data buffer space of the master device, a data buffer control logic circuit coupled to the data buffer for configuring data buffer space of the master device according to a device count of the master device coupled to the bus; and a selecting device, coupled to the data buffer and the data buffer control logic circuit for selecting the buffer sets contributed to the master device according to a selecting signal from the data buffer control logic circuit.
A PCI bus system includes: a target device, coupled to the PCI bus, at least one master device for requesting data from the target device via the PCI bus; and a bus controller coupled between the PCI bus and the master device, wherein the bus controller comprises a data buffer for providing data buffer space to the master device for buffering the data from the target device. In the invention, a first data buffer space is configured to the master device when a device count of the master device is not greater than a threshold, and a second data buffer space is configured to the master device when the device count of the master device is greater than the threshold.
The above contents of the present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which:
A data buffer space configuration method according to an embodiment of the present invention is exemplified under the PCI bus system of
In the present invention, the bus system as described above could be a PCI bus system.
For example, if the threshold is two and the device count of the master device physically coupled to the bus 2 is not greater than two, the bus controller 22 respectively configures the first data buffer space to each coupled master device. On the other hand, if the device count of the detected master devices is greater than two, the bus controller 22 respectively configures the second data buffer space to each coupled master device.
In different configurations of data buffer space, the data buffer baskets are contributed in different manners so that the data buffer space configured to each coupled master device is different in two cases. As a result, the first data buffer space is greater than that the second data buffer space.
In this manner, the bus utilization can be improved. For example, when there are only two master devices, e.g. master devices 200 and 201, coupled to the bus 2, the bus controller 220 configures the first data buffer space with two buffer sets (i.e. four data buffer baskets) to each of the master device 200 and 201. In other words, the buffer sets originally supposed to serve the master devices 202 and 203 are released to the master devices 200 and 201. Therefore, the bus system will not be usually idle due to the more data buffer space is configured to the master device when less master devices are coupled to the bus. In the embodiment, assume the buffer set (0, 1) and the buffer set (4, 5) are contributed to the first master device 200, and the buffer set (2, 3) and the buffer set (6, 7) are contributed to the second master device 201 for data fetching and data transmission.
FIGS. 4(a) and 4(b) give examples for contributing buffer sets by an embodiment of a bus controller according to the present invention. The bus controller 22 includes a data buffer control logic circuit 221, a data buffer 220 including eight data buffer units from basket 0 to basket 7 or four buffer sets, i.e. buffer set (0, 1), buffer set (2, 3), buffer set (4, 5) and buffer set (6, 7), a multiplexer 222˜224. The device count of master device physically coupled to the bus system is detected by the operating system for configuring the data buffer space of the master device.
In the example of
In the example of
Although the present invention is illustrated with the example of four master device sites and eight buffer units, it is understood that the present data buffer configuration method can be applied to various counts of master devices and data buffer. Generally, the count of data buffer basket is a multiple of the maximum count of the master devices supported by the bus. When the counts of master devices and data buffer basket change, the count and/or disposition of multiplexers may change accordingly. Meanwhile, there might be more than two kinds of data buffer space configurations when the counts of master devices and data buffer units is large, thereby making the data buffer space configuration more flexible.
While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not be limited to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims, which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.
Number | Date | Country | Kind |
---|---|---|---|
094134994 | Oct 2005 | TW | national |