JP2004362454A - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP2004362454A
JP2004362454A JP2003162744A JP2003162744A JP2004362454A JP 2004362454 A JP2004362454 A JP 2004362454A JP 2003162744 A JP2003162744 A JP 2003162744A JP 2003162744 A JP2003162744 A JP 2003162744A JP 2004362454 A JP2004362454 A JP 2004362454A
Authority
JP
Japan
Prior art keywords
instruction
processing
pipeline
microprocessor
present
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.)
Withdrawn
Application number
JP2003162744A
Other languages
Japanese (ja)
Inventor
Tamotsu 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.)
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi ULSI 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 Hitachi ULSI Systems Co Ltd filed Critical Hitachi ULSI Systems Co Ltd
Priority to JP2003162744A priority Critical patent/JP2004362454A/en
Publication of JP2004362454A publication Critical patent/JP2004362454A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Advance Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microprocessor provided with high processing capacity at low power consumption. <P>SOLUTION: Program counters (PCs) in the same number as that pipelines or more are prepared, and processing for successively fetching instructions of the address 0 of the PC 1 up to the address 0 of the PC 6 is performed. Then, the processing of fetching an instruction from the address 1 of the PC1 and so forth is performed. By the constitution and the processing, a pipeline stall is not generated in principle. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、マイクロプロセッサに関し、特に、低消費電力を必要とするマイクロプロセッサに適用して有効な技術に関する。
【0002】
【従来の技術】
本発明者が検討したところによれば、マイクロプロセッサの技術に関しては、以下のような技術が考えられる。
【0003】
現在、パイプライン機能を搭載したマイクロプロセッサが多く実在している。これらのマイクロプロセッサは、通常1本のプログラムカウンタを備え、パイプライン処理を実行している。また、パイプラインストールが発生した場合の穴埋めとして、更にもう1本のプログラムカウンタやそれに伴う演算回路などを備えたものも存在する。
【0004】
【発明が解決しようとする課題】
ところで、前記のようなマイクロプロセッサの技術について、本発明者が検討した結果、以下のようなことが明らかとなった。
【0005】
現在、パソコンや携帯電話などのように、様々な機器においてマイクロプロセッサが用いられている。例えば、携帯電話のマイクロプロセッサは、本来の電話機能の処理以外に、ブラウザ機能や動画/静止画の記録および再生などの付加機能の処理も行わなくてはならない。
【0006】
したがって、パソコンなどでは勿論のこと、携帯電話などにおいても、マイクロプロセッサに対して、高い処理能力が要求されてきている。そして、とりわけ携帯機器においては、低消費電力も兼ね備えなければならない。
【0007】
しかしながら、従来技術のようなマイクロプロセッサでは、高クロックで動作させるためにパイプラインを深くすると、分岐時のペナルティにより性能が低下してしまう。また、前の命令の結果を次の命令で使用するなどの命令の依存関係があると、次の命令の実行が待たされてしまい、これによっても性能が低下する。
【0008】
これらのようにパイプライン処理が乱れることを、パイプラインストールやパイプラインハザードなどと呼ぶ。現状では、このパイプラインストールを低減するため、分岐予測回路などによる分岐予測および投機実行や、命令順序を入れ替える回路などによる命令の依存関係を取り除く処理などを行っている。ところが、近年、これらの回路規模が格段に大きくなる傾向にあり、回路面積や消費電力の増加が無視できないものとなってきている。
【0009】
そこで、本発明の目的は、低消費電力のマイクロプロセッサを提供することにある。
【0010】
本発明の前記並びにその他の目的と新規な特徴は、本明細書の記述及び添付図面から明らかになるであろう。
【0011】
【課題を解決するための手段】
本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。
【0012】
本発明によるマイクロプロセッサは、パイプラインの段数と同数以上のプログラムカウンタを有し、1クロック毎に前記プログラムカウンタを順番に切り替えながら、前記プログラムカウンタが示す命令をパイプライン処理で実行するものである。この構成により、パイプラインストールを原理的に防止することができる。
【0013】
【発明の実施の形態】
以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一部材には同一の符号を付し、その繰り返しの説明は省略する。
【0014】
本発明の実施の形態では、本発明の一実施の形態のマイクロプロセッサの特徴を判り易くするために、本発明の前提となる従来のマイクロプロセッサと比較しながら説明する。
【0015】
図1は、本発明の前提となる従来のマイクロプロセッサにおける、パイプラインの処理方法の一例を示す概略図である。
【0016】
従来のマイクロプロセッサは、1本のプログラムカウンタ(PC)を持ち、1プロセス内でパイプラインを形成している。図1の例では、6段のパイプラインを有し、PCが示すアドレス0〜4に存在する5つの命令を、パイプラインで処理している。通常、この5つの命令は、1プロセス内の命令に該当し、いわば一つのタスクに含まれる命令となる。
【0017】
パイプラインの各段は、例えば、IF(命令フェッチ)段と、ID(命令デコード)段と、EX(命令実行)段と、MA(メモリアクセス)段と、2つのmm(演算処理)段などから構成される。
【0018】
図1は、理想的なパイプライン処理を示しているが、実際には、命令の種類や依存関係などによって、パイプラインストールが発生する。その具体例に関しては図4などで後述するが、本質的に、パイプラインストールは、前の命令の処理が終わる前に次の命令の処理に着手することから発生する。
【0019】
図2は、本発明の一実施の形態のマイクロプロセッサにおける、パイプラインの処理方法の一例を示す概略図である。
【0020】
本発明の一実施の形態のマイクロプロセッサは、パイプラインの段数と同数以上のプログラムカウンタを有し、1クロック毎に前記プログラムカウンタを順番に切り替えながら、前記プログラムカウンタが示す命令をパイプライン処理で実行するものである。
【0021】
すなわち、図2においては、パイプライン段数とPCの本数を同数とし、前記図1と同様に6段のパイプラインと、6本のPC(PC1〜6)を有し、そして各PC毎に異なるプロセスが割り当てられるものとする。このような構成において、クロック毎の処理手順は、例えば、下記のようになる。なお、下記の説明において、クロック毎に時間tの値が+1増加するものとする。
【0022】
t=1で、PC1が示すアドレス0の命令をフェッチする。
【0023】
t=2で、PC1が示すアドレス0の命令をデコードし、同時に、PC2が示すアドレス0の命令をフェッチする。
【0024】
t=3で、PC1が示すアドレス0の命令の実行とPC2が示すアドレス0の命令のデコードを行い、同時に、PC3が示すアドレス0の命令をフェッチする。
【0025】
以下同様にして、t=6で、PC1とPC2の演算処理と、PC3のメモリアクセスと、PC4の命令実行と、PC5の命令デコードと、PC6が示すアドレス0の命令フェッチが行われる。
【0026】
そして、t=7で、PC2〜PC6が示すアドレス0に対する処理と共に、PC1が示す次の命令、すなわちアドレス1の命令がフェッチされる。以降、t=8〜12において、順次PC2〜6が示すアドレス1の命令フェッチが行われる。
【0027】
なお、前記アドレス0と1は、物理アドレスではなく、各PC毎の論理アドレスを示すものである。
【0028】
ここで、PC1に着目すると、図2の下部に示すように、アドレス0の命令の処理が完了した後にアドレス1の命令の処理が行われている。他のPCに関しても同様で、同一PC内の命令は、必ず、前の命令の処理が完了してから次の命令が実行されることになる。
【0029】
つまり、同一PC内では、従来のように前の命令の処理が終わる前に次の命令の処理に着手するようなことがないため、パイプラインストールが原理的に発生しなくなる。そして、同一PC内を同一プロセスとし、各PC毎に異なるプロセスを割り当てると、パイプラインストールを発生させることなく、複数のプロセスの処理(マルチタスク処理)が可能となる。
【0030】
このように、パイプラインストールが原理的に発生しなくなると、さらに、下記(1)〜(4)のような効果が得られる。
【0031】
(1)分岐予測などの機能が不要となり、トランジスタ数の削減と消費電力の低減が図れる。
【0032】
(2)パイプライン段数を非常に深くすることができ、高クロック化が図れる。
【0033】
(3)MPEG(moving pictures expert group)などのように、各処理ブロックが並列して動作するシステムで、とりわけ演算器の使用効率を上げることができる。
【0034】
つまり、各PC毎に異なる処理ブロックを割り当てることで並列処理が可能となる。さらに、MPEGなどの画像処理においては、一般的に、可変長符号化/復号化などの処理で分岐命令が多く用いられるが、従来のように分岐予測ミスなどが発生することもない。
【0035】
(4)コンパイラなどで、パイプライン処理に関する命令の最適化処理などが行われる場合があるが、こういった処理を簡素化できる。
【0036】
図3は、本発明の一実施の形態のマイクロプロセッサにおいて、その構成の一例を示す概略図である。
【0037】
図3のマイクロプロセッサは、例えば、6本のプログラムカウンタ(PC1〜6)と、6段のパイプラインステージなどを有している。
【0038】
この6段のパイプラインステージは、例えば、命令フェッチ(IF)ステージと、命令デコード(ID)ステージと、命令実行(EX)ステージと、メモリアクセス(MA)ステージと、演算処理(mm)ステージと、レジスタライトバック(WB)ステージなどから構成される。
【0039】
各プログラムカウンタには、それぞれ依存関係がないプロセスが割り当てられ、各プロセス毎に命令コードメモリが割り当てられている。そして、1クロック毎に、各プログラムカウンタを順番に切り替えながらパイプライン処理を行う。
【0040】
ここで、図3に示すマイクロプロセッサの動作について、簡単なプログラム例を挙げ、従来の動作と比較しながら説明する。
【0041】
まず、図4は、本発明の前提となるマイクロプロセッサにおいて、簡単なプログラム例に対する従来のパイプラインの処理方法の一例を示す図である。図4では、命令▲1▼〜▲8▼により構成されるプログラム例を、従来のパイプラインで処理している。命令▲1▼〜▲8▼の内容を簡単に説明すると下記のようになる。なお、R0〜R3は汎用レジスタとする。
【0042】
R1が示すメモリアドレス上のデータを、R0に転送する(命令▲1▼)。R0のデータに1を加え、結果をR0に格納する(命令▲2▼)。R0のデータを、R1が示すメモリアドレスに書き込む(命令▲3▼)。R0のデータとR2のデータの大きさを比較する(命令▲4▼)。R0のデータ>R2のデータならば、命令▲8▼に分岐し、そうでなければ命令▲6▼に進む(命令▲5▼)。R0のデータとR2のデータを乗算し、結果を積和レジスタMACLに格納する(命令▲6▼)。MACLの値をR0に格納する(命令▲7▼)。R3のデータにR0のデータを加え、結果をR3に格納する(命令▲8▼)。
【0043】
このような命令において、従来のパイプライン処理では下記のようなパイプラインストールが発生する。
【0044】
(1)命令▲2▼において、命令▲1▼の結果を使用するため1クロック(ステージ)分の遅延が発生する。
【0045】
(2)命令▲3▼において、命令▲2▼の結果を使用するため1クロック(ステージ)分の遅延が発生する。
【0046】
(3)命令▲6▼,▲7▼において、命令▲5▼による分岐有無を確定する間にパイプライン内でフェッチが行われているが、分岐有りの場合は命令自体が破棄される。
【0047】
つまり、パイプライン処理において、命令▲2▼,▲3▼では、前命令の結果を次命令が使用するために遅延が発生し、命令▲6▼,▲7▼では、前命令の結果で分岐が発生するために無駄な処理を行うことになる。これらの結果、11ステージで6命令が実行されている。
【0048】
一方、図5および図6は、本発明の一実施の形態のマイクロプロセッサにおいて、簡単なプログラム例に対するパイプラインの処理方法の一例を示す図である。前記図4と同じ命令を処理することとし、前記命令▲1▼〜▲4▼の処理を図5で示し、前記命令▲5▼〜▲8▼の処理を図6で示している。
【0049】
図5では、前記図4における命令▲2▼,▲3▼の遅延箇所において、PC2とPC3の命令を実行できる。なおかつ、命令▲3▼の遅延によって命令▲4▼のフェッチが遅延した箇所で、PC4の命令を実行できる。つまり、本来待ちとなるステージを、別プロセスのステージとして使用できる。
【0050】
図6では、前記図4において、フェッチしたが分岐により破棄された無駄な命令▲6▼,▲7▼を、プリフェッチする必要がない。
【0051】
このように、図3のマイクロプロセッサは、あるPCにおける命令の処理が完了するまで、別のPCの命令を処理する仕組みとなる。したがって、前記あるPCにおける次の命令の処理に際し、待ち時間が必要となったり、破棄されて無駄な命令となる恐れもない。
【0052】
この結果、例えば、図5では、16ステージで13命令を実行しており、実質的には実行効率を1命令/1クロックまで高めることができる。つまり、高い処理能力を備えることができ、なおかつ前述したように分岐予測回路などによって電力を消費されることのないマイクロプロセッサを実現できる。
【0053】
また、これらの考え方を用いると、従来の32bit単位などの演算回路ではなく、1bit単位の演算回路を用いたアーキテクチャを構築することができる。このアーキテクチャを実現する構成の一例を図7および図8に示す。なお、ここでは32bitのアーキテクチャを想定する。
【0054】
図7は、本発明の一実施の形態のマイクロプロセッサにおいて、1bit単位の加算回路の構成の一例を示す回路図である。
【0055】
図7の加算回路は、例えば、32bitの入力A、入力Bがそれぞれ入力される32bitシフトレジスタ1,2と、入力Aと入力Bの各bitを1bitずつ加算する1bit加算器3と、この1bit加算器3の出力Cを格納する32bitシフトレジスタ4などから構成される。そして、図7には明示していないが、この回路を36ヶ設け、さらに、それぞれの回路に異なったPCを割り当てる。つまり、36本のPC(PC1〜36)を備える。
【0056】
図8は、本発明の一実施の形態のマイクロプロセッサにおいて、1bit単位の比較回路の構成の一例を示す回路図である。
【0057】
図8の比較回路は、例えば、32bitの入力A、入力Bが各々入力される32bitシフトレジスタ1,2と、入力Aと入力Bの各bitを1bitずつ比較する1bit比較器(減算器)5などから構成される。そして、図8には明示していないが、この回路を36ヶ設け、さらに、それぞれの回路に異なったPCを割り当てる。つまり、36本のPC(PC1〜36)を備える。
【0058】
これらのような回路において、前記図2の処理のように、PCを順番に切り替えながらパイプライン処理を行う。すると、例えば、PC1のアドレス0の命令フェッチが行われた後、アドレス1の命令フェッチが行われるのは36クロック後となる。したがって、この間に図7の加算回路や図8の比較回路などによって、1bit/1クロック単位で32bit分の加算および比較を行う。
【0059】
なお、パイプラインの段数は、IF、ID、IE、mm×32の計35段になるが、パイプラインの段数よりもPCの本数(36本)の方が多いため、原理的にパイプラインストールは発生しない。
【0060】
このように、PCの本数を、パイプラインの段数以上でなおかつデータbit数と等しく構成し、演算器を、従来の32bit単位から1bit単位に変更することで有益な効果を得ることができる。すなわち、従来において32bit同時に行っていた演算を、1bitずつ複数クロックに分散することになるため、クロックあたりの演算器内ゲート間遅延時間の低減を図ることができ、これによって、パイプラインの高クロック化が可能になる。更に、クロックあたりの演算器内ゲート間遅延時間の許容範囲であれば、素子駆動電圧を下げることができるため、消費電力低減も可能となる。
【0061】
また、一般的なプログラムにおいて、比較結果による分岐命令などがよく用いられるが、この場合、上位bitの比較のみで結果が判明する場合も多い。このような場合に、1bit/1クロックずつの比較を用いると、結果が判明した時点で演算を完了(演算器を停止)することができ、消費電流の低減や演算の効率化を図ることができる。
【0062】
なお、図7および図8は、ALU(arithmetic and logical unit)などの演算回路の一形態として加算器と比較器を示したもので、勿論、加算器と比較器に限定されるものではない。
【0063】
以上、本発明者によってなされた発明をその実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。
【0064】
例えば、前記図7および図8ではPCの本数とデータbit数を等しく構成したが、PCの本数は、パイプラインの段数以上である限り、データbit数以上の本数にすることも可能である。
【0065】
本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば、以下のとおりである。
【0066】
(1)パイプライン段数と同数以上のPCを備えることで、パイプラインストールが原理的に発生せず、パイプラインの実行効率を実質的に1命令/1クロックまで高めることができる。
【0067】
(2)前記(1)により、分岐予測などの機能が不要となり、トランジスタ数の削減と消費電力の低減が図れる。
【0068】
(3)前記(1)により、パイプライン段数を非常に深くすることができ、高クロック化が図れる。
【0069】
(4)データbit数とPCの本数を等しく構成し、演算器を1bit単位に変更することで、消費電流の低減や高クロック化および演算の効率化を図ることができる。
【0070】
(5)前記(1)〜(4)により、低消費電力で、なおかつ高い処理能力を備えたマイクロプロセッサを実現できる。
【0071】
【発明の効果】
本願発明を適用することにより低電力のマイクロプロセッサを実現することができる。
【図面の簡単な説明】
【図1】本発明の前提となる従来のマイクロプロセッサにおける、パイプラインの処理方法の一例を示す概略図である。
【図2】本発明の一実施の形態のマイクロプロセッサにおける、パイプラインの処理方法の一例を示す概略図である。
【図3】本発明の一実施の形態のマイクロプロセッサにおいて、その構成の一例を示す概略図である。
【図4】本発明の前提となるマイクロプロセッサにおいて、簡単なプログラム例に対する従来のパイプラインの処理方法の一例を示す図である。
【図5】本発明の一実施の形態のマイクロプロセッサにおいて、簡単なプログラム例に対するパイプラインの処理方法の一例を示す図である。
【図6】本発明の一実施の形態のマイクロプロセッサにおいて、図5に続く簡単なプログラム例に対するパイプラインの処理方法の一例を示す図である。
【図7】本発明の一実施の形態のマイクロプロセッサにおいて、1bit単位の加算回路の構成の一例を示す回路図である。
【図8】本発明の一実施の形態のマイクロプロセッサにおいて、1bit単位の比較回路の構成の一例を示す回路図である。
【符号の説明】
1,2,4 32bitシフトレジスタ
3 1bit加算器
5 1bit比較器
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a microprocessor, and more particularly, to a technique that is effective when applied to a microprocessor that requires low power consumption.
[0002]
[Prior art]
According to the studies made by the present inventors, the following techniques can be considered for the microprocessor technique.
[0003]
At present, there are many microprocessors equipped with a pipeline function. These microprocessors usually have one program counter and execute pipeline processing. In addition, there is a type provided with another program counter and an arithmetic circuit associated therewith as a fill-in when a stall occurs.
[0004]
[Problems to be solved by the invention]
By the way, as a result of the present inventor's study on the above-described microprocessor technology, the following has become clear.
[0005]
At present, microprocessors are used in various devices such as personal computers and mobile phones. For example, a microprocessor of a mobile phone must perform processing of additional functions such as a browser function and recording and reproduction of moving images / still images, in addition to processing of an original telephone function.
[0006]
Therefore, microprocessors are required to have high processing power not only in personal computers and the like but also in mobile phones and the like. In particular, portable devices must also have low power consumption.
[0007]
However, in a microprocessor as in the prior art, if the pipeline is deepened to operate at a high clock, the performance is reduced due to a penalty at the time of branching. Also, if there is an instruction dependency such as using the result of the previous instruction in the next instruction, the execution of the next instruction is delayed, which also lowers the performance.
[0008]
Disturbance in pipeline processing as described above is referred to as pipeline stall or pipeline hazard. At present, in order to reduce this pipeline stall, processing such as branch prediction and speculative execution by a branch prediction circuit or the like, and processing of removing instruction dependencies by a circuit for changing the order of instructions are performed. However, in recent years, these circuit scales tend to be much larger, and increases in circuit area and power consumption cannot be ignored.
[0009]
Therefore, an object of the present invention is to provide a microprocessor with low power consumption.
[0010]
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.
[0011]
[Means for Solving the Problems]
The following is a brief description of an outline of typical inventions disclosed in the present application.
[0012]
A microprocessor according to the present invention has at least as many program counters as the number of pipeline stages, and executes instructions indicated by the program counter by pipeline processing while sequentially switching the program counter every clock. . With this configuration, pipeline stall can be prevented in principle.
[0013]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In all the drawings for describing the embodiments, the same members are denoted by the same reference numerals, and a repeated description thereof will be omitted.
[0014]
Embodiments of the present invention will be described in comparison with a conventional microprocessor which is a premise of the present invention, in order to make the features of the microprocessor of the embodiment of the present invention easy to understand.
[0015]
FIG. 1 is a schematic diagram showing an example of a pipeline processing method in a conventional microprocessor which is a premise of the present invention.
[0016]
A conventional microprocessor has one program counter (PC) and forms a pipeline in one process. In the example of FIG. 1, there are six pipelines, and five instructions existing at addresses 0 to 4 indicated by the PC are processed by the pipeline. Usually, these five instructions correspond to instructions in one process, so to speak, are included in one task.
[0017]
Each stage of the pipeline includes, for example, an IF (instruction fetch) stage, an ID (instruction decode) stage, an EX (instruction execution) stage, an MA (memory access) stage, and two mm (arithmetic processing) stages. Consists of
[0018]
FIG. 1 shows an ideal pipeline process. However, in actuality, pipeline stall occurs depending on the type of instruction, dependency, and the like. Although a specific example thereof will be described later with reference to FIG. 4 and the like, essentially, pipeline stall occurs because the processing of the next instruction is started before the processing of the previous instruction is completed.
[0019]
FIG. 2 is a schematic diagram illustrating an example of a pipeline processing method in the microprocessor according to the embodiment of the present invention.
[0020]
A microprocessor according to an embodiment of the present invention has a program counter of the same number or more as the number of stages of a pipeline, and sequentially switches the program counter every clock, while executing an instruction indicated by the program counter by pipeline processing. To do.
[0021]
That is, in FIG. 2, the number of pipeline stages and the number of PCs are the same, and as in FIG. 1, the pipeline has six pipelines and six PCs (PC 1 to 6), and differs for each PC. Assume that a process is assigned. In such a configuration, the processing procedure for each clock is, for example, as follows. In the following description, it is assumed that the value of the time t increases by +1 for each clock.
[0022]
At t = 1, the instruction at address 0 indicated by PC1 is fetched.
[0023]
At t = 2, the instruction at address 0 indicated by PC1 is decoded, and at the same time, the instruction at address 0 indicated by PC2 is fetched.
[0024]
At t = 3, execution of the instruction at address 0 indicated by PC1 and decoding of the instruction at address 0 indicated by PC2 are performed, and at the same time, the instruction at address 0 indicated by PC3 is fetched.
[0025]
Similarly, at t = 6, arithmetic processing of PC1 and PC2, memory access of PC3, instruction execution of PC4, instruction decoding of PC5, and instruction fetch of address 0 indicated by PC6 are performed.
[0026]
Then, at t = 7, the next instruction indicated by PC1, that is, the instruction at address 1 is fetched together with the processing for address 0 indicated by PC2 to PC6. Thereafter, at t = 8 to 12, the instruction fetch of the address 1 indicated by PC2 to PC6 is sequentially performed.
[0027]
The addresses 0 and 1 are not physical addresses but indicate logical addresses for each PC.
[0028]
Here, focusing on PC1, as shown in the lower part of FIG. 2, the processing of the instruction at address 1 is performed after the processing of the instruction at address 0 is completed. The same applies to other PCs, and the instructions in the same PC always execute the next instruction after the processing of the previous instruction is completed.
[0029]
That is, in the same PC, the processing of the next instruction is not started before the processing of the previous instruction is completed as in the related art, so that pipeline stall does not occur in principle. If the same PC is set as the same process and different processes are assigned to each PC, processing of a plurality of processes (multitask processing) can be performed without causing pipeline stall.
[0030]
As described above, when the pipeline stall does not occur in principle, the following effects (1) to (4) are further obtained.
[0031]
(1) Functions such as branch prediction become unnecessary, and the number of transistors and power consumption can be reduced.
[0032]
(2) The number of pipeline stages can be made very deep, and a high clock can be achieved.
[0033]
(3) A system in which each processing block operates in parallel, such as a moving picture expert group (MPEG), can particularly increase the use efficiency of a computing unit.
[0034]
That is, parallel processing is possible by assigning different processing blocks to each PC. Further, in image processing such as MPEG, generally, a branch instruction is frequently used in processing such as variable-length encoding / decoding, but a branch prediction error does not occur unlike the related art.
[0035]
(4) There is a case where a compiler or the like performs optimization processing of instructions related to pipeline processing, but such processing can be simplified.
[0036]
FIG. 3 is a schematic diagram showing an example of the configuration of the microprocessor according to the embodiment of the present invention.
[0037]
The microprocessor of FIG. 3 has, for example, six program counters (PC1 to 6) and six pipeline stages.
[0038]
The six pipeline stages include, for example, an instruction fetch (IF) stage, an instruction decode (ID) stage, an instruction execution (EX) stage, a memory access (MA) stage, and an arithmetic processing (mm) stage. , A register write back (WB) stage.
[0039]
A process having no dependency is assigned to each program counter, and an instruction code memory is assigned to each process. Then, the pipeline process is performed while switching each program counter in order for each clock.
[0040]
Here, the operation of the microprocessor shown in FIG. 3 will be described by comparing a conventional operation with a simple program example.
[0041]
First, FIG. 4 is a diagram showing an example of a conventional pipeline processing method for a simple program example in a microprocessor as a premise of the present invention. In FIG. 4, a program example constituted by instructions (1) to (8) is processed by a conventional pipeline. The contents of the instructions (1) to (8) will be briefly described as follows. Note that R0 to R3 are general-purpose registers.
[0042]
The data on the memory address indicated by R1 is transferred to R0 (instruction {circle around (1)}). One is added to the data of R0, and the result is stored in R0 (instruction {circle around (2)}). The data of R0 is written to the memory address indicated by R1 (instruction {circle around (3)}). The size of the data of R0 and the size of the data of R2 are compared (instruction {circle around (4)}). If the data in R0> the data in R2, the flow branches to instruction (8); otherwise, the flow proceeds to instruction (6) (instruction (5)). The data of R0 is multiplied by the data of R2, and the result is stored in the product-sum register MACL (instruction {circle around (6)}). The value of MACL is stored in R0 (instruction {circle around (7)}). The data of R0 is added to the data of R3, and the result is stored in R3 (instruction (8)).
[0043]
In such an instruction, the following pipeline stall occurs in the conventional pipeline processing.
[0044]
(1) In the instruction (2), a delay of one clock (stage) occurs because the result of the instruction (1) is used.
[0045]
(2) In the instruction (3), a delay of one clock (stage) occurs because the result of the instruction (2) is used.
[0046]
(3) In the instructions (6) and (7), the fetch is performed in the pipeline while the presence or absence of the branch by the instruction (5) is determined. If there is a branch, the instruction itself is discarded.
[0047]
In other words, in the pipeline processing, in the instructions (2) and (3), a delay occurs because the result of the previous instruction is used by the next instruction, and in the instructions (6) and (7), a branch is caused by the result of the previous instruction. This causes unnecessary processing to be performed. As a result, 6 instructions are executed in 11 stages.
[0048]
5 and 6 are diagrams showing an example of a method of processing a pipeline for a simple program example in the microprocessor according to the embodiment of the present invention. It is assumed that the same instructions as those in FIG. 4 are processed, and the processing of the instructions (1) to (4) is shown in FIG. 5, and the processing of the instructions (5) to (8) is shown in FIG.
[0049]
In FIG. 5, the instructions of PC2 and PC3 can be executed at the delay point of the instructions (2) and (3) in FIG. The instruction of the PC 4 can be executed at a position where the fetch of the instruction (4) is delayed due to the delay of the instruction (3). In other words, the stage originally waiting can be used as a stage of another process.
[0050]
In FIG. 6, there is no need to prefetch the unnecessary instructions (6) and (7) fetched in FIG. 4 but discarded by the branch.
[0051]
As described above, the microprocessor of FIG. 3 is configured to process an instruction of another PC until the processing of the instruction in one PC is completed. Therefore, there is no danger that a waiting time is required when the next instruction is processed in the certain PC, or that the instruction is discarded and becomes a useless instruction.
[0052]
As a result, for example, in FIG. 5, 13 instructions are executed in 16 stages, and the execution efficiency can be substantially increased to 1 instruction / 1 clock. That is, it is possible to realize a microprocessor that can have high processing capability and does not consume power by the branch prediction circuit and the like as described above.
[0053]
Also, by using these ideas, it is possible to construct an architecture using an arithmetic circuit in units of 1 bit, instead of the conventional arithmetic circuit in units of 32 bits. FIGS. 7 and 8 show an example of a configuration for realizing this architecture. Here, a 32-bit architecture is assumed.
[0054]
FIG. 7 is a circuit diagram showing an example of a configuration of a 1-bit adding circuit in the microprocessor according to the embodiment of the present invention.
[0055]
The adder circuit of FIG. 7 includes, for example, 32-bit shift registers 1 and 2 to which 32-bit inputs A and B are respectively input, a 1-bit adder 3 that adds each bit of the inputs A and B by 1 bit, and a 1-bit adder 3 It comprises a 32-bit shift register 4 for storing the output C of the adder 3 and the like. Although not shown in FIG. 7, 36 circuits are provided, and a different PC is assigned to each circuit. That is, 36 PCs (PC1 to 36) are provided.
[0056]
FIG. 8 is a circuit diagram showing an example of a configuration of a 1-bit unit comparison circuit in the microprocessor according to the embodiment of the present invention.
[0057]
The comparison circuit in FIG. 8 includes, for example, 32-bit shift registers 1 and 2 to which a 32-bit input A and an input B are respectively input, and a 1-bit comparator (subtractor) 5 for comparing each bit of the input A and the input B by 1 bit. Etc. Although not explicitly shown in FIG. 8, 36 circuits are provided, and a different PC is assigned to each circuit. That is, 36 PCs (PC1 to 36) are provided.
[0058]
In such circuits, the pipeline processing is performed while sequentially switching the PCs, as in the processing of FIG. Then, for example, after the instruction fetch of the address 0 of the PC1 is performed, the instruction fetch of the address 1 is performed 36 clocks later. Therefore, during this period, addition and comparison for 32 bits are performed in units of 1 bit / 1 clock by the addition circuit of FIG. 7 and the comparison circuit of FIG.
[0059]
The number of pipeline stages is a total of 35 stages of IF, ID, IE, and mm × 32. However, since the number of PCs (36) is larger than the number of pipeline stages, the pipeline installation is in principle required. Does not occur.
[0060]
As described above, a beneficial effect can be obtained by configuring the number of PCs to be equal to or more than the number of stages in the pipeline and equal to the number of data bits, and changing the arithmetic unit from the conventional 32-bit unit to the 1-bit unit. In other words, the operation that was conventionally performed simultaneously in 32 bits is distributed to a plurality of clocks in units of 1 bit, so that the delay time between gates in the operation unit per clock can be reduced. Becomes possible. Furthermore, as long as the delay time between gates in the arithmetic unit per clock is within an allowable range, the element drive voltage can be reduced, and power consumption can be reduced.
[0061]
In a general program, a branch instruction based on a comparison result or the like is often used. In this case, the result is often determined only by comparing the upper bits. In such a case, by using the comparison of 1 bit / 1 clock, the operation can be completed (the operation unit is stopped) when the result is found, and the current consumption can be reduced and the efficiency of the operation can be improved. it can.
[0062]
FIGS. 7 and 8 show an adder and a comparator as one mode of an arithmetic circuit such as an ALU (arithmetic and logical unit), and are not limited to the adder and the comparator.
[0063]
As described above, the invention made by the inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and can be variously modified without departing from the gist thereof. Needless to say.
[0064]
For example, in FIGS. 7 and 8, the number of PCs is equal to the number of data bits, but the number of PCs can be equal to or greater than the number of data bits as long as the number is equal to or greater than the number of stages in the pipeline.
[0065]
The effects obtained by typical aspects of the invention disclosed in the present application will be briefly described as follows.
[0066]
(1) By providing the same number of PCs or more as the number of pipeline stages, pipeline stall does not occur in principle, and the execution efficiency of the pipeline can be substantially increased to one instruction / clock.
[0067]
(2) According to (1), functions such as branch prediction become unnecessary, and the number of transistors and power consumption can be reduced.
[0068]
(3) According to the above (1), the number of pipeline stages can be made very deep, and a high clock can be achieved.
[0069]
(4) By configuring the number of data bits and the number of PCs to be equal and changing the arithmetic unit in units of 1 bit, it is possible to reduce current consumption, increase the clock, and increase the efficiency of the operation.
[0070]
(5) By the above (1) to (4), a microprocessor with low power consumption and high processing capability can be realized.
[0071]
【The invention's effect】
By applying the present invention, a low-power microprocessor can be realized.
[Brief description of the drawings]
FIG. 1 is a schematic diagram showing an example of a pipeline processing method in a conventional microprocessor which is a premise of the present invention.
FIG. 2 is a schematic diagram illustrating an example of a pipeline processing method in the microprocessor according to the embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating an example of a configuration of a microprocessor according to an embodiment of the present invention.
FIG. 4 is a diagram showing an example of a conventional pipeline processing method for a simple program example in a microprocessor as a premise of the present invention.
FIG. 5 is a diagram illustrating an example of a pipeline processing method for a simple program example in the microprocessor according to the embodiment of the present invention;
FIG. 6 is a diagram illustrating an example of a method of processing a pipeline for a simple program example following FIG. 5 in the microprocessor according to the embodiment of the present invention;
FIG. 7 is a circuit diagram illustrating an example of a configuration of an addition circuit in units of 1 bit in the microprocessor according to one embodiment of the present invention;
FIG. 8 is a circuit diagram illustrating an example of a configuration of a 1-bit unit comparison circuit in the microprocessor according to one embodiment of the present invention;
[Explanation of symbols]
1,2,4 32-bit shift register 3 1-bit adder 5 1-bit comparator

Claims (1)

パイプラインの段数と同数以上のプログラムカウンタを有し、
1クロック毎に前記プログラムカウンタを順番に切り替えながら、前記プログラムカウンタが示す命令をパイプライン処理で実行することを特徴とするマイクロプロセッサ。
It has more program counters than the number of pipeline stages,
A microprocessor which executes an instruction indicated by the program counter by pipeline processing while sequentially switching the program counter every clock.
JP2003162744A 2003-06-06 2003-06-06 Microprocessor Withdrawn JP2004362454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003162744A JP2004362454A (en) 2003-06-06 2003-06-06 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003162744A JP2004362454A (en) 2003-06-06 2003-06-06 Microprocessor

Publications (1)

Publication Number Publication Date
JP2004362454A true JP2004362454A (en) 2004-12-24

Family

ID=34054807

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003162744A Withdrawn JP2004362454A (en) 2003-06-06 2003-06-06 Microprocessor

Country Status (1)

Country Link
JP (1) JP2004362454A (en)

Similar Documents

Publication Publication Date Title
Hameed et al. Understanding sources of inefficiency in general-purpose chips
JP5043560B2 (en) Program execution control device
JP4986431B2 (en) Processor
Renaudin et al. ASPRO-216: A standard-cell QDI 16-bit RISC asynchronous microprocessor
US6772355B2 (en) System and method for reducing power consumption in a data processor having a clustered architecture
KR20040016829A (en) Exception handling in a pipelined processor
US7949862B2 (en) Branch prediction table storing addresses with compressed high order bits
US20220035635A1 (en) Processor with multiple execution pipelines
KR101077425B1 (en) Efficient interrupt return address save mechanism
JP7495030B2 (en) Processors, processing methods, and related devices
US20070016759A1 (en) System and method of controlling multiple program threads within a multithreaded processor
US6829700B2 (en) Circuit and method for supporting misaligned accesses in the presence of speculative load instructions
US6334180B1 (en) Processor coupled by visible register set to modular coprocessor including integrated multimedia unit
US7757066B2 (en) System and method for executing variable latency load operations in a date processor
JP2004362454A (en) Microprocessor
JP2005234968A (en) Arithmetic processing unit
JP2007257349A (en) Processor and processing method thereof
Bansal Reduced Instruction Set Computer (RISC): A Survey
Hou et al. FuMicro: A Fused Microarchitecture Design Integrating In‐Order Superscalar and VLIW
US6807628B2 (en) System and method for supporting precise exceptions in a data processor having a clustered architecture
US6584556B1 (en) Modulo address generation method and apparatus
She et al. An energy-efficient method of supporting flexible special instructions in an embedded processor with compact ISA
EP4202664A1 (en) System, apparatus and method for throttling fusion of micro-operations in a processor
US6266757B1 (en) High speed four-to-two carry save adder
Chang et al. PAC DSP core and its applications

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060905