Abstract:
Systems allowing smooth, trouble-free, &#34;transparent&#34; switchover from a &#34;Primary clock&#34; to a &#34;Secondary clock&#34;, with no loss of clock or essential pulse-width, and where the &#34;Secondary clock&#34; may be completely separate from, and independent of, the &#34;Primary clock.&#34;

Description:
This is a division of U.S. Ser. No. 08/339,426, U.S. Pat. No. 5,467,468 filed Nov. 14, 1994 which, in turn, is a Division of U.S. Ser. No. 07/737.303, filed Jul. 29, 1991 (now U.S. Pat. No. 5,381,542). 
    
    
     This case relates to clock systems for redundant computer arrangements and more particularly to techniques for automatically switching between two or more clock-generating systems (cards), 
     BACKGROUND FEATURES 
     In present computer systems, a &#34;halt load&#34; condition typically results when one switches clock generation from one card to another. This typically corrupts the system, causing loss-of-memory (e.g. because related microprocessor etc. is unable to tolerate clock pulses which are stretched or foreshortened)--hence, loss of the application program being run (at the time of failure) and causes system &#34;down-time&#34; because of the &#34;halt load&#34;. An example is the arrangement in FIG. 1, with clock-cards #1B, 1B&#39; coupled to switchover circuit 1A. 
     This invention allows switchover of system clock generation and distribution: from a primary card to a secondary (back-up) card, with no loss of clock and essential pulse-width requirements maintained, giving a switchover which is &#34;transparent&#34; to the system. 
     This invention also provides a system designed so that loss of power on one clock-generating card (CGC) does not disturb the (connected) circuit operation of a companion CGC. 
     As a supplemental feature, this invention teaches the possible use of micro-controller means to control such &#34;Dynamic Clock Switch-over&#34;, using a clock source which is separate from the system clock, and is independent. 
     Workers have for some time been concerned with the problem of switching from one clock source to another [e.g. see U.S. Pat. No. 4853653 to Maher for &#34;Multiple Input Clock Selector&#34;, but this system must be &#34;halted&#34; before switching clocks; whereupon pulse width is stretched for several clock cycles to avoid generation of short (&#34;runt&#34;) pulses--such is not acceptable for systems using a microprocessor, as with this invention, where pulse-width requirements must be maintained.] Also, this invention allows the use of asynchronous clocks, with no analogous problems of stability or anomalous (&#34;runt &#34;) signals. 
    
    
     BRIEF DESCRIPTION OF DRAWINGS 
     For a more complete understanding of this invention and further features and advantages thereof, reference should be made to the following, in conjunction with the accompanying drawings, in which: 
     FIG. 1 is a block diagram of a general clock switch-over system that allows switch-over, but only in one direction; 
     FIG. 2 is a like generalized diagram of a two-clock/two-block switchover system according to this invention; that allows switchover repeatedly, in both directions; 
     FIG. 3 is a more detailed functional diagram of one of the two (like) blocks in FIG. 2; 
     FIG. 4 (4A, 4B) is a more detailed logic circuit of a preferred embodiment of the system of FIG. 2; while FIG. 4C is an associated Timing Diagram; and FIG. 5 diagrams a test circuit controlling inputs to FIGS. 4A, 4B, and FIG. 6 shows the associated command sequence; and 
     FIG. 7 shows typical &#34;clock buffer output enables&#34; for repeated switchover operation. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENT 
     In General: FIGS. 2, 3 (details in FIGS. 4A, 4B): 
     FIG. 2 will give a general sense of this invention. Here, a pair of Switchover Circuits A, B are shown (e.g. each like FIG. 3), each consisting, essentially, of a Phase-Compare circuit PCC feeding a Clock-Control circuit CCC which, at proper times, and under control of a Clock-Internal Control circuit CIC, issues a respective clock-output-enable signal (cf. O-A, O-B). Each CCC is also coupled to (all other) companion CIC stages so as to apply &#34;disable&#34; signals thereto when its own CIC is enabled (at instant of switchover). Switch-over is initiated upon detection of a prescribed &#34;switchover event&#34; (see below) and is executed upon detection of phase alignment. 
     Workers will appreciate that, in this fashion, one can switch over, from one clock to the other, any number of times and in either direction--yet without experiencing any &#34;Halt Load&#34; or like interruption, and without any resulting &#34;downtime&#34; or loss of program. [cf. whereas only one dynamic switchover circuit is necessary for switching in only one direct ion]. 
     FIG. 3 illustrates a preferred Dynamic Clock Switchover embodiment (e.g. A or B in FIG. 2) in very schematic, general, block diagram fashion, expanding on FIG. 2. 
     Here, a &#34;Phase Comparison Stage&#34; PCC is arranged to received system clock signals; i.e. CLK INT from Backup clock card and CLK EXT from primary clock card; a &#34;power-up-clear&#34; signal (usually from associated system power logic; e.g. cf. associated microcontroller MC in FIG. 5), plus a &#34;Primary Select&#34; signal and a &#34;Switchover Enable&#34; signal. [here assume &#34;CLK EXT&#34; in FIG. 3 is the clock signal from the &#34;primary&#34;, or operating, clock source, while &#34;CLK INT&#34; is the clock signal from the internal/backup source.] 
     Phase Comparison stage PCC is arranged and adapted to issue an &#34;OK-to-Switch&#34; signal (to its &#34;Clock Control Stage&#34; CCC) when the clocks are found to be properly &#34;aligned&#34;. 
     Clock Control Stage CCC is arranged and adapted to also receive the same &#34;Power-Up-Clear&#34; and &#34;Primary Select&#34; signals and to issue a &#34;CLK EXT DISABLE OUT&#34; signal, as well as an &#34;enable&#34; signal (to a prescribed CLK INT CONTROL CIRCUIT CIC) when it receives an &#34;OK-to-switch&#34; signal. 
     Clock Internal Control Circuit CIC is arranged and adapted to issue a &#34;CLK Buffer Enable&#34; signal to turn its clock buffers ON or OFF and to receive a &#34;CLK EXT Disable In&#34; signal that will turn off its clock buffers when it has been designated the &#34;primary&#34; and clock switchover is occurring to the backup card. 
     Dual Switchover Circuit Operation (FIG. 3) 
     System Initialization 
     1) &#34;Power-up clear&#34; signal disables both the SCM board clock drivers (FIG. 4) by driving &#34;CLK Buffer Enable&#34; inactive. 
     2) The microcontroller (on each card shown in FIG. 2) initializes and establishes a low on &#34;primary select&#34; and a high on &#34;switchover enable&#34; outputs, before &#34;power-up clear&#34; goes high. 
     3) &#34;Self-test&#34; is run and a decision is made as to which card is designated &#34;primary&#34; and which is &#34;secondary&#34; (back-up). 
     4) The micro controller, on the card (clock) designated &#34;primary&#34;, sets &#34;primary select&#34; high, enabling the system clocks on that board. 
     Switchover: 
     1) Switchover will be initiated upon detection by microprocessor of a &#34;Switchover-Event&#34; such as detection (by microprocessor) of a logic-fault or dropping of power on the clock card (or in the &#34;primary cabinet&#34; when 2+cabinets/partitions are used--a &#34;partition&#34; will be understood as two systems in one cabinet--these &#34;Events&#34; being defined and detected according to the user&#39;s discretion and as known in the art; for instance, a controlling microprocessor may be set to disable power and thus initiate the Switchover when it detects some error condition). 
     2) Whereupon, the secondary micro-controller sets &#34;switchover enable&#34; low, enabling the clock switchover operation by activating (its) Phase Compare stage PCC. 
     3) Thereafter, when the clocks are in proper &#34;alignment&#34; (or prescribed phase relation--phase relation being understood as depending on clock frequency and values of system components) the &#34;primary clock&#34; is disabled and the &#34;secondary&#34; clock enabled at the same instant. Preferably, &#34;Primary&#34; is disabled and &#34;secondary&#34; enabled during the &#34;high portion&#34; of the clock pulse for a smooth transition. 
     Switching Back to &#34;Primary&#34;: 
     1A) Thereafter, when the system perceives that the initiating &#34;Switchover-Event&#34; (Switchover-Condition) no longer prevails (e.g. logic fault cured, power then reapplied to Primary card/cabinet), this Switchover Circuit will automatically switch back to the &#34;primary clock&#34;. 
     2A) To do this the &#34;secondary clock&#34; must first temporarily become the &#34;primary&#34;. That is, first, the &#34;primary select&#34; on the &#34;actual primary&#34; gets set low, placing it in Back-up status. On the next clock-of the &#34;actual-primary&#34; (which later becomes the &#34;secondary&#34;), &#34;primary select&#34; can be set high. The &#34;former-secondary&#34; clock is now the primary clock. 
     3A) Repeat steps #1 and #2 of &#34;switchover&#34; above, then repeat step #1A here, (i.e. &#34;switching back to primary&#34;) to get the clocks back to the original primary. 
     Implementation in a Gate Array: 
     Because the circuit of FIG. 4A is here understood as implemented in a gate array, (except for delay line), test paths have been added to insure the functionality of the flip-flops. During test, Scan-1 is set high to select the SDI input; also Testmode-O is set low to disable the &#34;hold&#34; feature on the Clock Control flip-flop. The Output of the last flip-flop can be read at the &#34;Ck-Dis-Out&#34; Output. 
     CLOCK SWITCHOVER CIRCUIT DIAGNOSTICS 
     It will be understood here that a pair of Switchover Circuits (e.g. each as in FIG. 3) are to be connected in tandem as in FIGS. 4A, 4B. And, upon initialization, such a pair of clock switchover circuits, will be tested for functionality, i.e. by switching from one clock card to the other, and vice versa. To insure this capability, the circuit can be tested; e.g. with a test circuit as in FIG. 5. This test-control circuit is designed and operated to simulate commands from the micro-controller. The circuit is designed to operate continuously so that it can be observed using a real-time oscilloscope. FIG. 6 shows the associated command sequence. The test circuit &#34;holds&#34; until switchover occurs; then, once switchover is detected, commands are issued to switch back in the opposite direction. 
     FIG. 7 shows associated clock buffer &#34;output enables&#34; for cards 1 and 2 (operated at room temperature). These are opposite logic levels, with switching as expected. Switchover time will vary depending on how close the oscillator frequencies are to one another. 
     detail; of FIGS. 4A, 4B: 
     FIGS. 4A, 4B illustrate a preferred implementation of this FIG. 2, FIG. 3 system, (with like parts identically labeled), with a like preferred clock switchover CKT indicated on each of the two respective cards (Primary CLK on Card 1, Backup on Card 2). Here, the system will be understood as implemented in a CMOS gate array chip which has self-diagnostic features added. The operational description given here assumes the use of discrete IC logic, but without diagnostics, (for simplicity). Note Primary Card 1 with PCC 37, CCC 38 and CIC 39; Back-up card 2 with PCC 31, CCC 33 and CIC 35. 
     Since the two cards are essentially identical, only card 190 2 will be elaborated. CIC circuit 35 includes an AND gate 10 fed by output from CC circuit 33 and an external disable line (comprising voltage source VCC and pull-up resistor r-1). CC circuit 33 comprises an AND gate 11 fed by &#34;Primary Select&#34; and &#34;POWER-UP Clear&#34; signals, plus an OR gate 9 fed by output from gate 11 and by output from PC circuit 31. PC circuit 31 comprises a pair of phase-comparison flip-flops 1, 2, feeding an associated AND gate 4 which, in turn, feeds a storage flip flop 3. (flip flops 1, 2, 3 are all D-Type, with individual &#34;clock&#34; and &#34;clear&#34;). Non-inverted output from FF3 is fed to CC circuit 33 as well as to AND gate 5 (along with the inverse of &#34;Primary Select&#34; via inverter 13). AND gate 5 inputs OR gate 6 along with &#34;External Clock&#34;. Output from delay line 0 inputs FF2 and is adapted to control clock frequency. Inverter gate 13 inverts &#34;Primary Select&#34; input, while inverter gate 7 inverts the &#34;OK to switch&#34; signal. 
     Operation of FIGS. 4A, 4B: 
     First, after &#34;Power-up&#34;, the &#34;Power Up Clear&#34; signal goes low. This clears the Phase Comparison Circuit output (FF #3 in PCC 31, FIG. 4A) to a low, and prevents a (yet-undetermined) Primary Select input (AND gate 11) from propagating through gates 9 and 10, to enable the clock buffers. [avoids a &#34;bus contention&#34; problem]. After system stabilization, the &#34;Power Up Clear&#34; signal goes high, enabling AND gate 10 for &#34;Primary Select&#34; to occur. 
     Next, &#34;Primary Select&#34; is set high on the designated primary clock card (cf. PCC 37, CCC 38), enabling its clocks. &#34;Primary Select&#34; remains low on the designated backup clock card. (going to PCC 31, CCC 33). 
     CLOCK SWITCHOVER 
     Phase Comparison Circuit (PCC): 
     Upon detection of a &#34;Switchover Event&#34; (see above), a controller (e.g. preferably microprocessor or microcontroller, etc.) sets &#34;Switchover Enable&#34; high on the backup clock card, enabling the phase comparison with &#34;D&#34; Flip-Flops 1 &amp; 2, (FIG. 4A). 
     The Primary clock source (Clock External, see CLK EXT, FIG. 3) and Backup clock source (Clock Internal) are checked for phase relationship. The Ext Clk is delayed by a delay stage (see delay line O, FIG. 4A) by two different amounts, each one clocking a respective one of flip flops 1 &amp; 2. When both 1 and 2 are high, &#34;phase alignment&#34; is &#34;acceptable&#34;; so AND gate 4 goes high, and this is registered on the next Ext Clk in FF 3. The registered high output is ANDed at 5, with the &#34;high&#34; inputted from the inverted-Low of &#34;Primary Select&#34;. This &#34;high&#34; goes to OR gate 6 which prevents further clocking of the register flip-flop 3. 
     Clock Control Circuit (CCC, 33): 
     At the same time, the output high of FF3 (called &#34;OK to Switch&#34;) goes to the clock control circuit CCC(33) which inverts it and sends out a low on Clk Ext Disable Out line. This signal goes to the primary clock card&#39;s internal control circuit 39 and disables (tristates) the clock buffers while in a high output state. The clock buffers are terminated with a &#34;pull-up&#34; (or split termination) and so remain in a high output state when tristated. This is done by causing the output of AND gate 8 in CIC 39 to go low. The other input to AND gate 8 (from CCC 38) is high. 
     And, at the same time, the &#34;OK to Switch&#34; signal goes to the OR gate 9 input where it causes the output to go high. The other input to OR gate 9 is Low. 
     Clock Internal Control Circuit (CIC, 35): 
     This high from gate 9 goes to AND gate 10 whose other input is high. The output of AND gate 10 goes high, enabling the clock buffers, which now go from a tristate condition to a high logic level. (Clock inputs are still high. ) The clocks are now completely switched to Backup Card 190 2 (FIG. 4A). 
     SWITCHING BACK TO PRIMARY 
     It is possible to switch clocks from the backup card (cf. Card 2, FIG. 4A) back to the primary card (Card 1, FIG. 4B). First, the &#34;Switchover Enable&#34; signal is set low on the Backup Card (FIG. 4A), clearing FF&#39;s 1 &amp; 2 and causing the output of AND gate 4 to go low. 
     &#34;Primary Select&#34; on primary card #1 gets set low, throwing it into &#34;backup&#34; status. Then, &#34;Primary Select&#34; on the backup card (#2 , FIG. 4A) is set high, and so converts card-2 into the &#34;Primary&#34; card. When &#34;Primary Select&#34; thus goes high, it propagates through AND gate 11 to OR gate 9--this keeping the output of OR gate 9 high, and thus keeping the clock buffers enabled through AND gate 10. 
     As this occurs, the &#34;Primary Select&#34; high is inverted, causing the output of AND gate 5 to go low. This allows &#34;Clk Ext&#34; to go through OR gate 6 to FF 3. Since the output of AND gate 4 is low, the next clock to FF 3 will cause the output to go low. This will go to OR gate 9 where it will have no effect since &#34;Primary Select&#34; is already high. 
     To switch back to the original primary card (Card #1, FIG. 4B,) the sequence of clock switchover and switch-back (to primary) is repeated. This time, the original (primary) card is the &#34;backup&#34; card. 
     FIG. 4-C is a Timing diagram to illustrate typical time relations, for a 16 MH Z  clock, between the signals in FIGS. 4A-4B, as implemented on a clock gate array chip. [note, &#34;acceptable alignment&#34; extremes are labeled aa, bb, respectively]. 
     Note that, because of delay lime tolerance and register setup time variance, the CLKINT signal could go high as late as 17 ns, and could go low as early as 36.5 ns. The CLKINT enable delay must therefore fall between 17 ns. to 36.5 ns. The CLKEXT delay can be anywhere from 0 to 31.5 ns. 
     Workers will note the efficiency of each dynamic switchover circuit (FIGS. 4A, 4B), each requiring only one resistor (r-1), one delay line (cf. O), two inverter gates (cf. 7, 13), two OR gates (cf. 6, 9), four AND gates (cf. 4, 5, 10, 11) and three D-flip-flops (cf. 1, 2, 3; each with individual &#34;clock&#34; and &#34;clear&#34;). 
     DYNAMIC CLOCK SWITCHOVER CIRCUIT-SUGGESTED MODIFICATIONS 
     The Dynamic Clock Switchover Circuits described above will be understood as an implementation for a 2-clock system. Each includes a back-up clock generation card for switching clocks from a primary card to itself when given the switchover command. It will also switch clocks back to the primary when given the indicated command sequence (e.g. see FIG. 6). 
     However, workers will appreciate that such arrangements can be adapted to monitor any number of clocks by adding additional &#34;phase comparison stages&#34;, to switch from any of those clocks to itself, or (with slight modification) from itself to any of those clocks. 
     The upper limit of clock frequency that can be monitored is determined by the logic used in the Dynamic Clock Switchover Circuit. (This application was for 16 MH Z  implemented in a CMOS gate array. ) There is theoretically no lower frequency limit. 
     Conclusion: 
     It will be understood that the preferred embodiments described herein are only exemplary and illustrative, and that the invention is capable of many modifications land variations in construction, arrangement and use, without departing from the spirit of what is claimed. 
     For example, the means and methods disclosed herein are also somewhat applicable to other related computer systems and associated timing circuits. And, this invention is applicable for clock cards for other like systems. 
     Accordingly, the present invention should be considered as encompassing all possible modifications and variations coming within the scope of the following appended claims.