JP2004355477A - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP2004355477A
JP2004355477A JP2003154477A JP2003154477A JP2004355477A JP 2004355477 A JP2004355477 A JP 2004355477A JP 2003154477 A JP2003154477 A JP 2003154477A JP 2003154477 A JP2003154477 A JP 2003154477A JP 2004355477 A JP2004355477 A JP 2004355477A
Authority
JP
Japan
Prior art keywords
instruction
instruction code
code
type
microprocessor
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
JP2003154477A
Other languages
Japanese (ja)
Inventor
Kiyoshi Nakakimura
清 中木村
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2003154477A priority Critical patent/JP2004355477A/en
Publication of JP2004355477A publication Critical patent/JP2004355477A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microprocessor permitting reducing the capacity of a command memory and the capacity of a program itself. <P>SOLUTION: When a fetched command code is a long-type command code as shown in the figure (a), a 32-bit command code is output to a command decode stage as it is. When the fetched command code is a short-type command code as shown in the figure (b), it is extended by a part of the most recent long-type command code and an extended 32-bit command code is output to the command decode stage. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、命令コードを順次フェッチして実行するマイクロプロセッサに関し、特に、命令コードを格納する命令メモリなどの容量の削減を可能としたマイクロプロセッサに関する。
【0002】
【従来の技術】
近年、マイクロプロセッサを搭載した情報通信機器、家電機器などが広く普及しており、性能を向上させつつも、コストの削減が可能なマイクロプロセッサに対する要望が高まっている。
【0003】
一般に、32ビットの命令コード長を有するマイクロプロセッサコアやDSP(Digital Signal Processor)コアを実現しようとした場合、プロセッサが命令メモリなどから常に32ビットの命令コードをフェッチする必要がある。すなわち、プロセッサが1サイクルで命令コードをフェッチするためには、32本の信号線(データバス)が必要である。また、16本の信号線のみを使用した場合には、プロセッサは命令コードを2サイクルでフェッチすることになり、性能が低下することになる。
【0004】
また、命令メモリとして、命令数×32ビット分の容量を有する記憶装置が必要とされ、命令メモリの容量を削減したり、プログラム自体の容量を削減したりすることが困難である。これに関連する技術として、特開平11−167488号公報に開示された演算処理装置がある。
【0005】
特開平11−167488号公報に開示された演算処理装置は、32ビットの縮小命令セットの固定長の冗長な部分を、予め決められた規則にしたがって圧縮し、16ビットの圧縮命令セットを生成することにより、RISC(Reduced Instruction Set Computer)型のマイクロプロセッサのオブジェクトコードサイズを小さくするものである。
【0006】
【特許文献1】
特開平11−167488号公報
【0007】
【発明が解決しようとする課題】
上述した特開平11−167488号公報に開示された演算処理装置は、オブジェクトコードのサイズを小さくすることができるが、全ての命令セットを固定長とすることによって命令セットの幾つかに冗長な部分が多く含まれるという、RISC型のマイクロプロセッサ特有の問題点に着目してなされたものである。したがって、冗長な部分を含まない命令セットを圧縮することができず、オブジェクトサイズを小さくすることができないといった問題点があった。
【0008】
本発明は、上記問題点を解決するためになされたものであり、その目的は、命令メモリの容量やプログラム自体の容量を削減することが可能なマイクロプロセッサを提供することである。
【0009】
【課題を解決するための手段】
本発明のある局面に従えば、ロングタイプの命令コードとショートタイプの命令コードとを実行することのできるマイクロプロセッサであって、命令コードをフェッチするための命令フェッチ手段と、命令フェッチ手段によってフェッチされた命令コードをデコードするための命令デコード手段と、命令デコード手段によるデコード結果に応じて、命令コードを実行するための命令実行手段とを含み、命令フェッチ手段は、フェッチした命令コードがロングタイプの命令コードの場合には、当該命令コードをそのまま命令デコード手段へ出力し、フェッチした命令コードがロングタイプの命令コードに続くショートタイプの命令コードの場合には、直近のロングタイプの命令コードの一部によって拡張し、拡張後の命令コードを命令デコード手段へ出力する。
【0010】
本発明の別の局面に従えば、ロングタイプの命令コードとショートタイプの命令コードとを実行することのできるマイクロプロセッサであって、命令コードをフェッチするための命令フェッチ手段と、命令フェッチ手段によってフェッチされた命令コードをデコードするための命令デコード手段と、命令デコード手段によるデコード結果に応じて、命令コードを実行するための命令実行手段とを含み、命令フェッチ手段は、フェッチした命令コードがロングタイプの命令コードの場合には、当該命令コードをそのまま前記命令デコード手段へ出力し、フェッチした命令コードがショートタイプの命令コードの場合には、予めレジスタに設定された値によって拡張し、拡張後の命令コードを命令デコード手段へ出力する。
【0011】
【発明の実施の形態】
図1は、マイクロプロセッサの概略構成の一例を示すブロック図である。このマイクロプロセッサ100は、命令メモリ101からフェッチされた命令コードを保持するIF(Instruction Fetch)ステージ保持回路103と、IFステージ保持回路103に保持される命令コードをデコードするデコード用組合せ回路105と、デコード用組合せ回路105によるデコード結果を保持するID(Instruction Decode)ステージF/F(Flip Flop)107と、PC(Program Counter)の値を制御するPC制御部108と、IDステージF/F107に保持されるデコード結果に応じて命令を実行する演算器などの組合せ回路110と、組合せ回路110による演算結果などを保持するEX(Execution)ステージF/F112とを含む。
【0012】
図1は、簡単のために、命令フェッチ、命令デコード、命令実行からなる3段のパイプライン構成で命令コードを処理する場合を想定している。なお、本明細書における値の表記方法として、ハードウェア記述言語として広く用いられているVerilog−HDL(Hardware Description Language)言語の文法に従った表記を用いるものとする。
【0013】
PC制御部108は、PCの値を制御する。なお、このPCの値の制御の詳細は後述する。命令メモリ101は、PC制御部108から出力された命令アドレス113に応じて命令コードを出力する。IFステージ保持回路103は、命令メモリ101から出力された命令コード102を保持する。
【0014】
デコード用組合せ回路105は、IFステージ保持回路103によって保持される命令コード104をデコードし、デコード結果を制御信号106としてIDステージF/F107へ出力する。IDステージF/F107は、デコード用組合せ回路105から出力された制御信号106を保持して演算器などの組合せ回路110へ出力する。
【0015】
組合せ回路110は、IDステージF/F107から出力された制御信号109に応じて演算等の命令実行を行ない、命令実行結果111をEXステージF/F112へ出力する。EXステージF/F112は、組合せ回路110から出力された命令実行結果を保持する。
【0016】
図2は、PC制御部108の詳細を示す図である。PC制御部108は、セレクタ156と、セレクタ156の選択信号を生成する選択信号生成部151と、PCの値を保持するPC保持用F/F157と、PC保持用F/F157に保持されるPCの値をインクリメントするインクリメンタ159とを含む。
【0017】
選択信号生成部151は、その一部がデコード用組合せ回路105に含まれる回路であり、割込みアドレス152、分岐先アドレス153およびPC保持用F/F157に保持される命令アドレスがインクリメントされた値のいずれかを選択するための選択信号158を生成する。
【0018】
割込みが発生して割込みルーチンへジャンプする場合には、セレクタ156は割込みアドレス152を選択して出力する。分岐命令等の実行によって分岐先アドレス153へジャンプする場合には、セレクタ156は分岐先アドレス153を選択して出力する。また、割込みおよび分岐先アドレス153への分岐のいずれも発生しない場合には、セレクタ156はインクリメンタ159から出力される命令アドレスを選択して出力する。
【0019】
インクリメンタ159は、PC保持用F/F157に保持される命令アドレスを1だけインクリメントする。本来であれば、命令コードが32ビットであれば、命令アドレスを4だけインクリメントする必要があるが、簡単のために1だけインクリメントするものとして説明する。
【0020】
(第1の実施の形態)
図3は、本発明の第1の実施の形態におけるマイクロプロセッサで実行される命令フォーマットの概念を説明するための図である。図3(a)は、L(Long)タイプの命令フォーマット1を示しており、図3(b)は、S(Short)タイプの命令フォーマット2を示している。
【0021】
図3(a)に示すように、Lタイプの命令フォーマット1は、L/Sフォーマット識別用のビットである1ビットのfmと、演算の種類を示す10ビットのoperationと、それぞれ6ビットのoperand1〜operand3と、3ビットのoptionとを含む。fmビットは、命令コードがLタイプの命令フォーマット1であるか、Sタイプのフォーマット2であるかを示す。Lタイプの命令フォーマット1においては、命令コードが32ビットで指定され、サポートしている全ての命令コードを指定することが可能である。
【0022】
図3(b)に示すように、Sタイプの命令フォーマット2は、1ビットのfmと、9ビットのoperation’と、それぞれ2ビットのop1’〜op3’とを含む。Sタイプの命令フォーマット2においては、命令コードが16ビットで指定され、最も直近で指定されたLタイプの命令コードの値によって補間され、32ビットの命令コードが生成される。
【0023】
図3(b)に示すSタイプの命令コードがデコードされるときに、9ビットのoperation’に、直近のLタイプの命令コードのoperationの上位1ビットが付加されて、10ビットのoperationが生成される。また、2ビットのop1’〜op3’のそれぞれに、直近のLタイプの命令コードのoperand1〜operand3の上位4ビットが付加されて、それぞれ6ビットのoperand1〜operand3が生成される。なお、Sタイプの命令コードにおいて、3ビットのoptionは存在せず、直近のLタイプのoptionの3ビットをそのまま用いる。
【0024】
図4は、本発明の第1の実施の形態におけるマイクロプロセッサのIFステージ保持回路103の内部構成を示すブロック図である。このIFステージ保持回路103は、セレクタ251〜256および261〜265と、命令コードの一部を保持するF/F271〜276および281〜285と、セレクタ251〜256および261〜265の選択信号を生成する選択信号生成回路291と、選択信号生成回路291から出力される選択信号を1サイクル保持するF/F294と、F/F271〜276および281〜285に保持される32ビットの命令コード297またはnop命令コード296を選択するセレクタ298とを含む。
【0025】
まず、図3(a)に示すLタイプの命令コードが与えられた場合のIFステージ保持回路103の動作について説明する。命令コードがLタイプの場合、2サイクルで32ビットの命令コードがフェッチされる。
【0026】
1サイクル目において、32ビットの命令コードのうち上位の16ビット[0:15]がIFステージ保持回路103に入力される。このとき、選択信号生成回路291が選択信号292に“01”を出力する。したがって、F/F271,281,272,282および273のそれぞれには、icode[00]212、icode[01]213、icode[02:10]215、icode[11:14]216およびicode[15]218の値が取込まれる。
【0027】
なお、F/F274,283,275,284,276および285は、前のサイクルで保持していた値を保持する。すなわち、F/F274,283,275,284,276および285の値は更新されない。このサイクルにおいて、32ビットの命令コードを出力することができないため、選択信号生成回路291はセレクタ298に選択信号293を出力して、セレクタ298にnop命令コード296を出力させる。
【0028】
2サイクル目において、32ビットの命令コードのうち下位の16ビット[16:31]がIFステージ保持回路103に入力される。このとき、選択信号生成回路291が選択信号292に“10”を出力する。したがって、F/F274,283,275,284,276および285のそれぞれには、icode[00]220、icode[01:04]221、icode[05:06]223、icode[07:10]224、icode[11:12]226およびicode[13:15]227の値が取込まれる。
【0029】
なお、F/F271,281,272,282および273は、前のサイクルで保持していた値を保持する。すなわち、F/F271,281,272,282および273の値は更新されず、1サイクル目で書込まれた命令コードの上位16ビットが保持される。このサイクルにおいて、32ビットの命令コードを出力することができるため、選択信号生成回路291はセレクタ298に選択信号293を出力して、セレクタ298に32ビットの命令コード297を出力させる。
【0030】
次に、図3(b)に示すSタイプの命令コードが与えられた場合のIFステージ保持回路103の動作について説明する。命令コードがLタイプの場合、1サイクルで16ビットの命令コードがフェッチされ、最も直近で指定されたLタイプの命令コードの値によって補間される。
【0031】
このサイクルにおいて、Sタイプの16ビットの命令コードがIFステージ保持回路103に入力される。このとき、選択信号生成回路291が選択信号292に“00”を出力する。したがって、F/F271,272,273,274,275および276のそれぞれには、icode[00]211、icode[01:09]214、icode[10]217、icode[11]219、icode[12:13]222およびicode[14:15]225の値が取込まれる。
【0032】
なお、F/F281,282,283,284および285は、前のサイクルで保持していた値を保持する。すなわち、F/F281,282,283,284および285の値は更新されない。このサイクルにおいて、32ビットの命令コードを出力することができるため、選択信号生成回路291はセレクタ298に選択信号293を出力して、セレクタ298に32ビットの命令コード297を出力させる。
【0033】
図5は、選択信号生成回路291によって生成される選択信号292の値と、生成条件との関係を示す図である。F/F294の値(1つ前のサイクルの選択信号値)が2’b00または2’b10であり、かつicode[00]211の値が1’b0の場合には、選択信号値として2’b00が出力される。すなわち、1つ前のサイクルでフェッチした命令コードがSタイプまたはLタイプの命令コードのうち下位16ビットであり、今回フェッチした命令コードがSタイプの場合には、選択信号値として2’b00が出力される。
【0034】
また、F/F294の値が2’b00または2’b10であり、かつicode[00]211の値が1’b1の場合には、選択信号値として2’b01が出力される。すなわち、1つ前のサイクルでフェッチした命令コードがSタイプまたはLタイプの命令コードのうち下位16ビットであり、今回フェッチした命令コードがLタイプの場合には、選択信号値として2’b01が出力される。
【0035】
また、F/F294の値が2’b01の場合には、選択信号値として2’b10が出力される。すなわち、1つ前のサイクルでフェッチした命令コードがLタイプの命令コードのうち上位16ビットの場合には、選択信号値として2’10が出力される。
【0036】
なお、F/F271〜276および281〜285をリセット(セット)付きのF/Fとすることによって、マイクロプロセッサのリセット時に初期値を与えることができる。その結果、最初にフェッチされた命令がSタイプの命令であっても初期値に基づいて正しく動作を行なわせることができる。
【0037】
また、上述した説明においては、Sタイプの種類が1つの場合のみについて説明したが、L/Sフォーマット識別用fmのビット数を増やし、それに対応して図4に示す構成を複数備えることによって、複数種類のSタイプの命令コードをサポートしたマイクロプロセッサを提供することが可能である。
【0038】
以上説明したように、本実施の形態におけるマイクロプロセッサによれば、Sタイプの命令コードをフェッチした場合には、最も直近のLタイプの命令コードによって補間し、32ビットの命令コードを生成するようにしたので、性能の低下を最小限に抑えつつ信号線を削減することができると共に、命令メモリの容量やプログラム自体の容量を削減することが可能となった。
【0039】
(第2の実施の形態)
第1の実施の形態においては、フェッチした命令コードがSタイプの命令コードの場合には、直近のLタイプの命令コードによって補間し、32ビットの命令コードを生成するようにした。本発明の第2の実施の形態においては、フェッチした命令コードがSタイプの命令コードの場合には、ユーザが指定した任意の値によってSタイプの命令コードを補間し、32ビットの命令コードを生成するものである。
【0040】
図6は、本発明の第2の実施の形態におけるマイクロプロセッサの概念を説明するための図である。この命令コードは、Sタイプの命令コードのものであり、32ビットの命令コードのうち、[01]321,[11:14]322,[17:20]323,[23:26]324および[29:31]325が、IREG_0(331),IREG_1(332),IREG_2(333)およびIREG_3(334)の値によって補間される。レジスタIREG_0(331)〜IREG_3(334)は、それぞれ4ビットの明示的なレジスタであり、マイクロプロセッサが命令によって書込み/読出しが可能である。
【0041】
たとえば、Sタイプの命令コードとして、以下のような特殊命令を設けることによって実現することができる。
【0042】
書込み命令: LDSP IREG_0 4’b0101
読出し命令: STSP IREG_0
これらの命令は、Sフォーマットでのみ有効な命令であるが、それ以外には特殊性はない。すなわち、一般的なプロセッサが備えている、即値をレジスタに設定する命令、およびあるレジスタの値を読出す命令と全く同じ動作を行なう。したがって、ここでの詳細な説明は行なわない。
【0043】
以上説明したように、本実施の形態におけるマイクロプロセッサによれば、命令コードがSタイプの場合には、ユーザが予めレジスタに設定した値によって命令コードを補間するようにしたので、第1の実施の形態において説明した効果に加えて、汎用性をさらに高めることが可能となった。
【0044】
(第3の実施の形態)
本発明の第3の実施の形態におけるマイクロプロセッサは、割込みや分岐が発生したとき、その分岐先がSフォーマットの命令コードである場合に対応した構成を有するものである。
【0045】
図7は、本発明の第3の実施の形態におけるマイクロプロセッサのIFステージ保持回路およびPC制御部の概略構成を示すブロック図である。なお、本実施の形態においては、IFステージ保持回路およびPC制御部の参照符号をそれぞれ103’および108’として説明する。
【0046】
IFステージ保持回路103’は、図4に示す第1の実施の形態におけるIFステージ保持回路103と、IFステージ保持回路103に保持される32ビットの命令コード402から分岐命令を検出する分岐命令検出回路403と、分岐命令検出回路403による検出結果を保持する分岐命令保持F/F405と、IFステージ保持回路103によって保持される32ビットの命令コード410またはnop命令コード411を選択して、デコード用組合せ回路105へ出力するセレクタ412とを含む。
【0047】
また、PC制御部108’は、セレクタ438と、分岐命令保持F/F405に保持される分岐命令の検出結果406および命令コードのfmビット407に応じてセレクタ438の選択信号422を生成する選択信号生成部421と、設定された値から1ずつデクリメントする減算カウンタ414と、PCの値を保持するPC保持用F/F439と、PC保持用F/F439に保持されるPC値から16を減算するデクリメンタ434と、PC保持用F/F439に保持されるPC値を1ずつ加算するインクリメンタ435とを含む。
【0048】
分岐命令検出回路403は、IFステージ保持回路103から出力された32ビットの命令コードをデコード等することによって分岐命令を検出する。また、分岐命令保持F/F405は、分岐命令検出回路403による検出結果404を保持する。
【0049】
選択信号生成部421は割込みを検出した場合には、選択信号422を出力して、セレクタ438に割込みベクタアドレスに対応した割込みアドレス431を選択させる。また、選択信号生成部421は、分岐命令保持F/F405からの検出結果406を参照して分岐命令であることを検出した場合には、セレクタ438に分岐先アドレス432を選択させる。
【0050】
選択信号生成部421は、分岐命令保持F/F405からの検出結果406を参照して分岐命令であることを検出した後、分岐先の命令コードのfmビット407がSフォーマットであることを示す“0”であれば、PC保持用F/F439に保持されるPC値から16を減算したアドレス436をセレクタ438に選択させる。このとき、減算カウンタ414に“16”が設定される。この減算カウンタ414は、毎サイクル“1”ずつ値を減算し、その値が“0”になると減算を停止する。
【0051】
このようにして、分岐先の命令コードがSフォーマットの場合には、分岐先命令のアドレスから16個分だけさかのぼることによって、必ずLフォーマットの命令コードがIFステージ保持回路103に保持されるようにしている。なお、減算カウンタ414は、カウント値が“0”になるまで選択信号415を出力して、セレクタ412にnop命令コード411を選択させる。これによって、分岐先命令から16個分だけさかのぼった命令コードから、分岐先命令の直前の命令コードまでが実行されないようにしている。なお、減算カウンタ414は、カウント値が“0”になったときに選択信号415を出力して、セレクタ412にIFステージ保持回路103から出力される32ビットの命令コード410を選択させる。
【0052】
選択信号生成部421は、割込みおよび分岐のいずれも検出されず、かつ分岐先命令がSフォーマットの命令コードでない場合には、セレクタ438にインクリメンタ435から出力される値437を選択させる。
【0053】
また、割込みまたは例外が発生した場合には、セレクタ438はベクタアドレスに対応した割込みアドレス(例外アドレス)432の命令コードを選択して出力するが、この分岐先の命令コードがSフォーマットの命令コードの場合には、図4に示すIFステージ保持回路103内のF/F271〜276および281〜285をリセット(セット)して、Lフォーマットの命令コードの初期値を設定するするようにしてもよい。これによって、分岐先アドレスの命令コードがSフォーマットの場合でも、正しく動作を行なうことが可能になる。
【0054】
以上の説明においては、全てハードウェアによって処理を行なうようにしているが、分岐先命令がSフォーマットの命令コードであることが検出されたときに、TRAPを発生させることによってソフトウェアによって処理させることも可能である。
【0055】
また、プログラム中に静的に固定されている割込みアドレスや、分岐先を示すラベルで指定されるアドレスに必ずLフォーマットの命令コードが配置されるように、コンパイラなどを設計することによって、マイクロプロセッサの誤動作を防止することも可能である。
【0056】
以上説明したように、本実施の形態におけるマイクロプロセッサによれば、分岐先命令がSフォーマットの命令コードの場合には、分岐先命令から16個分だけさかのぼった命令コードを実行するようにしたので、分岐先のSフォーマットの命令コードに対応したLフォーマットの命令コードが、必ずIFステージ保持回路103に保持されるようになり、マイクロプロセッサの誤動作を防止することが可能となった。
【0057】
今回開示された実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
【0058】
【発明の効果】
本発明のある局面によれば、命令フェッチ手段は、フェッチした命令コードがショートタイプの命令コードの場合には、直近のロングタイプの命令コードの一部によってショートタイプの命令コードを拡張し、拡張後の命令コードを命令デコード手段へ出力するので、命令メモリの容量やプログラム自体の容量を削減することが可能となった。
【0059】
本発明の別の局面によれば、命令フェッチ手段は、フェッチした命令コードがショートタイプの命令コードの場合には、予めレジスタに設定された値によってショートタイプの命令コードを拡張し、拡張後の命令コードを命令デコード手段へ出力するので、命令メモリの容量やプログラム自体の容量を削減することが可能となった。
【図面の簡単な説明】
【図1】マイクロプロセッサの概略構成の一例を示すブロック図である。
【図2】PC制御部108の詳細を示す図である。
【図3】本発明の第1の実施の形態におけるマイクロプロセッサで実行される命令フォーマットの概念を説明するための図である。
【図4】本発明の第1の実施の形態におけるマイクロプロセッサのIFステージ保持回路103の内部構成を示すブロック図である。
【図5】選択信号生成回路291によって生成される選択信号292の値と、生成条件との関係を示す図である。
【図6】本発明の第2の実施の形態におけるマイクロプロセッサの概念を説明するための図である。
【図7】本発明の第3の実施の形態におけるマイクロプロセッサのIFステージ保持回路およびPC制御部の概略構成を示すブロック図である。
【符号の説明】
100 マイクロプロセッサ、101 命令メモリ、103 IFステージ保持回路、105 デコード用組合せ回路、107 IDステージF/F、108PC制御部、110 組合せ回路、112 EXステージF/F、151,421 選択信号生成部、156,251〜256,261〜265,298,412,438 セレクタ、157,439 PC保持用F/F、159,435インクリメンタ、271〜276,281〜285,294 F/F、291選択信号生成回路、403 分岐命令検出回路、405 分岐命令保持F/F、414 減算カウンタ、434 デクリメンタ。
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a microprocessor that sequentially fetches and executes instruction codes, and more particularly to a microprocessor that can reduce the capacity of an instruction memory for storing instruction codes.
[0002]
[Prior art]
2. Description of the Related Art In recent years, information communication devices and home electric appliances equipped with a microprocessor have become widespread, and there has been an increasing demand for a microprocessor capable of reducing the cost while improving the performance.
[0003]
Generally, when attempting to realize a microprocessor core or a DSP (Digital Signal Processor) core having a 32-bit instruction code length, the processor must always fetch a 32-bit instruction code from an instruction memory or the like. That is, in order for the processor to fetch the instruction code in one cycle, 32 signal lines (data buses) are required. Further, when only 16 signal lines are used, the processor fetches the instruction code in two cycles, and the performance is reduced.
[0004]
Further, a storage device having a capacity of the number of instructions × 32 bits is required as the instruction memory, and it is difficult to reduce the capacity of the instruction memory or the capacity of the program itself. As a technique related to this, there is an arithmetic processing device disclosed in Japanese Patent Application Laid-Open No. 11-167488.
[0005]
The arithmetic processing device disclosed in Japanese Patent Application Laid-Open No. H11-167488 compresses a fixed-length redundant part of a 32-bit reduced instruction set according to a predetermined rule to generate a 16-bit compressed instruction set. Thus, the object code size of a RISC (Reduced Instruction Set Computer) type microprocessor is reduced.
[0006]
[Patent Document 1]
JP-A-11-167488
[0007]
[Problems to be solved by the invention]
The arithmetic processing device disclosed in the above-mentioned Japanese Patent Application Laid-Open No. 11-167488 can reduce the size of the object code. However, by making all instruction sets have a fixed length, some of the instruction sets have redundant parts. Is focused on the problem inherent in the RISC type microprocessor, which contains a lot of. Therefore, there is a problem that an instruction set that does not include a redundant portion cannot be compressed, and the object size cannot be reduced.
[0008]
The present invention has been made to solve the above problems, and an object of the present invention is to provide a microprocessor capable of reducing the capacity of an instruction memory and the capacity of a program itself.
[0009]
[Means for Solving the Problems]
According to one aspect of the present invention, there is provided a microprocessor capable of executing a long type instruction code and a short type instruction code, wherein the instruction fetch means for fetching the instruction code and the instruction fetch means fetched by the instruction fetch means. Instruction decoding means for decoding the instruction code, and instruction execution means for executing the instruction code in accordance with the result of the decoding by the instruction decoding means. In the case of an instruction code, the instruction code is output to the instruction decoding means as it is, and in the case where the fetched instruction code is a short type instruction code following a long type instruction code, a part of the latest long type instruction code And decode the extended instruction code And outputs it to the stage.
[0010]
According to another aspect of the present invention, there is provided a microprocessor capable of executing a long-type instruction code and a short-type instruction code, wherein the instruction fetch means for fetching the instruction code and the instruction fetch means Instruction decoding means for decoding the received instruction code, and instruction execution means for executing the instruction code in accordance with the result of the decoding by the instruction decoding means. In the case of the instruction code, the instruction code is output to the instruction decoding means as it is, and when the fetched instruction code is a short type instruction code, the instruction code is extended by a value set in a register in advance, and the extended instruction The code is output to the instruction decoding means.
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 is a block diagram illustrating an example of a schematic configuration of a microprocessor. The microprocessor 100 includes an IF (Instruction Fetch) stage holding circuit 103 for holding an instruction code fetched from the instruction memory 101, a decoding combination circuit 105 for decoding the instruction code held in the IF stage holding circuit 103, An ID (Instruction Decode) stage F / F (Flip Flop) 107 for holding a decoding result by the decoding combination circuit 105, a PC control unit 108 for controlling a PC (Program Counter) value, and an ID stage F / F 107 It includes a combinational circuit 110 such as an arithmetic unit that executes an instruction according to the decoded result, and an EX (Execution) stage F / F112 that holds the operation result and the like by the combinational circuit 110.
[0012]
FIG. 1 assumes, for simplicity, that an instruction code is processed by a three-stage pipeline configuration including instruction fetch, instruction decode, and instruction execution. Note that, as a notation method of a value in this specification, a notation according to a grammar of Verilog-HDL (Hardware Description Language) language widely used as a hardware description language is used.
[0013]
The PC control unit 108 controls the value of PC. The details of the control of the PC value will be described later. The instruction memory 101 outputs an instruction code according to the instruction address 113 output from the PC control unit 108. The IF stage holding circuit 103 holds the instruction code 102 output from the instruction memory 101.
[0014]
The decoding combination circuit 105 decodes the instruction code 104 held by the IF stage holding circuit 103, and outputs the decoding result to the ID stage F / F 107 as a control signal 106. The ID stage F / F 107 holds the control signal 106 output from the decoding combination circuit 105 and outputs the control signal 106 to a combination circuit 110 such as an arithmetic unit.
[0015]
Combination circuit 110 executes an instruction such as an operation in accordance with control signal 109 output from ID stage F / F 107, and outputs an instruction execution result 111 to EX stage F / F 112. EX stage F / F 112 holds the instruction execution result output from combinational circuit 110.
[0016]
FIG. 2 is a diagram illustrating details of the PC control unit 108. The PC control unit 108 includes a selector 156, a selection signal generation unit 151 that generates a selection signal of the selector 156, a PC holding F / F 157 that holds a value of PC, and a PC that is held by the PC holding F / F 157. And an incrementer 159 for incrementing the value of.
[0017]
The selection signal generation unit 151 is a circuit part of which is included in the decoding combinational circuit 105. The selection signal generation unit 151 has a value obtained by incrementing the instruction address held by the interrupt address 152, the branch destination address 153, and the PC holding F / F 157. A selection signal 158 for selecting one of them is generated.
[0018]
When an interrupt occurs and the process jumps to the interrupt routine, the selector 156 selects and outputs the interrupt address 152. When jumping to the branch destination address 153 by executing a branch instruction or the like, the selector 156 selects and outputs the branch destination address 153. When neither an interrupt nor a branch to the branch destination address 153 occurs, the selector 156 selects and outputs the instruction address output from the incrementer 159.
[0019]
The incrementer 159 increments the instruction address held in the PC holding F / F 157 by one. Originally, if the instruction code is 32 bits, it is necessary to increment the instruction address by 4, but for simplicity, it is assumed that the instruction address is incremented by 1.
[0020]
(First Embodiment)
FIG. 3 is a diagram for explaining the concept of an instruction format executed by the microprocessor according to the first embodiment of the present invention. 3A illustrates an L (Long) type instruction format 1, and FIG. 3B illustrates an S (Short) type instruction format 2.
[0021]
As shown in FIG. 3A, the L-type instruction format 1 has a 1-bit fm, which is a bit for identifying the L / S format, a 10-bit operation indicating the type of operation, and a 6-bit operand1 each. Ooperand3 and a 3-bit option. The fm bit indicates whether the instruction code is in L-type instruction format 1 or S-type format 2. In the L-type instruction format 1, an instruction code is specified by 32 bits, and all supported instruction codes can be specified.
[0022]
As shown in FIG. 3B, the S type instruction format 2 includes 1-bit fm, 9-bit operation ', and 2-bit op1' to op3 ', respectively. In the S-type instruction format 2, the instruction code is specified by 16 bits, and is interpolated by the value of the most recently specified L-type instruction code to generate a 32-bit instruction code.
[0023]
When the S-type instruction code shown in FIG. 3B is decoded, the most significant one bit of the operation of the latest L-type instruction code is added to the 9-bit operation ′ to generate a 10-bit operation. Is done. In addition, the upper 4 bits of the latest L-type instruction code, operand1 to operand3, are added to each of the two bits op1 'to op3', thereby generating 6 bits of operand1 to operand3. Note that, in the S type instruction code, there is no 3-bit option, and the latest 3 bits of the L type option are used as they are.
[0024]
FIG. 4 is a block diagram showing an internal configuration of the IF stage holding circuit 103 of the microprocessor according to the first embodiment of the present invention. The IF stage holding circuit 103 generates selectors 251 to 256 and 261 to 265, F / Fs 271 to 276 and 281 to 285 for holding a part of the instruction code, and selection signals for the selectors 251 to 256 and 261 to 265. Selection signal generation circuit 291, an F / F 294 for holding the selection signal output from the selection signal generation circuit 291 for one cycle, and a 32-bit instruction code 297 or nop held in the F / Fs 271 to 276 and 281 to 285. And a selector 298 for selecting the instruction code 296.
[0025]
First, the operation of the IF stage holding circuit 103 when the L-type instruction code shown in FIG. When the instruction code is of the L type, a 32-bit instruction code is fetched in two cycles.
[0026]
In the first cycle, the upper 16 bits [0:15] of the 32-bit instruction code are input to the IF stage holding circuit 103. At this time, the selection signal generation circuit 291 outputs “01” to the selection signal 292. Therefore, the F / Fs 271, 281, 272, 282, and 273 respectively have icode [00] 212, icode [01] 213, icode [02:10] 215, icode [11:14] 216, and icode [15]. 218 values are captured.
[0027]
Note that the F / Fs 274, 283, 275, 284, 276 and 285 hold the values held in the previous cycle. That is, the values of F / Fs 274, 283, 275, 284, 276 and 285 are not updated. In this cycle, since the 32-bit instruction code cannot be output, the selection signal generation circuit 291 outputs the selection signal 293 to the selector 298 and causes the selector 298 to output the nop instruction code 296.
[0028]
In the second cycle, the lower 16 bits [16:31] of the 32-bit instruction code are input to the IF stage holding circuit 103. At this time, the selection signal generation circuit 291 outputs “10” to the selection signal 292. Therefore, each of F / Fs 274, 283, 275, 284, 276, and 285 has icode [00] 220, icode [01:04] 221, icode [05:06] 223, icode [07:10] 224, The values of icode [11:12] 226 and icode [13:15] 227 are captured.
[0029]
Note that the F / Fs 271, 281, 272, 282, and 273 hold the values held in the previous cycle. That is, the values of the F / Fs 271, 281, 272, 282, and 273 are not updated, and the upper 16 bits of the instruction code written in the first cycle are held. In this cycle, since a 32-bit instruction code can be output, the selection signal generation circuit 291 outputs a selection signal 293 to the selector 298 and causes the selector 298 to output a 32-bit instruction code 297.
[0030]
Next, the operation of the IF stage holding circuit 103 when the S type instruction code shown in FIG. When the instruction code is of the L type, a 16-bit instruction code is fetched in one cycle, and is interpolated by the value of the most recently specified L type instruction code.
[0031]
In this cycle, an S type 16-bit instruction code is input to the IF stage holding circuit 103. At this time, the selection signal generation circuit 291 outputs “00” to the selection signal 292. Therefore, each of F / F 271, 272, 273, 274, 275 and 276 has icode [00] 211, icode [01:09] 214, icode [10] 217, icode [11] 219, icode [12: 13] 222 and the value of icode [14:15] 225.
[0032]
Note that the F / Fs 281, 282, 283, 284 and 285 hold the values held in the previous cycle. That is, the values of F / Fs 281, 282, 283, 284 and 285 are not updated. In this cycle, since a 32-bit instruction code can be output, the selection signal generation circuit 291 outputs a selection signal 293 to the selector 298 and causes the selector 298 to output a 32-bit instruction code 297.
[0033]
FIG. 5 is a diagram illustrating the relationship between the value of the selection signal 292 generated by the selection signal generation circuit 291 and the generation conditions. When the value of the F / F 294 (the selection signal value of the previous cycle) is 2′b00 or 2′b10 and the value of the code [00] 211 is 1′b0, 2 ′ is selected as the selection signal value. b00 is output. That is, when the instruction code fetched in the immediately preceding cycle is the lower 16 bits of the S type or L type instruction code and the instruction code fetched this time is the S type, 2′b00 is selected as the selection signal value. Is output.
[0034]
When the value of F / F 294 is 2′b00 or 2′b10 and the value of code [00] 211 is 1′b1, 2′b01 is output as the selection signal value. That is, when the instruction code fetched in the immediately preceding cycle is the lower 16 bits of the S type or L type instruction code and the instruction code fetched this time is L type, 2′b01 is selected as the selection signal value. Is output.
[0035]
When the value of the F / F 294 is 2'b01, 2'b10 is output as the selection signal value. That is, when the instruction code fetched in the immediately preceding cycle is the upper 16 bits of the L-type instruction code, 2'10 is output as the selection signal value.
[0036]
By setting the F / Fs 271 to 276 and 281 to 285 as F / Fs with reset (set), an initial value can be given when the microprocessor is reset. As a result, even if the first fetched instruction is an S-type instruction, the operation can be correctly performed based on the initial value.
[0037]
Also, in the above description, only one type of the S type is described. However, by increasing the number of bits of the L / S format identification fm and providing a plurality of configurations shown in FIG. It is possible to provide a microprocessor that supports a plurality of types of S-type instruction codes.
[0038]
As described above, according to the microprocessor of the present embodiment, when an S-type instruction code is fetched, a 32-bit instruction code is generated by interpolating with the nearest L-type instruction code. As a result, it is possible to reduce the number of signal lines while minimizing a decrease in performance, and to reduce the capacity of the instruction memory and the capacity of the program itself.
[0039]
(Second embodiment)
In the first embodiment, when the fetched instruction code is an S-type instruction code, interpolation is performed using the nearest L-type instruction code to generate a 32-bit instruction code. In the second embodiment of the present invention, when the fetched instruction code is an S-type instruction code, the S-type instruction code is interpolated by an arbitrary value specified by the user, and the 32-bit instruction code is converted. To generate.
[0040]
FIG. 6 is a diagram for explaining the concept of a microprocessor according to the second embodiment of the present invention. This instruction code is an S-type instruction code, and among the 32-bit instruction codes, [01] 321, [11:14] 322, [17:20] 323, [23:26] 324, and [ 29:31] 325 is interpolated by the values of IREG — 0 (331), IREG — 1 (332), IREG — 2 (333), and IREG — 3 (334). Each of the registers IREG_0 (331) to IREG_3 (334) is an explicit register of 4 bits, and can be written / read by a microprocessor by an instruction.
[0041]
For example, it can be realized by providing the following special instructions as S-type instruction codes.
[0042]
Write command: LDSP IREG — 0 4'b0101
Read command: STSP IREG_0
These instructions are valid only in the S format, but have no special characteristics. That is, it performs exactly the same operation as an instruction provided in a general processor for setting an immediate value to a register and an instruction for reading a value of a certain register. Therefore, a detailed description will not be given here.
[0043]
As described above, according to the microprocessor of the present embodiment, when the instruction code is of the S type, the instruction code is interpolated by the value set in the register in advance by the user. In addition to the effects described in the embodiment, the versatility can be further improved.
[0044]
(Third embodiment)
The microprocessor according to the third embodiment of the present invention has a configuration corresponding to the case where an interrupt or a branch occurs, and the branch destination is an S-format instruction code.
[0045]
FIG. 7 is a block diagram illustrating a schematic configuration of an IF stage holding circuit and a PC control unit of a microprocessor according to a third embodiment of the present invention. In the present embodiment, the description will be made with reference numerals 103 'and 108' for the IF stage holding circuit and the PC control unit, respectively.
[0046]
The IF stage holding circuit 103 ′ includes the IF stage holding circuit 103 according to the first embodiment shown in FIG. 4 and a branch instruction detection for detecting a branch instruction from the 32-bit instruction code 402 held in the IF stage holding circuit 103. Circuit 403, a branch instruction holding F / F 405 for holding a detection result by the branch instruction detection circuit 403, and a 32-bit instruction code 410 or a nop instruction code 411 held by the IF stage holding circuit 103 for decoding. And a selector 412 for outputting to the combinational circuit 105.
[0047]
Further, the PC control unit 108 ′ generates a selection signal 422 for generating the selection signal 422 of the selector 438 according to the selector 438, the detection result 406 of the branch instruction held in the branch instruction holding F / F 405 and the fm bit 407 of the instruction code A generation unit 421, a subtraction counter 414 that decrements the set value by one, a PC holding F / F 439 that holds a PC value, and 16 subtracted from the PC value held in the PC holding F / F 439. It includes a decrementer 434 and an incrementer 435 for adding the PC value held in the PC holding F / F 439 by one.
[0048]
The branch instruction detection circuit 403 detects a branch instruction by decoding a 32-bit instruction code output from the IF stage holding circuit 103 or the like. The branch instruction holding F / F 405 holds the detection result 404 of the branch instruction detection circuit 403.
[0049]
When detecting an interrupt, the selection signal generation unit 421 outputs a selection signal 422 to cause the selector 438 to select an interrupt address 431 corresponding to the interrupt vector address. When the selection signal generation unit 421 detects a branch instruction by referring to the detection result 406 from the branch instruction holding F / F 405, the selection signal generation unit 421 causes the selector 438 to select the branch destination address 432.
[0050]
The selection signal generator 421 refers to the detection result 406 from the branch instruction holding F / F 405 to detect that the instruction is a branch instruction, and then indicates that the fm bit 407 of the instruction code at the branch destination is in the S format. If “0”, the selector 438 is made to select an address 436 obtained by subtracting 16 from the PC value held in the PC holding F / F 439. At this time, “16” is set in the subtraction counter 414. The subtraction counter 414 decrements the value by “1” every cycle, and stops the subtraction when the value becomes “0”.
[0051]
In this way, when the instruction code at the branch destination is in the S format, the instruction code in the L format is always held in the IF stage holding circuit 103 by going back by 16 addresses from the address of the branch destination instruction. ing. The subtraction counter 414 outputs the selection signal 415 until the count value becomes “0”, and causes the selector 412 to select the nop instruction code 411. As a result, the instruction code from the instruction code that is 16 times back from the branch destination instruction to the instruction code immediately before the branch destination instruction is not executed. Note that the subtraction counter 414 outputs the selection signal 415 when the count value becomes “0”, and causes the selector 412 to select the 32-bit instruction code 410 output from the IF stage holding circuit 103.
[0052]
The selection signal generator 421 causes the selector 438 to select the value 437 output from the incrementer 435 when neither an interrupt nor a branch is detected and the branch destination instruction is not an S format instruction code.
[0053]
When an interrupt or an exception occurs, the selector 438 selects and outputs the instruction code of the interrupt address (exception address) 432 corresponding to the vector address. In this case, the F / Fs 271 to 276 and 281 to 285 in the IF stage holding circuit 103 shown in FIG. 4 may be reset (set) to set the initial value of the L format instruction code. . As a result, even if the instruction code of the branch destination address is in the S format, the operation can be performed correctly.
[0054]
In the above description, all the processing is performed by hardware. However, when it is detected that the branch destination instruction is an S-format instruction code, the processing may be performed by software by generating a TRAP. It is possible.
[0055]
Further, by designing a compiler or the like such that an L-format instruction code is always arranged at an interrupt address statically fixed in a program or at an address specified by a label indicating a branch destination, Can be prevented from malfunctioning.
[0056]
As described above, according to the microprocessor of the present embodiment, when the branch destination instruction is the S-format instruction code, the instruction code that is 16 times older than the branch destination instruction is executed. The instruction code in the L format corresponding to the instruction code in the S format at the branch destination is always held in the IF stage holding circuit 103, so that malfunction of the microprocessor can be prevented.
[0057]
The embodiments disclosed this time are to be considered in all respects as illustrative and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
[0058]
【The invention's effect】
According to one aspect of the present invention, when the fetched instruction code is a short-type instruction code, the instruction fetch unit extends the short-type instruction code by a part of the latest long-type instruction code, and Since the instruction code is output to the instruction decoding means, the capacity of the instruction memory and the capacity of the program itself can be reduced.
[0059]
According to another aspect of the present invention, when the fetched instruction code is a short-type instruction code, the instruction fetch means extends the short-type instruction code by a value set in a register in advance, and expands the instruction code. Is output to the instruction decoding means, so that the capacity of the instruction memory and the capacity of the program itself can be reduced.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating an example of a schematic configuration of a microprocessor.
FIG. 2 is a diagram showing details of a PC control unit 108.
FIG. 3 is a diagram for explaining the concept of an instruction format executed by a microprocessor according to the first embodiment of the present invention.
FIG. 4 is a block diagram showing an internal configuration of an IF stage holding circuit 103 of the microprocessor according to the first embodiment of the present invention.
FIG. 5 is a diagram illustrating a relationship between a value of a selection signal 292 generated by a selection signal generation circuit 291 and generation conditions.
FIG. 6 is a diagram illustrating a concept of a microprocessor according to a second embodiment of the present invention.
FIG. 7 is a block diagram illustrating a schematic configuration of an IF stage holding circuit and a PC control unit of a microprocessor according to a third embodiment of the present invention.
[Explanation of symbols]
100 microprocessor, 101 instruction memory, 103 IF stage holding circuit, 105 decoding combination circuit, 107 ID stage F / F, 108 PC control unit, 110 combination circuit, 112 EX stage F / F, 151, 421 selection signal generation unit, 156,251-256,261-265,298,412,438 Selector, 157,439 PC holding F / F, 159,435 incrementer, 271-276,281-285,294 F / F, 291 selection signal generation Circuit, 403 branch instruction detection circuit, 405 branch instruction holding F / F, 414 subtraction counter, 434 decrementer.

Claims (8)

ロングタイプの命令コードとショートタイプの命令コードとを実行することのできるマイクロプロセッサであって、
命令コードをフェッチするための命令フェッチ手段と、
前記命令フェッチ手段によってフェッチされた命令コードをデコードするための命令デコード手段と、
前記命令デコード手段によるデコード結果に応じて、命令コードを実行するための命令実行手段とを含み、
前記命令フェッチ手段は、フェッチした命令コードがロングタイプの命令コードの場合には、当該命令コードをそのまま前記命令デコード手段へ出力し、フェッチした命令コードがロングタイプの命令コードに続くショートタイプの命令コードの場合には、直近のロングタイプの命令コードの一部によって前記ショートタイプの命令コードを拡張し、該拡張後の命令コードを前記命令デコード手段へ出力する、マイクロプロセッサ。
A microprocessor capable of executing a long type instruction code and a short type instruction code,
Instruction fetch means for fetching an instruction code;
Instruction decoding means for decoding the instruction code fetched by the instruction fetch means;
Instruction execution means for executing an instruction code according to a decoding result by the instruction decoding means,
When the fetched instruction code is a long type instruction code, the instruction fetch means outputs the instruction code as it is to the instruction decoding means, and the fetched instruction code is a short type instruction code following the long type instruction code. In the case of the microprocessor, the short-type instruction code is extended by a part of the latest long-type instruction code, and the extended instruction code is output to the instruction decoding means.
前記命令フェッチ手段は、初期状態においてフェッチした命令コードがショートタイプの命令コードの場合には、所定の初期値によって命令コードを拡張し、該拡張後の命令コードを前記命令デコード手段へ出力する、請求項1記載のマイクロプロセッサ。When the instruction code fetched in the initial state is an instruction code of a short type, the instruction fetch means extends the instruction code by a predetermined initial value and outputs the extended instruction code to the instruction decoding means. Item 7. The microprocessor according to Item 1. 前記命令フェッチ手段は、命令コードに含まれる識別ビットによってロングタイプの命令コードであるか、ショートタイプの命令コードであるかを識別する、請求項1または2記載のマイクロプロセッサ。3. The microprocessor according to claim 1, wherein the instruction fetch unit identifies whether the instruction code is a long type instruction code or a short type instruction code by an identification bit included in the instruction code. 前記命令フェッチ手段は、命令コードに含まれる複数の識別ビットによって複数種類のショートタイプの命令コードを識別し、当該種類に応じて直近のロングタイプの命令コードの一部によって命令コードを拡張する、請求項3記載のマイクロプロセッサ。The instruction fetch unit identifies a plurality of types of short-type instruction codes by a plurality of identification bits included in the instruction code, and expands the instruction code by a part of the latest long-type instruction code according to the type. Item 3. The microprocessor according to Item 3. ロングタイプの命令コードとショートタイプの命令コードとを実行することのできるマイクロプロセッサであって、
命令コードをフェッチするための命令フェッチ手段と、
前記命令フェッチ手段によってフェッチされた命令デコードをデコードするための命令デコード手段と、
前記命令デコード手段によるデコード結果に応じて、命令コードを実行するための命令実行手段とを含み、
前記命令フェッチ手段は、フェッチした命令コードがロングタイプの命令コードの場合には、当該命令コードをそのまま前記命令デコード手段へ出力し、フェッチした命令コードがショートタイプの命令コードの場合には、予めレジスタに設定された値によって前記ショートタイプの命令コードを拡張し、該拡張後の命令コードを前記命令デコード手段へ出力する、マイクロプロセッサ。
A microprocessor capable of executing a long type instruction code and a short type instruction code,
Instruction fetch means for fetching an instruction code;
Instruction decoding means for decoding the instruction decode fetched by the instruction fetch means;
Instruction execution means for executing an instruction code according to a decoding result by the instruction decoding means,
When the fetched instruction code is a long type instruction code, the instruction fetch means outputs the instruction code as it is to the instruction decoding means. A microprocessor that expands the short-type instruction code by the value set in (1) and outputs the expanded instruction code to the instruction decoding unit.
前記マイクロプロセッサはさらに、分岐先命令がショートタイプの命令コードの場合には、当該分岐先命令のアドレスから所定数だけさかのぼったアドレスをプログラムカウント値とし、当該プログラムカウント値を順次インクリメントして出力するためのプログラムカウンタ制御手段を含み、
前記命令フェッチ手段は、前記所定数だけさかのぼった命令コードから前記分岐先命令の直前の命令コードまでをノーオペレーション命令として出力する、請求項1〜5のいずれかに記載のマイクロプロセッサ。
When the branch destination instruction is an instruction code of a short type, the microprocessor further sets an address that is a predetermined number of times ahead of the address of the branch destination instruction as a program count value, and sequentially increments and outputs the program count value. Program counter control means,
The microprocessor according to any one of claims 1 to 5, wherein the instruction fetch means outputs, as a no-operation instruction, a part from the instruction code which has been advanced by the predetermined number to an instruction code immediately before the branch destination instruction.
前記命令フェッチ手段は、割込みまたは例外が発生し、ベクタアドレスによって指定されるアドレスの命令コードがショートタイプの命令コードの場合には、所定の初期値によって命令コードを拡張し、該拡張後の命令コードを前記命令デコード手段へ出力する、請求項1〜5のいずれかに記載のマイクロプロセッサ。The instruction fetch means extends the instruction code by a predetermined initial value when an interrupt or an exception occurs and the instruction code at the address specified by the vector address is a short type instruction code. The microprocessor according to any one of claims 1 to 5, wherein the microprocessor outputs to the instruction decoding means. 前記命令フェッチ手段は、分岐先命令として必ずロングタイプの命令コードをフェッチする、請求項1〜5のいずれかに記載のマイクロプロセッサ。6. The microprocessor according to claim 1, wherein said instruction fetch means always fetches a long type instruction code as a branch destination instruction.
JP2003154477A 2003-05-30 2003-05-30 Microprocessor Withdrawn JP2004355477A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003154477A JP2004355477A (en) 2003-05-30 2003-05-30 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003154477A JP2004355477A (en) 2003-05-30 2003-05-30 Microprocessor

Publications (1)

Publication Number Publication Date
JP2004355477A true JP2004355477A (en) 2004-12-16

Family

ID=34049123

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003154477A Withdrawn JP2004355477A (en) 2003-05-30 2003-05-30 Microprocessor

Country Status (1)

Country Link
JP (1) JP2004355477A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009093513A (en) * 2007-10-11 2009-04-30 Oki Semiconductor Co Ltd Method for reducing instruction bit length
JP2012252475A (en) * 2011-06-01 2012-12-20 Fujitsu Ltd Processor, compression program, compression device, and compression method
US9189234B2 (en) 2013-09-04 2015-11-17 Globalfoundries Inc. Reducing overhead in loading constants

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009093513A (en) * 2007-10-11 2009-04-30 Oki Semiconductor Co Ltd Method for reducing instruction bit length
JP2012252475A (en) * 2011-06-01 2012-12-20 Fujitsu Ltd Processor, compression program, compression device, and compression method
US9619235B2 (en) 2011-06-01 2017-04-11 Fujitsu Limited Compressing detected current and preceding instructions with the same operation code and operand patterns
US9189234B2 (en) 2013-09-04 2015-11-17 Globalfoundries Inc. Reducing overhead in loading constants

Similar Documents

Publication Publication Date Title
JP3592230B2 (en) Data processing device
US5727194A (en) Repeat-bit based, compact system and method for implementing zero-overhead loops
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
JP4986431B2 (en) Processor
US20020049894A1 (en) Method and apparatus for interfacing a processor to a coprocessor
KR100423910B1 (en) Method and apparatus for executing coprocessor instructions
JPH04313121A (en) Instruction memory device
CN108319559B (en) Data processing apparatus and method for controlling vector memory access
JPH07120278B2 (en) Data processing device
JP2001034471A (en) Vliw system processor
US6055628A (en) Microprocessor with a nestable delayed branch instruction without branch related pipeline interlocks
EP1609058A2 (en) Method and apparatus for hazard detection and management in a pipelined digital processor
US7707389B2 (en) Multi-ISA instruction fetch unit for a processor, and applications thereof
US20230359385A1 (en) Quick clearing of registers
US20190369995A1 (en) Vector generating instruction
JP2004355477A (en) Microprocessor
JP2000207210A (en) Microprocessor
US6877082B1 (en) Central processing unit including address generation system and instruction fetch apparatus
JP5068529B2 (en) Zero-overhead branching and looping in time-stationary processors
JPH1091441A (en) Program execution method and device using the method
JP2021168036A (en) Arithmetic processing unit
JP3699796B2 (en) Processor
JP2005149297A (en) Processor and assembler thereof
JP3915019B2 (en) VLIW processor, program generation device, and recording medium
US20100153688A1 (en) Apparatus and method for data process

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: 20060801