JP4125531B2 - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP4125531B2
JP4125531B2 JP2002087895A JP2002087895A JP4125531B2 JP 4125531 B2 JP4125531 B2 JP 4125531B2 JP 2002087895 A JP2002087895 A JP 2002087895A JP 2002087895 A JP2002087895 A JP 2002087895A JP 4125531 B2 JP4125531 B2 JP 4125531B2
Authority
JP
Japan
Prior art keywords
bank
register
interrupt
bank number
setting
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.)
Expired - Fee Related
Application number
JP2002087895A
Other languages
Japanese (ja)
Other versions
JP2003280923A (en
Inventor
貴代秀 堀
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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2002087895A priority Critical patent/JP4125531B2/en
Publication of JP2003280923A publication Critical patent/JP2003280923A/en
Application granted granted Critical
Publication of JP4125531B2 publication Critical patent/JP4125531B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、効率的にバンク機能を用いる機構を有するマイクロプロセッサに関するものである。
【0002】
【従来の技術】
複数のバンクを使用してプログラムを作成する際、割り込み時に切り替えたバンクの一貫性を保障する必要がある。従来では、バンクの一貫性を保障するための方法として、別のバンクをアクセスするためにバンクを切り替えている期間割り込みを無効にする手法を用いていた。
【0003】
図12は従来のマイクロプロセッサにおける割り込み時のバンク値の一貫性を保障する手法を示している。図12において、符号1はバンクを用いたデータアクセスを示すバンクアクセスシーケンスの全体図を示している。
【0004】
バンクアクセスシーケンス1中で、符号11は割り込み禁止工程であり、割り込み処理プログラムの実行を抑制することによって、以降の工程でバンク番号を設定することによる割り込み処理の不具合を回避している。
【0005】
符号12はバンク番号設定工程であり、データの置かれているバンク番号をバンク番号設定レジスタに格納するための工程である。
【0006】
符号13はバンク有効化工程であり、バンク番号設定工程12で設定したバンク番号を有効にし、以後のデータアクセスをバンク番号設定工程12で設定されたバンク番号のメモリに対してアクセスすることを決定している。
【0007】
符号14はバンクデータアクセス工程であり、バンク番号設定工程12で設定したバンク番号が示すメモリへのデータアクセスを行っている。
【0008】
符号15はバンク無効化工程であり、これにより、バンクメモリへのアクセスを無効にし、通常のメモリアクセスへ復帰する。
【0009】
符号16は割り込み許可工程であり、以降のプログラムで割り込みの処理を許可する。
【0010】
以上のような処理によって、バンクメモリへのデータアクセス時の割り込み処理による不具合を回避していた。
【0011】
【発明が解決しようとする課題】
しかしながら、バンクを切り替えている期間、割り込みを無効にする手法では、別のバンクにあるデータをアクセスするたびにバンク番号設定レジスタへの値の設定と割り込み禁止、許可の操作が必要となり、プログラムコードサイズと実行時間が大きくなり、また割り込みを禁止することによって、割り込み処理プログラムの応答時間が長くなるという課題があった。
【0012】
【課題を解決するための手段】
本発明では、バンク機能(有効無効、バンク番号、バンク番号の退避・復帰等)の設定と割り込み許可禁止の動作を同時に行う機構を備えることによって、プログラムのコードサイズと実行時間を縮小できる。また、割り込み処理の応答性も改善することができる。
【0013】
以下、請求項毎に説明する。
【0014】
請求項1記載のマイクロプロセッサは、同一アドレスの設定レジスタに配置された第1および第2のフラグを有し、第1のフラグに所定の値が設定されたときに割り込み有効となり、第2のフラグに所定の値が設定されたときにバンク無効となることを特徴とする。
【0015】
この構成によれば、バンク有効無効の設定と割り込み許可禁止の動作を同時に行うことが可能となり、プログラムのコードサイズと実行時間を縮小できる。また、割り込み処理の応答性も改善することができる。
【0016】
請求項2記載のマイクロプロセッサは、請求項1記載のマイクロプロセッサにおいて、割り込み有効にするときに第1のフラグに設定される値とバンク無効にするときに第2のフラグに設定される値とが同じ値である。
【0017】
この構成によれば、請求項1記載のマイクロプロセッサと同様の作用を有する。
【0035】
【発明の実施の形態】
以下、本発明の実施の形態を図面に基づいて詳細に説明する。
【0036】
図1は本発明の第1の実施の形態におけるマイクロプロセッサのバンクアクセス手法を示している。図1において、符号2はバンクアクセスシーケンスであり、バンクアクセスの方法の全体を示している。
【0037】
符号21はバンク有効かつ割り込み禁止工程であり、この工程によってバンク番号の有効化処理と割り込みの禁止設定処理とを同時に行っている。
【0038】
符号22はバンク番号設定工程であり、データの置かれているバンク番号をバンク番号設定レジスタに格納するための工程である。
【0039】
符号23はバンクデータアクセス工程であり、バンク番号設定工程22で設定したバンク番号の示すメモリへのデータアクセスを行っている。
【0040】
符号24はバンク無効かつ割り込み許可工程であり、この工程によって設定したバンク番号の無効化処理と割り込みの許可設定処理とを同時に行っている。
【0041】
図3(a)は、バンク有効かつ割り込み禁止工程21においてバンク番号の有効化処理と割り込みの禁止設定処理との同時処理を実現し、バンク無効かつ割り込み許可工程24においてバンク番号の無効化処理と割り込みの許可設定処理との同時処理を実現するためのハードウェア構成である、マイクロプロセッサのバンク・割り込み設定レジスタの一例を示している。図3(a)において、符号4は設定レジスタであり、割り込みの有効処理とバンクの無効化処理の設定を行うフラグが格納されている。符号41は割り込み有効フラグであり、割り込みの有効無効を切り替える。符号42はバンク無効化フラグであり、バンクの有効無効を切り替える。つまり、割り込み有効フラグ41とバンク無効化フラグ42は、同一アドレスの設定レジスタ4に配置されている。
【0042】
図3(b)は割り込み有効フラグ41とバンク無効化フラグ42の符号化の状態を示している。割り込み有効フラグ41に関しては、本実施の形態では値1を設定すると割り込み有効になり、値0を設定すると割り込みが無効になる。バンク無効化フラグ42に関しては、本実施の形態では値1を設定するとバンク番号設定が無効になり、値0を設定するとバンク番号設定が有効となる。
【0043】
なお、上記の説明とは逆に、割り込み有効フラグ41に関しては、値0を設定すると割り込み有効になり、値1を設定すると割り込みが無効になり、バンク無効化フラグ42に関しては、値0を設定するとバンク番号設定が無効になり、値1を設定するとバンク番号設定が有効となるようにしてもよい。
【0044】
上記のような設定レジスタ4を備え、図3(b)のような符号化を行うことによって、バンク有効かつ割り込み禁止工程21のようなバンク有効かつ割り込み禁止の同時処理や、バンク無効かつ割り込み許可工程24のようなバンク無効かつ割り込み許可の同時処理を、AND命令とOR命令のような一般的なプロセッサの命令の1命令で容易に行うことができる。
【0045】
例えば、割り込み有効フラグ41に関しては、値1を設定すると割り込み有効になり、値0を設定すると割り込みが無効になり、バンク無効化フラグ42に関しては、値1を設定するとバンク番号設定が無効になり、値0を設定するとバンク番号設定が有効となるような構成の場合、AND命令とOR命令は以下のようになる。すなわち、割り込み許可かつバンク無効にする場合、同レジスタの他のビットに影響を与えずに設定を変更する場合、“OR 0xc0,R”命令により実行可能である。上記のOR命令で、Rは設定レジスタであり、その意味は、設定レジスタRの値と16進数c0とのORをとり、設定レジスタRに代入することを意味する。
【0046】
また、“AND 0x3f,R”命令の実行によって割り込み禁止かつバンク有効にすることが可能である。このAND命令の意味は、設定レジスタRの値と16進数3fとのANDをとり、設定レジスタRに代入することを意味する。
【0047】
つまり、上記のように値を設定することで、フラグを設定する設定レジスタ4の他のビットに影響を与えずに、1つの命令で両方の設定の変更を実現できる。
【0048】
なお、割り込み有効フラグ41が値1で割り込み有効になり、バンク無効化フラグ42が値1でバンク有効になるような符号化の形態では、上記のように、一般的なマイクロプロセッサに備わっているようなAND命令、OR命令のような一般的な命令の一命令で、上記のような割り込み有効かつバンク無効のような処理を行うことはできない。しかし、レジスタの他のビットを使用しないものとすれば、上記のような処理を行うことは可能である。以下の実施の形態では、上記のような制限はない。
【0049】
図4はバンク有効かつ割り込み禁止工程21における同時処理とバンク無効かつ割り込み許可工程24における同時処理を実現するためのもう一つのハードウェア構成である、マイクロプロセッサのバンク・割り込み設定回路の一例を示している。図4において、符号51はインストラクションレジスタであり、メモリからフェッチされた命令コードが格納される。符号52はインストラクションデコーダであり、インストラクションレジスタ51に格納された命令コードをデコードし、インストラクションレジスタ51に格納された命令コードに応じた制御信号を送出する回路である。
【0050】
符号53はバンク無効化レジスタであり、本レジスタに設定された値によりバンクの有効無効を切り替える。符号531はバンク無効化レジスタセット信号であり、本信号が値1のときにバンク無効化レジスタ53がセットされる。符号532はバンク無効化レジスタクリア信号であり、本信号が値1のときにバンク無効化レジスタ53がクリアされる。
【0051】
符号54は割り込み有効レジスタであり、本レジスタに設定された値により割り込みの有効無効を切り替える。符号541は割り込み有効レジスタセット信号であり、本信号が値1のときに割り込み有効レジスタ54がセットされる。符号542は割り込み有効レジスタクリア信号であり、本信号が値1のときに割り込み有効レジスタ54がクリアされる。
【0052】
図5はインストラクションデコーダ52の動作の一部を示す真理値表であり、インストラクションレジスタ51に格納された命令コードを入力として、それに対する制御信号線531、532、541、542の動作を表している。本実施の形態では、バンク無効化割り込み有効化命令(DBEI)に割り付けられた命令コードを“10”とし、バンク有効化割り込み無効化命令(EBDI)を“20”とした場合を示している。
【0053】
図4および図5のようなハードウェアを備えることによって、バンク有効かつ割り込み禁止工程21とバンク無効かつ割り込み許可工程24における同時処理を、特別な小さな命令コードに割り当てることができる。したがって、バンク有効無効の設定と割り込み許可禁止の動作を同時に行うことが可能となり、プログラムのコードサイズと実行時間を小さくすることができる。また、割り込み処理の応答性も改善することができる。
【0054】
なお、上記の実施の形態では、バンク無効化割り込み有効化命令(DBEI)およびバンク有効化割り込み無効化命令(EBDI)の2つの命令コードをインストラクションデコーダ52でデコードする構成にしていたが、バンク無効化レジスタ53と割り込み有効レジスタ54の設定値をともに反転させる一つの命令コードのみをデコードする回路でもよい。
【0055】
図2は本発明の第2の実施の形態におけるマイクロプロセッサのバンクアクセス手法を示している。図2において、符号3はバンクアクセスシーケンスであり、バンクアクセスの方法の全体を示している。
【0056】
符号31はバンク番号設定かつ割り込み禁止工程であり、この工程によってバンク番号の設定処理およびバンクの有効化と割り込みの禁止設定を同時に行っている。
【0057】
符号32はバンクデータアクセス工程であり、バンク番号設定かつ割り込み禁止工程31で設定したバンク番号の示すメモリへのデータアクセスを行っている。
【0058】
符号33はバンク番号復帰かつ割り込み許可工程であり、この工程によってバンクアクセスシーケンス3の前に設定していたバンク番号の復帰処理とバンクの無効化と割り込み許可処理を同時に行っている。
【0059】
図6はバンク番号設定かつ割り込み禁止工程31における同時処理およびバンク番号復帰かつ割り込み許可工程33における同時処理を実現するためのハードウェア構成である、マイクロプロセッサのバンク・割り込み設定回路の一例を示している。図6において、符号61はインストラクションレジスタであり、メモリからフェッチされた命令コードが格納される。
【0060】
符号62はインストラクションデコーダであり、インストラクションレジスタ61に格納された命令コードをデコードし、格納された命令コードに応じた制御信号を送出する回路である。
【0061】
符号63はバンク無効化レジスタであり、本レジスタに設定された値によりバンクの有効無効を切り替える。符号631はバンク無効化レジスタセット信号であり、本信号が値1のときにバンク無効化レジスタ63がセットされる。符号632はバンク無効化レジスタクリア信号であり、本信号が値1のときにバンク無効化レジスタ63がクリアされる。
【0062】
符号64は割り込み有効レジスタであり、本レジスタに設定された値により割り込みの有効無効を切り替える。符号641は割り込み有効レジスタセット信号であり、本信号が値1のときに割り込み有効レジスタ64がセットされる。符号642は割り込み有効レジスタクリア信号であり、本信号が値1のときに割り込み有効レジスタ64がクリアされる。
【0063】
符号65はバンク番号設定レジスタであり、データアクセスするバンク番号を格納するレジスタである。符号651はバンク番号データバスであり、バンク番号設定レジスタ65に設定されるバンク番号を伝達する信号線である。符号652はバンク番号設定レジスタライトイネーブル信号であり、本信号が値1のときにバンク番号設定レジスタ65にバンク番号データバス651のバンク番号が格納される。
【0064】
符号66はバンク番号デコーダであり、バンク番号データバス651とバンク番号設定レジスタライトイネーブル信号652の値から制御信号であるバンク無効化レジスタセット信号631とバンク無効化レジスタクリア信号632と割り込み有効レジスタセット信号641と割り込み有効レジスタクリア信号642とを生成する。
【0065】
図7はバンク番号デコーダ66の動作を示した真理値表である。本実施の形態では、データバス651は2ビットとなっており、このうち値1,2,3をバンクの切り替えに使用し、値0をバンク無効化を示す符号として使用している。
【0066】
本構成によって、バンク番号の設定とバンク無効有効の切り替え、割り込み有効無効の切り替えを同時に実行でき、コードサイズ、実行時間、割り込みの応答時間を小さくすることができる。
【0067】
図8はバンク番号設定かつ割り込み禁止工程31における同時処理およびバンク番号復帰かつ割り込み許可工程33における同時処理を実現するための別のハードウェア構成である、マイクロプロセッサのバンク番号退避レジスタ付バンク・割り込み設定回路の一例を示している。図8において、符号71はインストラクションレジスタであり、メモリからフェッチされた命令コードが格納される。
【0068】
符号72はインストラクションデコーダであり、インストラクションレジスタ71に格納された命令コードをデコードし、格納された命令コードに応じた制御信号を送出する回路である。
【0069】
符号73はバンク番号退避メモリ(レジスタ)であり、バンク番号設定レジスタ75の設定値を一時的に退避するためのメモリである。符号731はバンク番号退避メモリライトイネーブル信号であり、値1のときにバンク番号退避メモリ73に退避すべきバンク番号が格納される。
【0070】
符号74は割り込み有効レジスタであり、本レジスタに設定された値により割り込みの有効無効を切り替える。符号741は割り込み有効レジスタセット信号であり、本信号が値1のときに割り込み有効レジスタ74がセットされる。符号742は割り込み有効レジスタクリア信号であり、本信号が値1のときに割り込み有効レジスタ74がクリアされる。
【0071】
バンク番号設定レジスタ75は、データアクセスするバンク番号を格納するレジスタである。符号751はバンク番号設定レジスタライトイネーブル信号であり、本信号が値1のときにバンク番号設定レジスタ75にバンク番号が格納される。
【0072】
符号76はバンク番号デコーダであり、バンク番号設定レジスタライトイネーブル信号751とバンク番号設定データ用バス772の値から制御信号であるバンク番号選択信号771とバンク番号退避メモリライトイネーブル信号731と割り込み有効レジスタセット信号741と割り込み有効レジスタクリア信号742を生成する。
【0073】
符号77はセレクタであり、バンク番号設定レジスタ75に格納するバンク番号の設定または退避された値の復帰を選択する。符号771はバンク番号選択信号であり、値0のときにバンク番号設定データ用バス772が選択され、したがってバンク番号設定データ用バス772を通して送られたバンク番号が選択され、値1のときにバンク番号退避データ用バス773が選択され、したがってバンク番号退避メモリ73に退避されたバンク番号が選択される。
【0074】
バンク番号設定データ用バス772は、バンク番号設定レジスタ75に設定されるバンク番号を伝達する信号線である。バンク番号退避データ用バス773は、バンク番号退避メモリ73に退避されたバンク番号をセレクタ77に伝達する信号線である。符号774はバンク番号選択結果であり、バンク番号をセレクタ77で選択された結果の値を出力している。
【0075】
図9はバンク番号デコーダ76の動作を示した真理値表である。本実施の形態では、バンク番号設定レジスタ75は2ビットとなっており、このうち値0,1,2をバンク番号の指定に使用し、値3を退避された以前のバンクの設定値を復帰させる符号として用いている。
【0076】
ここで、バンクの有効・無効とバンク番号の退避・復帰との関係について説明する。バンク番号の退避・復帰ができると、バンクの有効・無効の設定の必要はない。バンクの有効・無効フラグの場合、バンクの無効時にデータアクセスすると、予めハードウェアで決められたバンク番号のデフォルト値を使うことになるが、退避復帰を用いる場合、デフォルト値をユーザーが任意に決めることができる。復帰処理によって前に設定した値に戻る。
【0077】
本バンク番号デコーダ76によって、バンク番号0,1,2いずれの領域から別のバンクに設定を変更した場合でも、バンク番号3を設定することによって、前回のバンク番号に復帰することができる。
【0078】
この構成によれば、バンク番号設定および以前のバンク番号の退避・復帰等のバンク機能の設定と割り込み許可禁止の動作を同時に行うことが可能となり、プログラムのコードサイズと実行時間を縮小できる。また、割り込み処理の応答性も改善することができる。
【0079】
図10はバンク番号設定かつ割り込み禁止工程31における同時処理およびバンク番号復帰かつ割り込み許可工程33における同時処理を実現するためのさらに別のハードウェア構成である、マイクロプロセッサのバンク番号退避メモリ付バンク・割り込み設定回路の一例を示している。図10において、符号81はインストラクションレジスタであり、メモリからフェッチされた命令コードが格納される。
【0080】
符号82はインストラクションデコーダであり、インストラクションレジスタ81に格納された命令コードをデコードし、格納された命令コードに応じた制御信号を送出する回路である。
【0081】
符号83はバンク番号退避メモリであり、バンク番号設定レジスタ85の設定値を一時的に退避するためのメモリである。本メモリは複数、例えば4個の設定値を格納することができるようアドレス指定(0,1,2,3)ができるようになっている。符号831はバンク番号退避メモリライトイネーブル信号であり、値1のときにバンク番号退避メモリ83に退避するバンク番号が格納される。符号832はバンク番号退避メモリアドレス信号であり、バンク番号退避メモリ83のメモリのアドレスを指定することができる。
【0082】
符号84は割り込み有効レジスタであり、本レジスタに設定された値により割り込みの有効無効を切り替える。符号841は割り込み有効レジスタセット信号であり、本信号が値1のときに割り込み有効レジスタ84がセットされる。符号842は割り込み有効レジスタクリア信号であり、本信号が値1のときに割り込み有効レジスタ84がクリアされる。
【0083】
バンク番号設定レジスタ85は、データアクセスするバンク番号を格納するレジスタである。符号851はバンク番号設定レジスタライトイネーブル信号であり、本信号が値1のときにバンク番号設定レジスタ85にバンク番号が格納される。
【0084】
符号86はバンク番号デコーダであり、バンク番号設定レジスタライトイネーブル信号851とバンク番号設定データ用バス872の値とアドレスレジスタ88から出力されるアドレス値861とから制御信号であるバンク番号選択信号871とバンク番号退避メモリライトイネーブル信号831と加減算選択信号891と割り込み有効レジスタセット信号841と割り込み有効レジスタクリア信号842とを生成する。符号861はアドレス値であり、アドレスレジスタ88の値をデコーダ86へ伝達している。
【0085】
符号87はバンク番号セレクタであり、バンク番号設定レジスタ85に格納するバンク番号の設定または退避された値の復帰を選択する。バンク番号選択信号871は、値0のときにバンク番号設定データ用バス872が選択され、したがってバンク番号設定データ用バス872を通して送られたバンク番号が選択され、値1のときにバンク番号退避データ用バス873が選択され、したがってバンク番号退避メモリ83に退避されてアドレスで指定されたバンク番号が選択される。バンク番号設定データ用バス872は、バンク番号設定レジスタ85に設定されるバンク番号を伝達する信号線である。バンク番号退避データ用バス873は、バンク番号退避メモリ83に退避されたバンク番号をセレクタ87に伝達する信号線である。符号874はバンク番号選択結果であり、バンク番号セレクタ87で選択された結果の値を出力している。
【0086】
アドレスレジスタ88は、バンク番号退避メモリ83のアドレスを保持している。
【0087】
符号89は演算器を構成する加減算器であり、アドレスレジスタ88の値を演算する。加減算器89は、制御信号である加減算選択信号891によって加算と減算を切り替えることができる。加減算器89は、加減算選択信号891が値0のときに加算を行い、値1のときに減算を行う。なお、加減算器89の代わりにデコーダを用いても同様の機能を実現することができる。このような回路をアドレス値を変更する回路手段と称している。
【0088】
符号8aはアドレスセレクタであり、バンク退避メモリ83へ与えるアドレスを選択している。制御信号である加減算選択信号89が値0のときに加減算器89の値を選択し、値1のときにアドレスレジスタ88の値を選択する。
【0089】
図11はデコーダ86の動作を示す真理値表である。
【0090】
本実施の形態では、バンク番号設定レジスタ85は2ビットとなっており、このうち値0,1,2をバンク番号の指定に使用し、値3を退避された以前のバンクの設定値を復帰させる符号として用いている。この例では、アドレス値861がバンク番号デコーダ86に入力されており、アドレスレジスタ88のアドレス値が初期値の0に復帰するまで、割り込み有効レジスタセット信号841が出力されないようになっている。つまり、退避したバンク番号がすべて復帰されたときに初めて割り込み有効レジスタセット信号841が出力され、割り込みが有効となる。この点が、図8および図9の実施の形態の構成との違いである。
【0091】
本実施の形態ではバンク番号退避メモリ83を複数備えることによって、複数回バンクを切り替えることを可能にし、元のバンクへと復帰するまで割り込み無効状態とすることができる。
【0092】
ここで、アドレスレジスタ88、加減算器89、セレクタ8aに関連する動作について説明する。加減算器選択信号891は、バンク番号を設定する時、すなわちバンク番号値0,1,2を書き込んだ時は加算となり、バンク番号を復帰させる時、すなわちバンク番号3を書き込む時は減算となるように動作を選択する信号である。バンク番号を設定するとき、バンク番号退避用メモリを指し示すアドレス値は、アドレスレジスタ88の値に1を加算した値がセレクタ8aにより選択される。退避されるバンク番号が、加算されたアドレス値が指し示すバンク番号退避メモリ番地に退避される。次サイクルでアドレス88には、1加算された値が記憶される。
【0093】
バンク番号を復帰させるとき、セレクタ8aはアドレスレジスタ88の出力を選択し、アドレスレジスタ88に記憶されているアドレス値が指し示すバンク退避メモリに記憶されているバンク番号がバンク番号退避データ用バス873を通り、バンク番号設定レジスタ85に復帰される。次サイクルで加減算器89の値から1減算された値をアドレスレジスタ88に記憶する。
【0094】
上記の動作により複数個のバンク番号退避処理を実現している。上記の回路は、ポストインクリメントプリデクリメントのスタック動作を行う回路と等価のものであり、アドレスレジスタ88はスタックポインタということもできる。
【0095】
この構成によれば、バンク番号設定および以前のバンク番号の退避・復帰等のバンク機能の設定と割り込み許可禁止の動作を同時に行うことが可能となり、プログラムのコードサイズと実行時間を縮小できる。また、割り込み処理の応答性も改善することができる。また、以前のバンク番号を複数個、退避・復帰可能であり、元のバンクに復帰させるまでに複数回のバンク切替を行うことが可能である。
【0096】
【発明の効果】
本発明の請求項1、2記載のマイクロプロセッサによれば、バンク有効無効の設定と割り込み許可禁止の動作を同時に行うことが可能となり、プログラムのコードサイズと実行時間を縮小できる。また、割り込み処理の応答性も改善することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態のマイクロプロセッサにおけるバンクアクセス手法を示すフローチャートである。
【図2】本発明の第2の実施の形態のマイクロプロセッサにおけるバンクアクセス手法を示すフローチャートである。
【図3】 (a)は本発明の第1の実施の形態のマイクロプロセッサにおけるバンク・割り込み設定レジスタの一例を示す模式図、(b)は同じくレジスタ設定値を示す模式図である。
【図4】本発明の第1の実施の形態のマイクロプロセッサにおけるバンク・割り込み設定回路の一例を示すブロック図である。
【図5】図4のデコーダ真理値表を示す説明図である。
【図6】本発明の第2の実施の形態のマイクロプロセッサにおけるバンク・割り込み設定回路の一例を示すブロック図である。
【図7】図6のデコーダ真理値表を示す説明図である。
【図8】本発明の第2の実施の形態のマイクロプロセッサにおけるバンク番号退避レジスタ付バンク・割り込み設定回路の一例を示すブロック図である。
【図9】図8のデコーダ真理値表を示す説明図である。
【図10】本発明の第2の実施の形態のマイクロプロセッサにおけるバンク番号退避メモリ付バンク・割り込み設定回路の一例を示すブロック図である。
【図11】図10のデコーダ真理値表を示す説明図である。
【図12】従来のマイクロプロセッサにおけるバンクアクセス手法を示すフローチャートである。
【符号の説明】
1 バンクアクセスシーケンス
11 割り込み禁止工程
12 バンク番号設定工程
13 バンク有効化工程
14 バンクデータアクセス工程
15 バンク無効化工程
16 割り込み許可工程
2 バンクアクセスシーケンス
21 バンク有効かつ割り込み禁止工程
22 バンク番号設定工程
23 バンクデータアクセス工程
24 バンク無効かつ割り込み許可工程
3 バンクアクセスシーケンス
31 バンク番号設定かつ割り込み禁止工程
32 バンクデータアクセス工程
33 バンク番号復帰かつ割り込み許可工程
4 設定レジスタ
41 割り込み有効フラグ
42 バンク無効化フラグ
51 インストラクションレジスタ
52 インストラクションデコーダ
53 バンク無効化レジスタ
531 バンク無効化レジスタセット信号
532 バンク無効化レジスタクリア信号
54 割り込み有効レジスタ
541 割り込み有効レジスタセット信号
542 割り込み有効レジスタクリア信号
61 インストラクションレジスタ
62 インストラクションデコーダ
63 バンク無効化レジスタ
631 バンク無効化レジスタセット信号
632 バンク無効化レジスタクリア信号
64 割り込み有効レジスタ
641 割り込み有効レジスタセット信号
642 割り込み有効レジスタクリア信号
65 バンク番号設定レジスタ
651 バンク番号データバス
652 バンク番号設定レジスタライトイネーブル信号
66 バンク番号デコーダ
71 インストラクションレジスタ
72 インストラクションデコーダ
73 バンク番号退避メモリ
731 バンク番号退避メモリライトイネーブル信号
74 割り込み有効レジスタ
741 割り込み有効レジスタセット信号
742 割り込み有効レジスタクリア信号
75 バンク番号設定レジスタ
751 バンク番号設定レジスタライトイネーブル信号
76 バンク番号デコーダ
77 セレクタ
771 バンク番号選択信号
772 バンク番号設定データ用バス
773 バンク番号退避データ用バス
774 バンク番号選択結果
81 インストラクションレジスタ
82 インストラクションデコーダ
83 バンク番号退避メモリ
831 バンク番号退避メモリライトイネーブル信号
832 バンク番号退避メモリアドレス信号
84 割り込み有効レジスタ
841 割り込み有効レジスタセット信号
842 割り込み有効レジスタクリア信号
85 バンク番号設定レジスタ
851 バンク番号設定レジスタライトイネーブル信号
86 バンク番号デコーダ
861 アドレス値
87 バンク番号セレクタ
871 バンク番号選択信号
872 バンク番号設定データ用バス
873 バンク番号退避データ用バス
874 バンク番号選択結果
88 アドレスレジスタ
89 加減算器
891 加算減算選択信号
8a アドレスセレクタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microprocessor having a mechanism that efficiently uses a bank function.
[0002]
[Prior art]
When creating a program using multiple banks, it is necessary to ensure the consistency of the bank that was switched at the time of interrupt. Conventionally, as a method for ensuring the consistency of a bank, a method of disabling interrupts while switching banks to access another bank has been used.
[0003]
FIG. 12 shows a technique for ensuring the consistency of bank values at the time of interruption in a conventional microprocessor. In FIG. 12, reference numeral 1 indicates an overall view of a bank access sequence showing data access using a bank.
[0004]
In the bank access sequence 1, reference numeral 11 denotes an interrupt prohibiting process, and by preventing execution of the interrupt processing program, a problem of interrupt processing due to setting a bank number in the subsequent processes is avoided.
[0005]
Reference numeral 12 denotes a bank number setting step, which is a step for storing a bank number in which data is placed in a bank number setting register.
[0006]
Reference numeral 13 denotes a bank validation step. The bank number set in the bank number setting step 12 is validated, and subsequent data access is determined to access the memory of the bank number set in the bank number setting step 12. is doing.
[0007]
Reference numeral 14 denotes a bank data access process, which performs data access to the memory indicated by the bank number set in the bank number setting process 12.
[0008]
Reference numeral 15 denotes a bank invalidation step, which invalidates access to the bank memory and returns to normal memory access.
[0009]
Reference numeral 16 denotes an interrupt permission process, which permits interrupt processing in subsequent programs.
[0010]
With the processing as described above, problems due to interrupt processing at the time of data access to the bank memory are avoided.
[0011]
[Problems to be solved by the invention]
However, the method of disabling interrupts while switching banks requires setting the value in the bank number setting register and disabling and enabling interrupts every time data in another bank is accessed. There is a problem that the response time of the interrupt processing program becomes long by increasing the size and execution time and prohibiting the interrupt.
[0012]
[Means for Solving the Problems]
In the present invention, the code size and execution time of the program can be reduced by providing a mechanism for simultaneously setting the bank function (valid / invalid, bank number, saving / returning bank number, etc.) and interrupt permission prohibition. In addition, the responsiveness of interrupt processing can be improved.
[0013]
Hereinafter, each claim will be described.
[0014]
The microprocessor according to claim 1 has first and second flags arranged in a setting register having the same address, and the interrupt becomes valid when a predetermined value is set in the first flag. The bank is invalidated when a predetermined value is set in the flag.
[0015]
According to this configuration, it becomes possible to simultaneously perform the bank valid / invalid setting and the interrupt permission prohibiting operation, and the code size and execution time of the program can be reduced. In addition, the responsiveness of interrupt processing can be improved.
[0016]
According to a second aspect of the present invention, in the microprocessor according to the first aspect, a value set in the first flag when the interrupt is enabled and a value set in the second flag when the bank is disabled. Are the same value.
[0017]
According to this configuration, the operation is the same as that of the microprocessor according to the first aspect.
[0035]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0036]
FIG. 1 shows a bank access method of a microprocessor according to the first embodiment of the present invention. In FIG. 1, reference numeral 2 denotes a bank access sequence, which shows the entire bank access method.
[0037]
Reference numeral 21 denotes a bank valid and interrupt prohibition process, and the bank number validation process and the interrupt prohibition setting process are simultaneously performed by this process.
[0038]
Reference numeral 22 denotes a bank number setting step, which is a step for storing a bank number in which data is placed in a bank number setting register.
[0039]
Reference numeral 23 denotes a bank data access process, which performs data access to the memory indicated by the bank number set in the bank number setting process 22.
[0040]
Reference numeral 24 denotes a bank invalidation / interrupt permission process. The bank number invalidation process and the interrupt permission setting process set in this process are performed simultaneously.
[0041]
FIG. 3A shows the simultaneous processing of the bank number enabling process and the interrupt prohibition setting process in the bank valid and interrupt prohibiting process 21, and the bank invalidating and interrupt disabling process 24 in the bank invalidating and interrupt disabling process 24. An example of a microprocessor bank / interrupt setting register, which is a hardware configuration for realizing simultaneous processing with interrupt permission setting processing, is shown. In FIG. 3A, reference numeral 4 denotes a setting register, which stores flags for setting interrupt enable processing and bank invalidation processing. Reference numeral 41 denotes an interrupt valid flag that switches between valid and invalid interrupts. Reference numeral 42 denotes a bank invalidation flag, which switches between valid and invalid banks. That is, the interrupt valid flag 41 and the bank invalidation flag 42 are arranged in the setting register 4 having the same address.
[0042]
FIG. 3B shows the coding state of the interrupt valid flag 41 and the bank invalidation flag 42. With respect to the interrupt valid flag 41, in the present embodiment, setting the value 1 enables the interrupt, and setting the value 0 disables the interrupt. With respect to the bank invalidation flag 42, in the present embodiment, setting the value 1 invalidates the bank number setting, and setting the value 0 validates the bank number setting.
[0043]
Contrary to the above description, with respect to the interrupt valid flag 41, setting the value 0 enables the interrupt, setting the value 1 disables the interrupt, and setting the bank invalidation flag 42 with the value 0. Then, the bank number setting may be invalidated, and if the value 1 is set, the bank number setting may be validated.
[0044]
By providing the setting register 4 as described above and performing encoding as shown in FIG. 3B, simultaneous processing of bank valid and interrupt disable, such as bank valid and interrupt disable step 21, and bank invalid and interrupt enable Simultaneous processing of bank invalidation and interrupt permission as in step 24 can be easily performed by one instruction of a general processor instruction such as an AND instruction and an OR instruction.
[0045]
For example, for the interrupt enable flag 41, setting the value 1 enables the interrupt, setting the value 0 disables the interrupt, and for the bank disabling flag 42, setting the value 1 disables the bank number setting. When the value 0 is set to enable the bank number setting, the AND instruction and the OR instruction are as follows. That is, when the interrupt is enabled and the bank is invalidated, when the setting is changed without affecting other bits of the register, it can be executed by the “OR 0xc0, R” instruction. In the above OR instruction, R is a setting register, and its meaning means that the OR of the value of the setting register R and the hexadecimal number c0 is taken and substituted into the setting register R.
[0046]
Further, it is possible to disable the interrupt and enable the bank by executing the “AND 0x3f, R” instruction. The meaning of this AND instruction means that the AND of the value of the setting register R and the hexadecimal number 3f is taken and substituted into the setting register R.
[0047]
That is, by setting the value as described above, it is possible to change both settings with a single instruction without affecting other bits of the setting register 4 that sets the flag.
[0048]
It should be noted that, in the form of encoding in which the interrupt valid flag 41 is enabled by the value 1 and the bank invalidation flag 42 is enabled by the value 1, the general microprocessor is provided as described above. It is not possible to perform processing such as interrupt enable and bank invalidation as described above with one general instruction such as an AND instruction or an OR instruction. However, if the other bits of the register are not used, the above processing can be performed. In the following embodiment, there is no restriction as described above.
[0049]
FIG. 4 shows an example of a microprocessor bank / interrupt setting circuit, which is another hardware configuration for realizing the simultaneous processing in the bank valid and interrupt prohibiting step 21 and the simultaneous processing in the bank invalid and interrupt permitting step 24. ing. In FIG. 4, reference numeral 51 denotes an instruction register, which stores an instruction code fetched from the memory. Reference numeral 52 denotes an instruction decoder, which is a circuit that decodes an instruction code stored in the instruction register 51 and transmits a control signal corresponding to the instruction code stored in the instruction register 51.
[0050]
Reference numeral 53 denotes a bank invalidation register, which switches the validity of the bank according to the value set in this register. Reference numeral 531 denotes a bank invalidation register set signal. When this signal is a value 1, the bank invalidation register 53 is set. Reference numeral 532 denotes a bank invalidation register clear signal. When this signal is a value 1, the bank invalidation register 53 is cleared.
[0051]
Reference numeral 54 denotes an interrupt valid register, which switches between valid and invalid interrupts according to the value set in this register. Reference numeral 541 denotes an interrupt valid register set signal. When this signal is a value 1, the interrupt valid register 54 is set. Reference numeral 542 denotes an interrupt valid register clear signal. When this signal is a value 1, the interrupt valid register 54 is cleared.
[0052]
FIG. 5 is a truth table showing a part of the operation of the instruction decoder 52, and shows the operation of the control signal lines 531, 532, 541, and 542 in response to the instruction code stored in the instruction register 51 as an input. . In this embodiment, the instruction code assigned to the bank invalidation interrupt enable instruction (DBEI) is “10”, and the bank enable interrupt disable instruction (EBDI) is “20”.
[0053]
By providing the hardware as shown in FIGS. 4 and 5, the simultaneous processing in the bank valid / interrupt prohibiting step 21 and the bank invalid / interrupt permitting step 24 can be assigned to a special small instruction code. Accordingly, it is possible to simultaneously perform the bank valid / invalid setting and the interrupt permission prohibiting operation, and the code size and execution time of the program can be reduced. In addition, the responsiveness of interrupt processing can be improved.
[0054]
In the above embodiment, the instruction decoder 52 decodes the two instruction codes of the bank invalidation interrupt enable instruction (DBEI) and the bank enable interrupt disable instruction (EBDI). A circuit that decodes only one instruction code that inverts the set values of the generalization register 53 and the interrupt valid register 54 may be used.
[0055]
FIG. 2 shows a bank access method of the microprocessor according to the second embodiment of the present invention. In FIG. 2, reference numeral 3 denotes a bank access sequence, which shows the entire bank access method.
[0056]
Reference numeral 31 denotes a bank number setting and interrupt prohibiting step, and bank number setting processing, bank validation and interrupt prohibition setting are simultaneously performed by this step.
[0057]
Reference numeral 32 denotes a bank data access process, which performs data access to the memory indicated by the bank number set in the bank number setting and interrupt prohibition process 31.
[0058]
Reference numeral 33 denotes a bank number return and interrupt permission process, which simultaneously performs bank number recovery processing, bank invalidation, and interrupt permission processing set before the bank access sequence 3.
[0059]
FIG. 6 shows an example of a bank / interrupt setting circuit of a microprocessor, which is a hardware configuration for realizing the simultaneous processing in the bank number setting and interrupt prohibition step 31 and the bank number return and interrupt permission step 33. Yes. In FIG. 6, reference numeral 61 denotes an instruction register, which stores an instruction code fetched from the memory.
[0060]
Reference numeral 62 denotes an instruction decoder, which is a circuit that decodes the instruction code stored in the instruction register 61 and transmits a control signal corresponding to the stored instruction code.
[0061]
Reference numeral 63 denotes a bank invalidation register, which switches the validity of the bank according to the value set in this register. Reference numeral 631 denotes a bank invalidation register set signal. When this signal is a value 1, the bank invalidation register 63 is set. Reference numeral 632 denotes a bank invalidation register clear signal. When this signal is a value 1, the bank invalidation register 63 is cleared.
[0062]
Reference numeral 64 denotes an interrupt valid register, which switches between valid and invalid interrupts according to the value set in this register. Reference numeral 641 denotes an interrupt valid register set signal. When this signal is a value 1, the interrupt valid register 64 is set. Reference numeral 642 denotes an interrupt valid register clear signal. When this signal is a value 1, the interrupt valid register 64 is cleared.
[0063]
Reference numeral 65 denotes a bank number setting register which stores a bank number for data access. Reference numeral 651 denotes a bank number data bus, which is a signal line for transmitting a bank number set in the bank number setting register 65. Reference numeral 652 denotes a bank number setting register write enable signal. When this signal is 1, the bank number of the bank number data bus 651 is stored in the bank number setting register 65.
[0064]
Reference numeral 66 denotes a bank number decoder. The bank invalidation register set signal 631, the bank invalidation register clear signal 632, and the interrupt valid register set, which are control signals, are determined from the values of the bank number data bus 651 and the bank number setting register write enable signal 652. A signal 641 and an interrupt valid register clear signal 642 are generated.
[0065]
FIG. 7 is a truth table showing the operation of the bank number decoder 66. In the present embodiment, the data bus 651 has 2 bits, of which the values 1, 2, and 3 are used for bank switching, and the value 0 is used as a code indicating bank invalidation.
[0066]
With this configuration, bank number setting, bank invalid / effective switching, and interrupt valid / invalid switching can be executed simultaneously, and the code size, execution time, and interrupt response time can be reduced.
[0067]
FIG. 8 shows another hardware configuration for realizing the simultaneous processing in the bank number setting and interrupt prohibition step 31 and the simultaneous processing in the bank number return and interrupt permission step 33. An example of a setting circuit is shown. In FIG. 8, reference numeral 71 denotes an instruction register, which stores an instruction code fetched from the memory.
[0068]
Reference numeral 72 denotes an instruction decoder, which is a circuit that decodes the instruction code stored in the instruction register 71 and transmits a control signal corresponding to the stored instruction code.
[0069]
Reference numeral 73 denotes a bank number saving memory (register), which is a memory for temporarily saving the set value of the bank number setting register 75. Reference numeral 731 denotes a bank number saving memory write enable signal. When the value is 1, the bank number to be saved is stored in the bank number saving memory 73.
[0070]
Reference numeral 74 denotes an interrupt valid register, which switches between valid and invalid interrupts according to the value set in this register. Reference numeral 741 denotes an interrupt valid register set signal. When this signal is a value 1, the interrupt valid register 74 is set. Reference numeral 742 denotes an interrupt valid register clear signal. When this signal is a value 1, the interrupt valid register 74 is cleared.
[0071]
The bank number setting register 75 stores a bank number for data access. Reference numeral 751 denotes a bank number setting register write enable signal. When this signal is 1, the bank number is stored in the bank number setting register 75.
[0072]
Reference numeral 76 denotes a bank number decoder. The bank number setting signal write enable signal 751, the bank number setting data bus 772, and the bank number selection signal 771, which is a control signal, the bank number save memory write enable signal 731 and the interrupt valid register are indicated. A set signal 741 and an interrupt valid register clear signal 742 are generated.
[0073]
Reference numeral 77 denotes a selector which selects setting of the bank number stored in the bank number setting register 75 or restoration of the saved value. Reference numeral 771 denotes a bank number selection signal. When the value is 0, the bank number setting data bus 772 is selected. Therefore, the bank number sent through the bank number setting data bus 772 is selected. The number saving data bus 773 is selected, and therefore the bank number saved in the bank number saving memory 73 is selected.
[0074]
The bank number setting data bus 772 is a signal line for transmitting the bank number set in the bank number setting register 75. The bank number saving data bus 773 is a signal line for transmitting the bank number saved in the bank number saving memory 73 to the selector 77. Reference numeral 774 denotes a bank number selection result, and a value obtained by selecting the bank number by the selector 77 is output.
[0075]
FIG. 9 is a truth table showing the operation of the bank number decoder 76. In the present embodiment, the bank number setting register 75 has 2 bits, of which the values 0, 1, and 2 are used for specifying the bank number, and the value 3 is restored to the previous bank setting value. It is used as a code to be made.
[0076]
Here, the relationship between bank validity / invalidity and saving / restoring of bank numbers will be described. If the bank number can be saved / restored, there is no need to enable / disable the bank. In the case of the bank valid / invalid flag, if data is accessed when the bank is invalid, the default value of the bank number determined in advance by hardware is used. However, when using save / restore, the user arbitrarily determines the default value. be able to. Return to the previously set value by return processing.
[0077]
Even when the bank number decoder 76 changes the setting of any bank 0, 1, or 2 to another bank, the bank number 3 can be set to return to the previous bank number.
[0078]
According to this configuration, it is possible to simultaneously perform bank function settings such as bank number setting and saving / restoring of previous bank numbers, and interrupt permission prohibition operations, and the code size and execution time of the program can be reduced. In addition, the responsiveness of interrupt processing can be improved.
[0079]
FIG. 10 shows another hardware configuration for realizing the simultaneous processing in the bank number setting and interrupt prohibition step 31 and the simultaneous processing in the bank number return and interrupt permission step 33. 2 shows an example of an interrupt setting circuit. In FIG. 10, reference numeral 81 denotes an instruction register, which stores an instruction code fetched from the memory.
[0080]
Reference numeral 82 denotes an instruction decoder, which is a circuit that decodes the instruction code stored in the instruction register 81 and transmits a control signal corresponding to the stored instruction code.
[0081]
Reference numeral 83 denotes a bank number saving memory, which is a memory for temporarily saving the set value of the bank number setting register 85. This memory can be addressed (0, 1, 2, 3) so that a plurality of, for example, four set values can be stored. Reference numeral 831 denotes a bank number saving memory write enable signal. When the value is 1, the bank number saved in the bank number saving memory 83 is stored. Reference numeral 832 denotes a bank number saving memory address signal, which can specify the memory address of the bank number saving memory 83.
[0082]
Reference numeral 84 denotes an interrupt valid register, which switches between valid and invalid interrupts according to the value set in this register. Reference numeral 841 denotes an interrupt valid register set signal. When this signal is a value 1, the interrupt valid register 84 is set. Reference numeral 842 denotes an interrupt valid register clear signal. When this signal is a value 1, the interrupt valid register 84 is cleared.
[0083]
The bank number setting register 85 is a register for storing a bank number for data access. Reference numeral 851 denotes a bank number setting register write enable signal. When this signal is 1, the bank number is stored in the bank number setting register 85.
[0084]
Reference numeral 86 denotes a bank number decoder, and a bank number selection signal 871 which is a control signal based on the bank number setting register write enable signal 851, the value of the bank number setting data bus 872, and the address value 861 output from the address register 88. A bank number saving memory write enable signal 831, an addition / subtraction selection signal 891, an interrupt valid register set signal 841, and an interrupt valid register clear signal 842 are generated. Reference numeral 861 denotes an address value, and the value of the address register 88 is transmitted to the decoder 86.
[0085]
Reference numeral 87 denotes a bank number selector, which selects setting of a bank number stored in the bank number setting register 85 or restoration of a saved value. When the bank number selection signal 871 is 0, the bank number setting data bus 872 is selected. Therefore, the bank number sent through the bank number setting data bus 872 is selected. The bus 873 is selected, and therefore the bank number saved in the bank number saving memory 83 and designated by the address is selected. The bank number setting data bus 872 is a signal line for transmitting the bank number set in the bank number setting register 85. The bank number saving data bus 873 is a signal line for transmitting the bank number saved in the bank number saving memory 83 to the selector 87. Reference numeral 874 denotes a bank number selection result, and the value of the result selected by the bank number selector 87 is output.
[0086]
The address register 88 holds the address of the bank number saving memory 83.
[0087]
Reference numeral 89 denotes an adder / subtracter constituting an arithmetic unit, which calculates the value of the address register 88. The adder / subtractor 89 can switch between addition and subtraction by an addition / subtraction selection signal 891 which is a control signal. The adder / subtracter 89 performs addition when the addition / subtraction selection signal 891 is 0, and performs subtraction when the value is 1. A similar function can be realized by using a decoder instead of the adder / subtractor 89. Such a circuit is called a circuit means for changing an address value.
[0088]
Reference numeral 8 a denotes an address selector that selects an address to be given to the bank save memory 83. When the addition / subtraction selection signal 89 as the control signal is 0, the value of the adder / subtractor 89 is selected, and when the value is 1, the value of the address register 88 is selected.
[0089]
FIG. 11 is a truth table showing the operation of the decoder 86.
[0090]
In the present embodiment, the bank number setting register 85 has 2 bits, of which the values 0, 1, and 2 are used for specifying the bank number, and the value 3 is restored to the previous bank setting value. It is used as a code to be made. In this example, the address value 861 is input to the bank number decoder 86, and the interrupt valid register set signal 841 is not output until the address value of the address register 88 returns to the initial value 0. That is, the interrupt valid register set signal 841 is output for the first time when all the saved bank numbers are restored, and the interrupt becomes valid. This is the difference from the configuration of the embodiment shown in FIGS.
[0091]
In the present embodiment, by providing a plurality of bank number saving memories 83, it is possible to switch the bank a plurality of times, and to disable the interrupt until the original bank is restored.
[0092]
Here, operations related to the address register 88, the adder / subtractor 89, and the selector 8a will be described. The adder / subtracter selection signal 891 is added when the bank number is set, that is, when the bank number values 0, 1, and 2 are written, and is subtracted when the bank number is restored, that is, when the bank number 3 is written. This is a signal for selecting an operation. When setting the bank number, an address value indicating the bank number saving memory is selected by the selector 8a by adding 1 to the value of the address register 88. The saved bank number is saved in the bank number saving memory address indicated by the added address value. In the next cycle, a value obtained by adding 1 is stored in the address 88.
[0093]
When restoring the bank number, the selector 8a selects the output of the address register 88, and the bank number stored in the bank save memory indicated by the address value stored in the address register 88 is stored in the bank number save data bus 873. The bank number setting register 85 is restored. In the next cycle, a value obtained by subtracting 1 from the value of the adder / subtractor 89 is stored in the address register 88.
[0094]
A plurality of bank number saving processes are realized by the above operation. The above circuit is equivalent to a circuit that performs a post-increment pre-decrement stack operation, and the address register 88 can also be called a stack pointer.
[0095]
According to this configuration, it is possible to simultaneously perform bank function settings such as bank number setting and saving / restoring of previous bank numbers, and interrupt permission prohibition operations, and the code size and execution time of the program can be reduced. In addition, the responsiveness of interrupt processing can be improved. Further, a plurality of previous bank numbers can be saved and restored, and bank switching can be performed a plurality of times before returning to the original bank.
[0096]
【The invention's effect】
Claim 1 of the present invention 2 According to the described microprocessor, it is possible to simultaneously perform the bank valid / invalid setting and the interrupt permission prohibiting operation, and the code size and execution time of the program can be reduced. In addition, the responsiveness of interrupt processing can be improved.
[Brief description of the drawings]
FIG. 1 is a flowchart illustrating a bank access method in a microprocessor according to a first embodiment of this invention.
FIG. 2 is a flowchart showing a bank access method in a microprocessor according to a second embodiment of the present invention.
3A is a schematic diagram illustrating an example of a bank / interrupt setting register in the microprocessor according to the first embodiment of the present invention, and FIG. 3B is a schematic diagram illustrating register setting values.
FIG. 4 is a block diagram showing an example of a bank / interrupt setting circuit in the microprocessor according to the first embodiment of the present invention;
FIG. 5 is an explanatory diagram showing a decoder truth table of FIG. 4;
FIG. 6 is a block diagram showing an example of a bank / interrupt setting circuit in the microprocessor according to the second embodiment of the present invention;
7 is an explanatory diagram showing a decoder truth table of FIG. 6; FIG.
FIG. 8 is a block diagram showing an example of a bank / interrupt setting circuit with a bank number saving register in the microprocessor according to the second embodiment of the present invention;
9 is an explanatory diagram showing a decoder truth table of FIG. 8. FIG.
FIG. 10 is a block diagram showing an example of a bank / interrupt setting circuit with bank number saving memory in the microprocessor according to the second embodiment of the present invention;
FIG. 11 is an explanatory diagram showing a decoder truth table of FIG. 10;
FIG. 12 is a flowchart showing a bank access method in a conventional microprocessor.
[Explanation of symbols]
1 Bank access sequence
11 Interrupt disable process
12 Bank number setting process
13 Bank validation process
14 Bank data access process
15 Bank invalidation process
16 Interrupt enable process
2 Bank access sequence
21 Bank enabled and interrupt disabled process
22 Bank number setting process
23 Bank data access process
24 Bank invalid and interrupt enable process
3 Bank access sequence
31 Bank number setting and interrupt disable process
32 Bank data access process
33 Bank number return and interrupt enable process
4 Setting register
41 Interrupt enable flag
42 Bank invalidation flag
51 Instruction Register
52 Instruction decoder
53 Bank Invalidation Register
531 Bank invalidation register set signal
532 Bank invalidation register clear signal
54 Interrupt enable register
541 Interrupt enable register set signal
542 Interrupt enable register clear signal
61 Instruction Register
62 Instruction decoder
63 Bank invalidation register
631 Bank invalidation register set signal
632 Bank invalidation register clear signal
64 Interrupt enable register
641 Interrupt enable register set signal
642 Interrupt valid register clear signal
65 Bank number setting register
651 Bank number data bus
652 Bank number setting register write enable signal
66 Bank number decoder
71 Instruction Register
72 Instruction decoder
73 Bank number saving memory
731 Bank number saving memory write enable signal
74 Interrupt enable register
741 Interrupt enable register set signal
742 Interrupt valid register clear signal
75 Bank number setting register
751 Bank number setting register write enable signal
76 Bank number decoder
77 Selector
771 Bank number selection signal
772 Bank number setting data bus
773 Bank number saving data bus
774 Bank number selection result
81 Instruction register
82 Instruction decoder
83 Bank number save memory
831 Bank number save memory write enable signal
832 Bank number save memory address signal
84 Interrupt enable register
841 Interrupt enable register set signal
842 Interrupt enable register clear signal
85 Bank number setting register
851 Bank number setting register write enable signal
86 Bank number decoder
861 Address value
87 Bank number selector
871 Bank number selection signal
872 Bank number setting data bus
873 Bank number saving data bus
874 Bank number selection result
88 Address register
89 Adder / Subtractor
891 Addition / subtraction selection signal
8a Address selector

Claims (2)

同一アドレスの設定レジスタに配置された第1および第2のフラグを有し、前記第1のフラグに所定の値が設定されたときに割り込み有効となり、前記第2のフラグに所定の値が設定されたときにバンク無効となることを特徴とするマイクロプロセッサ。  It has first and second flags arranged in the setting register of the same address, interrupt is enabled when a predetermined value is set in the first flag, and a predetermined value is set in the second flag A microprocessor that is disabled when banked. 割り込み有効にするときに第1のフラグに設定される値とバンク無効にするときに第2のフラグに設定される値とが同じ値である請求項1記載のマイクロプロセッサ 2. The microprocessor according to claim 1, wherein the value set in the first flag when the interrupt is enabled is the same as the value set in the second flag when the bank is disabled .
JP2002087895A 2002-03-27 2002-03-27 Microprocessor Expired - Fee Related JP4125531B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002087895A JP4125531B2 (en) 2002-03-27 2002-03-27 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002087895A JP4125531B2 (en) 2002-03-27 2002-03-27 Microprocessor

Publications (2)

Publication Number Publication Date
JP2003280923A JP2003280923A (en) 2003-10-03
JP4125531B2 true JP4125531B2 (en) 2008-07-30

Family

ID=29233932

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002087895A Expired - Fee Related JP4125531B2 (en) 2002-03-27 2002-03-27 Microprocessor

Country Status (1)

Country Link
JP (1) JP4125531B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7258256B1 (en) * 2022-07-19 2023-04-14 三菱電機株式会社 Programmable logic controller, sequence control system, and active state control program

Also Published As

Publication number Publication date
JP2003280923A (en) 2003-10-03

Similar Documents

Publication Publication Date Title
JP4939387B2 (en) Data processing apparatus and address space protection method
WO1999028817A2 (en) An instruction decoder
JP4125531B2 (en) Microprocessor
JPH05257808A (en) Microprocessor and its operation converting method
CA1289265C (en) Microprocessor with selective cache memory
JP2001075804A (en) Parallel processor processing expansion instruction
JP2006072961A (en) Memory circuit for arithmetic processing unit
JP4889235B2 (en) Program control processor
JP2004062309A (en) Method of processing illegal instruction and processor
JP4498705B2 (en) Cash system
US7073049B2 (en) Non-copy shared stack and register file device and dual language processor structure using the same
JPH0241770B2 (en)
JPH09128248A (en) Microprocessor
JP3197045B2 (en) Extended central processing unit
JP2901454B2 (en) Programmable controller
JP4564025B2 (en) Interrupt processing method in information processing apparatus
JP2000029508A (en) Programmable controller
JPH06301534A (en) Information processor
EP0101759B1 (en) Data processing system having branch instruction prefetching performance
JPS6149695B2 (en)
JP2013161325A (en) Simd (single instruction-stream multiple data-stream) type microprocessor, processor system and data processing method for simd type microprocessor
JPH0683986A (en) Single chip microcomputer
JPS617961A (en) Control system of address converting buffer
JPH04270420A (en) Sequence operation processing device
JPH0467229A (en) Microprocessor and memory system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050314

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071204

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080125

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080415

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080508

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees