1. Technical Field
The present inventions relate to circuitry to selectively produce message signaled interrupt (MSI) signals and to related systems.
2. Background Art
Message signaled interrupts (MSI) were defined in the Peripheral Components Interconnect (PCI) Local Bus Specification v2.0 to improve system performance by reducing signal interrupt sharing in a heavily integrated or PCI device loaded system. Following the PCI v2.0 specification, PCI-X and PCI Express interconnect architectures have adopted MSI for event notification and interrupt delivery. While MSI provides a processor direct messaging system, it also changes the PCI interrupt signaling semantics from level triggered to edge triggered, which might impact system driver functionality, compatibility, and performance.
In PCI terminology, INTx is an interrupt that represents one of INTA, INTB, INTC, or INTD. As originally defined, PCI interrupts signaled through pin INTx use a level-triggered semantics. This allows the INTx to be shared among devices and allows internal PCI device events to share INTx assertion within a given device.
Generic interrupt control register circuit 32 functions as a latch for the host command to enable interrupt reporting for a specific event. In the example, a value of “1” indicates enable. The specific control bit is cleared by writing “0” to a register input. The figure represents N control bits. Although
AND logic 48-1 . . . 48-N each receive a status source signal 1 . . . signal N from outputs 34-1 . . . 34-N of status register circuit 28 and a source enable signal from outputs 40-1 . . . 40-N from interrupt control register circuit 32. Outputs of AND logic 48-1 . . . 48-N are provided to an OR logic 52. The output of OR logic 52 is provided as an input to AND logic 54. Accordingly, if for any of the sources, both the status source signal and the source enable signals are asserted (in the example, asserted=1=high), the output of OR logic 52 is also asserted.
Master interrupt control register circuit 60 functions as a latch for a host command to enable global interrupt reporting for the device interrupt logic. A value of “1” indicates enable. The specific control bit is cleared by writing “0” to a register input.
AND logic 54 receives an interrupt enable signal from output 64 of control register circuit 60. AND logic 54 gates the captured event as presented by OR logic 52. The gate of AND logic 54 is closed when the control bit of interrupt control register circuit 60 is “0” (logic low in this example). The output of AND logic 54 on conductor 66 is coupled to the external pin denominated as INTx and exposes level triggered semantics to the interrupt controller logic in the system.
In the examples of this disclosure, “0” represents a logic low voltage and “1” represents a logic high voltage. In the example of
In the simplest case, a device driver is code executing in the central processing unit (CPU) at operating system Ring 0 level. A section of this code in charge of the interrupt signaling is called the interrupt service routine (ISR). The ISR is invoked when a signal from the actual device is sent to the CPU. In level trigger semantics (LTS), the interrupt is asserted until the event causing the interrupt is cleared by the execution of ISR.
A well defined driver ISR disables the interrupts, will identify all possible interrupt sources inside the specific controller, save this information, and launch an auxiliary process to attend each event and finally clear the status on the controller and re-enable interrupts before exiting the ISR itself. The description above applies to a well architected driver executing in a properly defined interrupt architecture where all status bits reside in a single register accessed.
For level trigger semantics, the driver should be recalled under any possible circumstance where an interrupting event is generated and the specific status bit is not cleared. Under proper conditions, this removes the possibility for an ISR to miss an event generated by hardware while enabling the capability for multiple devices supporting level trigger semantics to share the interrupt pin as in the case of PCI architecture.
MSI was adopted in PCI Spec v2.0 to improve system performance by removing the latency introduced by multiple ISR chained in a single interrupt. MSI was later adopted by PCI-X and PCI Express architectures for event notification and interrupt delivery. A premise is to allow a processor direct messaging system thus removing the need of a physical pin per interrupt signal and the related need to share the pin as valuable resource. However, MSI changes the original PCI interrupt signaling semantics from level triggered to edge triggered as the MSI itself is a single message delivered to the CPU and no pin is held asserted until the interrupt itself is cleared. In other words, once the event is detected, a message is sent and no electrical signal is held asserted until drive clears the status.
The system described above works well if there is only a single event in the specific device that is capable of generating an interrupt message. However, in reality, devices contain multiple possible events capable of generating interrupts and basically causing an interrupt sharing of the MSI functionality internally to the controller.
The inventions will be understood more fully from the detailed description given below and from the accompanying drawings of embodiments of the inventions which, however, should not be taken to limit the inventions to the specific embodiments described, but are for explanation and understanding only.
Generic interrupt control register circuit 132 functions as a latch for the host command to enable interrupt reporting for a specific event. A value of “1” indicates enable. The specific control bit is cleared by writing “0” to a register input. The figure represents N control bits. Although
AND logic 148-1 . . . 148-N each receive a status source signal 01 . . . signal N from outputs 134-1 . . . 134-N of status register circuit 128 and a source enable signal from outputs 140-1 . . . 140-N from interrupt control register circuit 132. Outputs of AND logic 148-1 . . . 148-N are provided to an OR logic 152. The output of OR logic 152 is provided as an input to AND logic 154. Accordingly, if for any of the sources, both the status source signal and the source enable signals are asserted (high), the output of OR logic 52 is also asserted.
MSI control register circuit 160 functions as a latch for a host command to enable global interrupt reporting for the device interrupt logic. A value of “1” indicates enable. The specific control bit is cleared by writing “0” to a register input. In some embodiments, a PCI command register circuit 176 is also included even though it is redundant from the perspective of this invention. A “1” at output 174 indicates enable.
AND logic 154 receives an interrupt enable signal from output 164 of MSI control register circuit 160. AND logic 154 gates the captured event as presented by OR logic 152. The gate of AND logic 154 is closed when the control bit of MSI control register circuit 160 is clear (“0”, logic low voltage, in this example). The output of AND logic 154 is provided to AND logic 172, which also receives an output 174 of a bus master enable output 174 of PCI command register circuit 176. In some embodiments, MSI control register circuit 160 is at 92h and MSI control register circuit 176 is at 04h of the host PCI device, and output 164 is a bit 0 of the register and output 174 is a bit 2 of the register.
In the example of
The output of AND logic 172 is provided to pulse generation logic 180, which includes a flip-flop (latch) 184 and logic 186. One input to AND logic 186 is the output of AND logic 172 and another input to AND logic 186 is an inverse of the output of flip-flop 184. The output of AND logic 186 is the MSI on conductor(s) 188.
In
In the circuitry of
(1) ISR not clearing all detected events. In this case, the ISR when looking for the event will find the first status bit, service it, clear it and exit without servicing all status bits. As a consequence, all subsequent events are lost and no further message will be sent by the controller. (See situation 4 in table 1.)
(2) Event vs. clearing; race condition (multi-register): This case could be typical where there are multiple interrupt status registers. The ISR could access the first status register, determine all events, clear the register, and move to the next status register. The ISR will not be aware of the new event as it recently cleared the first status register. However, a new message will not be generated as the second register could still have pending uncleared bits. (See situation 6 in table 1.)
(3) Event vs. clearing; race condition (single-register): Race condition between the ISR clear and an event being recorded at the same time. The same conditions as in the multiple registers apply with the caveat that the boundary condition makes this event to be atypical. However, the probability of this occurrence is not zero and the consequences can be severe as to system stopping to function or data corruption. (See situation 6 in table 1.)
Yet another opportunity for error is when there is an interrupt event before software enables MSI capability. (See situation 7 in table 1.)
In situation 1 (of table 1), all interrupt event bits (from conductors 122-1 . . . 122-N) are ‘0’, meaning there are not interrupt events. Accordingly, the INTx conductor 66 in
In situation 2, at least one bit is set to ‘1’, meaning there is at least one interrupt event. Accordingly, the INTx conductor 66 in
In situation 3, at least one bit is set to ‘1’, meaning there is at least one interrupt event. A new bit gets set to ‘1’ prior to servicing of the at least one previously set bit. The INTx signal conductor 66 in
In situation 4, at least two bits are set to ‘1’, and software clears some, but not all, bits. In this case, the INTx signal conductor 66 in
In situation 5, at least one bit is set to ‘1’ and the software clears all bits. Since all interrupts have been serviced, the INTx signal on conductor 66 would be inactive and an MSI is not sent.
In situation 6, software clears at least one bit and at least one bit is set on the same clock. In this case, there is a race condition so the INTx signal on conductor 66 would be active and an MSI would be sent. In this disclosure, the term “same clock” means during the same relevant activity of the clock signal. For example, if the circuitry responds in a single data rate fashion, the relevant clock activity may be a clock period (or in some embodiments, more than one clock period). If the circuitry responds in a double data rate fashion, the relevant clock activity may be a half clock period (or in some embodiments multiple half clock periods).
In situation 7, software enables MSI and at least one bit was previous set. In this case, the INTx signal on conductor 66 would be active, and an MSI would be sent because the MSI capability is now enabled and interrupts are waiting to be serviced.
The circuitry of
Table 2 can be extrapolated to show that if all signals on conductors 122-1 . . . 122-N are low (0), then the output of NOR logic 192 is high (1), but if any of the signals on conductors 122-1 . . . 122-N is high, then the output of NOR logic 192 is low (0). AND logic 156 also received the output of OR logic 152 and output 164 of MSI control register 160.
In operation, interrupt event pulses are received one or more of conductors 122-1 . . . 122-N. Once the pulse(s) has passed, all conductors 122-1 . . . 122-N are “0.” The output of NOR logic 192 is “1” when all the conductors are “0.” If another event occurs in the same clock when the previous events are being cleared from register 128, the output of NOR logic 192 is temporarily “0” but quickly returns to “1.” This allows another pulse to travel through AND logic 156 and create another MSI pulse. By contrast, in the case of
The contents of circuits 128 and 132 may be at least partially controlled by control circuitry 138.
Other implementations are possible and typically the final circuitry design would be tailored to the available interrupt routing logic of the specific design. However, according to some embodiments of the invention, the circuitry satisfies Table 1 so as to avoid race conditions, which otherwise could cause the loss of interrupt event processing.
Note that the circuits of
In the figures, a square output indicates read/write (R/W) and a circle output indicates read/write clear (R/WC), although the inventions are not required to include these details.
The logic of
The term “pin” is intended to be interpreted broadly to include a pin, ball array or other contact to a pad or other interface to a chip.
An embodiment is an implementation or example of the inventions. Reference in the specification to “an embodiment,” “one embodiment,” “some embodiments,” or “other embodiments” means that a particular feature, structure, or characteristic described in connection with the embodiments is included in at least some embodiments, but not necessarily all embodiments, of the inventions. The various appearances of “an embodiment,” “one embodiment,” or “some embodiments” are not necessarily all referring to the same embodiments.
If the specification states a component, feature, structure, or characteristic “may”, “might”, or “could” be included, that particular component, feature, structure, or characteristic is not required to be included. If the specification or claim refers to “a” or “an” element, that does not mean there is only one of the element. If the specification or claims refer to “an additional” element, that does not preclude there being more than one of the additional element.
The inventions are not restricted to the particular details described herein. Indeed, many other variations of the foregoing description and drawings may be made within the scope of the present inventions. Accordingly, it is the following claims including any amendments thereto that define the scope of the inventions.