JP3644614B2 - Dynamic intermediate code processor - Google Patents

Dynamic intermediate code processor Download PDF

Info

Publication number
JP3644614B2
JP3644614B2 JP32836796A JP32836796A JP3644614B2 JP 3644614 B2 JP3644614 B2 JP 3644614B2 JP 32836796 A JP32836796 A JP 32836796A JP 32836796 A JP32836796 A JP 32836796A JP 3644614 B2 JP3644614 B2 JP 3644614B2
Authority
JP
Japan
Prior art keywords
address
instruction
intermediate code
processing
storage means
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 - Lifetime
Application number
JP32836796A
Other languages
Japanese (ja)
Other versions
JPH10171650A (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 JP32836796A priority Critical patent/JP3644614B2/en
Publication of JPH10171650A publication Critical patent/JPH10171650A/en
Application granted granted Critical
Publication of JP3644614B2 publication Critical patent/JP3644614B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、中間コードで記述されたプログラムを実行する装置に関し、特に、中間コードの命令を実行する際に、命令の解釈と分岐処理とを高速処理できる装置にかかる。
【0002】
【従来の技術】
従来の動的中間コード処理装置では、中間コードで記述されたプログラムを実行する場合、命令の解釈は、ソフトウェアで逐次命令コードを比較することで、各々の命令の処理に分岐して処理が行われていた。
【0003】
ここに、中間コードとは、コンパイラでソース・プログラムをオブジェクト・プログラムに変換する際に作られる仮想的な機械語をいう。
【0004】
図9は従来の中間コードで記述されたプログラムの処理を行う装置の構成を示すブロック図である。
【0005】
同図において、100は中央処理装置(以下、「CPU:Center Processing Unit」という。)、200はメモリである。中間コードの実行プログラムは、CPU100から出力されたアドレスに従ってメモリ200から読み出され、CPU100において、命令コードの解釈と処理部との実行が行われていた。
【0006】
また、マイクロプログラマブル・データ処理装置において、任意の仮想計算機の命令語を高速にデコードし、実行できるように、特開昭62−98427号公報にて「連想型マイクロ制御方式」が提案されている。
【0007】
かかる公開公報にて開示さている「連想型マイクロ制御方式」は、命令をレジスタにセットしてマイクロコードの先頭アドレスに分岐させることで、命令の実行を高速化する方式である。
【0008】
【発明が解決しようとする課題】
図9に示した従来の中間コードで記述されたプログラムの処理を行う装置では、以下の問題点が指摘されている。
【0009】
すなわち、命令を逐次比較して解釈するため、毎回命令を実行するたびに、比較処理が行われるので、効率的な処理が行えない。
【0010】
加えて、命令の解釈と処理部への条件分岐とが連続するため、CPU内のパイプライン処理の中断が頻繁に発生するので、効率的な処理が行えない。
【0011】
また、特開昭62−98427号公報にて提案されている「連想型マイクロ制御方式」では、以下の問題点が指摘されている。
【0012】
すなわち、連想メモリから得られたアドレスを変換するのではなく、そのまま利用して分岐するため、同様に、CPU内のパイプライン処理の中断が発生する。
【0013】
本発明は、上記技術的課題に鑑みなされたもので、中間コードの命令の解釈と処理部への分岐とを高速に行うことができるとともに、CPUのパイプライン処理を妨げることなく、高速処理化を達成することができる動的中間コード処理装置を提供することを目的とする。
【0014】
【課題を解決するための手段】
上記目的を達成するために、請求項1に記載の発明にかかる動的中間コード処理装置は、中央処理装置から出力された仮想アドレスに基づき、中間コードを解釈して物理アドレスに変換するための装置であって、上記中間コードの命令を格納する格納手段と、上記中間コードの命令処理が格納されたページの物理アドレスを記憶する記憶手段と、この記憶手段から取り出されたアドレスと、上記中央処理装置から出力された仮想アドレスとを組み合わせて物理アドレスに変換する変換手段とを含むことを特徴とするものである。
【0015】
請求項2に記載の発明にかかる動的中間コード処理装置は、請求項1に記載の動的中間コード処理装置において、上記記憶手段は、使用頻度の高い上記中間コードの命令処理が格納されたページの物理アドレスを記憶し、上記変換手段は、上記記憶手段において上記格納手段に格納された命令が存在する場合に、上記記憶手段から取り出されたアドレスと、上記中央処理装置から出力された仮想アドレスとを組み合わせて物理アドレスに変換し、上記記憶手段にエントリを持たない命令の場合に、上記中央処理装置から出力されたアドレスを直接出力する出力手段を含むことを特徴とするものである。
【0016】
請求項3に記載の発明にかかる動的中間コード処理装置は、請求項1に記載の動的中間コード処理装置において、上記記憶手段は、使用頻度の高い上記中間コードの命令処理が格納されたページの物理アドレスを記憶しており、かつ、当該記憶手段において存在しないオペレーションコードを処理するための命令解釈部が格納されたページの物理アドレスを備えていることを特徴とするものである。
【0017】
請求項4に記載の発明にかかる動的中間コード処理装置は、請求項1ないし3のいずれかに記載の動的中間コード処理装置において、上記記憶手段は、上記格納手段に格納されているオペレーションコードに対応して、上記中間コードの命令処理が格納されたページのサイズを記憶するページサイズエントリを備え、このページサイズエントリの値を元に、上記中央処理装置から出力された仮想アドレスと、上記記憶手段から取り出されたアドレスとの間で出力するアドレスを変換するために、両アドレスのいずれか一方のビットを選択する選択手段を含むことを特徴とするものである。
【0018】
【発明の実施の形態】
以下、本発明の実施の形態を添付図面に基づき詳細に説明する。
【0019】
実施の形態1.
図1は本発明の実施の形態1にかかる動的中間コード処理装置の構成を示すブロック図である。
【0020】
同図において、1はCPU、2はメモリ、3はオペレーションコードレジスタ、4は変換参照バッファ、5はアドレス変換部、6はメモリ管理部である。
【0021】
変換参照バッファ4、およびアドレス変換部5は、メモリ管理部6に含まれている。
【0022】
変換参照バッファ4は、命令コードの数に応じた数の複数のエントリを備えているものとする。例えば、命令コードの数が256の場合、256個のオペレーションコードと命令コードの処理部とが格納されたページの物理アドレスのエントリを持つ。
【0023】
ここで、図1を参照して、本実施の形態1の動的中間コード処理装置の処理動作について説明する。
【0024】
中間コードの処理プログラムは、予め、初期化処理として、変換参照バッファ4に、オペレーションコードと対応する物理アドレスの情報を書き込んでおく。
【0025】
そして、中間コードを処理するプログラムは、命令の解釈を逐次比較して行うのではなく、CPU1の外部に設けられたオペレーションコードレジスタ3に中間コードの命令コードを設定することで行われる。このとき、CPU1は、命令コードの書き込みを行うとともに、この書き込みに併せて、アドレス線に仮想アドレスを出力する。
【0026】
メモリ管理部6では、オペレーションコードレジスタ3に設定された命令コードから変換参照バッファ4に格納されている物理アドレスが取り出され、アドレス変換部5において、CPU1から出力された仮想アドレスの下位ビット(ページのオフセット部)と、変換参照バッファ4から得られた物理アドレスとから命令の処理部が格納された物理アドレスを生成する。
【0027】
図2はアドレス変換部で行われるアドレスの生成方法を示す図である。
【0028】
同図において、11はCPU1から出力された仮想アドレス(以下、「CPU出力アドレス」という。)、12はオペレーションコードレジスタ3に設定された命令コードから取り出された物理アドレス(以下、「変換参照バッファ出力アドレス」という。)、13は生成アドレスである。
【0029】
ここで、図2を参照して、アドレス変換部5で行われるアドレスの生成方法について説明する。
【0030】
なお、図2では、CPU1から出力される論理アドレスを32ビット、アドレス変換部5で生成された物理アドレスを32ビット、命令コードの処理が格納されるページのサイズを4Kバイトと想定しており、下位12ビットがページのオフセットを示している。
【0031】
アドレス変換部5では、CPU出力アドレス11の下位12ビットをそのまま取り出し、この取り出したCPU出力アドレス11の下位12ビットと、変換参照バッファ出力アドレス12から取り出された上位20ビットとを組み合わせることで、生成アドレス13、すなわち命令コードの処理部が格納された物理アドレスが得られる。
【0032】
このように、本実施の形態1では、命令コードの処理部が格納された物理アドレスが自動的に生成されるため、ソフトウェア(プログラム)の分岐が発生しない。これにより、以下の効果を奏する。
【0033】
すなわち、中間コードの命令をオペレーションコードレジスタ3に設定するだけで、変換参照バッファ4から中間コードの命令の解釈と処理部への分岐とを高速に行うことが可能となる。
【0034】
また、仮想アドレスと物理アドレスとをマッピングするだけで、CPU1からアクセスするアドレスが一定となり、CPU1のパイプライン処理を妨げないで済む。そのため、動的中間コードの高速処理化を達成することができる。
【0035】
上記の事項は、図3を参照することにより、より明瞭に理解することができる。
【0036】
図3は本実施の形態1の処理方式と従来の処理方式方式とにおける中間コードの命令解釈、および処理の時間の流れの比較を簡略化して示した図である。
【0037】
同図において、15は命令の解釈に要する時間、16は対応する命令の処理時間、17はオペレーションコードレジスタ3に命令のセットに要する時間である。
【0038】
図3から明らかな通り、従来の処理方式では、命令の解釈、および処理部への分岐に時間を要するが、本実施の形態1によれば、命令コードの解釈には、命令をオペレーションコードレジスタ3に設定する時間のみでよく、その結果、全体の処理時間を短縮することが可能となるのである。
【0039】
実施の形態2.
実施の形態2は、実施の形態1では、変換参照バッファ4に、中間コードの全ての命令コードのエントリを備えているものであるのに対し、利用される頻度の高い命令コードと命令コードの処理部とが格納されたページの物理アドレスのみを変換参照バッファ4に格納して、それ以外の頻度の低い命令は従来方式の処理を併用することにより、変換参照バッファ4の省メモリ化と中間コードの処理の効率化とを実現するものである。
【0040】
図4は本発明の実施の形態2にかかる動的中間コード処理装置の構成を示すブロック図である。
【0041】
同図を参照して、本実施の形態2の動的中間コード処理装置の特徴は、CPU1から出力されるアドレスと、アドレス変換部5で生成されるアドレスとの出力を切り替えるセレクタ7が新たに追加されている点にあり、その他の構成は、実施の形態1とほぼ同様である。
【0042】
ここで、図4を参照して、セレクタの動作を説明する。
【0043】
セレクタ7は、中間コードを処理するプログラムがオペレーションコードレジスタ3に命令コードを設定した際、変換参照バッファ4に命令コードが存在する場合には、アドレス変換部5で生成した物理アドレスを出力し、命令コードが変換参照バッファ4に存在しない場合には、従来方式の処理を行うべく、CPU1から出力されたアドレスをそのまま出力するために、両者のアドレス出力の切り替えを行う。
【0044】
なお、変換参照バッファ4に命令コードが存在する場合のアドレスの生成処理は、実施の形態1で同様であるので、その説明を省略する。
【0045】
このように、本実施の形態2では、セレクタ7は、CPU1からのアドレスをそのまま出力する系と、変換参照バッファ4を利用して変換したアドレスを出力する系との2種類の系の切り替えを行うので、従来通り、逐次命令コードを解釈して命令処理へ分岐させる方法と、変換参照バッファ4を利用して高速に命令処理を行う方法とを、命令コードにより、動的に選択することができる。これにより、変換参照バッファ4に全ての命令の処理コードのアドレスを持たせることなく、中間コードの解釈と実行とを行うことが可能となる。
【0046】
換言すると、頻繁に使用される命令コードと、それ以外の命令コードとに分け、変換参照バッファ4に使用頻度の高い命令の情報のみを持たせることができるので、変換参照バッファ4を構成するメモリ量を削減することができる。このとき、変換参照バッファ4にない命令コードの処理は高速化されないものの、高価なメモリの削減が可能となる。つまり、使用頻度の高い命令の高速処理化を達成しつつ、従来の方式に比べて、処理の効率化、およびメモリの削減を実現できるものである。
【0047】
実施の形態3.
図5は本発明の実施の形態3にかかる動的中間コード処理装置の構成を示すブロック図である。
【0048】
同図を参照して、本実施の形態3の動的中間コード処理装置の特徴は、上述した実施の形態2では、変換参照バッファ4に命令コードが存在しない場合、CPU1の出力アドレスを変換せずに、直接出力するセレクタ7を具備したものであるのに対し、変換参照バッファ4に命令コードが存在しない場合の変換用アドレスとして、中間コードの命令の解釈部の処理が記述されたページの物理アドレスをエントリに用意しておく点にあり、その他の構成は、実施の形態1とほぼ同様である。
【0049】
このエントリは、オペレーションコードに書き込まれた命令コードが変換参照バッファ4内で存在しない場合に、内容が読み出される特別なエントリとして、変換参照バッファ4内に用意される。
【0050】
ここで、図4を参照して、本実施の形態3の動的中間コード処理装置の処理動作について説明する。
【0051】
中間コード処理プログラムがオペレーションコードレジスタ3に命令コードを設定すると、アドレス生成を行う。このとき、命令コードが変換参照バッファ4に存在する場合のアドレス生成は、実施の形態1と同様であるので、その説明を省略する。一方、変換参照バッファ4に存在しなかった場合は、命令の解釈部の処理が記述されたページの物理アドレスが出力される。そのため、アドレス変換部5で、CPU1の出力アドレスのページオフセット部と、変換参照バッファ4とから出力された物理アドレスから求めるアドレスを生成する。
【0052】
このように、本実施の形態3では、変換参照バッファ4は、使用頻度の高い中間コードの命令処理が格納されたページの物理アドレスを記憶しており、かつ、変換参照バッファ4において存在しないオペレーションコードを処理するための命令解釈部が格納されたページの物理アドレスを備えているので、頻繁使用される命令コードと、それ以外の命令コードとに分け、変換参照バッファ4に使用頻度の高い命令の情報のみを持たせることができる。そのため、使用頻度の高い命令の高速処理化を達成しつつ、従来の方式に比べて、処理の効率化、およびメモリの削減を実現できる。
【0053】
実施の形態4.
実施の形態1ないし3において、命令の処理部は、1ページに格納される必要があるため、ページサイズは、命令コードの処理部の最大サイズに合わせて決定する必要があった。
【0054】
図6は、このときの主記憶のメモリマップを示す図である。
【0055】
同図において、18は1ページサイズ、19は命令に対応した処理部のサイズ、20はページ内の未使用領域である。
【0056】
図6からわかるように、命令に対応した処理部のサイズがページサイズよりも小さい場合は、ページ内に未使用領域20が多く発生し、その結果、メモリの使用効率が低下する。
【0057】
そこで、実施の形態4は、命令の処理部を格納するページサイズを動的に割り当てることを可能とし、メモリの使用効率を高めようとするものである。
【0058】
図7は本発明の実施の形態4にかかる動的中間コード処理装置の構成を示すブロック図、図8は実施の形態4におけるアドレスの生成方法を示す図である。
【0059】
これらの図を参照して、本実施の形態4の特徴は、変換参照バッファ4の命令コードのエントリに、命令コードの処理部が格納されているページのサイズを記憶するエントリ(以下、「ページサイスエントリ」という。)が新たに追加されている点、および変換参照バッファ4から取り出されたページサイズを用いて、CPU1から出力されるアドレスと、変換参照バッファ4から取り出された物理アドレスの各ビットとについて、いずれのアドレスを出力するかを選択するための複数のセレクタ7を具備する点にあり、その他の構成は、実施の形態1とほぼ同様である。
【0060】
なお、図8において、14は変換参照バッファ4内のオペレーションコードのページサイズである。
【0061】
ここで、図7、および図8を参照して、命令の処理部が格納される最小のページサイズを256バイト、最大のページサイズを4Kバイトとした場合の処理動作について説明する。
【0062】
中間コードを処理するプログラムは、CPU1の外部に設けられたオペレーションコードレジスタ3に中間コードの命令コードを設定し、この設定に併せて、CPU1からは、アドレス線に仮想アドレスが出力される。
【0063】
メモリ管理部6では、オペレーションコードレジスタ3に設定された命令コードから変換参照バッファ4に格納されている物理アドレスとページサイズとが取り出される。
【0064】
アドレス変換部5では、ページサイズに応じて、ページサイズの大きさを可変できる部分に対応するビットを用いて、アドレス生成の処理が行われる。このページのオフセットは、ページサイズが256バイトのときは下位の8ビットとなり、4Kバイトのときは下位の12ビットとなる。
【0065】
そこで、図8に示すように、アドレス変換部5は、CPU出力アドレス11の下位8ビットと、変換参照バッファ出力アドレス12の上位20ビットとをそのまま利用する。
【0066】
次に、生成アドレス13の8から11ビット目は、命令コードが格納されている変換参照バッファ4内のオペレーションコードのページサイズ14に含まれる処理のページサイスを各々のビットに対応するセレクタ7に通知して、CPU出力アドレス11の出力と、変換参照バッファ出力アドレス12の出力との切り替えを行なわせる。例えば、ページサイズが1の場合は、CPU出力アドレス11の8ビット目が利用され、ページサイズが2の場合は、CPU出力アドレス11の8ビット目と9ビット目とが利用される。
【0067】
以下、同様にして、ページサイズの値を元に、CPU出力アドレス11のアドレスの8から11ビット目の出力の選択が行われる。
【0068】
このようにして、アドレス変換部5は、CPU1から出力された仮想アドレスと、変換参照バッファ4から得られた物理アドレスとを組み合わせて、命令の処理部が格納された物理アドレスを生成することが可能となる。
【0069】
このように、本実施の形態4では、変換参照バッファ4の命令コードのエントリに、命令コードの処理部が格納されているページのサイズを記憶するページサイスエントリを新たに追加するとともに、変換参照バッファ4から取り出されたページサイズを用いて、CPU1から出力されるアドレスと、変換参照バッファ4から取り出された物理アドレスの各ビットとについて、いずれのアドレスを出力するか選択するための複数のセレクタ7を具備しているので、ページサイズのエントリの値から格納されている処理コードのサイズを知ることができ、実行する命令ごとに、処理コードが格納されている正しい先頭アドレスを取り出すことが可能となる。すなわち、各命令コードごとに、このエントリの値でセレクタ7を制御して、選択するアドレスを切り替えることができる。そのため、アクセスするメモリ上のアドレスの位置を細分化して指定することが可能となる。
【0070】
換言すると、変換参照バッファ4に、ページサイズエントリとセレクタ7とがない場合には、ページは固定となるのに対し、上記のように、変換参照バッファ4に命令の処理コードのページサイズを持たせることで、命令コードが変換参照バッファ4でヒットするとともに、セレクタ7がページサイズを読み出してCPU出力アドレス11と変換参照バッファ出力アドレス12との各ビットを選択し、例えば8から12ビットの範囲でページサイズを可変させてアドレスを生成することができる。そのため、命令の処理部を格納するページサイズを動的に割り当てることが可能となる。その結果、メモリの使用効率を高めることができる。
【0071】
なお、本発明は、上記各実施の形態に限定されるものではなく、本発明の請求の範囲内での種々の設計変更、および修正を加え得ることは勿論である。
【0072】
【発明の効果】
以上の説明から明らかな通り、本発明によると、中間コードの命令を格納手段に格納することで、記憶手段から中間コードの命令の解釈と処理部への分岐とを高速に行うことが可能となる。
【0073】
また、仮想アドレスと物理アドレスとをマッピングすることで、CPUからアクセスするアドレスが一定となり、CPUのパイプライン処理を妨げないため、高速処理化を達成することができる。
【図面の簡単な説明】
【図1】本発明の実施の形態1にかかる動的中間コード処理装置の構成を示すブロック図である。
【図2】アドレス変換部で行われるアドレスの生成方法を示す図である。
【図3】実施の形態1の処理方式と従来の処理方式とにおける中間コードの命令解釈、および処理の時間の流れの比較を簡略化して示した図である。
【図4】本発明の実施の形態2にかかる動的中間コード処理装置の構成を示すブロック図である。
【図5】本発明の実施の形態3にかかる動的中間コード処理装置の構成を示すブロック図である。
【図6】ページサイズ固定時の主記憶のメモリマップにおける1ページ内の使用状況を示す図である。
【図7】本発明の実施の形態4にかかる動的中間コード処理装置の構成を示すブロック図である。
【図8】実施の形態4におけるアドレスの生成方法を示す図である。
【図9】従来の中間コードで記述されたプログラムの処理を行う装置の構成を示すブロック図である。
【符号の説明】
1 CPU
2 メモリ
3 オペレーションコードレジスタ
4 変換参照バッファ
5 アドレス変換部
6 メモリ管理部
7 セレクタ
11 CPU出力アドレス
12 変換参照バッファ出力アドレス
13 生成アドレス
14 変換参照バッファ内のオペレーションコードのページサイズ
15 命令の解釈に要する時間
16 命令の処理時間
17 命令のセットに要する時間
18 1ページサイズ
19 命令に対応した処理部のサイズ
20 ページ内の未使用領域
100 CPU
200 メモリ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an apparatus for executing a program described in an intermediate code, and more particularly to an apparatus capable of high-speed instruction interpretation and branch processing when executing an intermediate code instruction.
[0002]
[Prior art]
In a conventional dynamic intermediate code processing device, when a program written in intermediate code is executed, instructions are interpreted by sequentially comparing instruction codes with software, and processing is performed by branching to each instruction process. It was broken.
[0003]
Here, the intermediate code is a virtual machine language created when a source program is converted into an object program by a compiler.
[0004]
FIG. 9 is a block diagram showing the configuration of a conventional apparatus for processing a program described in intermediate code.
[0005]
In the figure, 100 is a central processing unit (hereinafter referred to as “CPU: Center Processing Unit”), and 200 is a memory. The execution program for the intermediate code is read from the memory 200 according to the address output from the CPU 100, and the instruction code is interpreted and executed by the processing unit in the CPU 100.
[0006]
Japanese Patent Laid-Open No. 62-98427 proposes an “associative micro control system” so that an instruction word of an arbitrary virtual machine can be decoded and executed at high speed in a microprogrammable data processing apparatus. .
[0007]
The "associative micro control system" disclosed in this publication is a system that speeds up the execution of instructions by setting an instruction in a register and branching to the start address of a microcode.
[0008]
[Problems to be solved by the invention]
The following problems have been pointed out in the apparatus for processing the program described in the conventional intermediate code shown in FIG.
[0009]
That is, since the instructions are sequentially compared and interpreted, each time the instruction is executed, the comparison process is performed, so that an efficient process cannot be performed.
[0010]
In addition, since the interpretation of the instruction and the conditional branch to the processing unit are continuous, interruption of pipeline processing in the CPU frequently occurs, so that efficient processing cannot be performed.
[0011]
Further, the following problems have been pointed out in the “associative micro control system” proposed in Japanese Patent Laid-Open No. 62-98427.
[0012]
In other words, since the address obtained from the associative memory is not converted but is used as it is to branch, similarly, the pipeline processing in the CPU is interrupted.
[0013]
The present invention has been made in view of the above technical problem, and can perform high-speed processing without interfering with CPU pipeline processing while being able to interpret instructions of intermediate codes and branch to a processing unit at high speed. An object of the present invention is to provide a dynamic intermediate code processing apparatus capable of achieving the above.
[0014]
[Means for Solving the Problems]
In order to achieve the above object, a dynamic intermediate code processing device according to claim 1 is provided for interpreting an intermediate code and converting it into a physical address based on a virtual address output from a central processing unit. A storage unit for storing the intermediate code instruction; a storage unit for storing a physical address of a page storing the intermediate code instruction process; an address extracted from the storage unit; And conversion means for combining with a virtual address output from the processing device and converting it into a physical address.
[0015]
A dynamic intermediate code processing device according to a second aspect of the present invention is the dynamic intermediate code processing device according to the first aspect, wherein the storage means stores instruction processing of the intermediate code that is frequently used. The physical address of the page is stored, and the conversion means stores the address fetched from the storage means and the virtual output from the central processing unit when there is an instruction stored in the storage means in the storage means. In the case of an instruction that is combined with an address to be converted into a physical address and does not have an entry in the storage means, output means for directly outputting the address output from the central processing unit is included.
[0016]
A dynamic intermediate code processing device according to a third aspect of the present invention is the dynamic intermediate code processing device according to the first aspect, wherein the storage means stores instruction processing of the intermediate code that is frequently used. A physical address of the page is stored, and a physical address of the page in which an instruction interpretation unit for processing an operation code that does not exist in the storage unit is stored is provided.
[0017]
A dynamic intermediate code processing device according to a fourth aspect of the present invention is the dynamic intermediate code processing device according to any one of the first to third aspects, wherein the storage means is an operation stored in the storage means. Corresponding to the code, a page size entry that stores the size of the page in which the instruction processing of the intermediate code is stored, based on the value of the page size entry, a virtual address output from the central processing unit, In order to convert an address to be output between the address taken out from the storage means, a selection means for selecting one of the bits of both addresses is included.
[0018]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
[0019]
Embodiment 1 FIG.
FIG. 1 is a block diagram showing the configuration of the dynamic intermediate code processing apparatus according to the first embodiment of the present invention.
[0020]
In the figure, 1 is a CPU, 2 is a memory, 3 is an operation code register, 4 is a conversion reference buffer, 5 is an address conversion unit, and 6 is a memory management unit.
[0021]
The conversion reference buffer 4 and the address conversion unit 5 are included in the memory management unit 6.
[0022]
The conversion reference buffer 4 includes a plurality of entries corresponding to the number of instruction codes. For example, if the number of instruction codes is 256, it has an entry of a physical address of a page in which 256 operation codes and instruction code processing units are stored.
[0023]
Here, the processing operation of the dynamic intermediate code processing apparatus according to the first embodiment will be described with reference to FIG.
[0024]
The processing program for the intermediate code writes the physical address information corresponding to the operation code in the conversion reference buffer 4 in advance as an initialization process.
[0025]
The program for processing the intermediate code is performed by setting the instruction code of the intermediate code in the operation code register 3 provided outside the CPU 1, rather than sequentially comparing the interpretation of the instructions. At this time, the CPU 1 writes an instruction code and outputs a virtual address to the address line in conjunction with the writing.
[0026]
In the memory management unit 6, the physical address stored in the conversion reference buffer 4 is extracted from the instruction code set in the operation code register 3, and in the address conversion unit 5, the lower bits (pages) of the virtual address output from the CPU 1. ) And the physical address obtained from the conversion reference buffer 4 is used to generate a physical address in which the instruction processing unit is stored.
[0027]
FIG. 2 is a diagram illustrating an address generation method performed by the address conversion unit.
[0028]
In the figure, 11 is a virtual address output from the CPU 1 (hereinafter referred to as “CPU output address”), 12 is a physical address extracted from the instruction code set in the operation code register 3 (hereinafter referred to as “translation reference buffer”). "Output address")), 13 is a generated address.
[0029]
Here, with reference to FIG. 2, an address generation method performed by the address conversion unit 5 will be described.
[0030]
In FIG. 2, it is assumed that the logical address output from the CPU 1 is 32 bits, the physical address generated by the address conversion unit 5 is 32 bits, and the size of the page where the instruction code processing is stored is 4 Kbytes. The lower 12 bits indicate a page offset.
[0031]
The address conversion unit 5 extracts the lower 12 bits of the CPU output address 11 as they are, and combines the lower 12 bits of the extracted CPU output address 11 with the upper 20 bits extracted from the conversion reference buffer output address 12. The generation address 13, that is, the physical address where the instruction code processing unit is stored is obtained.
[0032]
As described above, in the first embodiment, since the physical address storing the instruction code processing unit is automatically generated, the software (program) branch does not occur. Thereby, the following effects are produced.
[0033]
That is, it is possible to interpret the intermediate code instruction from the conversion reference buffer 4 and branch to the processing unit at high speed only by setting the intermediate code instruction in the operation code register 3.
[0034]
In addition, by mapping the virtual address and the physical address, the address accessed from the CPU 1 is constant, and the pipeline processing of the CPU 1 can be prevented. Therefore, high-speed processing of dynamic intermediate code can be achieved.
[0035]
The above matters can be understood more clearly by referring to FIG.
[0036]
FIG. 3 is a diagram showing a simplified comparison of intermediate code instruction interpretation and processing time flow between the processing method of the first embodiment and the conventional processing method.
[0037]
In the figure, 15 is a time required for interpretation of an instruction, 16 is a processing time of a corresponding instruction, and 17 is a time required for setting an instruction in the operation code register 3.
[0038]
As apparent from FIG. 3, in the conventional processing method, it takes time to interpret the instruction and branch to the processing unit. According to the first embodiment, the instruction is interpreted in the operation code register. Only the time set to 3 is required, and as a result, the entire processing time can be shortened.
[0039]
Embodiment 2. FIG.
In the second embodiment, in the first embodiment, the conversion reference buffer 4 is provided with entries for all the instruction codes of the intermediate code, whereas the frequently used instruction codes and instruction codes are used. Only the physical address of the page in which the processing unit is stored is stored in the conversion reference buffer 4, and other less frequently used instructions are combined with conventional processing, thereby reducing the memory of the conversion reference buffer 4 and intermediate processing. This will improve the efficiency of code processing.
[0040]
FIG. 4 is a block diagram showing a configuration of the dynamic intermediate code processing device according to the second exemplary embodiment of the present invention.
[0041]
Referring to the figure, the dynamic intermediate code processing apparatus according to the second embodiment is characterized in that a selector 7 for switching output between an address output from the CPU 1 and an address generated by the address conversion unit 5 is newly provided. The other configuration is substantially the same as that of the first embodiment.
[0042]
Here, the operation of the selector will be described with reference to FIG.
[0043]
The selector 7 outputs the physical address generated by the address conversion unit 5 when the instruction code exists in the conversion reference buffer 4 when the program for processing the intermediate code sets the instruction code in the operation code register 3. When the instruction code does not exist in the conversion reference buffer 4, in order to output the address output from the CPU 1 as it is, the address output between the two is switched to perform the conventional processing.
[0044]
Note that the address generation process when the instruction code is present in the conversion reference buffer 4 is the same as that in the first embodiment, and thus the description thereof is omitted.
[0045]
As described above, in the second embodiment, the selector 7 switches between two types of systems, that is, a system that outputs the address from the CPU 1 as it is and a system that outputs the converted address using the conversion reference buffer 4. Therefore, as in the past, it is possible to dynamically select a method for interpreting a sequential instruction code and branching to instruction processing, and a method for performing instruction processing at high speed using the conversion reference buffer 4 based on the instruction code. it can. This makes it possible to interpret and execute the intermediate code without having the conversion reference buffer 4 have the addresses of the processing codes of all instructions.
[0046]
In other words, it is possible to divide into frequently used instruction codes and other instruction codes, and to give only information on frequently used instructions to the conversion reference buffer 4, so that the memory constituting the conversion reference buffer 4 The amount can be reduced. At this time, although the processing of the instruction code not in the conversion reference buffer 4 is not speeded up, it is possible to reduce expensive memory. That is, while achieving high-speed processing of frequently used instructions, processing efficiency and memory reduction can be realized as compared with the conventional method.
[0047]
Embodiment 3 FIG.
FIG. 5 is a block diagram showing the configuration of the dynamic intermediate code processing apparatus according to the third embodiment of the present invention.
[0048]
Referring to the figure, the dynamic intermediate code processing apparatus according to the third embodiment is characterized in that in the second embodiment described above, the output address of CPU 1 is converted when there is no instruction code in conversion reference buffer 4. In contrast, the page 7 in which the processing of the interpreter of the intermediate code instruction is described as the conversion address when the instruction code does not exist in the conversion reference buffer 4 whereas the selector 7 that directly outputs is provided. The physical address is prepared in the entry, and other configurations are almost the same as those in the first embodiment.
[0049]
This entry is prepared in the conversion reference buffer 4 as a special entry whose contents are read when the instruction code written in the operation code does not exist in the conversion reference buffer 4.
[0050]
Here, the processing operation of the dynamic intermediate code processing apparatus according to the third embodiment will be described with reference to FIG.
[0051]
When the intermediate code processing program sets an instruction code in the operation code register 3, an address is generated. At this time, the address generation when the instruction code is present in the conversion reference buffer 4 is the same as that in the first embodiment, and thus the description thereof is omitted. On the other hand, if it does not exist in the conversion reference buffer 4, the physical address of the page in which the processing of the instruction interpretation unit is described is output. Therefore, the address conversion unit 5 generates an address to be obtained from the page offset part of the output address of the CPU 1 and the physical address output from the conversion reference buffer 4.
[0052]
As described above, in the third embodiment, the conversion reference buffer 4 stores the physical address of the page in which the frequently used intermediate code instruction process is stored and does not exist in the conversion reference buffer 4. Since the instruction interpreter for processing the code has the physical address of the page in which it is stored, it is divided into frequently used instruction codes and other instruction codes, and frequently used instructions in the conversion reference buffer 4 It is possible to have only this information. Therefore, while achieving high-speed processing of frequently used instructions, processing efficiency and memory reduction can be realized as compared with the conventional method.
[0053]
Embodiment 4 FIG.
In the first to third embodiments, since the instruction processing unit needs to be stored in one page, the page size needs to be determined in accordance with the maximum size of the instruction code processing unit.
[0054]
FIG. 6 is a diagram showing a memory map of the main memory at this time.
[0055]
In the figure, 18 is the size of one page, 19 is the size of the processing unit corresponding to the instruction, and 20 is an unused area in the page.
[0056]
As can be seen from FIG. 6, when the size of the processing unit corresponding to the instruction is smaller than the page size, a large number of unused areas 20 are generated in the page, and as a result, the memory use efficiency decreases.
[0057]
In view of this, the fourth embodiment makes it possible to dynamically allocate the page size for storing the instruction processing unit, and to improve the use efficiency of the memory.
[0058]
FIG. 7 is a block diagram showing a configuration of a dynamic intermediate code processing apparatus according to the fourth embodiment of the present invention, and FIG. 8 is a diagram showing an address generation method according to the fourth embodiment.
[0059]
Referring to these figures, the feature of the fourth embodiment is that an entry (hereinafter referred to as “page”) stores the size of a page in which the instruction code processing unit is stored in the instruction code entry of conversion reference buffer 4. The size entry ") is newly added, and the page size fetched from the translation reference buffer 4 is used for each of the address output from the CPU 1 and the physical address fetched from the translation reference buffer 4. A plurality of selectors 7 are provided for selecting which address is output for each bit, and the other configuration is substantially the same as in the first embodiment.
[0060]
In FIG. 8, 14 is the page size of the operation code in the conversion reference buffer 4.
[0061]
Here, with reference to FIG. 7 and FIG. 8, the processing operation when the minimum page size in which the instruction processing unit is stored is 256 bytes and the maximum page size is 4 Kbytes will be described.
[0062]
A program for processing the intermediate code sets an instruction code of the intermediate code in an operation code register 3 provided outside the CPU 1, and in accordance with this setting, the CPU 1 outputs a virtual address to an address line.
[0063]
In the memory management unit 6, the physical address and page size stored in the conversion reference buffer 4 are extracted from the instruction code set in the operation code register 3.
[0064]
In the address conversion unit 5, address generation processing is performed using bits corresponding to a portion whose page size can be changed according to the page size. This page offset is the lower 8 bits when the page size is 256 bytes, and the lower 12 bits when the page size is 4K bytes.
[0065]
Therefore, as shown in FIG. 8, the address conversion unit 5 uses the lower 8 bits of the CPU output address 11 and the upper 20 bits of the conversion reference buffer output address 12 as they are.
[0066]
Next, the 8th to 11th bits of the generation address 13 indicate the page size of the process included in the page size 14 of the operation code in the conversion reference buffer 4 in which the instruction code is stored to the selector 7 corresponding to each bit. Notification is made to switch between the output of the CPU output address 11 and the output of the conversion reference buffer output address 12. For example, when the page size is 1, the 8th bit of the CPU output address 11 is used, and when the page size is 2, the 8th and 9th bits of the CPU output address 11 are used.
[0067]
Thereafter, similarly, the output of the 8th to 11th bits of the address of the CPU output address 11 is selected based on the page size value.
[0068]
In this way, the address conversion unit 5 can generate a physical address in which the instruction processing unit is stored by combining the virtual address output from the CPU 1 and the physical address obtained from the conversion reference buffer 4. It becomes possible.
[0069]
As described above, in the fourth embodiment, a page size entry that stores the size of the page in which the instruction code processing unit is stored is newly added to the instruction code entry of the conversion reference buffer 4, and conversion reference is made. A plurality of selectors for selecting which address is output for the address output from the CPU 1 and each bit of the physical address extracted from the conversion reference buffer 4 using the page size extracted from the buffer 4 7 so that the size of the processing code stored can be known from the value of the page size entry, and the correct start address where the processing code is stored can be extracted for each instruction to be executed. It becomes. That is, the address to be selected can be switched by controlling the selector 7 with the value of this entry for each instruction code. For this reason, it is possible to subdivide and specify the position of the address on the memory to be accessed.
[0070]
In other words, when the conversion reference buffer 4 does not have the page size entry and the selector 7, the page is fixed, whereas the conversion reference buffer 4 has the page size of the instruction processing code as described above. As a result, the instruction code hits in the conversion reference buffer 4, and the selector 7 reads the page size and selects each bit of the CPU output address 11 and the conversion reference buffer output address 12, for example, in the range of 8 to 12 bits. The address can be generated by changing the page size. Therefore, it is possible to dynamically assign a page size for storing the instruction processing unit. As a result, the memory usage efficiency can be increased.
[0071]
The present invention is not limited to the above-described embodiments, and various design changes and modifications can be made within the scope of the claims of the present invention.
[0072]
【The invention's effect】
As is apparent from the above description, according to the present invention, by storing the intermediate code instruction in the storage means, it is possible to interpret the intermediate code instruction from the storage means and branch to the processing unit at high speed. Become.
[0073]
Further, by mapping the virtual address and the physical address, the address accessed from the CPU becomes constant, and the pipeline processing of the CPU is not hindered, so that high speed processing can be achieved.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a dynamic intermediate code processing device according to a first exemplary embodiment of the present invention;
FIG. 2 is a diagram illustrating an address generation method performed by an address conversion unit.
FIG. 3 is a diagram showing simplified comparison of intermediate code instruction interpretation and processing time flow between the processing method of the first embodiment and a conventional processing method;
FIG. 4 is a block diagram showing a configuration of a dynamic intermediate code processing device according to a second exemplary embodiment of the present invention;
FIG. 5 is a block diagram illustrating a configuration of a dynamic intermediate code processing device according to a third embodiment of the present invention;
FIG. 6 is a diagram illustrating a usage state in one page in a memory map of the main memory when the page size is fixed.
FIG. 7 is a block diagram showing a configuration of a dynamic intermediate code processing apparatus according to a fourth embodiment of the present invention.
8 is a diagram illustrating an address generation method according to Embodiment 4. FIG.
FIG. 9 is a block diagram showing the configuration of a conventional apparatus for processing a program described in intermediate code.
[Explanation of symbols]
1 CPU
2 Memory 3 Operation code register 4 Conversion reference buffer 5 Address conversion unit 6 Memory management unit 7 Selector 11 CPU output address 12 Conversion reference buffer output address 13 Generated address 14 Operation code page size in the conversion reference buffer 15 Required for instruction interpretation Time 16 Instruction processing time 17 Time required to set an instruction 18 One page size 19 Size of processing unit corresponding to an instruction 20 Unused area in a page 100 CPU
200 memory

Claims (4)

中央処理装置から出力された仮想アドレスに基づき、中間コードを解釈して物理アドレスに変換するための装置であって、
上記中間コードの命令を格納する格納手段と、
上記中間コードの命令処理が格納されたページの物理アドレスを記憶する記憶手段と、
この記憶手段から取り出されたアドレスと、上記中央処理装置から出力された仮想アドレスとを組み合わせて物理アドレスに変換する変換手段とを含むことを特徴とする動的中間コード処理装置。
A device for interpreting an intermediate code based on a virtual address output from a central processing unit and converting it into a physical address,
Storage means for storing the intermediate code instructions;
Storage means for storing a physical address of a page in which instruction processing of the intermediate code is stored;
A dynamic intermediate code processing apparatus comprising: a conversion means for combining an address extracted from the storage means and a virtual address output from the central processing unit into a physical address.
請求項1に記載の動的中間コード処理装置において、
上記記憶手段は、使用頻度の高い上記中間コードの命令処理が格納されたページの物理アドレスを記憶し、
上記変換手段は、上記記憶手段において上記格納手段に格納された命令が存在する場合に、上記記憶手段から取り出されたアドレスと、上記中央処理装置から出力された仮想アドレスとを組み合わせて物理アドレスに変換し、
上記記憶手段にエントリを持たない命令の場合に、上記中央処理装置から出力されたアドレスを直接出力する出力手段を含むことを特徴とする動的中間コード処理装置。
The dynamic intermediate code processing device according to claim 1,
The storage means stores a physical address of a page in which instruction processing of the intermediate code that is frequently used is stored,
When the instruction stored in the storage means exists in the storage means, the conversion means combines the address fetched from the storage means and the virtual address output from the central processing unit into a physical address. Converted,
A dynamic intermediate code processing apparatus comprising output means for directly outputting an address output from the central processing unit in the case of an instruction having no entry in the storage means.
請求項1に記載の動的中間コード処理装置において、
上記記憶手段は、使用頻度の高い上記中間コードの命令処理が格納されたページの物理アドレスを記憶しており、かつ、当該記憶手段において存在しないオペレーションコードを処理するための命令解釈部が格納されたページの物理アドレスを備えていることを特徴とする動的中間コード処理装置。
The dynamic intermediate code processing device according to claim 1,
The storage means stores a physical address of a page in which the frequently used intermediate code instruction processing is stored, and an instruction interpretation unit for processing an operation code that does not exist in the storage means. A dynamic intermediate code processing apparatus comprising a physical address of a page.
請求項1ないし3のいずれかに記載の動的中間コード処理装置において、
上記記憶手段は、上記格納手段に格納されているオペレーションコードに対応して、上記中間コードの命令処理が格納されたページのサイズを記憶するページサイズエントリを備え、
このページサイズエントリの値を元に、上記中央処理装置から出力された仮想アドレスと、上記記憶手段から取り出されたアドレスとの間で出力するアドレスを変換するために、両アドレスのいずれか一方のビットを選択する選択手段を含むことを特徴とする動的中間コード処理装置。
The dynamic intermediate code processing device according to any one of claims 1 to 3,
The storage means includes a page size entry that stores a size of a page in which instruction processing of the intermediate code is stored, corresponding to the operation code stored in the storage means,
Based on the value of this page size entry, in order to convert the output address between the virtual address output from the central processing unit and the address extracted from the storage means, either one of the two addresses is used. A dynamic intermediate code processing apparatus comprising selection means for selecting a bit.
JP32836796A 1996-12-09 1996-12-09 Dynamic intermediate code processor Expired - Lifetime JP3644614B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32836796A JP3644614B2 (en) 1996-12-09 1996-12-09 Dynamic intermediate code processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32836796A JP3644614B2 (en) 1996-12-09 1996-12-09 Dynamic intermediate code processor

Publications (2)

Publication Number Publication Date
JPH10171650A JPH10171650A (en) 1998-06-26
JP3644614B2 true JP3644614B2 (en) 2005-05-11

Family

ID=18209467

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32836796A Expired - Lifetime JP3644614B2 (en) 1996-12-09 1996-12-09 Dynamic intermediate code processor

Country Status (1)

Country Link
JP (1) JP3644614B2 (en)

Also Published As

Publication number Publication date
JPH10171650A (en) 1998-06-26

Similar Documents

Publication Publication Date Title
US7873814B1 (en) Microcode based hardware translator to support a multitude of processors
JP5654056B2 (en) Hierarchical translation table control
US6718539B1 (en) Interrupt handling mechanism in translator from one instruction set to another
JPH0454652A (en) Microcomputer
US6691306B1 (en) Use of limited program space of general purpose processor for unlimited sequence of translated instructions
JPS61148551A (en) Address converting system
JPH04242848A (en) System for controlling cache memory by running mode
JP3605205B2 (en) Data processing device and processing method
US6687808B2 (en) Data processor using indirect register addressing
KR980004059A (en) Data processing apparatus and register address conversion method
US6378050B1 (en) Information processing apparatus and storage medium
KR19990037572A (en) Design of Processor Architecture with Multiple Sources Supplying Bank Address Values and Its Design Method
US5835973A (en) Instruction processing unit capable of efficiently accessing the entire address space of an external memory
US7536498B2 (en) Method and apparatus for address mapping
JP3088303B2 (en) Cache memory bank controller
JP3644614B2 (en) Dynamic intermediate code processor
EP0101718B1 (en) Computer with automatic mapping of memory contents into machine registers
US6654646B2 (en) Enhanced memory addressing control
JP3563724B2 (en) Microprocessor, emulator and instruction set interpretation method
JP2924708B2 (en) Information processing device
US20020073295A1 (en) Enhanced memory addressing capability
JP3733746B2 (en) Programmable controller
KR20030054292A (en) Method for memory addressing in micro controller and Apparutus for page mapping
KR100353814B1 (en) Ram access device for improving access time of extended ram access code
KR100337138B1 (en) Cache memory device using for high speed image processing and processor mounting the cache memory device

Legal Events

Date Code Title Description
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: 20050125

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050128

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080210

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090210

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100210

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100210

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110210

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120210

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130210

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130210

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20140210

Year of fee payment: 9

EXPY Cancellation because of completion of term