JPH07182164A - Central processor - Google Patents

Central processor

Info

Publication number
JPH07182164A
JPH07182164A JP5324993A JP32499393A JPH07182164A JP H07182164 A JPH07182164 A JP H07182164A JP 5324993 A JP5324993 A JP 5324993A JP 32499393 A JP32499393 A JP 32499393A JP H07182164 A JPH07182164 A JP H07182164A
Authority
JP
Japan
Prior art keywords
instruction
counter
signal
branch
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5324993A
Other languages
Japanese (ja)
Inventor
Yasuyuki Hasegawa
泰之 長谷川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP5324993A priority Critical patent/JPH07182164A/en
Publication of JPH07182164A publication Critical patent/JPH07182164A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Advance Control (AREA)

Abstract

PURPOSE:To improve the overall processing efficiency of a system by stopping the fetching operation based on the count value of a counter which stores the number of branching instructions carried out within a prescribed time and the count value of a counter which counts the number of instructions stored in an instruction queue. CONSTITUTION:A 1st counter 102 counts and stores the number of instruction codes which are already read into an instruction queue 502 and not read out an instruction decoding unit 519 yet by AND gates 112-114 and OR gates 115-117. The count value of the counter 102 is combined with the count value of a 2nd counter 512 which counts the number of branching instructions that are carried out by the unit 519 within a prescribed time. Thus the fetch bus cycle is suppressed. In such a way, the invalid fetch bus cycle is reduced regardless of the branching instruction and the bus occupation rate of a CPU 101 is reduced down to a necessary limit level. As a result, the overall processing efficiency of a system is improved.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は中央処理装置に関する。FIELD OF THE INVENTION The present invention relates to a central processing unit.

【0002】[0002]

【従来の技術】一般に、中央処理装置(以下、CPUと
略称する)の高速化技術としては、命令キューを用いて
命令コードの先取りを行う技術がある。これは、CPU
において内部処理を行っている間のバス空き時間を利用
して、次の命令コードをCPU内部の命令キューに蓄え
ておき、前の命令の実行が終った時点において、直ぐに
次の命令の実行を開始することができるようにする手法
である。図5に、命令キューを用いたCPUの一例を示
す。 図5に示されるように、本従来例のCPU501
は、CPU外部データバスに対応して、命令キュー50
2と、トランスファーゲート503および504と、カ
ウンタ512と、バスサイクル制御回路514と、NO
Rゲート515と、論理和ゲート516と、命令解読実
行ユニット519と、キューリードライト制御回路52
0とを備えて構成されている。
2. Description of the Related Art Generally, as a technique for speeding up a central processing unit (hereinafter abbreviated as CPU), there is a technique for prefetching an instruction code by using an instruction queue. This is the CPU
In the CPU, the next instruction code is stored in the instruction queue inside the CPU by using the free time of the bus during the internal processing, and immediately after the execution of the previous instruction, the execution of the next instruction is executed. It is a technique that allows you to get started. FIG. 5 shows an example of a CPU using an instruction queue. As shown in FIG. 5, the CPU 501 of this conventional example
Is the instruction queue 50 corresponding to the CPU external data bus.
2, transfer gates 503 and 504, a counter 512, a bus cycle control circuit 514, and NO.
R gate 515, OR gate 516, instruction decoding execution unit 519, queue read / write control circuit 52
It is configured with 0 and.

【0003】図5においては、命令キュー502の容量
を8ワードとして説明するものとする。命令キュー50
2には、バスサイクル制御回路514によりデータバス
518上よりフェッチされた命令コードが格納される。
命令実行解読ユニット519においては、命令キュー5
02に格納されている命令コードを取込み解読して実行
する。キューリードライト制御回路520においては、
バスサイクル制御回路514によりフェッチされた命令
コードを、命令キュー502に書込むキューライト信号
506と、命令キュー502に格納されている命令コー
ドとを、命令解読実行ユニット519に読込むキューリ
ードライト信号507が生成される。カウンタ512
は、キューライト信号506と、キューリード信号50
7のワンショットLOWパルスにより、カウントアップ
およびカウントダウンを行い、且つ命令解読実行ユニッ
ト519から出力される分岐命令検出信号510により
リセットされる4ビットの2進カウンタである。即ち、
カウンタ512によるカウント数は、命令キュー502
に格納されて命令解読実行ユニット519により読出さ
れていない実行待ちの命令コードの数を表わしている。
なおキューライト信号506とキューリード信号507
が同時にLOWになった時には、カウンタ512のカウ
ント数は変化しないものとする。
In FIG. 5, it is assumed that the instruction queue 502 has a capacity of 8 words. Instruction queue 50
In 2, the instruction code fetched from the data bus 518 by the bus cycle control circuit 514 is stored.
In the instruction execution decoding unit 519, the instruction queue 5
The instruction code stored in 02 is fetched, decoded, and executed. In the queue read / write control circuit 520,
A queue write signal 506 for writing the instruction code fetched by the bus cycle control circuit 514 into the instruction queue 502 and a queue read / write signal for reading the instruction code stored in the instruction queue 502 into the instruction decoding execution unit 519. 507 is generated. Counter 512
Is the cue write signal 506 and the cue read signal 50.
It is a 4-bit binary counter that counts up and down by a one-shot LOW pulse of 7 and is reset by a branch instruction detection signal 510 output from the instruction decoding execution unit 519. That is,
The number counted by the counter 512 is the instruction queue 502.
Represents the number of instruction codes waiting to be executed, which are stored in the instruction decoding execution unit 519.
The cue write signal 506 and cue read signal 507
When the two become LOW at the same time, the count number of the counter 512 does not change.

【0004】NORゲート515より出力されるフェッ
チバスサイクル起動要求信号521は、命令解読実行ユ
ニット519から出力される分岐命令検出信号510が
アクティブの時、またはカウンタ512のカウント値が
8即ち最上位ビットC3がHIGHになる時に、インア
クティブ即ちLOWとなる制御信号である。これは、命
令解読実行ユニット519が分岐命令の実行を行ってい
る時と、命令キュー502に格納されている命令コード
が8ワードで一杯になった時に、フェッチバスサイクル
が起動制御されることを意味している。論理和ゲート5
16より出力されるキューバリッド信号517は、カウ
ンタ512の構成ビットの論理和演算の出力信号であ
り、カウンタ512のカウント値が0の時即ち命令キュ
ー502に格納されている命令コードが0の時において
のみインアクティブ即ちLOWとなる。また、命令解読
実行ユニット519より出力される命令実行バスサイク
ル起動要求信号511は、命令の実行に際して必要とな
るバスサイクルの起動要求信号であり、このバスサイク
ルは、フェッチバスサイクルとは区別されている。以下
においては、説明上簡単のために、命令実行バスサイク
ル起動要求信号511は、常にLOWになっているもの
として説明を行うこととする。
The fetch bus cycle activation request signal 521 output from the NOR gate 515 is output when the branch instruction detection signal 510 output from the instruction decoding execution unit 519 is active or when the count value of the counter 512 is 8, that is, the most significant bit. It is a control signal that becomes inactive, that is, LOW when C3 becomes HIGH. This means that the fetch bus cycle is activated and controlled when the instruction decoding execution unit 519 is executing a branch instruction and when the instruction code stored in the instruction queue 502 is full of 8 words. I mean. OR gate 5
A queue valid signal 517 output from 16 is an output signal of the logical sum operation of the constituent bits of the counter 512, and when the count value of the counter 512 is 0, that is, when the instruction code stored in the instruction queue 502 is 0. Is inactive, i.e., LOW only. The instruction execution bus cycle activation request signal 511 output from the instruction decoding execution unit 519 is a bus cycle activation request signal necessary for executing an instruction, and this bus cycle is distinguished from the fetch bus cycle. There is. In the following, for simplicity of explanation, it is assumed that the instruction execution bus cycle activation request signal 511 is always LOW.

【0005】次に、図5の従来のCPU501の動作に
ついて説明する。
Next, the operation of the conventional CPU 501 shown in FIG. 5 will be described.

【0006】まず、CPU501において命令コードを
フェッチして、命令キュー502の格納する動作につい
て説明する。命令実行バスサイクル起動要求信号511
がインアクティブ即ちLOWの時には、フェッチバスサ
イクル起動要求信号521がアクティブ即ちHIGHに
なることによりフェッチバスサイクルが起動される。フ
ェッチバスサイクル起動要求信号521がHIGHにな
ると、バスサイクル制御回路514はフェッチバスサイ
クルを起動させ、データバス518から1ワードの命令
コードを読込み、内部データバス505にデータを送出
する。この時に、同時にバスサイクル制御回路514に
おいては、フェッチバスサイクルのステータス信号50
8をアクティブ即ちHIGHにする。キューリードライ
ト制御回路520においては、フェッチバスサイクルの
ステータス信号508がHIGHになると、キューライ
ト信号506としてワンショットLOWパルスを出力す
る。キューライト信号506がLOWになると、トラン
スファーゲート503が開き、内部データバス505に
送出されている命令コードのデータが、命令キュー50
2に格納される。また、この時に、キューライト信号5
06のワンショットLOWパルスにより、カウンタ51
2のカウント数が一つカウントアップする。
First, the operation of fetching an instruction code in the CPU 501 and storing it in the instruction queue 502 will be described. Instruction execution bus cycle activation request signal 511
Is inactive, i.e., LOW, the fetch bus cycle activation request signal 521 becomes active, i.e., HIGH, thereby activating the fetch bus cycle. When the fetch bus cycle activation request signal 521 becomes HIGH, the bus cycle control circuit 514 activates the fetch bus cycle, reads a 1-word instruction code from the data bus 518, and sends the data to the internal data bus 505. At this time, at the same time, the bus cycle control circuit 514 receives the status signal 50 of the fetch bus cycle.
8 is made active, that is, HIGH. The queue read / write control circuit 520 outputs a one-shot LOW pulse as the queue write signal 506 when the status signal 508 of the fetch bus cycle becomes HIGH. When the cue write signal 506 becomes LOW, the transfer gate 503 opens, and the data of the instruction code sent to the internal data bus 505 is transferred to the instruction queue 50.
Stored in 2. At this time, the cue light signal 5
The one-shot LOW pulse of 06 causes the counter 51 to
The count number of 2 is incremented by 1.

【0007】次に、命令解読実行ユニット519によ
り、命令キュー502より命令コードを読出す動作につ
いて説明する。前の命令の処理を終了し、次の命令の解
読実行を開始する時に、命令解読実行ユニット519に
おいては、キュー要求信号509をアクティブ即ちHI
GHにして出力し、キューリードライト制御回路520
に入力する。この時に、キューバリッド信号517がH
IGH即ち命令キュー502における命令コードが空で
ない場合には、キューリードライト制御回路520にお
いては、キューリード信号507としてワンショットL
OWパルスを出力する。キューリードワイト制御回路5
20がLOWとなると、トランスファーゲート504が
開き、命令キュー512より送り出される命令コード
が、命令解読実行ユニット519に取り込まれる。この
時、キューリードワイト信号507のワンショットLO
Wパルスにより、カウンタ512のカウント数を一つカ
ウントダウンする。
Next, the operation of reading the instruction code from the instruction queue 502 by the instruction decoding execution unit 519 will be described. When the processing of the previous instruction is finished and the decoding execution of the next instruction is started, in the instruction decoding execution unit 519, the queue request signal 509 is activated, that is, HI.
GH output, and queue read / write control circuit 520
To enter. At this time, the cubic valid signal 517 is H
When the IGH, that is, the instruction code in the instruction queue 502 is not empty, the one-shot L as the queue read signal 507 in the queue read / write control circuit 520.
Output OW pulse. Cue white control circuit 5
When 20 becomes LOW, the transfer gate 504 is opened, and the instruction code sent from the instruction queue 512 is fetched by the instruction decoding execution unit 519. At this time, the one-shot LO of the cue dry weight signal 507
The W pulse decrements the count number of the counter 512 by one.

【0008】以上説明したように、CPU501におい
ては、命令キュー502を介在して、命令のフェッチと
命令の解読実行との並列処理を行うことにより、処理ス
ピードの高速化が図られている。しかし、命令キュー5
02による命令コードの先取りは、分岐命令のようなプ
ログラムシーケンスを変える命令が実行された場合に
は、その時点において、既に命令キューに格納されてい
る命令コードは全て無駄になってしまう。図6は、この
例を図5に示される従来のCPU501を基に、タイミ
ング図として示したものである。図6において、CPU
501においては、時刻T1 において分岐命令をフェッ
チしている。この分岐命令は、時刻T9 において命令解
読実行ユニット519により読出され、時刻T10におい
て解読されて、分岐命令であることが検出されている。
この時分岐命令検出信号がアクティブ即ちHIGHとな
り、カウンタ512は「7」から「0」にリセットされ
ている。即ち、このことは、分岐命令が実行されるまで
命令キュー502に格納されていた命令コードが、7ワ
ード分捨てられたことを意味している。この捨てられた
7ワード分の命令コードは、時刻T2 から時刻T7 の間
および時刻T9 に、CPU501によりフェッチされた
命令である。即ち、この期間のCPU501において
は、無効のフェッチバスサイクルによりバスが占有され
ていたことになる。このような、CPUにおける意味の
ないバスの占有は、システム全体のパフォーマンスを著
しく低下させる要因になるという問題がある。
As described above, in the CPU 501, the instruction queue 502 is interposed to perform the parallel processing of the instruction fetch and the instruction decoding execution, whereby the processing speed is increased. However, instruction queue 5
In the case of prefetching the instruction code by 02, when an instruction such as a branch instruction that changes the program sequence is executed, all the instruction codes already stored in the instruction queue at that time are wasted. FIG. 6 is a timing chart showing this example based on the conventional CPU 501 shown in FIG. In FIG. 6, the CPU
In 501, a branch instruction is fetched at time T1. This branch instruction is read by the instruction decoding execution unit 519 at time T9 and decoded at time T10 to detect that it is a branch instruction.
At this time, the branch instruction detection signal becomes active, that is, HIGH, and the counter 512 is reset from "7" to "0". That is, this means that the instruction code stored in the instruction queue 502 until the branch instruction is executed is discarded by 7 words. The discarded seven-word instruction code is an instruction fetched by the CPU 501 from time T2 to time T7 and at time T9. That is, in the CPU 501 during this period, the bus is occupied by the invalid fetch bus cycle. Such meaningless bus occupation in the CPU causes a problem of significantly degrading the performance of the entire system.

【0009】そこで、以下においては、この問題を回避
するために採られている、従来の技術手法について説明
する。図7は、従来の他のCPUの一例を示すブロック
図である。図7に示されるように、本従来例のCPU7
01は、CPU外部データバスに対応して、命令キュー
502と、トランスファーゲート503および504
と、カウンタ512と、バスサイクル制御回路514
と、論理和ゲート516と、命令解読実行ユニット51
9と、キューリードライト制御回路520と、分岐命令
検出用プリデコーダ702と、フリップフロップ704
と、ORゲート705と、NORゲート706とを備え
て構成されている。
Therefore, in the following, a conventional technical method adopted to avoid this problem will be described. FIG. 7 is a block diagram showing an example of another conventional CPU. As shown in FIG. 7, the CPU 7 of the conventional example
01 is an instruction queue 502 and transfer gates 503 and 504 corresponding to the CPU external data bus.
, Counter 512, and bus cycle control circuit 514
, OR gate 516, and instruction decoding execution unit 51
9, a queue read / write control circuit 520, a branch instruction detection predecoder 702, and a flip-flop 704.
, An OR gate 705, and a NOR gate 706.

【0010】図7においては、前述の従来例の場合と同
様に、命令キュー502の容量を8ワードとして説明す
るものとする。命令キュー502には、バスサイクル制
御回路514によりデータバス518上よりフェッチさ
れた命令コードが格納される。命令実行解読ユニット5
19においては、命令キュー502に格納されている命
令コードを取込み解読して実行する。キューリードライ
ト制御回路520においては、バスサイクル制御回路5
14によりフェッチされた命令コードを、命令キュー5
02に書込むキューライト信号506と、命令キュー5
02に格納されている命令コードとを、命令解読実行ユ
ニット519に読込むキューリードライト信号507が
生成される。カウンタ512は、キューライト信号50
6と、キューリード信号507のワンショットLOWパ
ルスにより、カウントアップおよびカウントダウンを行
い、且つ命令解読実行ユニット519から出力される分
岐命令検出信号510によりリセットされる4ビットの
2進カウンタであり、これらの各構成要素の動作につい
ては、前述の従来例の場合と同様である。なお、本従来
例においては、分岐命令検出用プリデコーダ702が、
トランスファーゲート503の出力側に、命令キュー5
02と並列に接続されている。またフリップフロップ7
04のセット側入力には、分岐命令検出用プリデコーダ
702の出力703が入力され、またフリップフロップ
704のリセット側入力には、命令解読実行ユニット5
19より出力される分岐命令検出信号510が入力され
ている。ORゲート705には、フリップフロップ70
4の出力と、分岐命令検出信号510が入力されてお
り、その出力はNORゲート706に入力される。NO
Rゲート706より出力されて、バスサイクル制御回路
514に入力されるフェッチバスサイクル起動要求信号
707は、ORゲート705の出力がアクティブとなる
か、またはカウンタ512のカウント値が8即ち最上位
ビットC3がアクティブ即ちHIGHとなる時には、イ
ンアクティブ即ちLOWとなる制御信号である。
In FIG. 7, it is assumed that the capacity of the instruction queue 502 is 8 words, as in the case of the above-mentioned conventional example. The instruction queue 502 stores the instruction code fetched from the data bus 518 by the bus cycle control circuit 514. Instruction execution decoding unit 5
At 19, the instruction code stored in the instruction queue 502 is fetched, decoded, and executed. In the queue read / write control circuit 520, the bus cycle control circuit 5
The instruction code fetched by 14 is stored in the instruction queue 5
Cue write signal 506 written in 02 and instruction queue 5
A queue read / write signal 507 for reading the instruction code stored in 02 into the instruction decoding execution unit 519 is generated. The counter 512 displays the cue light signal 50.
6 and a 4-bit binary counter that counts up and down by a one-shot LOW pulse of the queue read signal 507 and is reset by the branch instruction detection signal 510 output from the instruction decoding execution unit 519. The operation of each constituent element is the same as that of the above-mentioned conventional example. In the conventional example, the branch instruction detecting predecoder 702 is
The instruction queue 5 is provided on the output side of the transfer gate 503.
02 is connected in parallel. Also flip-flop 7
The output 703 of the branch instruction detection predecoder 702 is input to the set side input of 04, and the instruction decoding execution unit 5 is input to the reset side input of the flip-flop 704.
A branch instruction detection signal 510 output from 19 is input. The OR gate 705 has a flip-flop 70.
4 and the branch instruction detection signal 510 are input, and the output is input to the NOR gate 706. NO
The fetch bus cycle activation request signal 707 output from the R gate 706 and input to the bus cycle control circuit 514 activates the output of the OR gate 705 or the count value of the counter 512 is 8, that is, the most significant bit C3. Is a control signal that becomes inactive, i.e., LOW when becomes active, i.e., HIGH.

【0011】次に、図7の従来のCPU701の動作に
ついて、図8のタイミング図を参照して説明する。図8
は、図7のCPU701が、図6示される場合と同一の
命令を実行する場合の動作について示したタイミング図
である。図8において、CPU701においては、時刻
T1 において分岐命令をフェッチしているものとする。
この時に取込まれた分岐命令の命令コード、命令キュー
502に取込まれると同時に分岐命令検出プリデコーダ
702に入力される。分岐命令検出プリデコーダ702
においては、この時に入力された命令コードを解読し、
当該命令が分岐命令であるか否かを判別する。時刻T1
において取込まれた命令は、分岐命令であるため、分岐
命令検出用プリデコーダ702の出力703はアクティ
ブ即ちHIGHとなり、フリップフロップ704のセッ
ト側に入力されて、フリップフロップ704はセットさ
れる。従って、ORゲート705の出力はHIGHとな
り、これによりNORゲート706より出力されるフェ
ッチバスサイクル起動要求信号707はインアクティブ
LOWとなり、時刻T2 よりのフェッチバスサイクルの
起動は保留される。時刻T1 におけるフェッチバスサイ
クルにおいて取込まれた分岐命令の命令コードは、時刻
T9 において命令解読実行ユニット519により取込ま
れる。命令解読実行ユニット519においては、分岐命
令検出信号510をHIGHにして出力し、これにより
フリップフロップ704はリセットされる。この分岐命
令検出信号510が時刻T10においてLOWに低下する
と、ORゲート705の出力値はLOWとなり、フェッ
チバスサイクル起動要求信号707がアクティブ即ちH
IGHになるので、時刻T11よりフェッチバスサイクル
が再度起動される。
Next, the operation of the conventional CPU 701 of FIG. 7 will be described with reference to the timing chart of FIG. Figure 8
FIG. 8 is a timing chart showing an operation when CPU 701 of FIG. 7 executes the same instruction as that shown in FIG. 6. In FIG. 8, it is assumed that the CPU 701 is fetching a branch instruction at time T1.
The instruction code of the branch instruction fetched at this time is fetched in the instruction queue 502 and simultaneously input to the branch instruction detection predecoder 702. Branch instruction detection predecoder 702
In, decode the instruction code input at this time,
It is determined whether or not the instruction is a branch instruction. Time T1
Since the instruction taken in is a branch instruction, the output 703 of the branch instruction detecting predecoder 702 becomes active, that is, HIGH, and is input to the set side of the flip-flop 704 to set the flip-flop 704. Therefore, the output of the OR gate 705 becomes HIGH, the fetch bus cycle activation request signal 707 output from the NOR gate 706 becomes inactive LOW, and the activation of the fetch bus cycle from time T2 is suspended. The instruction code of the branch instruction fetched in the fetch bus cycle at time T1 is fetched by the instruction decoding execution unit 519 at time T9. In the instruction decoding execution unit 519, the branch instruction detection signal 510 is set to HIGH and is output, which resets the flip-flop 704. When this branch instruction detection signal 510 falls to LOW at time T10, the output value of the OR gate 705 becomes LOW, and the fetch bus cycle activation request signal 707 becomes active, that is, H.
Since it becomes IGH, the fetch bus cycle is activated again from time T11.

【0012】以上説明したように、図7の従来のCPU
701においては、命令コードが分岐命令であるか否か
を、命令キュー502と並列に設けられている分岐命令
検出用プリデコーダ702により、命令コードが命令キ
ューに取込まれると同時に当該分岐命令の判定を行い、
分岐命令であることが分かると直ちに命令フェッチを抑
制している。このために、図6においては、時刻T2 か
ら時刻T7 、および時刻T9 において発生しているける
無効のフェッチバスサイクルは、図7においては発生し
ていない。従って、CPU701のバス占有率を必要限
度まで減少させることにより、CPU701のバスに接
続されている他のバスマスタが空いたバスを利用するこ
と可能となり、システム全体の処理効率が向上されると
い利点がある。
As described above, the conventional CPU shown in FIG.
In 701, a branch instruction detecting predecoder 702 provided in parallel with the instruction queue 502 determines whether or not the instruction code is a branch instruction. Make a decision,
As soon as it is found that the instruction is a branch instruction, the instruction fetch is suppressed. Therefore, in FIG. 6, the invalid fetch bus cycle that occurs from time T2 to time T7 and time T9 does not occur in FIG. Therefore, by reducing the bus occupancy rate of the CPU 701 to the required limit, it becomes possible for other bus masters connected to the bus of the CPU 701 to use the vacant bus, and the processing efficiency of the entire system is improved. is there.

【0013】[0013]

【発明が解決しようとする課題】上述した従来のCPU
においては、実行する命令が条件付きの分岐命令である
場合には、以下に示す欠点がある。
SUMMARY OF THE INVENTION The conventional CPU described above.
However, if the instruction to be executed is a conditional branch instruction, it has the following drawbacks.

【0014】ここにおいて条件付き分岐命令という分岐
命令とは、命令実行処理結果の状態を記憶するCPU内
部のフラグレジスタ即ちプログラムステータスワード
(以下PSWと略称する)の値に従って分岐を行う場合
と行わない場合との動作における違いの生じる命令のこ
とである。これまでに説明した分岐命令は、必ず分岐を
行う無条件分岐命令であった。もしも、図8の時刻T1
において、フェッチされた命令が条件付き分岐命令であ
ったものとする。この分岐命令により実際に分岐が行わ
れるかどうかは、実行時点の時刻T9 におけるPSWの
値によって決定されるために、時刻T1 の時点において
はその判断はできない。分岐命令検出用プリデコーダ7
02においては、無条件分岐命令に対してのみ出力信号
703をHIGHとするので、この場合の条件付き分岐
命令に対しては出力信号703はLOWのままとなる。
よって時刻T2 からのフェッチはそのまま継続される。
しかし、時刻T9 におけるPSWが時刻T1 に取込んだ
命令を分岐実行させる条件であった場合には、時刻T2
以降にフェッチされた命令は全て無効になってしまうと
いう結果となる。即ち、従来のCPUは、フェッチする
命令が、条件付き分岐命令である時には、無効なフェッ
チバスサイクルを停止させることができない。特に、C
PUにおいて実行するプログラムが、全て分岐命令とし
て条件付き分岐命令を使用しない構成になっている場合
には、CPUは、無効のフェッチバスサイクルを数多く
発行してしまうという状態となる。これにより、CPU
のバス占有率を無駄に増加させることによって、システ
ム全体の処理効率を著しく低下させるという欠点があ
る。
Here, a conditional branch instruction, a branch instruction, is a branch instruction according to a value of a flag register in the CPU for storing a state of an instruction execution processing result, that is, a program status word (hereinafter abbreviated as PSW), and not performed. It is an instruction that causes a difference in operation from the case. The branch instructions described so far have been unconditional branch instructions that always branch. If time T1 in Figure 8
In, it is assumed that the fetched instruction is a conditional branch instruction. Whether or not a branch is actually executed by this branch instruction is determined by the value of PSW at time T9 at the time of execution, so that judgment cannot be made at time T1. Branch instruction detection predecoder 7
In 02, since the output signal 703 is set to HIGH only for the unconditional branch instruction, the output signal 703 remains LOW for the conditional branch instruction in this case.
Therefore, the fetch from time T2 is continued.
However, if the PSW at time T9 is a condition for branching the instruction fetched at time T1, then time T2
The result is that all subsequent fetched instructions will be invalid. That is, the conventional CPU cannot stop an invalid fetch bus cycle when the fetched instruction is a conditional branch instruction. In particular, C
When the programs executed in the PU are all configured not to use conditional branch instructions as branch instructions, the CPU is in a state of issuing many invalid fetch bus cycles. This allows the CPU
However, there is a drawback in that the processing efficiency of the entire system is remarkably reduced by unnecessarily increasing the bus occupancy rate.

【0015】また、従来のCPUにおいては、分岐命令
検出用プリデコーダを有しているために、回路規模がそ
の分大きくなり、コストが増大するという欠点がある。
Further, since the conventional CPU has the branch instruction detection predecoder, it has a drawback that the circuit scale becomes large and the cost increases.

【0016】[0016]

【課題を解決するための手段】本発明のCPUは、所定
の記憶装置より読込まれた命令コードを一時的に記憶す
る先読み先出し方式の記憶手段(命令キュー)と、前記
記憶手段に一度記憶された命令コードを読込み、当該命
令コードの解読と実行とを行う命令解読実行手段と、前
記記憶手段に既に読込まれており、前記命令解読実行手
段によって読出されていない命令コードの数を計数して
記憶する第1の計数手段と、を少なくも含む中央処理装
置において、予め定められた時間内に前記命令解読実行
手段により実行された分岐命令の命令数を計数する第2
の計数手段と、前記第1の計数手段の計数値と、前記前
記第2の計数手段の計数値との組合わせにより、フェッ
チバスサイクル要求を抑制する手段と、を少なくとも備
えて構成されることを特徴としている。
A CPU of the present invention is a pre-read-out type storage means (instruction queue) for temporarily storing an instruction code read from a predetermined storage device, and the storage means once stored in the storage means. The instruction decoding execution means for reading the instruction code and decoding and executing the instruction code, and the number of the instruction codes already read in the storage means and not read by the instruction decoding execution means are counted. A central processing unit including at least a first counting unit that stores the second counting unit that counts the number of branch instructions executed by the instruction decoding execution unit within a predetermined time;
And a means for suppressing a fetch bus cycle request by a combination of the count value of the first count means and the count value of the second count means. Is characterized by.

【0017】なお、前記第2の計数手段は、前記予め定
められた時間を切替える機能を有するスイッチ回路を備
えて構成してもよい。
The second counting means may be provided with a switch circuit having a function of switching the predetermined time.

【0018】[0018]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

【0019】図1は本発明の一実施例を示すブロック図
である。図1に示されるように、本実施例のCPU10
1は、CPU外部データバスに対応して、命令キュー5
02と、トランスファーゲート503および504と、
カウンタ102および512と、バスサイクル制御回路
514と、セレクタ103と、ANDゲート112〜1
14と、ORゲート115〜117と、NORゲート5
15と、命令解読実行ユニット519と、キューリード
ライト制御回路520とを備えて構成されている。な
お、図1においては、前述の従来例の場合と同様に、命
令キュー502の容量を8ワードとして説明するものと
する。
FIG. 1 is a block diagram showing an embodiment of the present invention. As shown in FIG. 1, the CPU 10 of this embodiment
1 is an instruction queue 5 corresponding to the CPU external data bus
02, transfer gates 503 and 504,
Counters 102 and 512, bus cycle control circuit 514, selector 103, and AND gates 112 to 1
14, OR gates 115 to 117, and NOR gate 5
15, an instruction decoding execution unit 519, and a queue read / write control circuit 520. In FIG. 1, the capacity of the instruction queue 502 will be described as 8 words, as in the case of the above-described conventional example.

【0020】図1において、分岐命令数をカウンとする
機能を有するカウンタ102においては、命令解読実行
ユニット519より出力される分岐命令検出信号510
とクロックとを入力し、所定の時間内に実行された分岐
命令の数をカウントして、その値を端子123、12
2、121および120に出力する。分岐命令数をカウ
ントするカウンタ102により出力されるカウント値
は、本実施例においては4ビットとしており、その上位
ビットの順に端子123、122、121および120
に出力される。ここで、カウンタ102に入力されるク
ロックとしては、例えばCPU101の基本クロックを
使用すればよい。命令解読実行ユニット519において
は、命令キュー502から出力される命令を取込み、そ
の命令が分岐を行う場合に、当該分岐命令が無条件分岐
命令の場合または条件付き分岐命令で条件が成立した場
合においては、分岐命令検出信号510をHIGHレベ
ルにして出力する。ANDゲート112、113および
114より出力される信号104、105および106
と、カウンタ102より出力される信号107は、セレ
クタ103に入力される。ここにおいて、カウンタ10
2のカウンタ出力値が、8以上の時には信号107がH
IGHレベルになり、4以上で7以下の時には信号10
6がHIGHレベルになり、2以上で3以下の時には信
号105がHIGHレベルになり、そして1以下の時に
は信号104がHIGHレベルになる。また、信号10
8は、4ビットのカウンタ512のカウント値が8の時
にはHIGHレベルとなり、信号109はカウンタ51
2のカウンタ値が4以上にHIGHレベルになり、信号
110はカウンタ512のカウンタ値が2以上の時にH
IGHレベルになり、そして信号517はカウンタ51
2のカウンタ値が1以上の時にHIGHレベルになる。
セレクタ103においては、信号107がHIGHレベ
ルの時には信号517を、信号106がHIGHレベル
の時には信号110を、信号105がHIGHレベルの
時には信号109を、そして信号104がHIGHレベ
ルの時には信号108を、それぞれNORゲート515
に出力する。NORゲート515の出力信号は、フェッ
チバスサイクル起動要求信号111としてバスサイクル
制御回路514に入力される。なお、これ以外の他の構
成要素については図5に示される従来例と同様であり、
その説明は省略する。
In FIG. 1, in the counter 102 having the function of counting the number of branch instructions, the branch instruction detection signal 510 output from the instruction decoding execution unit 519.
And a clock are input, the number of branch instructions executed within a predetermined time is counted, and the value is determined by the terminals 123 and 12.
2, 121 and 120. The count value output by the counter 102 that counts the number of branch instructions is 4 bits in the present embodiment, and the terminals 123, 122, 121 and 120 are arranged in the order of the higher order bits.
Is output to. Here, as the clock input to the counter 102, for example, the basic clock of the CPU 101 may be used. In the instruction decoding execution unit 519, when an instruction output from the instruction queue 502 is fetched and the instruction branches, if the branch instruction is an unconditional branch instruction or a condition is satisfied by a conditional branch instruction, Outputs the branch instruction detection signal 510 to the HIGH level and outputs it. Signals 104, 105 and 106 output from AND gates 112, 113 and 114
Then, the signal 107 output from the counter 102 is input to the selector 103. Here, the counter 10
When the counter output value of 2 is 8 or more, the signal 107 is H
When it goes to IGH level and is 4 or more and 7 or less, signal 10
6 becomes HIGH level, the signal 105 becomes HIGH level when it is 2 or more and 3 or less, and the signal 104 becomes HIGH level when it is 1 or less. Also, signal 10
8 is HIGH when the count value of the 4-bit counter 512 is 8, and the signal 109 indicates the counter 51.
When the counter value of 2 becomes 4 or higher, the signal 110 becomes high when the counter value of the counter 512 is 2 or higher.
IGH level, and the signal 517 is the counter 51.
When the counter value of 2 is 1 or more, it becomes HIGH level.
In the selector 103, the signal 517 is output when the signal 107 is HIGH level, the signal 110 is output when the signal 106 is HIGH level, the signal 109 is output when the signal 105 is HIGH level, and the signal 108 is output when the signal 104 is HIGH level. NOR gate 515 respectively
Output to. The output signal of the NOR gate 515 is input to the bus cycle control circuit 514 as the fetch bus cycle activation request signal 111. Note that the other components other than this are the same as those in the conventional example shown in FIG.
The description is omitted.

【0021】ここにおいて、分岐命令数をカウントする
カウンタ102により、予め定められている時間内に、
前記命令解読実行ユニット519において実行された分
岐命令の命令数をカウントして記憶する第2のカウンタ
を構成し、ANDゲート112、113および114
と、ORゲート115、116および117と、セレク
タ103とにより、命令キュー502に既に読込まれて
前記命令解読実行ユニット519より読出されていない
命令コード数をカウントして記憶する第1のカウンタの
カウント値と前記第2のカウンタのカウント値との組合
わせにより、フェッチバスサイクルを抑制する回路が構
成されている。
Here, by the counter 102 which counts the number of branch instructions, within a predetermined time,
A second counter for counting and storing the number of branch instructions executed in the instruction decoding execution unit 519 is constituted, and AND gates 112, 113 and 114 are formed.
A count of a first counter that counts and stores the number of instruction codes that have already been read into the instruction queue 502 and have not been read out from the instruction decoding execution unit 519 by the OR gates 115, 116 and 117, and the selector 103. A combination of the value and the count value of the second counter constitutes a circuit that suppresses the fetch bus cycle.

【0022】次に、図1に示される本実施例の動作につ
いて説明するに先立って、図1の構成要素である分岐実
行命令数をカウントするカウンタ102の動作について
図2を参照して説明する。
Before explaining the operation of the present embodiment shown in FIG. 1, the operation of the counter 102 for counting the number of branch execution instructions, which is a component of FIG. 1, will be described with reference to FIG. .

【0023】図2は、本実施例における分岐実行命令数
をカウントするカウンタ102の第1の実施例を示すブ
ロック図である。入力端子119には分岐命令検出信号
510が入力され、4ビットのカウンタ201をカウン
トアップする。カウンタ206は、入力端子118にク
ロック信号によりカウントアップされる。また、4ビッ
トのラッチ205は、カウンタ201のカウント値を入
力して、カウンタ206のキャリー信号207によりそ
の値を保持し、出力端子120、121、122および
123に出力する。NANDゲート203とANDゲー
ト202は、カウンタ201のオーバーフローを防止す
る働きをする。
FIG. 2 is a block diagram showing a first embodiment of the counter 102 for counting the number of branch execution instructions in this embodiment. The branch instruction detection signal 510 is input to the input terminal 119, and the 4-bit counter 201 is counted up. The counter 206 is counted up by the clock signal at the input terminal 118. The 4-bit latch 205 inputs the count value of the counter 201, holds the value by the carry signal 207 of the counter 206, and outputs the value to the output terminals 120, 121, 122 and 123. The NAND gate 203 and the AND gate 202 serve to prevent the counter 201 from overflowing.

【0024】次に、図2のカウンタ102の動作につい
て説明する。入力端子118に入力されるクロック信号
により、カウンタ206はカウントアップされる。その
間に入力端子119に入力される分岐命令検出信号51
0により、カウンタ201はカウントアップされる。即
ち、カウンタ201により、実行された分岐命令数が示
される。カウンタ206のカウント数が2の8乗の25
6に到達すると、キャリー信号207がHIGHレベル
となり、ラッチ205においては、その時のカウンタ2
01のカウント値をラッチする。この時、ラッチ205
によりラッチされた値は、カウンタ206が256回カ
ウントする間に実行された分岐命令数を示している。次
に、キャリ−信号207は、遅延回路204を経由して
カウンタ201のカウント値をリセットする。これによ
り、カウンタ201は再度分岐命令数を1からカウント
してゆく。キャリー信号207を出力したカウンタ20
6においても同様に再度全ビットが0となり、再びカウ
ントアップが行われる。
Next, the operation of the counter 102 shown in FIG. 2 will be described. The counter 206 is incremented by the clock signal input to the input terminal 118. Meanwhile, a branch instruction detection signal 51 input to the input terminal 119.
The counter 201 is incremented by 0. That is, the counter 201 indicates the number of executed branch instructions. The number of counts of the counter 206 is 2 8 25
When it reaches 6, the carry signal 207 becomes HIGH level, and in the latch 205, the counter 2 at that time is
Latch the count value of 01. At this time, the latch 205
The value latched by indicates the number of branch instructions executed while the counter 206 counts 256 times. Next, the carry signal 207 resets the count value of the counter 201 via the delay circuit 204. As a result, the counter 201 counts the number of branch instructions from 1 again. Counter 20 that outputs carry signal 207
In 6 as well, similarly, all the bits become 0 again, and the count-up is performed again.

【0025】次に、図1のCPU101の動作について
説明する。最初は、分岐実行命令数をカウントするカウ
ンタ102におけるカウント値が0、即ち出力端子12
0、121、122および123が全て0であるものと
する。この時にはANDゲート112より出力される信
号104はHIGHレベルとなるので、セレクタ103
においては、信号108をNORゲート515に対する
入力として選択する。これは、カウンタ512のカウン
ト値が8、即ち命令キュー502に格納された命令数が
8ワードとなった時に、NORゲート515の出力であ
るフェッチバスサイクル起動要求信号111がLOWと
なり、フェッチバスサイクル要求が抑制されることを意
味している。
Next, the operation of the CPU 101 shown in FIG. 1 will be described. Initially, the count value in the counter 102 that counts the number of branch execution instructions is 0, that is, the output terminal 12
It is assumed that 0, 121, 122 and 123 are all 0. At this time, the signal 104 output from the AND gate 112 becomes HIGH level, so that the selector 103
, Select signal 108 as an input to NOR gate 515. This is because when the count value of the counter 512 is 8, that is, when the number of instructions stored in the instruction queue 502 becomes 8 words, the fetch bus cycle activation request signal 111 output from the NOR gate 515 becomes LOW, and the fetch bus cycle It means that the demand is suppressed.

【0026】分岐実行命令数をカウントするカウンタ1
02においては、命令解読実行ユニット519から出力
される分岐命令検出信号510の入力を受けて、命令解
読実行ユニット519により分岐が行われた命令数がカ
ウントされる。このカウントは、クロック入力端子11
8に入力されるクロックにより計数される所定時間中ご
とに行われ、その時間の間においてカウンタされた値
が、端子123、122、121および120に出力さ
れる。仮に、所定時間経過後において、期間中に実行さ
れた分岐命令の数が、2命令かまたは3命令であったも
のとする。この場合には、カウンタ102の出力端子1
21はHIGHレベル、出力端子123および122は
LOWレベルとなるので、信号105はHIGHレベル
となる。よって、セレクタ103においては、信号10
9をNORゲート515に対する入力として選択する。
これは、カウンタ512のカウント値が4以上、即ち命
令キュー502に格納されている命令数が4ワード以上
となった時に、NORゲート515の出力であるフェッ
チバスサイクル起動要求信号111がLOWレベルとな
り、フェッチバスサイクル要求が抑制されることを示し
ている。
Counter 1 for counting the number of branch execution instructions
In 02, the number of instructions branched by the instruction decoding execution unit 519 is counted in response to the input of the branch instruction detection signal 510 output from the instruction decoding execution unit 519. This count is based on the clock input terminal 11
The operation is performed every predetermined time counted by the clock input to 8, and the value counted during that time is output to the terminals 123, 122, 121 and 120. It is assumed that the number of branch instructions executed during the period is two or three after the lapse of a predetermined time. In this case, the output terminal 1 of the counter 102
21 is HIGH level, and the output terminals 123 and 122 are LOW level, so that the signal 105 is HIGH level. Therefore, in the selector 103, the signal 10
9 is selected as the input to NOR gate 515.
This is because when the count value of the counter 512 is 4 or more, that is, when the number of instructions stored in the instruction queue 502 is 4 words or more, the fetch bus cycle activation request signal 111 output from the NOR gate 515 becomes LOW level. , Fetch bus cycle requests are suppressed.

【0027】次に、所定時間経過後に、期間中に実行さ
れた分岐命令の数が4命令から7命令に間であった場合
について説明する。この場合においては、カウンタ10
2の出力端子122がHIGHレベル、出力端子123
はLOWレベルとなることにより、信号114がHIG
Hレベルとなる。よって、セレクタ103においては、
信号110をNORゲート515に対する入力として選
択する。これは、カウンタ512のカウント数が2以
上、即ち命令キュー502に格納された命令数が2ワー
ド以上となった時に、NORゲート515の出力である
フェッチバスサイクル起動要求信号111がLOWにな
って、フェッチバスサイクル要求が抑制されることを意
味している。次に、所定時間経過後に、期間中に実行さ
れた分岐命令の数が8命令以上であった場合について説
明する。この場合においては、カウンタ102の出力端
子123がHIGHレベルとなることにより信号107
がHIGHレベルとなる。よって、セレクタ103にお
いては、信号517をNORゲート515に対する入力
として選択する。これは、カウンタ512のカウント数
が1以上、即ち命令キュー502に格納された命令数が
1ワード以上となった時に、NORゲート515の出力
であるフェッチバスサイクル起動要求信号111がLO
Wになって、フェッチバスサイクル要求が抑制されるこ
とを意味している。
Next, a case where the number of branch instructions executed during the period after the lapse of a predetermined time is between 4 and 7 will be described. In this case, the counter 10
The output terminal 122 of 2 is HIGH level, and the output terminal 123
Goes low, the signal 114 goes high.
It becomes H level. Therefore, in the selector 103,
Signal 110 is selected as an input to NOR gate 515. This is because when the count number of the counter 512 is 2 or more, that is, when the number of instructions stored in the instruction queue 502 is 2 words or more, the fetch bus cycle activation request signal 111 output from the NOR gate 515 becomes LOW. , Means that fetch bus cycle requests are suppressed. Next, a case where the number of branch instructions executed during the period after the predetermined time has elapsed is eight or more will be described. In this case, since the output terminal 123 of the counter 102 becomes HIGH level, the signal 107
Becomes HIGH level. Therefore, the selector 103 selects the signal 517 as an input to the NOR gate 515. This is because when the count number of the counter 512 is 1 or more, that is, when the number of instructions stored in the instruction queue 502 is 1 word or more, the fetch bus cycle activation request signal 111 output from the NOR gate 515 is LO.
This means that the fetch bus cycle request is suppressed to W.

【0028】図3は、以上において説明した図1のCP
U101の動作を示すタイミング図であり、CPU10
1により、図8に示されるタイミング図の場合と同一の
命令を実行する場合の動作に対応するタイミング図であ
る。時刻T0 までは、信号104がHIGHレベルであ
るため、フエッチバスサイクルの抑制条件は、カウンタ
512のカウント値が8になることである。このときの
カウンタ512における値は未だ8に達していないの
で、次の時刻T1 においてフェッチバスサイクルが起動
されている。今、時刻T1 においてカウンタ102の出
力が変化し、信号107がHIGH、信号104がLO
Wになったものとする。この時におけるフェッチバスサ
イクルの抑制条件は、カウンタ512のカウント値が1
以上になることとなる。時刻T1 においてはカウンタ5
12のカウント値は1を越えているので、時刻T2 から
のフェッチバスサイクルは抑制される。時刻T1 におい
てフェッチされた分岐命令は時刻T10において実行さ
れ、時刻T11においては、新たなフェッチバスサイクル
が起動される。なお、図3においては、無効なフェッチ
バスサイクルは発生していない。
FIG. 3 shows the CP of FIG. 1 explained above.
FIG. 7 is a timing chart showing the operation of U101, which is a CPU 10
FIG. 9 is a timing diagram corresponding to the operation when executing the same instruction as in the timing diagram shown in FIG. 8 by 1. Since the signal 104 is at the HIGH level until the time T0, the condition for suppressing the futuristic bus cycle is that the count value of the counter 512 becomes 8. Since the value in the counter 512 at this time has not yet reached 8, the fetch bus cycle is activated at the next time T1. Now, at time T1, the output of the counter 102 changes, the signal 107 is HIGH, and the signal 104 is LO.
Suppose it has become W. The condition for suppressing the fetch bus cycle at this time is that the count value of the counter 512 is 1
That is all. Counter 5 at time T1
Since the count value of 12 exceeds 1, the fetch bus cycle from time T2 is suppressed. The branch instruction fetched at time T1 is executed at time T10, and a new fetch bus cycle is started at time T11. In FIG. 3, an invalid fetch bus cycle has not occurred.

【0029】次に、本発明の他の実施例について説明す
る。本実施例は、その全体の構成は図1と同一である
が、分岐実行命令数をカウントするカウンタ102の内
部構成において、前述の実施例とは差異がある。図4
は、分岐実行命令数をカウントするカウンタ102の第
2の実施例の内部構成を示すブロック図である。図4に
示されるように、当該カウンタ102は、カウンタ20
1および206と、ANDゲート202と、NANDゲ
ート203と、遅延回路204と、ラッチ205と、切
替スイッチ304とを備えて構成されており、切替スイ
ッチ304が新たに付加されている。この切替スイッチ
304により、キャリー信号207としては、カウンタ
206の第5ビット目からのキャリー信号と、第6ビッ
ト目からのキャリー信号と、第7ビット目からのキャリ
ー信号とを含む3本のキャリー信号の内から、1本のキ
ャリー信号を選択することが可能となる。
Next, another embodiment of the present invention will be described. The present embodiment has the same overall configuration as that of FIG. 1, but is different from the above-described embodiments in the internal configuration of the counter 102 that counts the number of branch execution instructions. Figure 4
FIG. 8 is a block diagram showing an internal configuration of a second embodiment of a counter 102 that counts the number of branch execution instructions. As shown in FIG. 4, the counter 102 is the counter 20.
1 and 206, an AND gate 202, a NAND gate 203, a delay circuit 204, a latch 205, and a changeover switch 304, and a changeover switch 304 is newly added. By the changeover switch 304, as the carry signal 207, three carry signals including a carry signal from the fifth bit of the counter 206, a carry signal from the sixth bit, and a carry signal from the seventh bit are carried. It is possible to select one carry signal from the signals.

【0030】図3に示されるタイミング図においては、
分岐実行命令数のカウントを行う時間間隔が256クロ
ック時間の固定値であったのに対して、本実施例のカウ
ンタ102によれば、この時間間隔を256クロック時
間のみではなく、128クロック時間および64クロッ
ク時間をも含む三つの時間の内より、切替スイッチ30
4により任意に選択することができる。これにより、C
PU101により実行される命令、即ちソフトウェアに
合わせて最も実行効率のよい組合わせを、切替スイッチ
304により設定することができる。
In the timing diagram shown in FIG.
While the time interval for counting the number of branch execution instructions is a fixed value of 256 clock times, according to the counter 102 of the present embodiment, this time interval is not only 256 clock times but 128 clock times and The changeover switch 30 is selected from among the three times including the 64 clock time.
It can be arbitrarily selected by 4. This gives C
An instruction executed by the PU 101, that is, a combination having the highest execution efficiency according to software can be set by the changeover switch 304.

【0031】[0031]

【発明の効果】以上説明したように、本発明は、予め定
められた時間内に命令解読実行ユニットにより実行され
た分岐命令数を記憶するカウンタと、当該カウンタのカ
ウント値と命令キューに格納されている命令数をカウン
トするカウント値との組合わせによりフェッチを停止す
る手段を有することにより、分岐命令の種類に無関係に
無効なフェッチバスサイクルを低減することが可能とな
り、CPUのバス占有率を必要限度に低下させることこ
とにより、システム全体の処理効率を向上することがで
きるという効果がある。
As described above, according to the present invention, the counter for storing the number of branch instructions executed by the instruction decoding execution unit within a predetermined time, the count value of the counter and the instruction queue are stored. By providing a means for stopping the fetch by a combination with a count value that counts the number of instructions being executed, it is possible to reduce invalid fetch bus cycles regardless of the type of branch instruction, and to reduce the CPU bus occupation rate. There is an effect that the processing efficiency of the entire system can be improved by lowering it to the required limit.

【0032】また、本発明は、2本のカウンタと1個の
ラッチ、1個のセレクタに10個程度の論理ゲートとい
う小規模の回路構成により実現することができるため、
従来技術において必要とされた回路規模の大きい分岐命
令検出用プリデコーダが不要となり、コストを低減する
ことができるという効果がある。
Further, the present invention can be realized by a small-scale circuit configuration of two counters, one latch, and one selector and about 10 logic gates.
The branch instruction detecting predecoder, which has a large circuit scale and is required in the related art, is not required, and the cost can be reduced.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】前記実施例における分岐命令数をカウントする
カウンタの第1の実施例を示すブロック図である。
FIG. 2 is a block diagram showing a first embodiment of a counter for counting the number of branch instructions in the above embodiment.

【図3】前記一実施例の動作を示すタイミング図であ
る。
FIG. 3 is a timing chart showing an operation of the one embodiment.

【図4】前記実施例における分岐命令数をカウントする
カウンタの第2の実施例を示すブロック図である。
FIG. 4 is a block diagram showing a second embodiment of a counter for counting the number of branch instructions in the above embodiment.

【図5】従来例を示すブロック図である。FIG. 5 is a block diagram showing a conventional example.

【図6】従来例の動作を示すタイミング図である。FIG. 6 is a timing chart showing an operation of a conventional example.

【図7】他の従来例を示すブロック図である。FIG. 7 is a block diagram showing another conventional example.

【図8】前記他の従来例の動作を示すタイミング図であ
る。
FIG. 8 is a timing chart showing an operation of the other conventional example.

【符号の説明】[Explanation of symbols]

101、501、701 CPU 102、201、206、512 カウンタ 103 セレクタ 112〜114、202 ANDゲート 115〜117 ORゲート 203 NANDゲート 204 遅延回路 205 ラッチ 304 切替スイッチ 502 命令キュー 503、504 トランスファ−ゲート 505 内部データバス 514 バスサイクル制御回路 515 NORゲート 516 論理和ゲート 518 データバス 519 命令解読実行ユニット 520 キューリードライト制御回路 702 分岐命令検出用プリデコーダ 704 フリップフロップ 101, 501, 701 CPU 102, 201, 206, 512 counter 103 selector 112-114, 202 AND gate 115-117 OR gate 203 NAND gate 204 delay circuit 205 latch 304 changeover switch 502 instruction queue 503, 504 transfer gate 505 internal Data bus 514 Bus cycle control circuit 515 NOR gate 516 OR gate 518 Data bus 519 Instruction decoding execution unit 520 Queue read / write control circuit 702 Branch instruction detection predecoder 704 Flip-flop

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 所定の記憶装置より読込まれた命令コー
ドを一時的に記憶する先読み先出し方式の記憶手段(命
令キュー)と、前記記憶手段に一度記憶された命令コー
ドを読込み、当該命令コードの解読と実行とを行う命令
解読実行手段と、前記記憶手段に既に読込まれており、
前記命令解読実行手段によって読出されていない命令コ
ードの数を計数して記憶する第1の計数手段と、を少な
くも含む中央処理装置において、 予め定められた時間内に前記命令解読実行手段により実
行された分岐命令の命令数を計数する第2の計数手段
と、 前記第1の計数手段の計数値と、前記前記第2の計数手
段の計数値との組合わせにより、フェッチバスサイクル
要求を抑制する手段と、 を少なくとも備えて構成されることを特徴とする中央処
理装置。
1. A read-ahead first-out type storage means (instruction queue) for temporarily storing an instruction code read from a predetermined storage device, and an instruction code once stored in the storage means to read the instruction code Instruction decoding execution means for performing decoding and execution, and already read in the storage means,
In a central processing unit including at least a first counting means for counting and storing the number of instruction codes not read by the instruction decoding execution means, the instruction decoding execution means executes within a predetermined time. A fetch bus cycle request is suppressed by a combination of a second counting unit that counts the number of branch instructions that have been executed, a count value of the first counting unit, and a count value of the second counting unit. A central processing unit, comprising:
【請求項2】 前記第2の計数手段が、前記予め定めら
れた時間を切替える機能を有するスイッチ回路を備える
ことを特徴とする請求項1記載の中央処理装置。
2. The central processing unit according to claim 1, wherein the second counting means includes a switch circuit having a function of switching the predetermined time.
JP5324993A 1993-12-22 1993-12-22 Central processor Pending JPH07182164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5324993A JPH07182164A (en) 1993-12-22 1993-12-22 Central processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5324993A JPH07182164A (en) 1993-12-22 1993-12-22 Central processor

Publications (1)

Publication Number Publication Date
JPH07182164A true JPH07182164A (en) 1995-07-21

Family

ID=18171939

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5324993A Pending JPH07182164A (en) 1993-12-22 1993-12-22 Central processor

Country Status (1)

Country Link
JP (1) JPH07182164A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009530753A (en) * 2006-03-21 2009-08-27 フリースケール セミコンダクター インコーポレイテッド Data processor with dynamic control of instruction prefetch buffer depth and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009530753A (en) * 2006-03-21 2009-08-27 フリースケール セミコンダクター インコーポレイテッド Data processor with dynamic control of instruction prefetch buffer depth and method
US9304773B2 (en) 2006-03-21 2016-04-05 Freescale Semiconductor, Inc. Data processor having dynamic control of instruction prefetch buffer depth and method therefor

Similar Documents

Publication Publication Date Title
US7159133B2 (en) Low-power processor hint, such as from a pause instruction
US5455924A (en) Apparatus and method for partial execution blocking of instructions following a data cache miss
EP0992907B1 (en) Trace fifo management
US6857060B2 (en) System, apparatus and method for prioritizing instructions and eliminating useless instructions
US20090271790A1 (en) Computer architecture
US5887129A (en) Asynchronous data processing apparatus
US5233691A (en) Register window system for reducing the need for overflow-write by prewriting registers to memory during times without bus contention
TW201305821A (en) Flexible flash commands
US20090113192A1 (en) Design structure for improving efficiency of short loop instruction fetch
JPH07129413A (en) Interruption processor
JP2532300B2 (en) Instruction supply device in parallel processing device
US6920549B1 (en) Branch history information writing delay using counter to avoid conflict with instruction fetching
KR100431975B1 (en) Multi-instruction dispatch system for pipelined microprocessors with no branch interruption
US20050257224A1 (en) Processor with instruction-based interrupt handling
JPH07182164A (en) Central processor
EP0992889A1 (en) Interrupt processing during iterative instruction execution
US20040128484A1 (en) Method and apparatus for transparent delayed write-back
JP2006221664A (en) Risc microprocessor priority vector interrupt system
US7124277B2 (en) Method and apparatus for a trace cache trace-end predictor
JPH07505242A (en) Elimination of critical paths in the operation of memory control units and input/output control units
JP2636074B2 (en) Microprocessor
TW202144998A (en) Device and method for controlling command sequence
JPH02236651A (en) Memory buffer
CN116088942A (en) Instruction execution method, device, chip and computer equipment
JPS598058A (en) Microprocessor

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19990323