Abstract:
To provide for efficient use of computer microcodes, a firmware structure containing a mainline programmable logic array circuit and at least one subroutine programmable logic array circuit may be used. As the states of the mainline programmable logic array circuit are sequenced, the data bits representing the encode number field in its OR array are compared with the data bits representing the encode number field of the AND array of the subroutine programmable logic array circuit. If a match is made, the mainline programmable logic array circuit suspends its operation and sequencing of the subroutine programmable logic array circuit begins, in order to perform the function required. Upon completion of the function, control is automatically transferred from the subroutine programmable logic array circuit back to the mainline programmable logic array circuit, at the point where it was suspended. By nesting a plurality of subroutine programmable logic array circuits, a plurality of functions, many of which may be performed simultaneously, can take place.

Description:
FIELD OF THE INVENTION 
     This invention relates to microcode control apparatus for use in microprogrammed data processors and digital computers wherein a sequence of microwords is used to control the execution of each of the processor instructions. 
     BACKGROUND OF THE INVENTION 
     In a microprogrammed data processor, microwords, or microinstructions, are read from an internal storage unit to provide internal processor control actions for executing the processor instructions obtained from a user&#39;s software program. The microwords are read from the storage unit and written to a control register one at a time. Each microword consists of multiple binary bits, some or all of which may be organized into pluralbit control groups or fields. The control register provides control point signals which, in turn, control the various data flow rate and data manipulation mechanisms within the data processor, with each microword controlling the internal operation of the data processor for one microword cycle. Several microwords are usually needed to execute each processor instruction. Some processor instructions require only a few microwords, while others require many. 
     The microwords may be located in a separate so called &#34;control storage&#34; unit, or they may be located in a portion of the processor&#39;s main memory set aside for the exclusive use of the microwords. Furthermore, microwords may also be stored in read only storage units (ROS). 
     Alternatively, the control storage unit and its associated addressing circuitry can be replaced by a programmable logic array (PLA), working in conjunction with a sequence counter. The PLA is driven by an operation code portion of the processor instruction and a particular sequence count from the sequence counter for producing a particular microword at its output. Such a PLA and sequence counter combination is able to provide significant savings in the size of the real estate (in terms of the area within the data processor) required--when the PLA is compared to the conventional storage unit. If a desired number of repetitions for a certain microcode is needed, a fixed capacity repeat counter for counting the number of microcode loops in order to terminate the looping action at a certain count is also required. For different types of processor instructions where the number of microcode loops are different, a different number of fixed capacity repeat counters may also be needed, thereby further burdening the data processor. 
     U.S. Pat. No. 4,556,938 (incorporated herein by reference to this application) discloses the use of a programmable repeat counter which can be loaded with different initial count values for different processor instructions, in order to provide different numbers of repeats for the different microcode loops needed for the different instructions. Although such an arrangement is able to reduce the amount of circuitry needed in those situations where microcode looping is provided for two or more different processor instructions, the fact remains that--when working in concert with the programmable repeat counter--the PLA can only generate one microword at a time. In other words, if an instruction requires the execution of a given action X number of times, the PLA needs to repeat all of the operations preceding (or following) this action the same X number of times in order to bring about this action, notwithstanding the fact that quite a few of these operations may not be necessary and in fact may actually take up valuable time. This necessarily leads to crude and inefficient processing of the computer microcode, thereby resulting in the unnecessary implementation of an excessive number of product terms (lines of microcode) to perform each job. 
     SUMMARY OF THE INVENTION 
     This invention allows efficient usage of computer microcode by configuring a logic array (PLA), which is referred to as a &#34;mainline&#34; PLA, to effectively incorporate a firmware subroutining mechanism into the data processor. 
     The mainline PLA, in controlling the subroutine PLAs, utilizes an encoded number, in the form of a multiple number of data bits, provided from its output partition (OR array) to the input partition (AND array) of the subroutine PLA(s) it is addressing. The addressed subroutine PLA becomes operative if the encoded number data bits from the mainline PLA match predetermined data bits in its encoded number field. At that point, the mainline PLA goes into a state of suspension (although control point signals are still being output therefrom), while the states (i.e. the addresses) of the addressed subroutine PLA are incremented to perform the operation it is preprogrammed for. The subroutine PLA continues to implement the operation and provide as its output the necessary control points, until it has been incremented by its corresponding sequence counter into a state whereby it is informed that the operation no longer needs to be implemented (or that the operation is finished). At that time, a data bit is sent from the subroutine PLA to the mainline PLA for automatically reinitializing, or reinstating, the incrementation of the mainline PLA. 
     As the mainline PLA is again incremented, different subroutine PLAs, which can perform different operations, can be addressed by the mainline PLA. These additional subroutine PLAs can be positioned, relative to the mainline PLA, at different levels. Moreover, an unlimited number of subroutine PLAs can be nested together such that a plurality of different levels of subroutine PLAs can be commanded by the same mainline PLA for performing different operations, at the same or different times via different subroutines. 
     It is therefore an objective of the present invention to provide a microcode control mechanism which uses computer microcodes efficiently by performing subroutine actions in PLAs similar to software subroutining. 
     Another objective and advantage provided by the present invention is the automatic branching back to the point in the mainline PLA where the subroutine PLA was addressed, after the operation performed by the subroutine PLA has been completed, and without using any kind of address return &#34;save&#34; mechanism. 
     Additional advantages of the present invention reside in the reduction of the PLA size and the improved performance that is achieved. 
     The above-mentioned objectives and advantages of the present invention will become more apparent and the invention itself will be best understood by reference to the following description of the invention taken in conjunction with the accompanying drawings, wherein: 
    
    
     BRIEF DESCRIPTION OF THE FIGURES 
     FIG. 1 is a functional block diagram of a prior art data processor that utilizes a PLA; 
     FIG. 2 is a functional block diagram of the present invention showing only a mainline PLA and a subroutine PLA; 
     FIG. 3 is a functional block diagram, with the appropriate representative data bits for the different states being shown in the different AND and OR arrays of the mainline and subroutine PLAs, illustrating the operation of the present invention; 
     FIG. 4 is a simplified functional block diagram showing the relationship between a mainline PLA and different levels of subroutine PLAs; 
     FIG. 5 illustrates a double latch mechanism used for enhancing the operation of PLAs in accordance with the present invention; and 
     FIG. 6 is a functional partial schematic block diagram showing a recursively operating subroutine PLA. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 1 shows a broad overview of a prior art data processor. Data processor 2 includes a data flow unit 4, a main memory 6, an input/output unit 8 and a simplified control unit 10. Data flow unit 4 may oftentimes be referred to as a central processing unit (CPU) and may include such things as an arithmetic logic unit (ALU), various hardware registers, storage units and a bus system interconnecting the different units for controlling the movement of data between the same. In essence, data flow unit 4 performs the actual manipulation of data to produce the desired results. In addition, by means of data buses 12 and 14, data flow unit 4 is connected to main memory 6 and I/0 unit 8, respectively, for transporting information to and from these units. 
     The software program, or user program, containing the instructions to be executed, is loaded into main memory 6. The processor instructions contained within the user program are read out of main memory 6 and supplied to data flow unit 4, one at a time and in a sequential manner, for performing the desired operations. As shown, data flow unit 4 includes a plural-bit instruction register 16 and a general register 18. Instruction register 16 is used by data flow unit 4 for storing each of the processor instructions that needs to be executed. Conventionally, either the complete processor instruction or a portion thereof is loaded into instruction register 16. No matter which format is used, however, the portion of the processor instruction that contains the operation code is loaded into instruction register 16. The operation code, of course, is defined as all of the bits in the processor instruction which are needed to uniquely define the kind of operation to be performed by data processor 2. 
     General register 18 is a general purpose register which is used to temporarily store the calculated data values and other values such as address values during the performance of a program. Although only one general register is shown, in actuality, a data flow unit may contain a plurality of general registers. 
     In the data processor defined in FIG. 1, control unit 10, which controls the operation of data flow unit 4, main memory 6 and I/0 unit 8, is shown to have a clock 20, a programmable logic array circuit (PLA) 22, a sequence counter 24 and a control register 26. For sake of simplicity many other components which ordinarily reside in control unit 10 but which are not needed for understanding of this invention are not shown. 
     Control unit 10 is a microprogrammed type unit which uses PLA 22 and sequence counter 24. As is well known, a PLA is defined as a fixed, orderly structure of logic circuits that can be personalized to implement a specific set of logic equations. Typically, a PLA includes an input AND array (or input partition) connected by a large number of product terms (or lines of microcode) to an output OR array (or output partition). All of the structures for a PLA, which may be of the static or dynamic type, are fabricated on a single integrated circuit chip. For this discussion, it may be assumed that PLA 22 is static. 
     Sequence counter 24 is a plural-bit binary counter for supplying plural-bit binary number signals, by means of bus 28, to PLA 22 for incrementing the states (or addresses) of the same. The timing of the different components are controlled by clock 20 whose outputs, for sake of simplicity, are not shown. Control register 26 is a plural-bit register which, when in receipt of an output, i.e. a microword from PLA 22, deciphers the same and routes a signal corresponding to the output to the different components for further processing. Although ordinarily a decoder is needed for deciphering a microword, none is shown in FIG. 1, again for the sake of simplicity. 
     When a processor instruction is loaded into instruction register 16 from main memory 6, the operation code portion of the processor instruction is fed, by bus 30, to PLA 22. In response to this operation code on bus 30 and a particular sequence count on bus 28 from sequence counter 24, PLA 22 produces, as an output, a particular plural-bit microword which may be defined as a microinstruction or output signal that, either by itself or with some other control signals, is used to perform a certain function. It should be noted that the to-be-performed function may be predetermined for each PLA. Although not shown in FIG. 1, the operation code from bus 30 is fed to the AND array (AND partition) portion of PLA 22, while the output from PLA 22 onto bus 32 to control register 26 is provided by the OR array (OR partition) portion of PLA 22. 
     Upon receipt of the output signal on bus 32, control register 26 can route the output, as control point signals, to various components. Although, in actuality, a microword is output from control register 26, for this discussion, the outputs from control register 26 are considered as control point signals for performing a particular function. 
     When given an operation code, PLA 22 produces a sequence of microwords, each microword being produced by one count in accordance with the timing from sequence counter 24. Thus, irrespective of whether or not all of the microwords in a sequence are needed for a particular operation, a sequence of microwords is generated. Moreover, if the particular operation has to be repeated, the same operation code has to be fed to PLA 22 repeatedly. Therefore, the size of the PLA required for performing the different operation codes remains relatively large. Furthermore, such operation has been found to be quite inefficient, despite the fact that circuitries, such as repeat circuitry for reducing the number of microwords needed in PLA 22 already are being used in control circuit 10. 
     To eliminate this inefficiency and the relatively large size of the PLA, the present invention, as shown in the embodiment of FIG. 2, replaces the single PLA 22 of FIG. 1 with a mainline PLA 34 interconnected with at least one other PLA, such as a subroutine PLA 36. Each of the PLAs shown in FIG. 2 has an AND array and an OR array, and each of the PLAs has its own corresponding sequence counter--sequence counter 38 for PLA 34 and sequence counter 40 for PLA 36. Mainline PLA 34 is incremented by a control bit from its OR array, shown routed by bus 42, to sequence counter 38 and fed as an input to the AND array. Mainline PLA 34 is also being incremented, by a control bit from subroutine PLA 36, more specifically, from the OR array thereof and fed via line 44 to sequence counter 38. The control bits from the respective OR arrays of PLAs 34 and 36 are gated by an OR gate 43, before being fed to sequence counter 38. 
     Subroutine PLA 36 is incremented, via sequence counter 40, by a control bit from its OR array sent through line 46. In addition, a plural-bit encode number (in the form of plural-bits), sent from the OR array of mainline PLA 34 via bus 48, is also used to address subroutine PLA 36. Each of the OR arrays of the respective PLAs has an additional output, designated CP, for providing control points as output signals to perform particular function(s) associated with a given operation code. Such an operation code can be seen as being input to the AND array of mainlines PLA 34 from line 50. Further shown as a possible output for the OR array of subroutine PLA 36 is a bus 52 which may be used to provide data bits representing the encode numbers from subroutine PLA 36 to other subroutine PLAs. This nested feature of one subroutine PLA being connected to another will be discussed later in this application. 
     With the structure shown in the embodiment of FIG. 2, an automatic branch, for performing different operations, may be effected with the same operation code. For example, if an operation code were to have generated a sequence of different microwords (for corresponding functions), as was sequentially done by the same PLA in the prior art, the present invention can actually use a single PLA for generating individually each of the microwords. And when the corresponding functions are done, a branching back from the subroutine PLA(s) to the mainline PLA is automatically effected. Hence, the subroutine PLA may be used repeatedly to perform the same function such that each time that function is finished, an automatic branching back to the part of the processor instruction which requires the execution of that particular function can be effected, without having to have special hardware or having to actually execute the same processor instruction repeatedly. In effect, the embodiment of FIG. 2 is executing a &#34;firmware&#34; subroutining, which is much less expensive than software subroutining, conventional circuitries or read only storage (ROS), which are much more expensive, ie. greater power consumption and more silicon use or &#34;real-estate&#34; required, than PLAs and require more real estate in the data processor. 
     The actual subroutine mechanism in the PLA structure is shown in FIG. 3. As shown, the OR array of mainline PLA 34 contains a two bit encode number that is fed, via bus 48, to the AND array of subroutine PLA 36. Although only a two bit encode number field is used, it should be appreciated that an encode number containing as many bits as necessary can also be used, as the encode number field can be expanded to accommodate the additional bits. The encode number field is designated as 54 and 56 in the OR array of mainline PLA 34 and the AND array of subroutine PLA 36, respectively. 
     For both PLAs 34 and 36, the respective sequence counters 38 and 40 are shown to increment only three bits in the respective AND arrays. As before, a much greater number of data bits can be accommodated in the respective AND arrays. 
     Focus now on mainline PLA 34. A plurality of states (which can be equated with addresses in the case of a ROS) are located within the AND array (AND partition) of mainline PLA 34. To simplify the discussion, the respective states are referred to as states 0, 1, 2, etc., as shown to left Each of the states is comprised of a set of data bits. For example, state 0 is represented by 000 while state 2 is represented by 010. Each state in the AND array has a corresponding set of data bits in the OR array (OR partition). For this discussion, this set of data bits is comprised of only the bits representative of the encode numbers and an incrementing bit, which is shown as being output to sequence counter 38, by means of line 42. Thus, state 0 is represented as 001 in the OR array of PLA 34. 
     Although only three data bits are shown in the OR array of mainline PLA 34, it should be appreciated that additional data bits are actually present therein since these additional data bits are needed for generating the control points CP to perform particular functions. 
     Each state of the AND array of subroutine PLA 36, in addition to the data bits representing the sequence count, further has data bits representing the encode number for subroutine PLA 36 which is limited to two data bits since only two data bits are represented in the OR array of mainline PLA 34. For this discussion, subroutine PLA 36 is shown to have an encode number represented by data bits having values 10. Thus, for each of the states contained within the AND array of subroutine PLA 36, five data bits are shown. For example, state 0 is represented by 10000 while state 2 is represented by 10010. For subroutine PLA 36, the set of data bits in its AND array has a corresponding set of data bits in its OR array. 
     For the embodiment of FIG. 3, each pair of corresponding set of data bits in the OR array of subroutine PLA 36 is shown to have only two data bits--one being used to increment mainline PLA 34 while the other being used to increment subroutine PLA 36. Like the OR array of mainline PLA 34, the OR array of subroutine PLA 36 also has a plurality of sets of control points, not shown, for performing particular functions. 
     The embodiment of FIG. 3 operates as follows. Assume that sequence counters 38 and 40 have been reset to 000, i.e. the initial state, and that the operation code (not shown in FIG. 3) has chosen a value of 010 (i.e. state 2) for producing the function it requires. As mainline PLA 34 is sequenced by sequence counter 38, by means of the incrementing control data bit having the value of 1 through line 42, nothing happens during the first two states 0 and 1, as the encode number bits have values of 00. However, when mainline PLA 34 is incremented to state 2 (010), the encode number field has a corresponding set of data bits having the value 10, which as can be seen, corresponds to the data bit values in encode number field 56 in the AND array of subroutine PLA 36. At this point, subroutine PLA 36 is activated. At the same time, the incrementing control data bit in the OR array of mainline PLA 34 (for state 2) has a value of  0. This signifies the effective freezing, or suspension, of operation of mainline PLA 34. In other words, mainline PLA 34 is suspended in state 2, as subroutine PLA 36 takes over the operation. It is important to note, however, that even though mainline PLA 34 is effectively suspended, data bits representing control points for state 2 are still being output from its OR array. 
     When the value of encode number field 56 of subroutine PLA 36 matches that of encode number field 54 at state 2 (010) of mainline PLA 34, subroutine PLA 36 is incremented, by means of its subroutine sequence counter control point which has a value 1, and carried along line 46 to sequence counter 40. As subroutine PLA 36 sequences through its states, in this instance states 0 to 3, it is, of course, generating control point signals from its OR array for performing specific functions. 
     When subroutine PLA 36 is incremented to state 3, i.e. location containing 10011, the data bit representing the increment subroutine sequence counter attains a value 0. At the same time, the field in the OR array having the data bit representing the increment mainline sequence counter control point has the value 1. As a result, sequence counter 38 is activated for stepping mainline PLA 34 from state 2 to state 3, i.e. from 010 to 011. Since encode number field 54 for state 3 now has a value 00, subroutine PLA 36 no longer is &#34;addressed.&#34; Hence, an automatic branching from subroutine PLA 36 back to mainline PLA 34 is effected. At this point, sequence counter 40 of subroutine PLA 36 can be reset to 0 in order to prepare for the next subroutine entry. Or, alternatively, it can be left as is, or set to some other state, if a particular function is desired when it next operates. 
     When mainline PLA 34 resumes operation, different states are incremented. Accordingly, different subroutine PLAs can also be &#34;addressed.&#34; And this is illustrated in FIG. 4 by the interconnections between the mainline PLA and different subroutine PLAs, located at different levels. Although only two separate subroutine PLAs are shown for each of the levels, it should readily be appreciated that a plurality of PLAs can be assigned at each of the different levels. 
     As shown, the different PLAs can be nested from one level to the next, ad infinitum, as long as the following criteria are followed: each PLA has to have its own corresponding sequence counter; each PLA must have a control point in its OR array to increment its own sequence counter and must also have a control point to increment the sequence counter of the PLA that feeds it; and each PLA has to have an encode number field in its OR array that is used to form part of an &#34;address&#34; to the PLA that it is feeding, so that when the data bits in the encode number field of the fed PLA match the data bits of the encode number field of the feeding PLA, the fed PLA becomes operative. 
     For the embodiment of FIG. 4, a plurality of PLAs may become operative at the same time. For example, subroutine PLA 36 and subroutine PLA 60 could be operating at the same time to execute different functions required by the operation code. In fact, subroutine PLA 36 may still be sequencing, and thereby operating, while subroutine PLA 60 may already have been incremented to a state whereby it is suspended and control has been passed on to second level subroutine PLA 64. Note, however, that even though some of PLAs in the embodiment of FIG. 4 may have been &#34;suspended&#34;, the expected control point signals from these &#34;suspended&#34; PLAs (which may also include those of mainline PLA 34) can be combined with the control points output from the &#34;operative&#34; PLAs. Thus, unlike the prior art, the present invention allows the simultaneous generation of each microword of a sequence of microwords. And with the feature which allows a fed PLA to automatically branch back to a feeding PLA, flexible and efficient operations result. 
     For the embodiment shown in FIG. 4, to &#34;unfreeze&#34; mainline PLA 34, only one of the first level subroutine PLAs has to have been incremented to the state whereby its data bit representing the control point for incrementing the mainline sequence counter becomes active. Putting it differently, only one of the first level subroutine PLAs has to finish its work before mainline PLA 34 is again incremented. By means of programming, however, this sequence of events may actually be altered to require all of the first level subroutine PLAs to finish their respective functions before the operation of the mainline PLA is reinstated. Alternatively, the reinitializing of the incrementation of the mainline PLA may be contingent on the last first level subroutine PLA to finish its function. 
     For reliable operation whereby a hazard free environment, i.e. no logical race conditions, exists during the time the PLAs are incrementing, a double latch &#34;Level Sensitive Scan Design&#34; (LSSD) mechanism may be used. 
     In essence, with reference to FIG. 5, a LSSD mechanism uses two latches L1 and L2 which together represent one bit of a sequence counter. An output from the OR array (of the feeding PLA) is latched into the L1 latch via a &#34;Φ 1  &#34; clock. A subsequent &#34;Φ 2  &#34; clock transfers the latch information from latch L1 to L2, thereby causing a change in the output of the OR array, which is again latched into the L1 latch. Thus, the output of the OR array can actually be clocked while the particular data is read out, even though the address (state) has been incremented. Putting it differently, the data bit values of the state will not be changed until &#34;Φ 2  &#34; clock comes along. Of course, the &#34;Φ 1  &#34; clock and the &#34;Φ 2  &#34; clock are two mutually exclusive clocks and are separated by an increment of time for providing this so-called &#34;non-overlaying mode&#34;, which is necessary inasmuch as it is desirable to insure that no logical race conditions occur as the feeding PLA is being incremented by a control point from a fed subroutine PLA. 
     FIG. 6 illustrates an arrangement whereby a subroutine PLA can recursively operate. This is accomplished by including a subroutine encode number field in the OR array of the subroutine PLA. For example, a data bit representing the subroutine enable data bit may be fed from line 66 to latches 68 for gating with the data bits from the encode number field of the feeding PLA which, in the embodiment of FIG. 6, is shown as a mainline PLA. The subroutine enable data bit field can be shared with an existing control field if the function that it is to be shared with is mutually exclusive. As can be seen, a small amount of control logic is required in order to distinguish the logical meaning of this field on a time-share basis. For hazard free operation, a plurality of latching arrangements as shown in FIG. 5 have been incorporated into the embodiment of FIG. 6. 
     For the sake of clarity, as the operations of the respective sequence counters are the same as previously discussed, the sequence counter controls are not shown. By using this recursive arrangement, an automatic branching to different places within the same physical subroutine PLA can be effected. Also, this recursive arrangement is desirable inasmuch as a particular function has to be repeated a number of times. To end the recursive operation, the subroutine enabled data bit is given a non-enabling value. 
     Inasmuch as the present invention is subject to many variations, modifications and changes in detail, it is intended that all matter described throughout this specification and shown in the accompanying drawings be interpreted as demonstrative only and not in a limiting sense. Accordingly, it is intended that the invention be limited only by the spirit and scope of the appended claims.