JPH0388029A - Register filing device - Google Patents

Register filing device

Info

Publication number
JPH0388029A
JPH0388029A JP22501989A JP22501989A JPH0388029A JP H0388029 A JPH0388029 A JP H0388029A JP 22501989 A JP22501989 A JP 22501989A JP 22501989 A JP22501989 A JP 22501989A JP H0388029 A JPH0388029 A JP H0388029A
Authority
JP
Japan
Prior art keywords
register
window
absolute
registers
procedure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP22501989A
Other languages
Japanese (ja)
Inventor
Yukihiro Ide
井出 進博
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP22501989A priority Critical patent/JPH0388029A/en
Publication of JPH0388029A publication Critical patent/JPH0388029A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To efficiently transfer argument and to utilize a register by opening the window of optimum size in each transfer procedure of the argument of an optional number and executing the proper access protection of the window. CONSTITUTION:A register whose register number is to be accessed is specified from an input 13. An adder 9 in an absolute register number calculating device 3 calculates the absolute register number of the register based upon the specification signal. The number is decided by a decoder 10 and inputted by an access protection circuit 12. On the other hand, the output of the adder 9 is compared with the output 15 of a RAM 7 indicating the upper limit of a register window by a comparator circuit 11. When the output of the adder 9 is less than the upper limit, a register file 1 is accessed. When the output of the adder 9 is larger, a select signal 16 is invalidated and an invalid access detection signal 17 is generated. Thus, access protection is executed.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野〉 この発明は、マイクロプロセッサおよびコンピュータで
使用されるレジスタファイル装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial Application Field) This invention relates to a register file device used in microprocessors and computers.

(従来の技術〉 近年、LSIの集積度の高密度化に伴い、数十から百数
十ワードの汎用レジスタを中央処理装置に実装すること
が可能となった。このような大規模レジスタファイルを
利用して、手続きの呼び出し/復帰を高速に処理するマ
イクロプロセッサが開発されている。現在、多く用いら
れているプログラムの開発手法では、処理を多くの手続
き、あるいはモジュールに分割して記述する。したがっ
て処理の実行において手続きの呼び出し/復帰を高速に
処理することは、プログラム処理全体の高速化に大きく
貢献する。
(Prior art) In recent years, with the increase in the density of LSI integration, it has become possible to implement general-purpose registers of several tens to hundreds of words in central processing units. Microprocessors have been developed that utilize this technology to process procedure calls/returns at high speed.Currently, the most commonly used program development method is to divide processing into many procedures or modules. Therefore, processing call/return of procedures at high speed during execution of processing greatly contributes to speeding up the overall program processing.

上記のような手続き処理を多用するプログラムの実行に
適したレジスタファイル装置は、以下の3点を満足する
ことが望ましい。
It is desirable that a register file device suitable for executing a program that uses a lot of procedural processing as described above satisfies the following three points.

(1)手続き毎に割り当てるローカルレジスタを備えて
いること。また、ローカルレジスタは割り当てられた手
続き以外の手続きからのアクセスに対して保護機能を備
えていること。
(1) A local register allocated to each procedure must be provided. In addition, local registers must have a protection function against access from procedures other than the procedure to which they are assigned.

(2)手続き闇で任意の数の引き数が引き渡せること。(2) An arbitrary number of arguments can be handed over in a procedural manner.

(3)手続き毎に任意の数のローカルレジスタを割り当
てることができること。
(3) Any number of local registers can be allocated for each procedure.

上記のようなプログラムでは、変数は全ての手続きで参
照できるグローバル変数と手続きに固有なローカル変数
に分類できる。手続きが呼び出される時には、引き数の
引き渡しと共に現在利用中のローカル変数の退避が行な
われる。また、手続きから復帰する時には、前記ローカ
ル変数を再びワークエリア上に復元して処理を続行する
。これらの処理を高速に行なうためには、レジスタファ
イルを、全ての手続ぎからアクセス可能なグローバルレ
ジスタの他に更に番手続き毎に割り当てるローカルレジ
スタを備えた構成にすると良い(前記(1)の要件)。
In a program like the one above, variables can be classified into global variables that can be referenced by all procedures and local variables that are unique to a procedure. When a procedure is called, arguments are passed and local variables currently in use are saved. Furthermore, when returning from the procedure, the local variables are restored onto the work area and processing continues. In order to perform these processes at high speed, it is recommended to configure the register file to include, in addition to global registers that can be accessed from all procedures, local registers that are allocated to each procedure (requirement (1) above). ).

ローカル変数をローカルレジスタで扱えば、手続き呼び
出し/復帰時のローカル変数の退避/復元が不用になる
。また、これらのローカル変数を他の手続きで破壊した
り、実在しない変数を参照しないようにアクセス保護機
能も備えていることが必要である(前記(1)の要件〉
If local variables are handled in local registers, there is no need to save/restore local variables when calling/returning a procedure. It is also necessary to have an access protection function to prevent these local variables from being destroyed by other procedures or from referencing non-existent variables (requirement (1) above).
.

また、引き数の数、手続きで使用するローカル変数の数
は、手続き毎に異なる。さらに、レジスタの数は有限で
あり、多重の手続きの呼び出しに対応するためには、手
続き毎に最適な数のレジスタを割り当て、効率よくレジ
スタを利用することが必要である。そのためには、手続
き毎に任意の数のローカルレジスタを割り当てることが
でき、また任意の数の変数の引渡しができることが必要
である(前記(2)、 (3)の要件)。
Furthermore, the number of arguments and the number of local variables used in a procedure vary depending on the procedure. Furthermore, the number of registers is finite, and in order to handle multiple procedure calls, it is necessary to allocate an optimal number of registers to each procedure and use the registers efficiently. To this end, it is necessary to be able to allocate any number of local registers for each procedure and to be able to pass any number of variables (requirements (2) and (3) above).

現在、発表されているマイクロプロセッサでは、以下に
示すような方式によってローカルレジスタを実現してい
る。
Currently released microprocessors implement local registers using the following method.

第一は、各レジスタに固有な絶対レジスタ番号による通
常のアクセスの他に、第6図(a )のようにレジスタ
ファイル50に対してスタックポインタ51を設け、こ
のスタックポインタの値とオフセット〈レジスタ番@〉
によって間接的なローカルレジスタのアクセスを可能に
した方式である。
First, in addition to normal access using the absolute register number unique to each register, a stack pointer 51 is provided for the register file 50 as shown in FIG. 6(a), and the value of this stack pointer and offset <register Number @〉
This method allows indirect access to local registers.

この方式では、任意の数の引き数を他の手続きに受は渡
すことが可能であり、また一つの手続き内において必要
な数のローカルレジスタを使用することができる。しか
し、この方式では、特定の手続きで使用されるレジスタ
の範囲を明確に指定することができないため、他の手続
きのみで使用されるレジスタに対するアクセスは自由で
あり、レジスタのアクセス保護上、信頼性が十分である
とは言えない。アクセスの保護機能を実現するためには
、メモリあるいはレジスタ上に現在使用しているレジス
タの絶対レジスタ番号の上限および下限を記憶しておき
、レジスタのアクセスを行なう毎にアクセスしたレジス
タの絶対レジスタ番号が、この範囲を越えているか否か
をソフトウェアによってチエツクしなければならず、実
行におけるオーバヘッドが大きくなる。
With this method, any number of arguments can be received and passed to other procedures, and as many local registers as necessary can be used within one procedure. However, with this method, it is not possible to clearly specify the range of registers used in a specific procedure, so access to registers used only by other procedures is free, and reliability is not guaranteed in terms of register access protection. cannot be said to be sufficient. In order to implement the access protection function, the upper and lower limits of the absolute register numbers of the registers currently in use are stored in memory or registers, and the absolute register numbers of the accessed registers are stored every time a register is accessed. However, software must check whether or not the value exceeds this range, which increases execution overhead.

もう一つの構成方式は、第6図(b)に示すように互い
にオーバラップさせたレジスタウィンド52を一つの手
続き毎に割り当てる方式である。
Another configuration method is to allocate mutually overlapping register windows 52 to each procedure, as shown in FIG. 6(b).

この方式は、オーバラップ53しているレジスタの数、
手続き内で使用できるレジスタの数が固定であるので、
手続き間で高速に受渡しのできる弓き数、および一つの
手続きで使用できるレジスタの数が限られてしまう。そ
のため、使用するレジスタの数が固定値より少ない場合
には、使用しないレジスタが無駄となる。また、使用す
るレジスタの数が多い場合には、レジスタの内容をメモ
リへ退避させるなどソフトウェアによって処理を行なわ
なければならず、実行上の高速性が失われてしまう。
This method uses the number of registers that overlap 53,
Since the number of registers that can be used within a procedure is fixed,
The number of registers that can be quickly transferred between procedures and the number of registers that can be used in one procedure are limited. Therefore, if the number of registers used is less than a fixed value, unused registers are wasted. Furthermore, if a large number of registers are used, processing must be performed by software, such as saving the contents of the registers to memory, resulting in a loss of high-speed execution.

その他のローカルレジスタの構成として、第6図(C)
に示すようにローカルレジスタを幾つかのレジスタバン
ク54に分割し、一つの手続きに一つのバンクを割り当
てる方式がある。この方式では、割り当てられたバンク
のみがアクセス可能であるので、レジスタのアクセス保
護はなされている。しかし、レジスタバンクのワード数
は固定であり、また引き数をハードウェア的に受は渡す
ことができない。そのため、このバンク構成のローカル
レジスタは、マルチタスク処理には適していると考えら
れるが、頻繁に手続きの呼び出し/復帰がおこなわれる
処理には向いていない。
Figure 6 (C) shows the configuration of other local registers.
As shown in FIG. 2, there is a method in which local registers are divided into several register banks 54 and one bank is assigned to one procedure. In this method, only the assigned bank can be accessed, so register access is protected. However, the number of words in the register bank is fixed, and arguments cannot be passed by hardware. Therefore, although this bank-structured local register is considered suitable for multitask processing, it is not suitable for processing that involves frequent procedure calls/returns.

(発明が解決しようとする課題) このように従来装置においては、それぞれ一長一短があ
り、任意の数の引き数を受渡すこと、手続き毎に最適な
大きさのローカルレジスタを割り当てること、また、冬
季続きに割り当てられたローカルレジスタに対して適切
なアクセス保護を施すこと、を同時に満足することがで
きない、という問題があった。
(Problems to be Solved by the Invention) As described above, conventional devices each have their own advantages and disadvantages. There has been a problem in that it is not possible to simultaneously provide appropriate access protection to local registers allocated subsequently.

この発明は、上記のような従来技術の欠点を解決するた
めになされたものであり、任意の数の引き数を受は渡す
こと、および手続き毎に最適な大きざのローカルレジス
タを割り当てるために任意の大きさのレジスタウィンド
を開くことができ、また、開かれたレジスタウィンド以
外のローカルレジスタに対して適切なアクセス保護を施
こすことが可能なレジスタファイル装置を提供すること
を目的とする。
This invention was made in order to solve the above-mentioned drawbacks of the prior art, and it is possible to pass an arbitrary number of arguments, and to allocate a local register of an optimal size for each procedure. It is an object of the present invention to provide a register file device capable of opening a register window of any size and providing appropriate access protection to local registers other than the opened register window.

[発明の構成] (課題を解決するための手段〉 この発明では、上記課題を解決するために、第1図に示
すように、多数のレジスタを備えるレジスタファイル1
と、前記レジスタファイル1において過去および現在に
使用したレジスタウンドウの範囲、即ちそのレジスタウ
ィンドウの上限および下限を記憶するための記憶装置2
と、前記記憶装置2に記憶されたレジスタウィンドウの
範囲を示す情報とアクセスしようとするレジスタのレジ
スタ番号とからこのレジスタの絶対レジスタ番号とから
このレジスタの絶対レジスタ番号を算出する絶対レジス
タ番号算出装置3と、前記絶対レジスタ番号算出装置3
によって算出された前アクセスしようとするレジスタの
絶対レジスタ番号を示す信号と前記記憶装置2に記憶さ
れたレジスタウィンドウの範囲を示す情報とを比較して
アクセスしようとするレジスタが使用中(現在)のウィ
ンドウの範囲内か範囲外かを判定し、ウィンドウ内であ
ればレジスタセレクト信号5を発生し、ウィンドウ外で
あれば不正アクセス検出信号6を発生するレジスタセレ
クト信号発生装置4、とからなるレジスタファイル装置
を提供することを要旨とする。
[Structure of the Invention] (Means for Solving the Problems) In order to solve the above problems, the present invention provides a register file 1 having a large number of registers, as shown in FIG.
and a storage device 2 for storing the range of register windows used in the past and present in the register file 1, that is, the upper and lower limits of the register window.
and an absolute register number calculation device that calculates the absolute register number of this register from the information indicating the range of the register window stored in the storage device 2 and the register number of the register to be accessed. 3, and the absolute register number calculation device 3
The signal indicating the absolute register number of the register to be previously accessed, calculated by a register select signal generator 4 that determines whether it is within or outside the range of the window, generates a register select signal 5 if it is within the window, and generates an unauthorized access detection signal 6 if it is outside the window; The purpose is to provide a device.

(作用) 第1図に示す装置において、まずレジスタへのアクセス
の過程におけるアクセス保護について説明する。
(Operation) In the apparatus shown in FIG. 1, access protection in the process of accessing a register will first be explained.

記憶装置2には現在および過去に使用されたレジスタウ
ィンドウの上限と下限が記憶されており、記憶されてい
る情報のうち最も新しい情報が読み出されている。レジ
スタのアクセスのために、まずアクセスしようとするレ
ジスタのレジスタ番号(オフセット)を絶対レジスタ番
号に変換する。
The storage device 2 stores the upper and lower limits of register windows used currently and in the past, and the newest information among the stored information is read out. To access a register, first convert the register number (offset) of the register to be accessed into an absolute register number.

これはアクセスしようとするレジスタのレジスタ番号と
、記憶装置2に記憶されている現在のウィンドウの下限
値の絶対レジスタ番号とを絶対レジスタ番号算出装置3
において加算することによって行われる。このようにし
てアクセスしようとするレジスタの絶対レジスタ番号が
得られると、次にこのレジスタが、現在のウィンドウの
範囲内であるかどうかが判定される。この判定は、レジ
スタセレクト信号発生装置4において、記憶装置2に記
憶されている現在のウィンドウの範囲を示す情報、具体
的にはレジスタウィンドウの上限値と、上記算出された
絶対レジスタ番号とを比較することによって行われる。
This calculates the register number of the register to be accessed and the absolute register number of the lower limit value of the current window stored in the storage device 2 by the absolute register number calculation device 3.
This is done by adding at . Once the absolute register number of the register to be accessed is obtained in this way, it is then determined whether this register is within the range of the current window. This determination is made in the register select signal generating device 4 by comparing information indicating the current window range stored in the storage device 2, specifically, the upper limit value of the register window, and the absolute register number calculated above. It is done by doing.

この比較により、アクセスしようとするレジスタがレジ
スタウィンドウ内であると判定されると、レジスタセレ
クト信号発生装置4はレジスタセレクト信@5を発生し
、レジスタをアクセスする。反対にレジスタウィンドウ
外であると判定されると、レジスタセレクト信号発生装
置4から不正アクセス検出信号6が発生し、レジスタは
アクセスされない。このようにして、レジスタウィンド
ウ外のレジスタのアクセスに対して保護が威される。
If it is determined by this comparison that the register to be accessed is within the register window, the register select signal generator 4 generates a register select signal @5 and accesses the register. On the other hand, if it is determined that it is outside the register window, the register select signal generator 4 generates an unauthorized access detection signal 6, and the register is not accessed. In this way, protection is provided against accessing registers outside the register window.

次に、手続きの呼び出しの場合について説明する。手続
きの呼び出しは、記憶装置2に次の手続きで用いるレジ
スタウィンドウの上限値、下限値を書き込むことによっ
て実行される。この時、新しいレジスタウィンドウの下
限値を、現在のレジスタウィンドウの上限値よりも小さ
くしておくことによって、両レジスタウィンドウはオー
バラップし、自動的に引き数の受は渡しが行われる。レ
ジスタウィンドウの大きさ、引き数の数は、このように
任意の値を指定することができる。
Next, the case of calling a procedure will be explained. A procedure call is executed by writing the upper and lower limit values of the register window to be used in the next procedure into the storage device 2. At this time, by setting the lower limit value of the new register window smaller than the upper limit value of the current register window, both register windows overlap, and arguments are automatically received and passed. In this way, arbitrary values can be specified for the size of the register window and the number of arguments.

手続きからの復帰は、現在のレジスタウィンドウの上限
値、下限値(最も新しい情報)を記憶装置2から消去す
ることによって行われる。消去後は、次に新しい情報が
有効となり、自動的に前に開かれていたレジスタウィン
ドウが再現される。
Return from the procedure is performed by erasing the upper and lower limit values (the newest information) of the current register window from the storage device 2. After erasing, the next new information becomes valid and the previously opened register window is automatically recreated.

(実施例) 以下、この発明の実施例を図面を参照して説明する。な
お、以下の図面において第1図と同一の符号は同様の構
成部材を示すので、重複した説明は省略する。
(Example) Hereinafter, an example of the present invention will be described with reference to the drawings. Note that in the following drawings, the same reference numerals as in FIG. 1 indicate the same constituent members, and therefore duplicate explanations will be omitted.

第2図はこの発明の一実施例のブロック図である。この
装置では、記憶装置2はRAM (ランダムアクセスメ
モリ)7とスタックポインタ8によって最も新しい情報
が読み出されるスタックとして構成されている。このR
AM7には、レジスタウィンドウの上限と下限の絶対レ
ジスタ番号が記憶されている。RAM7の1ワードの幅
は、レジスタファイルのワード数に依存する。
FIG. 2 is a block diagram of an embodiment of the present invention. In this device, the storage device 2 is configured as a stack from which the newest information is read using a RAM (random access memory) 7 and a stack pointer 8. This R
AM7 stores the absolute register numbers of the upper and lower limits of the register window. The width of one word of RAM 7 depends on the number of words of the register file.

絶対レジスタ番号算出装置3は、この実施例では、記憶
装置2に記憶されているレジスタウィンドウの下限値と
、指定されたくアクセスしようとするレジスタの)レジ
スタ番号とを加算する加算器9と、得られた絶対レジス
タ番号をデコードするデコーダ10によって構成されて
いる。また、レジスタセレクト信号発生袋@4は、記憶
装置2に記憶されているレジスタウィンドウの上限値と
絶対レジスタ番号算出装置3で計算された絶対レジスタ
番号とを比較する比較器11と、この比較結果によって
レジスタセレクト信号をアサート/ネゲートするアクセ
ス保護回路12から構成されている。なお、1は第1図
と同様のレジスタファイルを示す。
In this embodiment, the absolute register number calculating device 3 includes an adder 9 that adds the lower limit value of the register window stored in the storage device 2 and the register number (of the designated register to be accessed); It is composed of a decoder 10 that decodes the absolute register number assigned. Further, the register select signal generation bag @4 includes a comparator 11 that compares the upper limit value of the register window stored in the storage device 2 and the absolute register number calculated by the absolute register number calculation device 3, and the result of this comparison. The access protection circuit 12 is configured to assert/negate a register select signal according to the following. Note that 1 indicates a register file similar to that in FIG.

次に上記第2図の装置の動作を説明する。Next, the operation of the apparatus shown in FIG. 2 will be explained.

レジスタのアクセスは次のようにして行われる。Register access is performed as follows.

まず、入力13からレジスタ番号によりアクセスしよう
とするレジスタを指定する。このレジスタの指定信号は
、絶対レジスタ番号算出袋W3の加算器9において、記
憶装置2に記憶されている現在のレジスタウィンドウの
下限を示す信号18と加算され、入力されたレジスタの
絶対レジスタ番号が算出される。算出された絶対レジス
タ番号はデコーダ10においてデコードされ、信号14
としてレジスタセレクト信号発生装置4のアクセス保護
回路12に入力される。一方、絶対レジスタ番号を示す
加算器9の出力とレジスタウィンドウの上限を示すRA
M7の出力15は、レジスタセレクト信号発生装置4の
比較回路11に入力され、ここで比較される。アクセス
保護回路12では、この比較結果により、もしアクセス
しようとするレジスタの絶対レジスタ番号がレジスタウ
ィンドウの上限よりも小さければ、レジスタセレクト信
号16を発生して、レジスタファイル1へのアクセスを
行う。もし上記比較結果により、算出された絶対レジス
タ番号がレジスタウィンドウの上限よりも大きいと判定
されると、アクセス保護回路12はレジスタセレクト信
号16を無効にし、さらに比較回路11から不当アクセ
ス検出信号17を発生する。このようにして、現在のレ
ジスタウィンドウ外のレジスタに対して、アクセス保護
が成される。
First, the register to be accessed is specified using the register number from input 13. This register designation signal is added to the signal 18 indicating the lower limit of the current register window stored in the storage device 2 in the adder 9 of the absolute register number calculation bag W3, and the absolute register number of the input register is calculated. Calculated. The calculated absolute register number is decoded in the decoder 10 and the signal 14
The signal is input to the access protection circuit 12 of the register select signal generator 4 as a signal. On the other hand, the output of adder 9 indicating the absolute register number and RA indicating the upper limit of the register window
The output 15 of M7 is input to the comparison circuit 11 of the register select signal generator 4 and compared there. Based on this comparison result, the access protection circuit 12 generates a register select signal 16 and accesses the register file 1 if the absolute register number of the register to be accessed is smaller than the upper limit of the register window. If it is determined from the above comparison result that the calculated absolute register number is larger than the upper limit of the register window, the access protection circuit 12 invalidates the register select signal 16 and further outputs the illegal access detection signal 17 from the comparison circuit 11. Occur. In this way, access protection is achieved for registers outside the current register window.

手続きの呼び出しは、以下のようにして行われる。まず
、スタックポインタ8のプリデクリメント(あるいはブ
リインクレメント〉を行って、新しい手続きで用いるレ
ジスタウィンドウの上限と下限を書き込む。この上限値
は、絶対レジスタ番号算出装置3の入力13に、“次の
手続きで新しく使用するレジスタの数”を入力し、この
値と現在の上限値を加算器9において加算することによ
り求められる。下限値は、絶対レジスタ番号算出装置3
の入力13に、“現゛在使用しているが次の手続きでは
使用しないレジスタの数(レジスタスタックにブツシュ
するレジスタの数)”を入力し、加算器9においてこの
値と現在のレジスタウィンドウの下限値の和を取ること
により求められる。
The procedure is called as follows. First, the stack pointer 8 is pre-decremented (or b-incremented) and the upper and lower limits of the register window used in the new procedure are written. These upper limits are input to the input 13 of the absolute register number calculation device 3 as "next The number of new registers to be used in the procedure is input and the adder 9 adds this value to the current upper limit value.The lower limit value is determined by the absolute register number calculation device 3.
Input 13 of ``the number of registers currently used but not used in the next procedure (number of registers to be pushed onto the register stack)'', and adder 9 adds this value to the current register window. It is obtained by taking the sum of the lower limit values.

以上の操作により、任意の大きさのレジスタウィンドウ
を開くことができる。また、このとき両レジスタウィン
ドウのオーバーラツプさせることにより、任意の数の引
き数を受は渡すことができる。
With the above operations, you can open a register window of any size. Also, by overlapping both register windows at this time, any number of arguments can be passed.

手続きからの復帰は、スタックポインタ8をインクリメ
ント(あるいはデクリメント〉とし、現在のレジスタウ
ィンドウの上限、下限を消去することによって行われる
。この操作によって一つ前の手続きにおけるレジスタウ
ィンドウの上限、下限が有効となり、自動的に前の手続
きのレジスタウィンドウが再現される。
Return from the procedure is performed by incrementing (or decrementing) the stack pointer 8 and erasing the upper and lower limits of the current register window.This operation makes the upper and lower limits of the register window in the previous procedure valid. The register window of the previous procedure is automatically recreated.

第3図は、この発明の他の実施例を示すブロック図であ
る。この実施例では、第1図の記憶装置2は、レジスタ
の各ワードに対応した2ビツトのタグレジスタ20rl
成されている。なお、1ビツトは現在および過去のレジ
スタウィンドウの上限を示すトップタグレジスタ20a
で、他の1ビツトは現在および過去のレジスタウィンド
ウの下限を示すベースタグレジスタ20bである。上限
、あるいは下限であるレジスタのタグは1であり、それ
以外は○とする。絶対レジスタ番号算出装置3は、タグ
レジスタ20の内容を数値に変換するプライオリティ・
エンコーダ21と加算器22、デコーダ23とで構成さ
れている。またレジスタセレクト信号発生装置4は、ベ
ース・タグレジスタとトップ・タグレジスタの出力から
現在のレジスタウィンドウの範囲を抽出するウィンドウ
抽出回路24と、このウィンドウ抽出回路24の出力に
よりレジスタセレクト信号26をアサート/ネゲートす
るアクセス保護回路25とからなる。なお、1はレジス
タファイルを示す。
FIG. 3 is a block diagram showing another embodiment of the invention. In this embodiment, the storage device 2 of FIG. 1 includes a 2-bit tag register 20rl corresponding to each word of the register.
has been completed. Note that 1 bit indicates the upper limit of the current and past register windows in the top tag register 20a.
The other bit is the base tag register 20b indicating the lower limit of the current and past register windows. The tag of the register that is the upper or lower limit is 1, and the others are ○. The absolute register number calculation device 3 is a priority register converter that converts the contents of the tag register 20 into a numerical value.
It is composed of an encoder 21, an adder 22, and a decoder 23. The register select signal generator 4 also includes a window extraction circuit 24 that extracts the range of the current register window from the outputs of the base tag register and the top tag register, and asserts a register select signal 26 based on the output of this window extraction circuit 24. /negate access protection circuit 25. Note that 1 indicates a register file.

次に上記第3図の装置の動作を説明する。Next, the operation of the apparatus shown in FIG. 3 will be explained.

レジスタのアクセスは以下のようにして行われる。まず
、入力27からレジスタ番号によりアクセスしようとす
るレジスタを指定する。一方、現在のレジスタウィンド
ウの下限を示すベース・タグレジスタ20bの値はプラ
イオリティ・エンコーダ21に入力されてレジスタの絶
対レジスタ番号に変換される。この値と指定されたレジ
スタ番号とを加算器22において加算し、アクセスしよ
うとするレジスタの絶対レジスタ番号を計算する。
Register access is performed as follows. First, the register to be accessed is specified using the register number from the input 27. On the other hand, the value of the base tag register 20b indicating the lower limit of the current register window is input to the priority encoder 21 and converted into an absolute register number of the register. This value and the designated register number are added in an adder 22 to calculate the absolute register number of the register to be accessed.

計算さ・れた絶対レジスタ番号を示す信号28はデコー
ダ23によってデコードされ、信号29を発生する。レ
ジスタセレクト信号発生装置4のウィンドウ抽出回路2
4は、ベース・タグレジスタ20b、トップ・タグレジ
スタ20aの値から、現在のレジスタウィンドウの範囲
を示す信号30を発生する。アクセス保護回路25では
、信号29と信号30の論理積を取ることによって、レ
ジスタウィンドウ内のレジスタへのアクセスの場合のみ
レジスタセレクト信号26(Oが有効〉を出力し、レジ
スタウィンドウ外のレジスタをアクセスしようとした場
合は不正アクセス検出信号31を発生する。以上のよう
にして、現在のレジスタウィンドウ外のレジスタには、
アクセス保護がなされる。
Signal 28 indicating the calculated absolute register number is decoded by decoder 23 to generate signal 29. Window extraction circuit 2 of register select signal generator 4
4 generates a signal 30 indicating the current register window range from the values of the base tag register 20b and top tag register 20a. The access protection circuit 25 outputs the register select signal 26 (O is valid) only when accessing a register within the register window by taking the logical product of the signals 29 and 30, and prevents access to registers outside the register window. If an attempt is made to do so, an unauthorized access detection signal 31 is generated.As described above, registers outside the current register window are
Access protection is provided.

第4図(a )および(b )は、レジスタ番号3のレ
ジスタをアクセスする場合を例にとって、第3図の装置
の一部分の具体的な回路構成とその動作を示す図である
FIGS. 4(a) and 4(b) are diagrams showing the specific circuit configuration and operation of a portion of the device in FIG. 3, taking as an example the case where register number 3 is accessed.

今、レジスタファイル1では、第4図(b )に示すよ
うに、レジスタ番@O−4、絶対レジスタ番号2−6の
レジスタウィンドウが開いているものとする。第4図(
a )に示すように、ベース・タグレジスタ20bには
、第4図(b )に示すレジスタウィンドウの下限値を
現すタグが記憶されており、この値は絶対レジスタ番号
算出装置3のプライオリティ・エンコーダ21に入力さ
れて絶対レジスタ番号“2″に変換され、さらに加算器
22に入力される。加算器22には、アクセスしようと
するレジスタの番号3が同時に入力されているので、こ
こで両者が加算されて絶対レジスタ番号“5″が得られ
る。この値はデコーダ23によってデコードされ、信号
29が発生される。
Assume that in register file 1, a register window with register number @O-4 and absolute register number 2-6 is open, as shown in FIG. 4(b). Figure 4 (
As shown in FIG. 4(b), the base tag register 20b stores a tag representing the lower limit value of the register window shown in FIG. 21 and is converted into an absolute register number "2", which is further input to an adder 22. Since the number 3 of the register to be accessed is simultaneously input to the adder 22, the two are added here to obtain the absolute register number "5". This value is decoded by decoder 23 and signal 29 is generated.

方、ベースおよびトップ・タグレジスタ20b。On the other hand, base and top tag registers 20b.

20aに記憶されているタグは、第4図(b)に示すウ
ィンドウ抽出回路24の第1の論理回路24a、24b
にそれぞれ入力され、レジスタウィンドウの上限と下限
を示す数値信号32.33に変換される。これらの信号
32.33は、さらに両者の排他的論理和を求める第2
の論理回路24Cに入力され、ウィンドウの範囲を示す
信号30が得られる。信号30と、上述の信号29はナ
ンド回路からなるアクセス保護回路25に共に入力され
、両者の論理積を取ることによって、アクセスするレジ
スタがレジスタウィンドウ内の場合のみ発生するレジス
タセレクト信号26(Oが有効〉が得られる。この場合
は、アクセスしようとするレジスタの番号が3(絶対レ
ジスタ番号5〉であり、レジスタウィンドウ内であるの
で、信号Oが発生し、レジスタへのアクセスが行われる
The tags stored in 20a are the first logic circuits 24a and 24b of the window extraction circuit 24 shown in FIG. 4(b).
are respectively input into the register window and are converted into numerical signals 32 and 33 indicating the upper and lower limits of the register window. These signals 32 and 33 are further processed by a second
A signal 30 indicating the window range is obtained. The signal 30 and the above-mentioned signal 29 are input together to the access protection circuit 25 consisting of a NAND circuit, and by taking the AND of the two, a register select signal 26 (O is generated only when the register to be accessed is within the register window) is generated. In this case, the register number to be accessed is 3 (absolute register number 5) and is within the register window, so the signal O is generated and the register is accessed.

手続きの呼び出しは以下のようにして行われる。The procedure is called as follows.

まず初めに、トップ・タグレジスタの更新を行う。First, the top tag register is updated.

第5図<a >は、新たに3つのレジスタを用いる場合
のトップ・タグレジスタの更新のようすを示す図であっ
て、この図を参照しながら、トップ・タグレジスタの更
新の手順を説明する。まず、絶対レジスタ番号算出装置
3では、プライオリティ・エンコーダ21によりトップ
・タグレジスタ2Qaの値から、現在の上限となるレジ
スタの絶対レジスタ番号が算出される。この値に、次の
手続きで使用するレジスタの数“3”を、加算器22に
おいて加締し、上限のレジスタの絶対レジスタ番号を求
める。この値は、デコーダ23によってデコードされ、
新しい上限のレジスタを指定し、トップ・タグレジスタ
20aに、図示のように1を書き込む。なお、ベース・
タグレジスタ20bの更新は、絶対レジスタ番号算出装
置3にベース・タグレジスタの値と“現在使用している
が次の手続きでは使用しないレジスタの数(レジスタス
タッタにブツシュするレジスタの数〉”を入力すること
により、同様に行われる。この操作により、任意の大き
さのレジスタウィンドウを開くことができる。またレジ
スタウィンドウをオーバーラツプさせることにより任意
の数の引き数を受は渡すことができる。
FIG. 5 <a> is a diagram showing how the top tag register is updated when three new registers are used, and the procedure for updating the top tag register will be explained with reference to this diagram. . First, in the absolute register number calculating device 3, the absolute register number of the current upper limit register is calculated by the priority encoder 21 from the value of the top tag register 2Qa. The adder 22 adds to this value the number of registers to be used in the next procedure, "3", to obtain the absolute register number of the upper limit register. This value is decoded by the decoder 23,
Specify a new upper limit register and write 1 to the top tag register 20a as shown. In addition, the base
To update the tag register 20b, the absolute register number calculation device 3 is provided with the value of the base tag register and "the number of registers that are currently used but will not be used in the next procedure (the number of registers to be bushed in the register stutter)". This is done similarly by typing. This operation allows you to open a register window of any size. You can also pass any number of arguments by overlapping the register windows.

手続きからの復帰は、タグレジスタの最上位のu 11
1を消呑することにより行なわれる。トップ・タグレジ
スタの更新は、次のように行なう。まず、絶対レジスタ
番号算出装置3において、トップ・タグレジスタ20a
の値からブラリオリティ・エンコーダ21により現在の
上限のレジスタの絶対レジスタ番号を求める。現在の上
限のレジスタの絶対レジスタ番号をデコードしてレジス
タを指定し、トップ・タグレジスタ20aに0を書き込
む。第5図(b)にトップ・タグレジスタの更新のよう
すを示す。ベース・タグレジスタ20bの更新は、絶対
レジスタ番号算出装置3にベース・タグレジスタ20b
の値を入力することにより、同様に行なわれる。この操
作によって一つ前の手続きにおけるレジスタウィンドウ
の上限、下限が有効となり、自動的に前の手続きのレジ
スタウィンドウが再現される。
To return from the procedure, use the top u11 tag register.
This is done by swallowing 1. The top tag register is updated as follows. First, in the absolute register number calculation device 3, the top tag register 20a
The absolute register number of the current upper limit register is determined from the value of . The absolute register number of the current upper limit register is decoded to designate the register, and 0 is written to the top tag register 20a. FIG. 5(b) shows how the top tag register is updated. To update the base tag register 20b, the absolute register number calculation device 3 updates the base tag register 20b.
The same thing can be done by inputting the value of . This operation makes the upper and lower limits of the register window in the previous procedure valid, and the register window of the previous procedure is automatically reproduced.

この実施例では、レジスタ1ワードに付随する論理回路
は同じ構造であり、レジスタのワード数によらず、レジ
スタファイルを同一回路の繰り返しで構成できるので、
VLSIに適しており、拡張性が非常に高い。また、記
憶装置にスタックを用いた第1の実施例に比べ、呼び出
す手続きの数がスタックのワード数で制限されることは
ない。
In this embodiment, the logic circuits associated with one word of the register have the same structure, and the register file can be constructed by repeating the same circuits regardless of the number of words in the register.
Suitable for VLSI and highly expandable. Furthermore, compared to the first embodiment in which a stack is used as a storage device, the number of procedures to be called is not limited by the number of words in the stack.

この実施例では、ウィンド抽出回路24とプライオリテ
ィ・エンコーダ21の遅延が動作高速化の鍵となる。ウ
ィンド抽出回路の遅延は、キャリー・ルック・アヘッド
技術などの公知技術によってレジスタ数の対数のオーダ
まで速度を早めることが容易である。また、プライオリ
ティ・エンコーダが動作するのは、手続きの呼び出し、
手続きからの復帰によりタグレジスタの値が変化する場
合だけである。手続き呼び出し、復帰命令の実行には、
他の命令の実行と比較して時間を要するので、プライオ
リティ・エンコーダの遅延は、全く問題にならないも [発明の効果] 以上述べてきたように、この発明のレジスタフフィル装
置によれば、簡単な回路構成で、任意の数の引き数の受
渡しができ、手続き毎に最適な大きさのレジスタウィン
ドを開くことができ、また、開かれたレジスタウィンド
に対して適切なアクセス保護を施すことができるので、
効率の良い引き数の受渡し、レジスタの活用が実現され
、極めて有効である。
In this embodiment, the delay of the window extraction circuit 24 and the priority encoder 21 is the key to speeding up the operation. The delay of the window extraction circuit can easily be sped up to the order of the logarithm of the number of registers by known techniques such as carry look ahead techniques. In addition, the priority encoder operates by calling a procedure,
This only occurs when the value of the tag register changes upon return from the procedure. To execute procedure calls and return instructions,
Since it takes time compared to the execution of other instructions, the delay of the priority encoder is not a problem at all. [Effects of the Invention] As described above, according to the register fill device of the present invention, the delay of the priority encoder is not a problem at all. With a simple circuit configuration, it is possible to pass any number of arguments, it is possible to open an optimally sized register window for each procedure, and it is possible to apply appropriate access protection to the opened register window. Because you can
It achieves efficient argument passing and register utilization, and is extremely effective.

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

第1図はこの発明の装置の基本的な構成を示すブロック
図、第2図はこの発明の一実施例装置のブロック図、第
3図はこの発明の第2の実施例装置のブロック図、第4
図および第5図は第3図の装置の一部分の詳細な構成お
よびその動作の説明に供する図、および第6図は従来の
装置の説明に供する図である。 1・・・レジスタファイル  2・・・記憶装置3・・
・絶対レジスタ番号算出装置 4・・・レジスタセレクト信号発生装置5・・・レジス
タセレクト番号 6・・・不正アクセス検出信号
FIG. 1 is a block diagram showing the basic configuration of a device of the present invention, FIG. 2 is a block diagram of an embodiment of the device of the present invention, and FIG. 3 is a block diagram of a second embodiment of the device of the present invention. Fourth
5 and 5 are diagrams for explaining the detailed configuration and operation of a part of the device shown in FIG. 3, and FIG. 6 is a diagram for explaining the conventional device. 1...Register file 2...Storage device 3...
- Absolute register number calculation device 4... Register select signal generation device 5... Register select number 6... Unauthorized access detection signal

Claims (1)

【特許請求の範囲】 多数のレジスタを備えるレジスタファイルと、前記レジ
スタファイルにおいて過去および使用中のレジスタウン
ドウの範囲を記憶するための記憶装置と、 前記記憶装置に記憶されたレジスタウィンドウの範囲を
示す情報とアクセスしようとするレジスタのレジスタ番
号とからこのレジスタの絶対レジスタ番号を算出する絶
対レジスタ番号算出装置と、前記絶対レジスタ番号算出
装置によって算出された前記アクセスしようとするレジ
スタの絶対レジスタ番号を示す信号と前記記憶装置に記
憶されたレジスタウィンドウの範囲を示す情報とを比較
してアクセスしようとするレジスタが前記使用中のウィ
ンドウの範囲内か範囲外かを判定し、ウィンドウ内であ
ればレジスタセレクト信号を発生し、ウィンドウ外であ
れば不正アクセス検出信号を発生するレジスタセレクト
信号発生装置、 とを具備することを特徴とするレジスタファイル装置。
[Scope of Claims] A register file including a large number of registers, a storage device for storing a range of register windows in the past and in use in the register file, and a range of register windows stored in the storage device. an absolute register number calculation device that calculates an absolute register number of this register from information and a register number of the register to be accessed, and an absolute register number of the register to be accessed calculated by the absolute register number calculation device; It compares the signal with information indicating the range of the register window stored in the storage device to determine whether the register to be accessed is within or outside the range of the window in use, and if it is within the window, selects the register. A register file device comprising: a register select signal generating device that generates a signal and generates an unauthorized access detection signal if the signal is outside the window.
JP22501989A 1989-08-31 1989-08-31 Register filing device Pending JPH0388029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22501989A JPH0388029A (en) 1989-08-31 1989-08-31 Register filing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22501989A JPH0388029A (en) 1989-08-31 1989-08-31 Register filing device

Publications (1)

Publication Number Publication Date
JPH0388029A true JPH0388029A (en) 1991-04-12

Family

ID=16822801

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22501989A Pending JPH0388029A (en) 1989-08-31 1989-08-31 Register filing device

Country Status (1)

Country Link
JP (1) JPH0388029A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6665793B1 (en) * 1999-12-28 2003-12-16 Institute For The Development Of Emerging Architectures, L.L.C. Method and apparatus for managing access to out-of-frame Registers

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6665793B1 (en) * 1999-12-28 2003-12-16 Institute For The Development Of Emerging Architectures, L.L.C. Method and apparatus for managing access to out-of-frame Registers
US7272702B2 (en) 1999-12-28 2007-09-18 Hewlett-Packard Development Company, L.P. Method and apparatus for managing access to out-of-frame registers
US7334112B2 (en) 1999-12-28 2008-02-19 Hewlett-Packard Development Company, L.P. Method and apparatus for managing access to out-of-frame registers

Similar Documents

Publication Publication Date Title
US5210874A (en) Cross-domain call system in a capability based digital data processing system
US4777588A (en) General-purpose register file optimized for intraprocedural register allocation, procedure calls, and multitasking performance
US4347565A (en) Address control system for software simulation
US4794522A (en) Method for detecting modified object code in an emulator
JP3219826B2 (en) Information processing device
AU593570B2 (en) Digital data processing system
US5751988A (en) Microcomputer with memory bank configuration and register bank configuration
JPH0248931B2 (en)
US5490259A (en) Logical-to-real address translation based on selective use of first and second TLBs
EP0891586A1 (en) Flexible expansion of virtual memory addressing
US5018064A (en) Virtual computer system
JPH0388029A (en) Register filing device
JPH0343827A (en) Fuzzy microcomputer
JPS61160160A (en) Addressing control device in virtual computer system
JPS60142429A (en) I/O execution method and device for virtual computer system
JPH08147217A (en) Processor
JPS6225348A (en) Address bus extension system
JPH01147747A (en) Extended virtual storage control system
JP2982181B2 (en) Central processing unit
JPS60118952A (en) Virtual address control system
JPS5897184A (en) Address translation method
JPS6360427B2 (en)
JPH05225063A (en) Buffer memory clear system
JPS59188900A (en) Data processor
JPS5816560B2 (en) Memory protection method