JPH0217541A - Stack system micro-computer - Google Patents

Stack system micro-computer

Info

Publication number
JPH0217541A
JPH0217541A JP16675588A JP16675588A JPH0217541A JP H0217541 A JPH0217541 A JP H0217541A JP 16675588 A JP16675588 A JP 16675588A JP 16675588 A JP16675588 A JP 16675588A JP H0217541 A JPH0217541 A JP H0217541A
Authority
JP
Japan
Prior art keywords
stack frame
stack
data
register set
register
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
JP16675588A
Other languages
Japanese (ja)
Inventor
Toyoko Yokota
横田 豊子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP16675588A priority Critical patent/JPH0217541A/en
Publication of JPH0217541A publication Critical patent/JPH0217541A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To effectively use the multi-register setting and without any waste by making a stack frame corresponding to a certain processing into a variable length and setting an overlapping area between stack frames. CONSTITUTION:When the address of an instruction word designated by an instruction fetching unit 12 is hit through an address bus 1d to a cache memory 11, the data are read out of the cache memory 11. When the data are not present at the cache memory 11, the data are read out of an external memory 16 through an address bus 1f and a data bus 1g. The read instruction word (data) is decoded by a control unit 13 and the access to a multi-register setting 14 is performed. Next, processing is performed by an execution unit 15 and the result is stored into the multi-register setting 14. The multi-register setting is composed of the (n) number of stack frames of the variable length.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、オーバーラツプのあるマルチレジスタセット
を内蔵するマイクロコンピュータに係り。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a microcomputer incorporating a multi-register set with overlap.

特に多量のデータを高速処理しながら割込みやイベント
などの発生に対応するのに好適なスタック方式とする。
In particular, the stack method is suitable for processing large amounts of data at high speed while responding to the occurrence of interrupts and events.

[従来の技術〕 従来、計算機システムにおいて、イベント発生によるタ
スクスイッチ時や、関数の呼出し時におけるレジスタの
メモリへの退避、復帰のための処理時間(以後、オーバ
ーヘッド時間とよぶ)を必要としていた。そこで、この
オーバーヘッド時間の高速化を行なうため、汎用レジス
タセットを複数個設けるマルチレジスタセット方式があ
る。
[Prior Art] Conventionally, computer systems require processing time (hereinafter referred to as overhead time) for saving and restoring registers to memory when switching tasks due to the occurrence of an event or when calling a function. Therefore, in order to speed up this overhead time, there is a multi-register set system in which a plurality of general-purpose register sets are provided.

タスクスイッチの高速化の場合、マルチレジスタセット
の各汎用レジスタセットに、タスクを割当て、タスクス
イッチ発生時に、汎用レジスタセットを各タスクに対応
させて切換える処理を行なう。
In the case of speeding up task switching, a task is assigned to each general-purpose register set of a multi-register set, and when a task switch occurs, the general-purpose register set is switched in correspondence with each task.

また、高級言語における関数呼出しの高速化の場合、タ
スクをプログラムにおける関数にねりあてる。各汎用レ
ジスタセットは、引数の受は用、局所変数用、引数の渡
し用として、3種に分類されている。引数の受は用、渡
し用のレジスタは、各関数を呼び出す側と、呼び出され
る側で共用され、呼ぶ側では、渡し用、呼ばれる側では
、受は用として用いられる。このオーバーラツプのある
マルチレジスタセットについては、アイ・イー・イー・
イー コンピューター、15巻、9号、第8頁から、第
21項(Daid、A、Patterson、andC
arlo、H,5equin“A VLSI RISC
” IEEIE Computervol、15.no
9.pp8−21,5ept’ 82)において論じら
れている。
Furthermore, in the case of speeding up function calls in high-level languages, tasks are assigned to functions in the program. Each general-purpose register set is classified into three types: those for receiving arguments, those for local variables, and those for passing arguments. The registers for receiving and passing arguments are shared by the side that calls each function and the called side, and the registers are used for passing on the calling side and for passing on the called side. For this overlapping multi-register set, IE.
E-Computer, Vol. 15, No. 9, pp. 8-21 (Daid, A., Patterson, and C.
arlo, H, 5equin “A VLSI RISC
” IEEE Computer vol. 15. no.
9. pp 8-21, 5ept' 82).

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上記従来技術は、マルチレジスタセットにおけるレジス
タセット数、および汎用レジスタセットあたりのレジス
タの数の点については配慮がされていない。
The above conventional technology does not consider the number of register sets in a multi-register set and the number of registers per general-purpose register set.

そのため、1タスクあたりに用いるデータが多い場合に
は、レジスタセットにデータが入りきれないため、主メ
モリ上にデータをおかなければならないため、メモリア
クセスが増加するという問題がある。
Therefore, when a large amount of data is used per task, the data cannot fit into the register set, so the data must be stored in the main memory, resulting in an increase in memory accesses.

また、1タスクあたりに用いるデータが少ない場合には
、レジスタセットに空きが生じるという問題がある。
Furthermore, when the amount of data used per task is small, there is a problem in that the register set becomes empty.

本発明の目的は、レジスタセットを可変に構成できるス
タック方式のマルチレジスタセットを内蔵することにあ
る。
An object of the present invention is to incorporate a stack-type multi-register set that can variably configure the register set.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的は、可変語数のレジスタからなるスタックフレ
ームを構成することができ、スタックフレームに接続し
得て、少なくとも、算術演算と論理演算のできる演算回
路と、スタックフレームの長さを決定できる蓄積手段と
、前後のスタックフレームとのオーバーラツプ領域を設
定できる指定情報と、マルチレジスタセット内のスタッ
クフレームを指定できる選択手段とをそなえ、また、ス
タックフレームの長さを命令フォーマットにより決定す
る手段と、蓄積情報によりマルチレジスタセット内のス
タックフレームを指定できる選択手段を含んで構成する
ことにより、達成される。
The above object is capable of configuring a stack frame consisting of registers with a variable number of words, an arithmetic circuit that can be connected to the stack frame and capable of at least arithmetic operations and logical operations, and a storage means that can determine the length of the stack frame. , specification information for setting an overlap area with the previous and subsequent stack frames, selection means for specifying the stack frame within the multi-register set, means for determining the length of the stack frame based on the instruction format, and storage This is achieved by including a selection means that can specify a stack frame within a multi-register set based on information.

〔作用〕[Effect]

マルチレジスタセットにおける第1のスタックフレーム
を第2のスタックフレームへ切換える命令が発生した場
合に、第1のスタックフレームから第2のスタックフレ
ームへの切換えができるとともに、第1のスタックフレ
ームと第2のスタックフレームとのオーバーラツプ領域
を指定できる。
When an instruction to switch the first stack frame to the second stack frame in a multi-register set occurs, it is possible to switch from the first stack frame to the second stack frame, and also to switch between the first stack frame and the second stack frame. You can specify the overlap area with the stack frame.

また、第2のスタックフレームとして必要な長さを決定
し、使用することができる。
Additionally, the required length of the second stack frame can be determined and used.

このスタックフレームの選択手段は、蓄積情報として、
暗黙指定する手段と、指定情報として。
This stack frame selection means uses, as accumulated information,
As a means of implicit specification and specification information.

命令フォーマットにより指定することができる。It can be specified by the instruction format.

また、スタックフレームの長さを指定する手段は、指定
情報として、処理が発生する前に指示する手段と、レジ
スタの必要に応じて、蓄積手段として、保持できる手段
とを持つことによりマルチレジスタセットを有効に使用
することができる。
In addition, the means for specifying the length of the stack frame is a multi-register set by having a means for specifying the length of the stack frame as specification information before the processing occurs, and a means for holding it as a storage means according to the register needs. can be used effectively.

〔実施例〕〔Example〕

以下、本発明の1実施例を第1図により説明する。 Hereinafter, one embodiment of the present invention will be described with reference to FIG.

第1図は、本発明が適用されるデータ処理装置の全体構
成の1例を示す図である。第1図において、10は、1
1のキャッシュメモリ、12の命令フェッチユニット、
13の制御ユニット、14のマルチレジスタセット、1
5の実行ユニット、を内蔵するマイクロプロセッサであ
り、1fのアドレスバスと、1gのデータバスを介して
、1Gの外部記憶と接続している。
FIG. 1 is a diagram showing an example of the overall configuration of a data processing device to which the present invention is applied. In Figure 1, 10 is 1
1 cache memory, 12 instruction fetch units,
13 control units, 14 multi-register sets, 1
It is a microprocessor with a built-in 5 execution units, and is connected to a 1G external storage via a 1f address bus and a 1g data bus.

ここで、これらの要素からなるマイクロコンピュータ1
0の動作の概要を説明する。
Here, microcomputer 1 consisting of these elements
An overview of the operation of 0 will be explained.

命令フェッチユニット12で指定する命令語のアドレス
が、アドレスバス1dを介し、キャッシュメモリ11に
ヒツトした場合、キャッシュメモリ11からデータを読
出す。キャッシュメモリ11にデータがない場合は、ア
ドレスバス1fと、データバス1gを介して、外部記憶
16からデータを読出す。
When the address of the instruction word specified by the instruction fetch unit 12 hits the cache memory 11 via the address bus 1d, data is read from the cache memory 11. If there is no data in the cache memory 11, the data is read from the external storage 16 via the address bus 1f and the data bus 1g.

読出された命令語(データ)は、制御ユニット13でデ
コードされ、マルチレジスタセット14へのアクセスを
行なう。次に、実行ユニット15で処理され、結果がマ
ルチレジスタセットに格納される。
The read instruction word (data) is decoded by the control unit 13 and accesses the multi-register set 14. It is then processed in execution unit 15 and the result is stored in a multi-register set.

第2図は、実行ユニットの構成を示す図である。FIG. 2 is a diagram showing the configuration of an execution unit.

実行ユニットは2本のリードデータバス1aと1b上の
データをソースラッチ1の23、ソースラッチ2の24
、に入力し、バレルシフタ21で高速シフトを実行し、
マルチプレクサ25に出力する。シフト量は、制御11
IA2aで指定される。
The execution unit transfers the data on the two read data buses 1a and 1b to 23 of source latch 1 and 24 of source latch 2.
, execute a high-speed shift with barrel shifter 21,
Output to multiplexer 25. The shift amount is controlled by control 11.
Specified by IA2a.

ソースラッチ1の23とマルチプレクサの25から演算
ユニット22に入力を行ない、演算結果をディスティネ
ーションラッチ26に出力する。
Inputs are made to the arithmetic unit 22 from the source latch 1 23 and the multiplexer 25, and the arithmetic results are output to the destination latch 26.

ディスティネーションラッチ26からディスティネーシ
ョンバス1c上に出力される。
The signal is output from the destination latch 26 onto the destination bus 1c.

第3図は、マルチレジスタセットの基本構成を示す。ラ
イトデータバスlc上のデータを、マルチレジスタセッ
ト14に保持する。マルチレジスタセット14に保持し
たデータは、リードデータバス1aとリードデータバス
1bに出力される。
FIG. 3 shows the basic configuration of a multi-register set. The data on the write data bus lc is held in the multi-register set 14. The data held in the multi-register set 14 is output to the read data bus 1a and the read data bus 1b.

このマルチレジスタセットは、可変長のスタックフレー
ムn個から構成される。ベースになるスタックフレーム
は、基底スタックフレームであるスタック0の30、ス
タック1の31、スタック2の32.n番目のスタック
フレームであるスタックnの33により構成される。
This multi-register set is composed of n variable-length stack frames. The base stack frames are 30 of stack 0, 31 of stack 1, 32 of stack 2, etc. It is composed of 33 of stack n, which is the nth stack frame.

第4図は、マルチレジスタセットにおける1個のスタッ
クフレームの構成を示したものである。
FIG. 4 shows the structure of one stack frame in a multi-register set.

スタックフレームの0番は、1番目のレジスタとして、
BSARO(ベーススタックアドレスレジスタ0)があ
る。i番目のスタックフレームは、1つ前のスタックの
アドレスレジスタであるPSARi(Previous
 5tack Address Registen i
) 41と1つ前のスタックフレームとのレジスタの共
有領域であるG S RL (Global 5tac
k Registen Low)42と、1つ前のスタ
ックフレームの長さを示すP S L R(Previ
ous 5tack Length Registen
)43と現在のスタックフレームの基底アドレスを示す
B S A Ri (Base 5tack Addr
ess Registen 1)44と次のスタックフ
レームとのレジスタの共有領域であるG S RH(G
lobal 5tack RegistenHigh)
 45と、現在のスタックフレームの長さを示すCS 
L Ri (Current 5tack LenlH
th Registeni)46とにより構成される。
Stack frame number 0 is the first register,
There is a BSARO (base stack address register 0). The i-th stack frame is the address register of the previous stack, PSARi (Previous
5tack Address Register i
) 41 and the previous stack frame.
k Register Low) 42 and P S L R (Previous) which indicates the length of the previous stack frame.
ous 5tack Length Register
)43 and B S A Ri (Base 5tack Addr) indicating the base address of the current stack frame.
ess Register 1) G S RH (G
(lobal 5tack Register High)
45 and a CS indicating the length of the current stack frame
L Ri (Current 5tack LenlH
th Registeri) 46.

スタックフレームを切替える命令、又はイベント、が発
生した時は、BSARiは、次のスタックフレームのP
 S A Ri+1として用いられる。またGSRHは
、GSRLとして用いられ、C3LRiは、PSLRI
÷1として用いられる。
When a command or event that switches stack frames occurs, BSARi switches the P of the next stack frame.
Used as S A Ri+1. Also, GSRH is used as GSRL, and C3LRi is used as PSLRI.
It is used as ÷1.

1つのスタックフレームにおいて必要なデータは。What data is required in one stack frame?

GSRLとGSRHに格納されている。Stored in GSRL and GSRH.

通常は、関数呼出し、イベント呼出しが発生した時点で
、スタックフレームの切換え(インクリメント)を行な
う。
Normally, the stack frame is switched (incremented) when a function call or event call occurs.

また、直接スタックフレームを選択する方法として、ス
タックの番号を保持するレジスタ5NR(スタックナン
バーレジスタ)47がある。
Further, as a method for directly selecting a stack frame, there is a register 5NR (stack number register) 47 that holds a stack number.

第5図は、マルチレジスタセットにおける汎用レジスタ
のアクセス方法を示す。
FIG. 5 shows a method of accessing general-purpose registers in a multi-register set.

関数呼出しくイベント呼出し)が発生し、スタツクフレ
ームの切換えを行なう時点で、スタックフレームi−1
の基底アドレスBARt−t を現在のスタックフレー
ムのアドレスレジスタPSARiに格納する。スタック
フレームi−1のスタックの長さCS L Ri−t 
を現在のスタックフレームにおけるPSLRiに格納す
る。PSARiとPSLRiの加算を行ない現在の基底
アドレスをBARiに格納する。
When a function call or event call occurs and the stack frame is switched, stack frame i-1
The base address BARt-t of is stored in the address register PSARi of the current stack frame. Stack length of stack frame i-1 CS L Ri-t
is stored in PSLRi in the current stack frame. PSARi and PSLRi are added and the current base address is stored in BARi.

現在のスタックフレームでデータの加算を行なう場合は
、GRIにデータの3を代入し、GR2に150を代入
し、GRIとGR2のデータをGR3に格納する。
When data is to be added in the current stack frame, data 3 is assigned to GRI, 150 is assigned to GR2, and the data of GRI and GR2 are stored in GR3.

第6図は、スタックフレームにおけるレジスタの加算方
法を示す。
FIG. 6 shows how registers are added in a stack frame.

基底アドレスレジスタBARiにオフセット2を加算し
たアドレスで指すデータをSLI (ソースラッチの2
)に代入する。BARiにオフセット2を加算したデー
タを5L2(ソースラッチ2)に代入する。
The data pointed to by the address obtained by adding offset 2 to the base address register BARi is transferred to SLI
). The data obtained by adding offset 2 to BARi is assigned to 5L2 (source latch 2).

SLIとSL2の加算結果をディスティネーションラッ
チDLに格納する。
The addition result of SLI and SL2 is stored in the destination latch DL.

ディスティネーションラッチのデータDLを基底アドレ
スレジスタBARiとオフセット3で示すアドレスに格
納する。
The data DL of the destination latch is stored in the base address register BARi and the address indicated by offset 3.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、多数のレジスタセットにより構成され
るマルチレジスタセットにおいて、ある処理に対応する
スタックフレームを可変長にすることができるとともに
、スタックフレーム間にオーバーラツプ領域を設定する
ことができるため、ある処理に必要なデータ数が多い場
合は、対応するスタックフレームの長さを長くとり、必
要なデータが少ない場合には、スタックフレームの長さ
を短くとることができるので、マルチレジスタセットを
有効に無駄なく使用することができる。
According to the present invention, in a multi-register set composed of a large number of register sets, it is possible to make the length of a stack frame corresponding to a certain process variable, and it is also possible to set an overlap area between stack frames. When a large amount of data is required for a certain process, the length of the corresponding stack frame can be increased, and when less data is required, the length of the stack frame can be shortened, making multi-register sets effective. It can be used without waste.

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

第1図はマイクロコンピュータの全体構成図、第2図は
実行ユニットを示す図、第3図はマルチレジスタセット
を示す図、第4図はi番目のスタックフレームを示す図
、第5図はレジスタの加算を示す図、第6図はスタック
フレームのデータのアクセス手段を示す図である。 1・°゛マイクロコンピユータ14・・・マルチレジス
タセット、15・・・実行ユニット、16・・・外部記
憶、11・・・マイクロプログラム、12・・・命令フ
ェッチユニット、13・・・制御ユニット。
Figure 1 is a diagram showing the overall configuration of a microcomputer, Figure 2 is a diagram showing an execution unit, Figure 3 is a diagram showing a multi-register set, Figure 4 is a diagram showing the i-th stack frame, and Figure 5 is a diagram showing registers. FIG. 6 is a diagram showing the access means for data in the stack frame. 1.°゛Microcomputer 14...Multi register set, 15...Execution unit, 16...External storage, 11...Micro program, 12...Instruction fetch unit, 13...Control unit.

Claims (1)

【特許請求の範囲】 1、複数のレジスタからなるスタックフレームを有し、
該スタックフレームが複数本からなるマルチレジスタセ
ットを内蔵するマイクロコンピュータにおいて、前記ス
タックフレームに接続し得て、少なくとも、算術演算と
論理演算のできる演算回路と、前記スタックフレームの
長さを決定できる蓄積手段と、前後のスタックフレーム
とのオーバーラップ領域を設定できる指定情報と、マル
チレジスタセット内のスタックフレームを指定できる選
択手段とをそなえ、前記選択手段で選択している第1の
スタックフレームを第2のスタツクフレームへ切換える
命令、或いは、イベントが発生した場合には、第2のス
タックフレームを選択できる様にするとともに、前記指
定情報により、第2のスタックフレームと第1のスタッ
クフレームとのオーバーラップ領域を指定できる様にす
るとともに、第2のスタックフレームとして必要な長さ
を決定し、使用することを特徴とするスタック方式マイ
クロコンピュータ。 2、特許請求の範囲第1項記載のスタックフレームは、
スタックフレームを切換える命令、イベントが発生した
場合に、そのスタックフレームの長さを命令フォーマッ
トにより決定する手段と、蓄積情報により、マルチレジ
スタセット内のスタックフレームを指定できる選択手段
を含んで構成することを特徴とするスタック方式マイク
ロコンピュータ。 3、特許請求の範囲第1項記載のスタックフレームは、
マルチレジスタセット内のスタックフレーム数を記憶す
る手段を持ち、また、レジスタのオーバーフローが生じ
た場合に、下位のスタックフレームから、メモリへデー
タを退避する手段を保持することを特徴とするスタック
方式マイクロコンピュータ。
[Claims] 1. Having a stack frame consisting of a plurality of registers,
In a microcomputer in which the stack frame has a built-in multi-register set consisting of a plurality of registers, an arithmetic circuit connectable to the stack frame and capable of at least arithmetic operations and logical operations, and a storage capable of determining the length of the stack frame. means, specification information for setting an overlap area between previous and succeeding stack frames, and selection means for specifying a stack frame in the multi-register set, the first stack frame being selected by the selection means is selected as the first stack frame. When a command or an event to switch to the second stack frame occurs, the second stack frame can be selected, and the specification information allows the switching between the second stack frame and the first stack frame. A stack type microcomputer is characterized in that an overlapping area can be specified, and a length required for a second stack frame is determined and used. 2. The stack frame according to claim 1,
When a stack frame switching instruction or event occurs, the stack frame length is determined by the instruction format, and the stack frame selection means is configured to specify the stack frame in the multi-register set based on stored information. A stack-type microcomputer featuring: 3. The stack frame described in claim 1 is:
A stack type micro that has means for storing the number of stack frames in a multi-register set, and also has means for saving data from lower stack frames to memory in the event of register overflow. Computer.
JP16675588A 1988-07-06 1988-07-06 Stack system micro-computer Pending JPH0217541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16675588A JPH0217541A (en) 1988-07-06 1988-07-06 Stack system micro-computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16675588A JPH0217541A (en) 1988-07-06 1988-07-06 Stack system micro-computer

Publications (1)

Publication Number Publication Date
JPH0217541A true JPH0217541A (en) 1990-01-22

Family

ID=15837131

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16675588A Pending JPH0217541A (en) 1988-07-06 1988-07-06 Stack system micro-computer

Country Status (1)

Country Link
JP (1) JPH0217541A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02217925A (en) * 1989-02-17 1990-08-30 Toshiba Corp Microprocessor
JPH03230282A (en) * 1990-02-05 1991-10-14 Matsushita Electric Ind Co Ltd microprocessor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02217925A (en) * 1989-02-17 1990-08-30 Toshiba Corp Microprocessor
JPH03230282A (en) * 1990-02-05 1991-10-14 Matsushita Electric Ind Co Ltd microprocessor

Similar Documents

Publication Publication Date Title
US4206503A (en) Multiple length address formation in a microprogrammed data processing system
KR940009095B1 (en) Data processing system
US8726292B2 (en) System and method for communication in a multithread processor
US5978910A (en) Performing pending interrupts or exceptions when interruptible jumps are detected
WO1983001133A1 (en) Microprocessor with memory having interleaved address inputs and interleaved instruction and data outputs
JP3970609B2 (en) Processor system
US4152763A (en) Control system for central processing unit with plural execution units
US4791560A (en) Macro level control of an activity switch in a scientific vector processor which processor requires an external executive control program
US5491826A (en) Microprocessor having register bank and using a general purpose register as a stack pointer
JPS6290728A (en) Interruption processing method
JPS615357A (en) Data processor
KR19990058732A (en) Hardware real-time multitasking device and method
JPH03188530A (en) Program prefetching device
US7434039B2 (en) Computer processor capable of responding with comparable efficiency to both software-state-independent and state-dependent events
JPS6352241A (en) microprocessor
JP2918570B2 (en) Central processing unit
JPH0298744A (en) Interruption processing system
JPS6352240A (en) Data processor
JP3239042B2 (en) Microcomputer
JPH0535896B2 (en)
JPS60164843A (en) Microcomputer
JPS62128342A (en) Memory access control system
JPS60193046A (en) Instruction exception detection method
JPH041373B2 (en)
JPH09319598A (en) Low-cost signal mask control system