The present invention relates to a technique for controlling an I/O (Input/Output) serial interface, and relates to, for example, a semiconductor device capable of implementing system configurations corresponding to various PCI (Peripheral Component Interconnect) Express (hereinafter referred to as “PCIe”) topologies.
As data processing apparatuses such as personal computers have recently become more advanced in performance and multifunctionality, various types of interface circuits are being mounted thereon. PCIe can be mentioned as one example of such an interface.
PCIe is a serial interface that has been developed as a next-generation interface to overcome the insufficient transfer rate of a conventional PCI bus, and has realized full compatibility with the PCI bus at the software level. PCIe, therefore, can run on any OS (Operating System) in which the conventional PCI bus can run, without particularly requiring new support.
Examples of elements configuring a PCIe system include a root complex, an endpoint, a switch, a bridge, and the like, which are connected with one another to thereby implement various topologies. In connection with this, the following techniques have been disclosed.
Japanese Patent Laying-Open No. 11-288400 (Patent Document 1) discloses a PCI bridge device with a reduced amount of circuitry. The PCI bridge device spuriously implements configuration space of a device that is connected to a secondary-side pseudo-PCI bus. A secondary-side pseudo-PCI interface unit thus acquires information (functional numbers shown to a primary-side PCI bus) of the above-mentioned device, immediately after resetting. A decoding unit associates the information of the device with IDSEL for output to the secondary-side pseudo-PCI bus. When a primary-side PCI interface unit then detects a configuration cycle, it relays the cycle with the secondary-side pseudo-PCI interface unit, and the decoding unit replaces some bits of the information of the device.
Japanese Patent Laying-Open No. 11-238030 (Patent Document 2) discloses a customized PCI-PCI bridge that is supported reliably by existing BIOS (Basic Input/Output System) and provided with a DMA (Direct Memory Access) controller and an LSI (Large Scale Integrated Circuit) core on the same chip. The customized PCI-PCI bridge uses the type “00” header, and identifies a secondary PCI device using function numbers to enable a configuration. The PCI-PCI bridge switches between memory maps at the time of and after startup, in order to support a VGA device together with a processing core and a PCI agent. The PCI-PCI bridge adjusts bus drive such that two PCI buses are not driven simultaneously.
Japanese Patent Laying-Open No. 2002-024161 (Patent Document 3) discloses a PCI agent integrated circuit in which the number of PCI agents to be incorporated is not restricted, subsequent addition and replacement of a PCI agent can be easily made, the entire circuit scale can be reduced, and a layout design can be made to reduce a propagation delay in a signal line, and also discloses a communication method for such a PCI agent integrated circuit. The PCI agent integrated circuit is composed of a single PCI bus control unit for common use among a plurality of PCI agents, a function control unit for each of the PCI agents, and an internal common bus that is connected among the PCI agents for common use. This facilitates changing the configuration of the PCI agents or changing the design when a new PCI agent is added.
In the case of adding a PCIe device function to a system design having a PCIe-PCI bridge, it is necessary to align a plurality of LSIs on a product substrate, or increase the number of IPs (Intellectual Properties) incorporated in an LSI.
For example, when a topology in which the PCIe-PCI bridge and a PCIe endpoint are aligned downstream of a PCIe switch is configured, at least three types of LSIs or IPs are required.
Thus, the realization of such a topology with a plurality of LSIs poses problems such as an increased substrate area and increased costs of components. The realization of such a topology with a plurality of IPs incorporated in an LSI also poses problems such as an increased number of gates and an increased package size. In either case, these problems lead to an increased development cost as well.
Other objects and novel features will become apparent from the descriptions of the present specification and the attached drawings.
In accordance with one embodiment, there is provided a semiconductor device that implements a device configuring a PCIe topology. A RAM stores one or more configuration registers that define function information of a PCIe device. A Link control unit decodes a request received from a PCIe host and outputs a decoded result to a CPU (Central Processing Unit). The CPU reads a corresponding configuration register from the RAM based on a decoded result received from the Link control unit, and generates a response to the request and causes the Link control unit to transmit the response.
In accordance with the foregoing embodiment, the CPU reads the corresponding configuration register from the RAM in accordance with the decoded result received from the Link control unit, and generates the response to the request and causes the Link control unit to transmit the response. This allows system configurations corresponding to various PCIe topologies to be implemented.
A downstream of PCIe-PCI bridge 102 is connected to a PCI endpoint and the like via PCI I/F. When such a topology is configured, the use of at least three types of LSIs or IPs is necessary, which causes problems such as an increased development cost as described above.
PCIe device hardware 11 is connected to the PCIe I/F, and mainly performs control of a physical layer and a data link layer. CPU 13 mainly performs control of a transaction layer by executing a program stored in code RAM/ROM 15. Work RAM 14 stores configuration registers, details of which will be described later.
The transaction layer mainly generates and decodes a transaction layer packet (TLP). TLP is composed of a command such as a read or a write, an address, data, or the like. The transaction layer also performs flow control between connected devices.
Credit-based flow control is performed in PCIe. The credit-based flow control is a scheme in which a receiving side notifies in advance a transmitting side of a buffer size that can be received, and conveys to the transmitting side every time empty space is available in the buffer. The transmitting side sums sizes of received packets, and when it is notified of empty space in the buffer from the receiving side, the transmitting side subtracts an amount of the empty space from a sum size of received packets. This allows transfer of packets without exceeding the buffer size of the receiving side.
The transaction layer supports three address spaces, which are memory space, I/O space, and configuration space.
In the case of controlling a PCIe (PCI) device, the control is performed by operating configuration registers of a PCIe bus (PCI bus). For details, reference may be made to the PCI specification, for example.
Initially, when PCIe device hardware 11 receives a request packet (Req TLP) from the PCIe host via the PCIe I/F, it decodes the TLP and determines what kind of request the TLP is, and then outputs an interrupt request in accordance with the request to CPU 13 of software sequencer 12 (S11). It is noted that the request packet includes a memory request, which is a request for reading/writing from/to the memory, an I/O request, which is a request for reading/writing from/to the I/O, a configuration request for reading/writing from/to the configuration space, etc.
When CPU 13 within software sequencer 12 receives the interrupt request from PCIe device hardware 11, it checks a header and data of the TLP (S12), generates a response to the request packet, and sets the generation of the response in a control register for notification (S13). Here, reference is made as appropriate to the value of a configuration register stored in work RAM 14.
When PCIe device hardware 11 receives the notification of the generation of the response from software sequencer 12, it transmits a response (Cpl TLP: Completion) via the PCIe I/F (S14). Here, in the case of reading, the response also includes the data.
PCIe-Phy unit 21, which is connected to PCIe host 2 via the PCIe I/F, has the function of the physical layer of PCIe. PCIe-Link unit 22 has the function of the data link layer of PCIe.
Link control unit 23 decodes the received TLP (request packet) output from PCIe-Link unit 22 and determines what kind of request the TLP is, and then outputs an interrupt request to CPU 13. Link control unit 23 transmits the response (completion) corresponding to the request packet to PCIe host 2 via PCIe-Link unit 22 and PCIe-Phy unit 21.
Control register 24 includes a group of registers provided for the control of semiconductor device 1 itself, and is distinguished from the configuration registers.
Data buffer 25 temporarily stores data that is transmitted to a device A (3) or a device B (4) via the PCI bus or the general-purpose bus, and data received from device A (3) or device B (4) via the PCI bus or the general-purpose bus.
When the request packet is a memory read from or a memory write to device A (3) which is connected to PCI bus, PCI bus control unit 26 transmits and receives data to and from device A (3).
When the request packet is a memory read from or a memory write to device B (4) which is connected to the general-purpose bus, general-purpose bus control unit 27 transmits and receives data to and from device B (4).
Bus selecting unit 28 is connected to a downloader 5, CPU 13, RAMs 14, 15, and control register 24, and switches the bus. For example, when downloader 5 downloads a program executed on CPU 13 into RAM 15, bus selecting unit 28 switches the bus such that a processing code output from downloader 5 is written to RAM 15.
Moreover, when CPU 13 executes the program stored in RAM 15, bus selecting unit 28 switches the bus such that CPU 13 can fetch the processing code stored in RAM 15. Furthermore, when CPU 13 accesses control register 24, bus selecting unit 28 switches the bus such that CPU 13 can read/write from/to control register 24.
PCIe host 2 searches for a PCIe topology by reading a configuration register corresponding to each device function at system startup. When a device function number for each of the device functions hits the device function number in a configuration register defined in RAM 14, CPU 13 instructs Link control unit 23 to return a completion that means the presence of the device function, thereby causing PCIe host 2 to recognize the device function.
Initially, when Link control unit 23 receives a request packet from PCIe host 2 via PCIe-Phy unit 21 and PCIe-Link unit 22 ((1) in
Link control unit 23 may issue this notification by outputting an interrupt request to CPU 13 as described above, or by writing to control register 24 the reception of the configuration read, which is then polled by CPU 13.
When CPU 13 receives the notification from Link control unit 23, it reads contents of a corresponding configuration register from RAM 14 ((3) in
For example, when the topology shown in
When the topology shown in
Initially, when Link control unit 23 receives a request packet from PCIe host 2 via PCIe-Phy unit 21 and PCIe-Link unit 22 ((1) in
When CPU 13 receives the notification from Link control unit 23, it requests a PCI configuration read cycle to PCI bus control unit 26 ((3) in
When device A (3) receives the configuration read from PCI bus control unit 26, it transmits contents of the configuration register to PCI bus control unit 26. PCI bus control unit 26 then notifies CPU 13 of the read data received from device A (3) ((5) in
Next, CPU 13 sets the contents of the configuration register received from PCI bus control unit 26 in Link control unit 23 ((6) in
Initially, when Link control unit 23 receives a request packet from PCIe host 2 via PCIe-Phy unit 21 and PCIe-Link unit 22 ((1) in
When PCI bus control unit 26 receives the notification from Link control unit 23, it issues the memory read to device A (3) ((3) in
When PCI bus control unit 26 then completes the reception of the read data, it notifies Link control unit 23 of the completion of the read data ((5) in
It is noted that a memory write to device A (3) is performed by an operation similar to that shown in
As described above, in the semiconductor device according to this embodiment, the configuration registers of the PCIe device configuring a PCIe topology are stored in RAM 14, and upon reception of a request from PCIe host 2, a response is transmitted to PCIe host 2 with reference to the configuration registers stored in RAM 14. This has enabled the realization of system configurations corresponding to various PCIe topologies.
Moreover, when a topology with any combination of a plurality of PCIe devices such as a PCIe-PCI bridge, a PCIe switch, an endpoint, and the like is configured with the semiconductor device according to this embodiment, the number of hardware devices for controlling the physical layer, the data link layer, and the like among these PCIe devices can be reduced. This has enabled a reduction in substrate area and/or component costs, or a reduction in the number of gates and/or package size.
Furthermore, even after shipping of the semiconductor device, changes can be made to the PCIe topologies and device functions, thus allowing any trouble that is found during debugging to be corrected, and/or allowing a change to be made to the specification as requested by a client, for example.
Moreover, in the semiconductor device according to this embodiment, when a desired topology is implemented, the memory read operation from the device connected to the PCI bus is performed by bypassing CPU 13. While the memory transfer time can be shortened in this way, the method of memory transfer is not limited to the above, and memory transfer may also be performed via CPU 13.
In a semiconductor device according to a second embodiment, configuration registers corresponding to general-purpose devices connected to a general-purpose bus are stored in RAM 14, and the configuration registers are used to control the general-purpose devices as devices spuriously connected to a PCIe topology. It is noted that the configuration of the semiconductor device according to the second embodiment is similar to that of the semiconductor device according to the first embodiment shown in
Initially, when Link control unit 23 receives a request packet from PCIe host 2 via PCIe-Phy unit 21 and PCIe-Link unit 22 ((1) in
When CPU 13 receives the notification from Link control unit 23, it writes contents of a configuration register received from Link control unit 23 to RAM 14 ((3) in
CPU 13 also sets the response status in Link control unit 23 ((5) in
It is noted that an operation of a configuration read for general-purpose device B (4) is similar to the read operation of the configuration register shown in
Initially, when Link control unit 23 receives a request packet from PCIe host 2 via PCIe-Phy unit 21 and PCIe-Link unit 22 ((1) in
Next, Link control unit 23 notifies general-purpose bus control unit 27 that the memory write has been received ((3) in
It is noted that a memory read from device B (4) connected to the general-purpose bus is performed by an operation similar to that shown in
As described above, in the semiconductor device according to this embodiment, the configuration registers of the general-purpose devices connected to the general-purpose bus are stored in RAM 14, and contents of any of these configuration registers are returned to the configuration read from PCIe host 2. Therefore, in the semiconductor device according to this embodiment, in addition to the effects described in the first embodiment, the general-purpose registers can be spuriously connected to the PCIe topology.
While the invention made by the present inventors has been specifically described above based on the embodiments, the present invention is by no means limited to the foregoing embodiments, and can be modified in various manners without departing from the gist of the invention.
1: semiconductor device; 2: PCIe host; 3, 4: device; 5: downloader; 6, 7: general-purpose device; 11: PCIe device hardware; 12: software sequencer; 13: CPU; 14: work RAM; 15: code RAM/ROM; 21: PCIe-Phy unit; 22: PCIe-Link unit; 23: Link control unit; 24: control register; 25: data buffer; 26: PCI bus control unit; 27: general-purpose bus control unit; 28: bus selecting unit.
Number | Date | Country | Kind |
---|---|---|---|
2011-059318 | Mar 2011 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2012/053761 | 2/17/2012 | WO | 00 | 8/8/2013 |