Differential receiver for detecting and correcting polarity inversion

Abstract: A differential receiver incorporated into a MAU which receives both Manchester packets and linkpulses according to the IEEE 802.3 10Base-T standard has polarity detection and correction circuit for automatically detecting a reversed polarity for RD input lines. The differential receiver samples incoming pulses for time, amplitude and pulse width qualification and makes a preliminary polarity determination based upon polarity of such qualified pulses. This preliminary polarity allows a linktest state machine to transition to a link_pass state, enabling output drivers of the MAU. Additionally, the linkpulse polarity information initially makes a polarity determination for the entire differential receiver which asserts a FIX POLARITY signal. The FIX POLARITY signal controls a correction circuit which internally remedies reversed input lines. Preferably, the correction circuit internally reroutes the signals. An ETD polarity circuit makes polarity determinations from any ETD information received, as effected by the correction circuit. The ETD polarity circuit independently controls the linkpulse polarity determinations and conflicting determinations are resolved in favor of the ETD polarity circuit. Upon detecting two consecutive, consistent valid ETDs, the ETD polarity circuit locks-in the polarity determinations until a reset or a linkfail condition. The correction circuit effects both Manchester packets and linkpulses, so an incorrectly locked polarity will produce inverted linkpulses which will not allow the MAU to remain in the link_pass state. In the linkfail state, the MAU may reestablish the correct polarity.

Description: The present invention relates to an improved apparatus for and method of detecting differential signals having a pre-specified signal format. EP-A-0442 619 discloses such an apparatus and method. The present invention seeks to improve on this known apparatus and method and is usable in both a heavily loaded and a lightly loaded network. Loading of a network in this case refers to an amount of data transmitted over the network. Thus, a lightly loaded network is a network which has relatively few data transmissions. Fig. 5 is a block diagram having two Medium Attachment Units (MAUs) 50 interconnected by a pair of twisted pair cables 52 to form a simple network. The twisted pair cables 52 transmit data packets and linkbeat pulses from one MAU 50 to the other according to the IEEE 802.3 10BASE-T standard. The standard requires that when one MALT 50 is not transmitting a data packet to another MAU 50, it should periodically transmit linkpulses to the MAU 50 to test an integrity of a link between the MAUs 50. Fig. 6A illustrates one example of one such packet having a preamble portion, a data portion and an end of transmission delimiter (ETD) portion. The preamble portion is an alternating series of high and low transitions and the ETD is a high level for a specified minimum time duration. Fig. 6B is an illustration of two acceptable linkpulse transmit waveforms conforming to the IEEE Specification. A linkpulse waveform is either a high transition or a high transition followed by a low transition fitting within a specified pulse template. A linktest state machine which performs the link integrity test functions described in the IEEE 802.3 10BASE-T specification monitors these link pulses to determine whether any link between two particular MAUs 50 passes a link integrity test. Upon power up or RESET, a particular MAU resets to a particular known state, either a link_pass state or link_fail state. If there is no packet information received, the MAU 50 will expect to periodically receive a series of linkpulses, just as it periodically transmits a linkpulse in the absence of other transmissions. A MAU can be designed to recognize positive-only or any polarity of link pulses. An advantage of recognizing only one polarity of link pulse at a time is that it is less likely that noise spikes will be recognized as link pulses. If a MAU 50 is designed to recognize only positive pulses, it must receive link pulses similar to those shown in FIG. 6B to enter or remain in the link_pass state. If the MAU 50 does not receive positive linkpulses within the time windows, the IEEE Specification requires, then the MAU 50 will transition to a link_fail state. The link_fail state can result from a faulty link, a disconnected lead disabled driver at transmitter reversed leads or other electrical or mechanical fault of the twisted pair cable 52 on its receive data (RD) lines. A reversed twisted pair cable 52 causes a differential receiver to receive an inverted differential signal, meaning that the linkpulses will appear inverted. FIG. 6C is an illustration of an inverted linkpulse signal which results from incorrect connection of the twisted pair cable 52. A typical MAU 50 which recognizes positive linkpulses only and receiving an inverted linkpulse as shown in FIG. 6C will ignore the linkpulse, causing the MAU either to transition to the link_fail state, or to remain in the link_fail state. The MAUs 50 may also exit a link_fail state by receiving a data packet. The parent application allows a MAU 50 receiving valid data packets to detect reversed polarity at its RD input and to automatically correct it. However, this method requires receipt of a prespecified number of valid and consistent packets by the MAU 50. If the network is lightly loaded, the MAUs 50 will not receive enough data packets to keep the MAUs 50 from relying on linkpulses to test its link. A potential difficulty with this prior apparatus and method results from a configuration similar to that of Fig. 5 in which both MAUs 50 have incorrectly wired twisted pair cables 52 for their RD inputs. If both MAUs 50 only look for a linkpulse with an initially positive transition, and the MAU 50 powers up in the link_fail state, then the two MAUs 50 will continually received inverted linkpulses from each other. These inverted linkpulses will not bring the MAUs 50 out from the link_fail state. When the MAUs 50 are in the link-fail state, the linktest state machine disables output drivers of the MAUs 50, preventing the MAUs 50 from transmitting data packets. Since the prior apparatus and method relied exclusively on packet information to detect and correct polarity, the MAUs 50 of Fig. 5 would be unable to detect the incorrect polarity and correct themselves. In other words, the MAUs 50 would be locked-out and not function to correct polarity. Note that for a lightly-loaded network, a MAU 50 which powers up in a link _pass state would inevitably enter the link_fail state and be locked-out as well. Therefore, it is a desire to improve upon the prior apparatus and method to provide an improved and robust polarity detection and correction which is operable for the network of Fig. 5. EP-A-0442 619 discloses a method and apparatus to check an incoming signal for various attributes of a prespecified format for the incoming signal. In that patent specification, the incoming signal was a Manchester-encoded signal that had a preamble portion and terminated in an end-of-transmission delimiter (ETD) having a positive voltage level. This ETD is referred to as the start of TD-IDL waveform in the IEEE 802.3 10BASE-T specification. The disclosed apparatus tests an input signal's preamble transition sequence to establish whether a Manchester packet is present at an input. If the signal is present, the differential receiver asserts an internal carrier sense signal and upon detecting the ETD or end of signal activity, it deasserts the internal carrier sense signal. The falling edge of the internal carrier sense signal causes a sampling of the ETD to establish the existing polarity. The ETD has particular characteristics, namely that it must remain positive for an extended time period at the end of transmission. Detecting this particular characteristic as a positive input results in the system determining that the input polarity is correct. However, if the ETD appears negative when the internal carrier sense is deasserted, the system determines that the input polarity is incorrect. A signal is available which remedies the incorrect polarity. The preferred embodiment reroutes the input signals applied to the RD inputs to alternate paths internally so that the differential receiver has a correct polarity for the input lines, just as if the external lines themselves had been corrected. In accordance with the present invention, there is provided a differential signal polarity reversal detection apparatus comprising: a first and a second input for receipt of complementary differential signals and linkpulse signals; means, coupled to said first and second inputs, for asserting a carrier sense signal while a first and a second input signal at said first and second inputs, respectively, correspond to a valid prespecified format; characterised by means, coupled to said first and second inputs, for asserting one of a first and a second link signal if an input signal at said first and second inputs, respectively, corresponds to a linkpulse signal; means, coupled to said first and second link signals, for asserting a link polarity signal if said asserted one of said first and second link signals indicate said first and second inputs have a reversed polarity, said link polarity signal asserting means deasserting said link polarity signal if said asserted one of said first and second link signals indicates said first and second inputs have a correct polarity; means, coupled to said first and second inputs and responsive to said carrier sense signal, for asserting an ETD polarity signal if said first and second inputs have reversed polarity based upon receipt of a valid ETD having a first voltage range, said ETD polarity signal asserting means deasserting said ETD polarity signal if said first and second inputs have correct polarity based on receipt of a valid ETD having a second voltage range; and means, coupled to said ETD polarity signal asserting means and to said link polarity signal asserting means, for asserting a fix polarity signal if either one of said ETD polarity and said link polarity signals is asserted. Preferably there is provided a means, coupled to the fix polarity signal asserting means, for providing the ETD polarity signal with precedence over the link polarity signal in control of the fix polarity signal. There may also be provided a means, coupled to the fix polarity signal asserting means, for remedying a reverse polarity if the fix polarity signal is asserted. In accordance with the present invention, there is also provided a method for correcting a reverse polarity for a differential signal, characterised by the steps of: receiving a first and a second input differential input signal; establishing whether said first and second input signals have a pulse width within a prespecified range for linkpulse determination; asserting a link polarity signal if said first and second input signals have said pulse width within said specified range and said input signals are inverted linkpulse signals; establishing whether said first and second input signals comprise valid end-of-transmission delimiters; asserting an ETD polarity signal if said valid end-of-transmission delimiter comprises an inverted ETD and deasserting said ETD polarity signal if a subsequent ETD establishment of said input signals indicates said input signals are inverted; asserting a FIX POLARITY signal if said link polarity signal is asserted until a deassertion of said ETD polarity signal, said FIX POLARITY signal also asserted if said ETD polarity signal is asserted; and remedying a reversed polarity if said FIX POLARITY signal is asserted. The remedying step may include rerouting input signals received at the first input to travel a path that signals received at said second input would travel in an absence of said assertion of said FIX POLARITY signal, and rerouting input signals received at said second input to travel a path that signals received at said first input would travel in an absence of said assertion of said FIX POLARITY signal. A method and apparatus in accordance with the invention can detect and automatically correct a reversed polarity of a pair of differential input lines. This offers advantages over existing methods and apparatus as it makes use of periodic linkpulses received as part of a link integrity test to enhance a MAU's ability to detect and correct improper data polarity. The apparatus and method according to the invention serves to receive both linkpulses and Manchester-encoded data. The apparatus recognises whether a valid ETD is present when carrier is deasserted. In EP-A-0442 619 no voltage squelch criteria was used to determine if a carrier was deasserted due to a normal end of transmission delimeter or was caused by an abnormal end. The present invention checks for a valid ETD before using the ETD for polarity information. The present arrangement improves upon this further by also monitoring input signals to sample incoming linkpulses. If the applied external signal is inverted, the linkpulses will also appear inverted. Thus, by assuming that input pulses which meet linkpulse width requirements are in fact linkpulses and making initial polarity determinations based upon this assumption, a MAU is enabled to transition to a link_pass state based upon what would otherwise be inverted, and therefore unusable, linkpulses. In the link_pass state, the MAU's output line drivers are enabled, allowing transmission of data. The polarity detection circuit uses the initial link polarity as an estimate of the polarity status when no data polarity information is available. Data polarity refers to polarity determinations based on the ETD and the internal carrier sense, in the preferred embodiment. Thus, MAUs wired as in FIG. 5 with reversed input lines are not caused to be locked-out, and data transmissions may resume between the Data Terminal Equipment (DTE) and the network. The polarity circuit will use the transmitted and ETD polarity information to determine arbitrate a final decision of an appropriate polarity for the system, as the transmitted ETD information is more easily distinguishable from noise than are linkpulses. Therefore, the ETD polarity information supersedes linkpulse polarity information. In the preferred embodiment, when the data polarity information determines that a sufficient number of successive consistent data packets have been received, the system locks-out further polarity changes until a system reset or the system enters a link_fail state. The system may include an optional provision for disabling the polarity reversal as described in EP-A-0442 619. The described arrangement is superior to existing systems because it incorporates linkpulse information to establish an initial polarity, thus allowing a system to pass a link integrity test so that it can transmit data to another MAU, which can, in turn, use the transmitted data to make a final polarity determination. This is especially useful in lightly loaded networks and in those otherwise active networks where no data transmission occurs at infrequent intervals. Reference to the remaining portions of the specification and the drawings realizes a further understanding of the nature and advantages of the invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block schematic diagram of a preferred embodiment of the present invention; FIG. 2 is a detail block diagram of the link pulse reversal circuit 24 and the link pulse polarity circuit 28; FIG. 3 is a detail block diagram of the polarity detection circuit 14 according to a preferred embodiment of the present invention; FIG. 4A is a logic table illustrating the relationship of the NOR gate G100 inputs and the output selected by the multiplexer 102; FIG. 5 is a block diagram having two Medium Attachment Units (MAUs) 10 interconnected by a pair of twisted pair cables 12 to form a simple network; FIG. 6A illustrates one example of a packet having a preamble portion, a data portion and an end of transmission delimiter (ETD) portion; FIG. 6B is an illustration of two acceptable linkpulse waveforms conforming to the IEEE Specification; and FIG. 6C is an illustration of an inverted linkpulse signal which results from incorrect connection of the twisted pair cable. DESCRIPTION OF A SPECIFIC EMBODIMENT FIG. 1 is a block schematic diagram of a preferred embodiment of the present invention. FIG. 1 includes a portion of a differential receiver 10 having two input lines RD+ and RD- incorporating an automatic polarity detection and correction circuit of the present invention. A polarity correction circuit 12 receives any input signals from the RD+ and the RD- input lines. The polarity correction circuit 12 remedies an incorrect polarity of the RD+ and the RD- input lines in response to a FIX POLARITY signal from a data polarity detection circuit 14. In the preferred embodiment of the present invention, the polarity correction circuit 12 responds to an assertion of the FIX POLARITY signal to internally reroute an RD+ signal to a Nsig output. Similarly, the polarity correction circuit reroutes an RD- signal to a Psig output. Ordinarily, without an assertion of the FIX POLARITY signal, an RD+ signal and an RD- signal would propagate to the Psig and the Nsig outputs, respectively. As discussed in the parent application, the correction circuit 12 could invert input signals upon an assertion of the FIX POLARITY signal to correct the incorrect polarity. A pair of threshold evaluating circuits 16 are attached to the polarity correction circuit 12 outputs, one to the Psig line and one to the Nsig line. A well-known comparator circuit operates for each of the threshold evaluating circuits 16 to provide amplitude qualification for input signals. Any input signal below a prespecified threshold voltage does not propagate past the evaluating circuits 16. These circuits 16 remove low level noise from the internal signal lines. Any input signal at Psig which exceeds the threshold voltage will propagate to a positive squelch line (PSQ) while Nsig signals exceeding the threshold voltage will propagate to a negative squelch line (NSQ). A transition sequence checking (SEQ) circuit 20 and a pulse width qualifying circuit (PW) 22 receive any PSQ and NSQ signals. The SEQ circuit 20 operates similarly to a transition sequence checking circuit described in the parent application to determine if a signal on the PSQ and the NSQ lines is a Manchester-encoded signal having a valid end-of-transmission (ETD) delimiter. If the SEQ circuit 20 detects a proper transition sequence, the SEQ circuit 20 asserts a carrier sense signal until transitions cease, as during the ETD. Lack of transitions at PSQ and NSQ cause the SEQ circuit 20 to deassert the carrier sense signal. Additionally, the PW 22 samples any PSQ and NSQ signals to determine if the signals might represent linkpulses rather than encoded data. Transmitted linkpulses have a particular waveform with a pulse width within a prespecified range. Pulses which are too narrow or too wide cannot be linkpulses and are rejected by the PW 22. Pulses with too many transitions are likewise rejected by PW 22. A reversal of the RD+ and the RD- input lines also inverts the linkpulses. Therefore, "upside-down" linkpulses can give an indication of incorrect polarity in their own right, in addition to the data packets. The preferred embodiment uses the ETD polarity when it is available in that the linkpulse polarity method is more susceptible to noise and therefore susceptible to erroneous indications of correct and reversed polarities. The PW 22 provides two output signals in response to assertions of a PSQ and an NSQ signal; receive link positive (RXLNKPOS) and receive link negative (RXLNKNEG). An assertion of PSQ for a duration falling within the established pulse width range will fire a one-shot circuit to assert a RXLNKPOS signal. Similarly, a desired pulsewidth on the NSQ signal will assert a RXLNKNEG signal. A link pulse reversal circuit 24 monitors assertions of both RXLNKPOS and RXLNKNEG to determine an initial polarity sense for the RD+ and the RD- input lines. For received linkpulses falling within an IEEE 10BASE-T standard, a PSQ assertion or a PSQ assertion followed by an NSQ assertion is a proper linkpulse sequence which asserts RXLNKPOS and is likely to be a link pulse. Therefore, an assertion of NSQ or an assertion of NSQ followed by PSQ may indicate that the RD+ and the RD- lines have a reversed polarity as the PW 22 asserts its RXLNKNEG signal. Thus, the link pulse reversal circuit 24 monitors for a series of successive consistent linkpulses and makes preliminary determinations of an RD+ and RD- polarity based solely upon the linkpulse information. The link pulse reversal circuit 24 asserts a link polarity signal if RXLNKPOS and RXLNKNEG assertions indicate that the RD lines have an incorrect polarity. The link pulse reversal circuit 24 monitors and changes polarity only when the differential receiver 10 is in its link_fail state as determined by a linktest state machine 26. The link test state machine 26 of the preferred embodiment implements a link integrity test according to an IEEE 802.3 Specification. This link integrity test specifies that a MAU incorporating the differential receiver 10 must receive a minimum number of linkpulses with the proper amount of delay between pulses before its linktest state machine 26 transitions it to a link_pass state. Alternatively, receipt of a valid data packet allows the linktest state machine 26 to transition to the link_pass state. Reversal of the RD+ and the RD- lines would prevent the linktest state machine 26 from ever entering the link_pass state in an absence of data packets if only positive linkpulses are accepted by the MAU. The linktest state machine 26 of the preferred embodiment enters the link_fail state upon power up or reset. To allow the linktest state machine 26 to operate properly with inverted linkpulses, a linkpulse polarity circuit 28 is responsive to a polarity signal from the link pulse reversal circuit 24 to route either the RXLNKPOS or the RXLNKNEG pulses to the linktest state machine 26, as appropriate. Additionally, as the linktest state machine 26 requires a particular number of consecutive linkpulses before it may transition to the link_pass state, when the link pulse reversal circuit 24 alters a particular polarity of the linkpulses, it asserts a signal to the linktest state machine 26 requiring the linktest state machine 26 to reset its consecutive linkpulse counter. In this fashion, only consecutive link pulses of like polarity will allow the linktest state machine 26 to transition to the link_pass state. Upon transitioning through a link fail_extend state to the link_pass state as described in the IEEE 802.3 10BASE-T standard, the linktest state machine 26 deasserts a linkfail signal which it asserts as long as it is in the link_fail state. The polarity detection circuit 14 and the link pulse reversal circuit 24 receive and respond to various states of the linkfail signal. Deassertion of the linkfail signal disables the link pulse reversal circuit 24 from further effecting a state of the link polarity signal and the particular one of the RXLNKPOS and RXLNKNEG signals directed to the linktest state machine 26. This disabling remains in effect until a reset occurs or the linktest state machine returns to the link_fail state, such as would occur, if for example, the polarity was locked-in incorrectly and the network had a period of light traffic, allowing the link integrity test to fail. The reader will note that a frequent exchange of data packets prevents transmissions of linkpulses. The polarity detection circuit 14 responds to various assertions of the PSQ, NSQ, carrier sense, link polarity and the linkfail signals to assert or deassert the FIX POLARITY signal to the polarity correction circuit 12. An initial determination of a state for the FIX POLARITY signal results from a status of the link polarity signal at a time when the linktest state machine 26 transitions to the link_pass state. Deassertion of linkfail simultaneously locks-in a state of the link polarity signal as well as influences the FIX POLARITY signal to initially have the same value as the link polarity signal. A detailed description of the specific operation of the polarity detection circuit 14 and the link pulse reversal circuit 24 follows the present description of the overall system. The initial polarity determination based on the link pulse information will not become final until polarity determinations based on received data verify the initial determination. The ETD polarity determinations are an improvement to the apparatus and method described in EP-A-0442 619. An assertion of PSQ or NSQ when the SEQ 20 deasserts carrier sense signal determines whether the polarity detection circuit 14 verifies a correctness of any particular established polarity. That is, an assertion of PSQ upon a deassertion of the carrier sense indicates that the presently established value of the FIX POLARITY signal is correct. In contrast, an assertion of NSQ upon a deassertion of the carrier sense changes a state of the FIX POLARITY signal, irrespective of its initial value established by the link polarity signal. The next valid ETD will test the previous determinations of polarity in the same fashion, either accepting or reversing the state of the FIX POLARITY signal. The polarity detection circuit 14 will continue to upgrade its last evaluation of the polarity status of the RD+ and the RD- lines until it counts a prespecified number of successive consistent determinations of a particular state for the FIX POLARITY signal. The polarity detection circuit 14 ignores invalid data packets and does not count them in any particular series. The invalid data packet, known as a packet fragment, does not include a valid ETD or otherwise include an ETD that is corrupted by noise. The preferred embodiment of the present invention requires two successive consistent polarity determinations. Counting two successive consistent valid pulses will lock-in the current state of the FIX POLARITY signal. Changing the state of the FIX POLARITY signal is possible thereafter only after reset or assertion of the linkfail signal, in the preferred embodiment. The term "consistent" conveys the concept that a second pulse (PSQ or NSQ) following a first pulse asserts a signal when it is consistent with a then present assumption made for a particular state of the input lines RD+ and RD-. In other words, if a first pulse does not appear inverted, an inverted subsequent pulse would not be consistent with the first determination that the input lines had the proper polarity. Similarly, an inverted first pulse would indicate polarity reversal, resulting in remedying the incorrect polarity. To be consistent with this determination, a second pulse must now appear non-inverted. A second pulse which was also inverted would not be consistent with the determination made based upon the first pulse. The present invention's focus upon the detection of polarity reversal for Manchester-encoded differential signals having a positive voltage level for the ETD ultimately means that consistency can only be obtained by having all pulses after an initial determination assert only PSQ upon a carrier sense signal deassertion. Any other combination would be inconsistent, preventing the polarity detection circuit 14 from locking-in a state for the FIX POLARITY signal. It is important that the polarity detection circuit 14 wait for the prespecified number of consistent pulses as noise can remain for an indefinite duration on the RD input lines after "plugging in" a MAU to the network, resulting in uncertain polarity determinations. In operation, the differential receiver 10 effectively and simply provides for automatic polarity detection and correction. There are many combinations and permutations of the different states of many key parameters for the system, so only a representative example of the operation of the system will be provided. Initially, the linktest state machine 26 is in a link_fail state, requiring receipt of a minimum number of linkpulses or a data packet before enabling output drivers of a MAU incorporating the differential receiver 10. A first scenario has the MAU wired properly. The receiver 10 will receive linkpulses or a full or partial data packet. Receipt of a first linkpulse asserts RXLNKPOS and PSQ without a carrier sense assertion. This is the expected sense for the linkpulse signal, and results in a deassertion of link polarity and a routing of RXLNKPOS to the linktest state machine 26 for counting. If the minimum consecutive number of linkpulses occur in the same fashion, then the linktest state machine will deassert linkfail as it transitions to the link_pass state, locking-in the deasserted value of link polarity signal to the polarity detection circuit 14. Thereafter, the first Manchester-encoded signal having a valid ETD will assert PSQ when the carrier sense is deasserted because the ETD remains at a high level for an extended period. The polarity detection circuit 14 logs the occurrence of a valid ETD and does not change the value of the FIX POLARITY signal. The next valid data signal will confirm the value of the FIX POLARITY signal because a PSQ assertion corresponding to a carrier sense deassertion is a consistent result, and locks-in the value of the FIX POLARITY signal until a reset or a linkfail condition occurs. The second scenario is similar to the first, except for a reversal of the RD lines. In this instance, the linkpulse signals result in an assertion of the RXLNKNEG signals, indicating a reversed polarity. The link reversal circuit adjusts the polarity for the linktest state machine by routing it the RXLNKNEG signals rather than the RXLNKPOS signals. The link pulse reversal circuit 24 also asserts the link polarity signal to provide the initial indication that the polarity is reversed. When the linktest state machine 26 counts the correct number of inverted linkpulses, it transitions to the link_pass state, preventing the link pulse reversal circuit 24 from changing the link polarity signal as well as asserting the FIX POLARITY signal to match the link polarity signal. The FIX POLARITY signal remains asserted until locked-in by confirmation through use of subsequent ETD polarity information. An input data signal will now assert PSQ when the carrier sense signal is deasserted. The polarity detection circuit 14 will log the occurrence of the valid ETD and the fact of the assertion of the FIX POLARITY signal. A subsequent consistent determination, PSQ with a deassertion of the carrier sense signal, will lock-in the assertion of the FIX POLARITY signal. The third scenario provides for noise on the RD input lines. The noise can adversely effect the linkpulses, or erroneously appear as linkpulses, as well as adversely effect any data inputs or emulate data, though the latter is the least likely. The noise will cause the link pulse reversal circuit 24 to alternatively route RXLNKPOS and RXLNKNEG to the linktest state machine 26, as well as correspondingly deasserting and asserting the link polarity signal. Whenever the link reversal circuit 24 makes a different polarity determination from its last determination, it resets the link pulse counter of the linktest state machine 26 which gives some margin of protection from noise-induced error. When the linktest state machine counts the minimum number of consecutive consistent linkpulses, it deasserts linkfail and locks-in the then present value of the link polarity signal. The initial value of the FIX POLARITY signal will match this locked-in value of the link polarity signal. The FIX POLARITY signal's final determination of polarity status for the input RD lines remains until received data confirms or refutes the link polarity initial determination. An assertion of NSQ corresponding to a deassertion of the carrier sense signal results in a reversal of the then present value of the FIX POLARITY signal. A subsequent assertion of NSQ with a carrier sense deassertion will continue to toggle the FIX POLARITY signal until a PSQ coupled with the carrier sense signal deassertion locks-in the then present value of the FIX POLARITY signal. FIG. 2 is a detail block diagram of the link pulse reversal circuit 24 and the link pulse polarity circuit 28. The link pulse reversal circuit 24 has four input signals, RXLNKPOS, RXLNKNEG, RESET, and linkfail. The link pulse reversal circuit 24 has three output signals, the link polarity signal, the linkpulse counter reset signal (LNKCNT RESET), and a control line for the link pulse polarity circuit 28. The link pulse polarity circuit 28 has four inputs, the RXLNKPOS and RXLNKNEG signals, the Linkfail signal and the control signal from the link pulse reversal circuit 24. The link pulse polarity circuit 28 provides the RXLINK signal to the linktest state machine 26 responsive to these signals. The link pulse polarity circuit 28 is a simple multiplexing circuit to choose a particular one of the RXLNKPOS and the RXLNKNEG signals to route to the linktest state machine 26 as the RXLINK signal which represents a linkpulse line. A two input NOR gate G100 receives the control signal from the link pulse polarity circuit 24 and the linkfail signal to control a multiplexer 102 which receives the RXLNKPOS and RXLNKNEG signals as input signals. Depending upon the output of the NOR gate G100, the multiplexer 102 will select a particular one of its input signals to route to an output as the RXLINK signal. The output value of the NOR gate G100 depends upon the state of the input signals, the control signal and the linkfail signals. As further described below, the control signal value is a complementary value to the link polarity signal. Thus, when the link pulse reversal circuit 24 deasserts the link polarity signal, it asserts the control signal, and vice versa. FIG. 4A is a logic table illustrating the relationship of the NOR gate G100 inputs and the output selected by the multiplexer 102. The control signal operates to indicate a polarity determination made by the link pulse reversal circuit 24, and as such, operates to route the proper RXLNKPOS or RXLNKNEG signal to the linktest state machine 26. However, the link pulse reversal circuit 24 functions to change linkpulse polarity when the linktest state machine is in the link_fail state. As soon as the linktest state machine enters the link_pass state, the system requires that the link pulse polarity circuit 28 route the RXLNKPOS signal as the RXLINK signal. This is possible because when the linktest state machine 26 enters the link_pass state, the initial polarity of the link polarity signal will influence the correction circuit 12 to change the wiring direction as appropriate. Thus, if the link polarity signal indicates that a reversed polarity of the input signals exists when the linktest state machine deasserts the linkfail signal, the correction circuit 24 will route RD- input signals to the Psig lines, which means linkpulses on the RD- line will manifest themselves as a RXLNKPOS signal, which is correct for reversed RD input lines. The link pulse reversal circuit 24 includes an RS latch 110 having an output coupled to a D flip-flop 112 data input. An output of the D flip-flop 112 provides the link polarity signal. An exclusive-or (XOR) gate G114 samples the D flip-flop 112 output and the RS latch 110 output, and if the signals are different, indicating a polarity change, then the XOR G114 asserts the LNKCNT RESET. A complementary output of the D flip-flop 112 provides the control signal to the link pulse polarity circuit 28. The reset signal clears the D flip-flop 112 and RS latch 110 outputs to a low level, that is, it deasserts the link polarity signal indicating no polarity reversal of the input lines. A low to high (positive edge triggered) transition on a clock (CK) input of the D flip-flop 112 latches a value present at the D input, the RS latch 110 output, to its output. An output of a dual-input NAND gate G116 controls the CK input of the D flip-flop 112. Qualified RXLNKPOS and the RXLNKNEG signals are input to the RS latch 110 and to the NAND gate G116. A dual-input NAND gate G120 has the RXLNKNEG signal as one input and the linkfail signal as the other input. Similarly, a dual-input AND gate G122 has the RXLNKPOS signal as one input and the linkfail signal as the other input. A dual-input NOR gate G124 has the RESET signal as one input and an output of the AND gate G122 as the other input. The RS latch 110 has a set input and a reset input with inverted senses. That is, a deassertion of a signal on the set input will set (assert) the RS latch 110 output and a deassertion of a signal on the reset input will reset (deassert) the RS latch 110 output. An output of the NAND gate G120 provides the set input signal to the RS latch 110 and an output of the NOR gate G124 provides the reset input signal to the RS flip-flop 124. Additionally, the outputs of the NAND gate G120 and the NOR gate G124 provide the two input signals for the NAND gate G116 which controls the D flip-flop 112. Initially, after a power up or a reset, the D flip-flop 112 deasserts the link polarity signal and the linktest state machine 26 asserts the linkfail signal. A first assertion of one of the RXLNKPOS or the RXLNKNEG signals will either reset or set the RS latch 110, respectively. An assertion of the RXLNKNEG signal will set the RS latch 110, as well as produce an assertion of the NAND gate G116 output. Asserting the NAND gate G116 outputs clocks the set value of RS flip-flop 112 to the link polarity signal output, thereby clocking in a previous value of the RS latch 110. Another assertion of either RXLNKPOS or RXLNKNEG latches an appropriate value at the RS Patch 110 output and the asserted output of the latch into the D flip-flop 112. The XOR gate G114 will assert the RESET LNKCNT signal and the deasserted control signal will route RXLNKNEG to the linktest state machine 26 as the RXLINK signal. The RXLNKPOS and the RXLNKNEG signals will continue to effect the link polarity signal, with the RXLNKPOS signal deasserting the link polarity signal and the RXLNKNEG signal asserting the link polarity signal until the linktest state machine enters the link_pass state. At which time, the assertions of the RXLNKPOS and the RXLNKNEG signals can no longer effect changes in the link polarity signal. FIG. 3 is a detail block diagram of the polarity detection circuit 14 according to a preferred embodiment of the present invention. The polarity detection circuit 14 receives six input signals, the PSQ, NSQ, carrier sense, linkfail, link polarity and the RESET signals to control the FIX POLARITY signal. There are two parts to the link polarity detection circuit, a ETD polarity part primarily responsive to the PSQ, NSQ and the carrier sense signals and a link polarity part primarily responsive to the linkfail and the link polarity signals. The two parts mutually coact to provide a reliable polarity detection apparatus in the preferred embodiment, with the ETD polarity part dominant. However, a system employing only one of the two parts may, in particular applications, be effective to provide satisfactory performance. A dual-input NAND gate G200 merges information from the two parts to provide a data output to an NLAT 202. The NLAT 202 is an inverting output level sensitive latch which, for as long as a signal is asserted at a clock (CK) input, continually changes its output in response to logic changes at its data input (D). An inverted carrier sense signal controls the latching of the NLAT 202. A dual-input NOR gate G204 has the NLAT output as one input and the RESET signal as another input, with an output providing the FIX POLARITY signal. The link polarity part comprises a triple-input NAND gate G206 which receives an inverted linkfail signal as one input and the link polarity signal as another signal. A control signal from the ETD polarity part permits the ETD polarity part to override the link polarity determinations and is input at the third input of the NAND gate G206. An output of the NAND gate G206 provides the polarity information of the link polarity part to one input of the NAND gate G200. The ETD polarity part comprises three D flip-flops 210, 212 and 214, two dual-input AND gates G220 and G222, a triple-input OR gate G224, a dual-input XOR gate G226, and a dual input OR gate G228. The OR gate G228 has the linkfail signal as one input and the RESET signal as the other input and an output coupled to a reset input of the three D flip-flops 210, 212 and 214. An assertion of either the linkfail or the RESET signal deasserts all the D flip-flop outputs and asserts all the complementary outputs. The D flip-flops 210, 212 and 214 have clock (CK) inputs which cause a logic level present at a data (D) input to latch to an output when the CK input transitions from a high to a low voltage level. An output signal from the NAND gate G222 provides the CK inputs to the D flip-flops 210, 212 and 214. The carrier sense signal is one input and a complementary output signal from the D flip-flop 210 is the other input. The D flip-flop 210 complementary output to the NAND gate G222 provides the locking mechanism for the polarity detection circuit 14. As long as the D flip-flop 210 asserts its complementary output, a falling edge of the carrier sense signal will clock the various D inputs of the D flip-flops. A deasserted complementary output of the D flip-flop 210 disables further changes in the D flip-flop values until the D flip-flops are reset. An output signal of the AND gate G220 controls a logical value of the complementary output of the D flip-flop 210. The PSQ signal is one input of the AND gate G220 and a Q output of the D flip-flop 212 is the other input. Thus, concurrent assertions of both the output of the D flip-flop 212 and the PSQ signal when the carrier sense signal transitions to zero results in a deassertion of the complementary output of the D flip-flop 210. An assertion of the output of the D flip-flop 212 indicates a previous sampling of a valid ETD has occurred while the assertion of PSQ indicates the currently sampled ETD has a polarity consistent with the present polarity indicated by the FIX POLARITY signal. A complementary output of the D flip-flop 212 is the control signal to the link polarity part, that is the third input of the NAND gate G206. The signal, when asserted, indicates a valid ETD has not been received, therefore the link polarity should establish the initial polarity. An output signal of the OR gate G224 controls a logical value of the output and the complementary output of the D flip-flop 212. The PSQ and NSQ signals and the output of the D flip-flop 212 are input signals of the OR gate G224. An assertion of any of the three input signals results in an assertion of the D flip-flop 212 output when the carrier sense signal falls. An output of the XOR gate G226 controls a logical level value of a complementary output of the D flip-flop 214. The D flip-flop 214 stores information regarding detection of a reverse polarity of the input lines. The complementary output of the D flip-flop 214 is the output of the ETD polarity part and provides the second input into the NAND gate G200. The output of the NAND gate G200 is one input of the XOR gate G226, whose other input is the NSQ signal. An assertion of either one, but not both, of the inputs of the XOR gate G226 results in a deassertion of the D flip-flop 214's complementary output. This deassertion in turn asserts the G200 output, resulting in an ultimate assertion of FIX POLARITY signal. The connection of the NAND gate G200 output to the XOR gate G226 input allows the link polarity part to inform the data part as to the link polarity status upon receipt of a valid ETD. In operation, the polarity detection circuit will initially use the value of the link polarity signal as the FIX POLARITY signal upon a deassertion of the linkfail signal. As soon as the SEQ circuit 20 detects an ETD and deassertion carrier sense, a D flip-flop will respond to an assertion of one of the PSQ or the NSQ signals. That is, an assertion of the PSQ signal will assert the output of the D flip-flop 212 logging a valid ETD as well as disabling the link polarity part by negating the complementary output. A second assertion of the PSQ signal will lock-in the FIX POLARITY signal, indicating that the link polarity part's initial determination was incorrect. An assertion of the NSQ signal on the other hand, will toggle the value of the FIX POLARITY signal by asserting the complementary output of the D flip-flop 214. Subsequent assertions of the NSQ signal will continue to toggle the value of the FIX POLARITY signal until an assertion of the PSQ signal locks-out further change by disabling the carrier sense signal from clocking further changes. In conclusion, the present invention enhances performance of automatic polarity detection methods and apparatus by using linkpulse information to establish an initial polarity determination in an absence of data packet transmissions on a network. The reliance on the use of the ETD polarity information to lock-in a particular polarity provides greater immunity from noise on the input lines. While the above is a complete description of the preferred embodiment of the present invention, it is possible to use various alternatives, modifications and equivalents. For example, various signals having ETDs received as a differential signal could be corrected by use of the present invention. Additionally, signals characterized as keep-alive signals or heartbeat signals which have a particular polarity or transition sequence could be implemented similarly to the linkpulse signal circuits. The RESET LNKCNT signal in Figure 1 does not necessarily need to be used; the Linktest circuit 26 can be utilized to discriminate noise from actual link pulses instead of using both the Link Pulse Reversal circuit 24 and Linktest circuit 26 to check pulse validity. In this variation, the LINK POLARITY signal can be used by itself to determine polarity, or, LINK POLARITY can be qualified by the RESET LNKCNT signal to indicate the LINK POLARITY signal accuracy by inverting RESET LNKCNT and adding it as another input to gate G-206 in Figure 3. Therefore, the above description does not limit the scope of the present invention. Rather, the appended claims define the present invention.

Claims: A differential signal polarity reversal detection apparatus (10) comprising: a first and a second input for receipt of complementary differential signals and linkpulse signals; means (20), coupled to said first and second inputs, for asserting a carrier sense signal while a first and a second input signal at said first and second inputs, respectively, correspond to a valid prespecified format; characterised by means (22), coupled to said first and second inputs, for asserting one of a first and a second link signal if an input signal at said first and second inputs, respectively, corresponds to a linkpulse signal; means (24), coupled to said first and second link signals, for asserting a link polarity signal if said asserted one of said first and second link signals indicate said first and second inputs have a reversed polarity, said link polarity signal asserting means (24) deasserting said link polarity signal if said asserted one of said first and second link signals indicates said first and second inputs have a correct polarity; means (14), coupled to said first and second inputs and responsive to said carrier sense signal, for asserting an ETD polarity signal if said first and second inputs have reversed polarity based upon receipt of a valid ETD having a first voltage range, said ETD polarity signal asserting means deasserting said ETD polarity signal if said first and second inputs have correct polarity based on receipt of a valid ETD having a second voltage range; and means (14), coupled to said ETD polarity signal asserting means and to said link polarity signal asserting means, for asserting a fix polarity signal if either one of said ETD polarity and said link polarity signals is asserted. The apparatus of claim 1 further comprising: means (14), coupled to said fix polarity signal asserting means, for providing said ETD polarity signal with precedence over said link polarity signal in control of said fix polarity signal. The apparatus of claim 1 or 2 further comprising: means (12), coupled to said fix polarity signal asserting means, for remedying a reversed polarity if said fix polarity signal is asserted. The apparatus of claims 1, 2 or 3 wherein said ETD polarity asserting means (14) samples one of said first and second inputs for a particular voltage level when said carrier sense signal is deasserted. The apparatus of any one of claims 1 to 4 wherein said fix polarity signal has a first state indicating said first and second inputs have said correct polarity and a second state indicating said first and second inputs have said reversed polarity. The apparatus of claim 5 further comprising: means for inhibiting said fix polarity signal from having said second state. The apparatus of any one of claims 3 to 6 wherein said remedying means includes means (12) for rerouting signals at said first and second inputs to said second and first inputs, respectively. The apparatus of any one of claims 1 to 7 further comprising: means for locking-in polarity correction after receipt of a prespecified number of consistent and valid end-of-transmission delimiters. The apparatus of any one of claims 1 to 8 wherein the valid prespecified format includes a particular transition sequence. A method for correcting a reversed polarity for a differential signal, characterised by the steps of: receiving a first and a second input differential input signal; establishing whether said first and second input signals have a pulse width within a prespecified range for linkpulse determination; asserting a link polarity signal if said first and second input signals have said pulse width within said specified range and said input signals are inverted linkpulse signals; establishing whether said first and second input signals comprise valid end-of-transmission delimiters; asserting an ETD polarity signal if said valid end-of-transmission delimiter comprises an inverted ETD and deasserting said ETD polarity signal if a subsequent ETD establishment of said input signals indicates said input signals are inverted; asserting a FIX POLARITY signal if said link polarity signal is asserted until a deassertion of said ETD polarity signal, said FIX POLARITY signal also asserted if said ETD polarity signal is asserted; and remedying a reversed polarity if said FIX POLARITY signal is asserted. The method of claim 10 wherein said remedying step includes the step of rerouting input signals received at said first input to travel a path that signals received at said second input would travel in an absence of said assertion of said FIX POLARITY signal, and rerouting input signals received at said second input to travel a path that signals received at said first input would travel in an absence of said assertion of said FIX POLARITY signal.

Inventors: BLUMENTHAL JEFFREY M, CRAYFORD IAN S, VIJEH NADER, WINCN JOHN M, BLUMENTHAL, JEFFREY M., CRAYFORD, IAN S., VIJEH, NADER, WINCN, JOHN M.
Applicants: ADVANCED MICRO DEVICES INC, ADVANCED MICRO DEVICES, INC.
Application year: 1991
Main classification: H04L25
IPC codes: H04L25, H03M5, H03M7