Microprocessor

Abstract: A microprocessor comprising an instruction decoder (13) having a plurality of tag bit memories (23) corresponding to each of the memory areas of a buffer memory (21) within the decoder (13) and a NAND circuit (25) having it input connected to each of the tag bit memories (23) and its output connected to one input of an AND gate (19), a flip-flop circuit (17) having its input connected to the output of the instruction decoder (13) and its output is connected to the other input of the AND gate (19) and to each of the inputs of the tag bit memories (23) and a bus controller (15) having bus access control logic (27) having one input connected to the output of the AND gate (19) and the other input connected to the output of an instruction execution unit (5). With this construction, when the macroinstructions decoded by the instructions belong to unconditional branch instructions, a fetch demand is suppressed by the output signal from the flip-flop circuit (17) while all of the macroinstructions already fetched and stored in the buffer memory (21) to be invalid by the output signal from the flip-flop (17).

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a microprocessor of the look-ahead control type, which is capable of performing a high speed instruction excution. Description of the Prior Art In microprocessor of the present look-ahead control type, a pipeline processing is performed in order to realize a high speed instructiontion execution as well as realizing multifunction and high performance of the system, by employing a microprogram control system. For the purpose of increasing the decoding efficiency of macroinstructions in these microprocessors described above, it is a general later from macroinstructions which are currently being executed. In this case, the macroinstructions read out of an external memory are temporarily stored in a buffer memory within an instruction decoder of the microprocessor and the macroinstructions thus stored are read out of the buffer memory and are then decoded. Fig. 1 shows a block diagram of the conventional microprocessor for performing the decoding operation described above. Namely, in Fig. 1, the microprocessor 1 comprises a decoder 3 for decoding the macroinstructions, an instruction execution unit 5 for executing the decoded instructions and a bus controller 7 for controlling an external data bus 100 in accordance with a demand for using the bus by both the decoder 3 and the instruction unit 5. The decoder 3 includes therein a buffer 9 for temporarily storing a plurality of macroinstructions. The buffer 9 has a memory capacity of N times larger than the amount of data which can be transferred by the external data bus 100 at a time and macroinstructions to be executed which after the instructions currently being executed have been completed are transferred at a time and are stored therin in accordance with the transfer capability of the external data bus 100. The macroinstructions thus stored in the buffer 9 are decoded by the decoder 3 after they are successively read out, and the macroinstructions thus decoded are applied to the instruction execution unit 5 through an internal bus 200. Furthermore, when the macroinstructions are read out of the buffer 9 and any vacancy for storing the data amount which can be transferred at a time by the external data bus 100 occurs in the buffer 9, the decoder 3 demands to the bus controller 7 the fetch of the macroinstructions via a signal line 300, the fetch being a read-out of the macroinstructions from an external memory not shown which is connected to the external data bus 100. The instruction execution unit 5 is for executing the macroinstructions which are decoded by the decoder 3 and applied thereto via the internal bus 200. The instruction execution unit 5, when using the external data bus 100 in association with the instruction executions, supplies the bus-controller 7 with a demand for using the external data bus 100 via the signal line 400. The bus controller 7 fetches the macroinstructions from the external memory not shown, responsive to a fetch demand of the macroinstructions from the decoder 3 and it also transfers the macroinstructions thus fetched to the buffer 9 in the decoder 3 via the internal bus 500. Moreover, the bus controller 7, when the use of the external data bus 100 is demanded at the same time by the decoder 3 and the instruction execution unit 5, adjusts the coordinates these demands in accordance with the priority orders preliminarily established. In order to realize the high speed instruction execution, the priority of the use of the external data bus relating to the normal instruction execution is normally higher than that of the macroinstruction fetch. However, this is only the case when the simultaneous demands for the use of the bus occur. Accordingly, even when any demand for the use of the external data bus 100 involving the instruction execution having a higher priority occurs, the use of the external data bus 100 involving the instruction execution has to be delayed until the use of the bus 100 by the macroinstruction fetch having a lower priority order terminates when the external data bus 100 is being used for the macroinstruction fetch. In the microprocessor in the prior art thus constructed, when the instruction which has been read out of the buffer 9 provided within the decoder 3 and decoded by the decoder, belongs to an unconditional branch instruction, it is normal that a plurality of macroinstructions which have already been stored in the buffer 9 are all processed as being invalid in order to execute instructions at the branch destination and the latter is then fetched and is newly stored in the buffer 9. As described in the foregoing prior art, in the microprocessor for carrying out the instruction execution in such a manner that the macroinstructions are preliminarily locked-ahead and are temporarily stored in the buffer 9 within the decoder 3, the subsequent macroinstructions which have been stored are all made invalid when the instructions to be decoded and executed belong to unconditional branch instructions and the instructions at the branch destination are to be executed. Accordingly, in the case described above, although all of the macroinstructions stored in the buffer 9 are made invalid, an unnecessary operation that they are to be decoded by the decoder was performed. As a result, a combined circuit such as PLA (Programmable Logic Array) which performs the decoding operation is operated uselessly, thus increasing power dissipation and calorific value. In addition, due to the non-effective macroinstruction fetch through the external data bus which results in the useless instruction storing in the buffer 9 and the useless instruction decoding in the decoder, other operations for the instruction execution via the data bus are hindered and the use of the bus 100 has to be delayed until the useless fetch operation terminates, thus delaying the execution of the other useful instructions. EP-A-0 036 093 discloses a microprocessor of the look-ahead control type in which, in case of branching instructions, the prebuffered instruction is rendered ineffective by a software operation. After executing the branching instruction in order to obtain the branch address, instructions starting from the branch address are then fetched. It is therefore an object of the present invention to provide a microprocessor capable of executing instructions at high speed as well as increasing the efficiencies of both the fetch and decoding operations, in particular by halting the fetch operation that would otherwise occur unnecessarily once an unconditional branch instruction has been decoded. It is another object of the present invention to provide, according to one preferred embodiment, a microprocessor comprising an instruction decoder having a plurality of tag bit memories corresponding to each of memory areas of a buffer memory within the decoder and logical circuit means in which when the macroinstructions decoded by the decoder are those which belong to unconditional branch instructions, a fetch demand is suppressed by the combined gate cicuit consisting of a flip-flop and an AND gate while making all of the instructions already fetched and stored in the buffer memory invalid by the output signal from the flip-flop and the tag bit memories. The invention, in common with EP-A-0 036 093, provides a microprocessor comprising: a bus controller for controlling input/output operation through a data bus; buffer memory means connected to said bus controller for prefetching a plurality of macroinstructions transferred through said data bus; a control logic circuit connected to said buffer memory means for generating a signal which requests use of said data bus when said buffer memory means has a memory location storing no valid macroinstruction and therefore capable of accepting another macroinstruction; a decoder connected to said buffer memory means for decoding said macroinstructions in order to detect whether or not an instruction decoded by said decoder is an unconditional branch instruction; circuit means connected to said decoder for rendering ineffective macroinstructions stored in said buffer memory means when an unconditional branch instruction is decoded by said decoder; and an instruction execution unit connected to said decoder for executing macroinstructions transferred from said decoder in sequence. The microprocessor is characterized by hardwired control means operatively connected to said decoder and said control logical circuit for preventing the bus requesting signal from being transferred to said bus controller when an unconditional branch instruction is decoded by said decoder. These and other objects, features and advantages will become apparent from the following detailed description of the invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a brief block diagram of a microprocessor of the look-ahead control type according to the prior art, and Fig. 2 is a block diagram of the microprocessor of the look-ahead control type according to the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT In Fig. 2, the microprocessor 11 according to the present invention comprises an instruction decoder 13 having a buffer memory 21 which has N memory areas for temporarily storing macroinstructions, for decoding the macroinstruction stored in the buffer memory, an instruction execution unit 5, a bus controller 15 for controlling an external data bus 100, a flip-flop circuit 17 and an AND gate 19. Among reference numerals used in Fig. 2, the same reference numerals as those used in Fig. 1 indicate the same elements having the same function, respectively. The buffer memory 21 in the decoder 13 has a sufficient memory capacity for the bit numbers constituting one macroinstruction which the internal bus 500 can transfer at a time. The macroinstructions to be executed are stored into the buffer memory 21 after the instructions being currently executed have been terminated. The decoder 31 also comprises a decode portion 31, and a plurality of tag bit memories 23 corresponding to the memory areas of the buffer memory 21, which indicate whether or not the macroinstruction stored in each memory areas in the buffer memory 21 are valid. Namely, when a certain tag bit memory 23 contains therein the binary digit "1", it indicates that a macroinstruction stored in the buffer memory 21, which memory area corresponding to the specific tag bit memory in question is valid. On the other hand, when it contains the binary digit "0", it indicates that the macroinstruction stored in the specific memory area in the buffer memory 21 corresponding to the tag bit memory is invalid. The content of each tag bit memory 23 is made "1" when the macroinstructions are stored in each of the memory areas of the buffer memory 21 and it is made "0" when each of the corresponding memory areas of the buffer memory 21 becomes vacant. The instruction decoder 13 also comprises a logical circuit 25 with its inputs connected to each of the tag bit memories 23 and with its output connected to one input of the AND gate 19. The logical circuit 25 produces at its output line 300, the binary bit signal "1" when at least any one of the tag bit memories 23 contains the binary digit "0". The logical circuit 25 for performing the logical operation as described above about the input signals from the tag bit memories 23 can be realized by a NAND gate circuit. The bus controller 15 is connected to an external memory not shown through the external data bus 100 and also performs an input/output control of the external data bus 100 which is a data transfer path when executing the macroinstructions in the instruction execution unit 5 or macroinstruction fetch. The input/output control is carried out in accordance with either a macroinstruction fetch demand from the decoder 13 or a bus use demand from the instruction execution unit 5. The bus controller 15 also comprises a bus access control logic 27 receptive of the macroinstruction fetch demand from the decoder 13 or the bus use demand from the instruction execution unit 5. The bus access control logic 27 firstly accepts the bus use demand relating to the instruction execution having a higher priority order about the use of the external data bus 100 than that of the macroinstruction fetch demand, when each of the two demands are applied thereto at the same time. Moreover, when the bus access control logic 27 receives the bus use demand from the instruction execution unit 5, the bus controller 15 uses the external data bus 100 so as to execute the instructions. On the other hand, when the macroinstruction fetch demand is accepted by the bus access control logic 27 of the bus controller unit 15, i.e., the output of the AND gate 19 produces the binary "1", with macroinstructions are fetched from the external memory not shown and the macroinstructions thus fetched are transferred to the buffer memories 21 through the internal bus 500. The flip-flop circuit 17 has its input connected to the output terminal 29 of the decode portion 31 and its output connected to the other input of the AND gate 19 and to each of the tag memories 23. The flip-flop circuit 17 is set at the binary "1" when the macroinstructions decoded by the decoder 13 are not branch instructions, while it is reset at "0" when the macroinstructions belong to unconditional branch instructions. The output terminal 29 of the decode portion 31 is constructed to supply signals to the flip-flop circuit 17 such that the flip-flop circuit 17 is reset when the macroinstructions decoded by the decode portion 31 belong to unconditional branch instructions and the flip-flop circuit 17 is set when the macroinstructions do not belong to the unconditional branch instructions. When the flip-flop circuit 17 is reset to be "0", all of the tag bit memories 23 are set at "0", i.e., the binary "0" is stored in each of the tag bit memories 23, all of the macroinstructions which have been stored in the buffer memory 21 are made invalid, and the decoding operation by the decode portion 31 is inhibited. The logical products are taken in the AND gate 19 between the output from the logical circuit 25 and the output signal from the flip-flop circuit 17 and the resulting signal from the AND gate 19 is applied to the bus access control logic 27. In addition, the AND gate 19 produces the binary bit "1" when the macroinstructions stored in the buffer memory 21 and decoded by the decoder 13 do not belong to the unconditional branch instructions as at least one of the tag bit memories 23 contains the binary "0", and it demands the macroinstruction fetch to the bus access control logic 27. The operation of the macroprocessor according to the present invention thus constructed will now be described with reference to Fig. 2. When a macroinstruction stored in the buffer memory 21 is decoded by the decoder 13 and the macroinstruction thus decoded is found to be the one which does not belong to the unconditional branch instructions, the flip-flop circuit 17 is set at "1". Under this condition, when any bit vacancy occurs at least in any one of the memory areas of the buffer memory 21, the tag bit memory corresponding to the particular memory area of the buffer memory 21 becomes "0" bit condition. As a result, the output from the logical circuit 25 becomes "1" and this output signal is applied to one input of the AND gate 19 via signal line 300. In this case, the binary bit "1" is applied to the other input of the AND gate 19 from the flip-flop 17 so that the output of the AND gate 19 comes "1" and the macroinstruction fetch demand is applied to the bus access control logic 27. This demand will be accepted after the use is terminated of the external data bus 100 by the instruction execution unit 5, when it is being used by it. After the macroinstruction fetch demand has been accepted, macroinstructions are fetched by the bus controller 15 from the external memory not shown via the external data bus 100 and they are stored in the memory areas of the buffer memory 21 which is now vacant, through the internal bus 500. On the other hand, when the macroinstruction decoded by the decoder 13 is an unconditional branch instruction, the flip-flop circuit 17 is now reset to be "0". On the other hand, when the macroinstructions are read out of the memory areas of the buffer memory 21, and at least one vacant memory area occurs in the buffer memory 21, the corresponding tag bit memory 23 becomes "0", thus the output of the logical circuit 25 becomes "1" and the macroinstruction fetch demand is applied to one input of the AND gate 19 through the signal line 300. However, since the flip-flop circuit 17 has been reset to be "0", when the other input of the AND gate 19 is supplied with "0" from the logical circuit 25, the output from the AND gate 17 becomes "0". Namely, the macroinstruction fetch demand is not applied to the bus access control logic 27. Moreover, when the flip-flop circuit 17 is reset at "0", the contents of all of the tag bit memories 23 are made "0" and this will in turn make all of the macroinstructions stored in the buffer memories 21 invalid. In other words, when the macroinstructions decoded by the decoder 13 belong to unconditional branch instructions, the buffer memory becomes vacant in some memory area or areas. As a result, even when the macroinstruction fetch demand is produced from the decoder 13, the fetch demand is not applied to the bus access control logic 27 so that the fetch operation of the macroinstruction is not performed. In this case, all of the macroinstructions which have been stored in the buffer memories 21 are made invalid and the decoding operation is inhibited. As described in the foregoing, when the macroinstructions thus decoded belong to unconditional branch instructions, the fetch demand after the decode of the branch instruction is not accepted. As a result, the unnecessary operation that subsequent macroinstructions for executing non-effective instructions at the branch destination are fetched, can be eliminated, which has been otherwise performed in the prior art. Consequently, the use of the external data bus 100 for the unnecessary operation can be eliminated, and an efficient use of the external data bus 100 can be realized. According to the present invention, the waiting time for using the external data bus 100 for instructions which really necessitate the use of the bus for their execution can be reduced and a high speed execution of the instructions can be realized. Moreover, when the macroinstructions decoded by the decoder belong to the unconditional branch instructions, all of the macroinstructions which have been stored in the buffer memory 21 are no longer decoded and an unnecessary operation for decoding the resulting invalid macroinstructions can be omitted. As described in the foregoing embodiment, in the microprocessor according to the present invention, when the macroinstructions decoded by the instruction decoder belong to unconditional branch instructions, the subsequent macroinstruction fetch demand is suppressed and the decoding operation of the macroinstructions which have already been fetched and stored in the buffer memory is inhibited, thereby increasing the efficiencies of the fetch opera-ion and the decoding operation without the conventional unnecessary operation and realizing a high speed execution of instructions.

Claims: A microprocessor comprising: a bus controller (15) for controlling input/output operation through a data bus (100); buffer memory means (21) connected to said bus controller (15) for prefetching a plurality of macroinstructions transferred through said data bus (100); a control logic circuit (25) connected to said buffer memory means (21) for generating a signal which requests use of said data bus (100) when said buffer memory means (21) has a memory location storing no valid macroinstruction and therefore capable of accepting another macroinstruction; a decoder (31) connected to said buffer memory means (21) for decoding said macroinstructions in order to detect whether or not an instruction decoded by said decoder (31) is an unconditional branch instruction; circuit means (23) connected to said decoder (31) for rendering ineffective macroinstructions stored in said buffer memory means (21) when an unconditional branch instruction is decoded by said decoder (31); and an instruction execution unit (5) connected to said decoder (31) for executing macroinstructions transferred from said decoder (31) in sequence, said microprocessor being characterized by hardwired control means (17, 19) operatively connected to said decoder (31) and said control logical circuit (25) for preventing the bus requesting signal from being transferred to said bus controller (15) when an unconditional branch instruction is decoded by said decoder (31). A microprocessor as claimed in claim 1, wherein said circuit means (23) comprises a plurality of tag bit memories corresponding respectively with the memory locations of said buffer memory means (21), and said control logic circuit (25) has a plurality of inputs respectively connected to the tag bit memories of said circuit means (23). A microprocessor as claimed in claim 1 or 2, wherein said hardwired control means (17, 19) comprises a second memory means (17) and a logic gate (17) being connected to the output (29) of the decoder (13) and the output thereof being connected to one input of said logic gate (19) and to each of the memories of circuit means (23), another input of said logic gate (19) being connected to the output of said control logic circuit (25) and its output being connected to one input of bus access control logic means (27) of said bus controller (15). A microprocessor as claimed in claim 3, wherein said second memory means (17) comprises a flip-flop circuit and said logic gate (19) comprising an AND gate. A microprocessor as claimed in claim 4, wherein said flip-flop circuit (17) is arranged to be set at "1" when an unconditional branch instruction is not decoded by said decoder (13) and it is arranged to be reset when an unconditional branch instruction is decoded by the decoder, thereby inhibiting the production of the bus request signal from said AND gate (19) and making all of the macroinstructions already stored in the buffer memory means (21) invalid by a reset output of logical "0" from said flip-flop (17). A microprocessor as claimed in claim 3 or any dependent claim thereof, wherein the ouput of the instruction execution unit (5) is connected to the other input of said bus access control logic means (27) of said bus controller (15). A microprocessor as claimed in any preceding claim, wherein said buffer memory means (21) has a memory capacity N times higher than the amount of data which can be transferred by the data bus (100) at a time. A microprocessor as claimed in any preceding claim, wherein the control logic circuit (25) is a NAND circuit.

Inventors: YOSHIDA TOSHIYA D TOSHIBANOGAW, YOSHIDA, TOSHIYA D405 TOSHIBANOGAWA-APART
Applicants: TOSHIBA KK, KABUSHIKI KAISHA TOSHIBA
Application year: 1988
Main classification: G06F9
IPC codes: G06F9