JPH05341996A - Digital computer and program restoring method - Google Patents

Digital computer and program restoring method

Info

Publication number
JPH05341996A
JPH05341996A JP17760992A JP17760992A JPH05341996A JP H05341996 A JPH05341996 A JP H05341996A JP 17760992 A JP17760992 A JP 17760992A JP 17760992 A JP17760992 A JP 17760992A JP H05341996 A JPH05341996 A JP H05341996A
Authority
JP
Japan
Prior art keywords
data
interrupt
input
subroutine
instruction
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
JP17760992A
Other languages
Japanese (ja)
Inventor
Takanori Saneto
隆則 實藤
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP17760992A priority Critical patent/JPH05341996A/en
Publication of JPH05341996A publication Critical patent/JPH05341996A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To provide a digital computer and a program restoring method capable of reducing the kind of instructions. and simplifying an instruction decoder circuit and decreasing memory size required after the instruction is executed. CONSTITUTION:An address and internal state saving part 1 which saves a code to identify Input from-subroutine SR, and required operating state data when the subroutine is inputted and saves a code to identify the input from interrupt AI and the required operating state data when the interrupt is inputted, and an address and internal state restoring part which reads out saving data by receiving the same restoration instruction RI and performs restoration from the subroutine or the interrupt corresponding to an identification code are provided, and the restoration from the subroutine or the interrupt can be performed by using the same restoration instruction.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、たとえば人工知能情報
処理、自然言語処理、数式処理などを行うディジタル計
算機に係り、特に、サブルーチン処理時および割り込み
処理時の復帰命令に対する処理に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital computer for performing, for example, artificial intelligence information processing, natural language processing, mathematical expression processing, etc., and more particularly to processing for a return instruction during subroutine processing and interrupt processing.

【0002】[0002]

【従来の技術】一般に、ディジタル計算機においては、
オペレーティングシステムからの呼び出しによって主プ
ログラムに実行の制御権が渡され、ここからサブプログ
ラムの呼び出しが行われる。サブプログラムは、一つの
プログラムの中で何度も同じ処理を繰り返す場合、その
処理を独立したプログラムの形にして、必要なときに呼
び出し命令により呼び出して処理を行わせるためのもの
であり、主として処理手順のまとまりであるいわゆるサ
ブルーチンにより構成される。
2. Description of the Related Art Generally, in a digital computer,
Execution control is given to the main program by a call from the operating system, and the subprogram is called from here. A subprogram is a program that, when the same processing is repeated many times in one program, makes that processing an independent program, and calls it by a calling instruction when necessary to perform the processing. It is composed of a so-called subroutine, which is a set of processing procedures.

【0003】通常、サブルーチン呼び出し命令が発せら
れると、復帰アドレス情報が所定の退避域に退避、保存
され、主ルーチンからサブルーチンに基づくプログラム
の進行に移行される。復帰アドレスデータとしては、プ
ログラムカウンタ(PC;Program Counter )の値が保
存される。サブルーチンからの復帰命令があると、退避
させた復帰アドレスデータが取り出されて、PCの値が
サブルーチン呼び出し命令が発せられる前の元の値に戻
され、呼び出されたサブルーチンから呼び出した主ルー
チンにプログラムの進行が戻される。
Normally, when a subroutine call instruction is issued, the return address information is saved and saved in a predetermined save area, and the main routine proceeds to a program based on a subroutine. As the return address data, the value of a program counter (PC) is stored. When there is a return instruction from the subroutine, the saved return address data is taken out, the value of PC is returned to the original value before the subroutine call instruction was issued, and the main routine called from the called subroutine is programmed. Progress is returned.

【0004】また、計算機では、電源の異常、計算機の
誤動作、外部信号の受信、入出力動作の完了、プログラ
ムの誤りなどが発生すると、現に実行中のプログラムの
処理が中断され、オペレーティングシステムの割り込み
制御ルーチンに制御が移行される、いわゆる割り込みが
行われる。割り込み処理時には、割り込みからの復帰ア
ドレスデータとともに、割り込みが発生したときの計算
機の内部状態に係るデータが退避、保存される。割り込
みの発生により中断されたプログラムは、処理の継続が
可能であれば、復帰命令に基づいて、復帰アドレスデー
タとともに、割り込みが発生したときの計算機の内部状
態に係るデータが取り出されて、中断した時点からプロ
グラムが再開される。
Further, in a computer, when a power supply abnormality, a computer malfunction, an external signal reception, an input / output operation completion, a program error, etc. occur, the processing of the program currently being executed is interrupted, and the operating system interrupts. A so-called interrupt is performed in which control is transferred to the control routine. At the time of interrupt processing, the return address data from the interrupt and the data related to the internal state of the computer when the interrupt occurs are saved and saved. If it is possible to continue processing, the program interrupted by the occurrence of an interrupt was interrupted by the return address data and the data related to the internal state of the computer when the interrupt occurred, based on the return instruction. The program restarts from that point.

【0005】[0005]

【発明が解決しようとする課題】ところで、従来のディ
ジタル計算機では、サブルーチンからの主ルーチンへの
復帰の場合には、プログラムカウンタの値を元に戻せば
よいが、割り込みからの復帰の場合には、割り込みが発
生する前の状態に戻さなければならないことから、各々
の復帰処理は、それぞれ別々の復帰命令に基づいて行わ
れている。このように、従来のディジタル計算機では、
サブルーチンからの復帰と割り込みからの復帰とでそれ
ぞれ異なる復帰命令を用いているので、命令デコードの
ためのハードウェア構成が複雑となるとともに、コスト
高となり、また、命令に要するメモリサイズが増大する
という欠点がある。
By the way, in the conventional digital computer, when returning from the subroutine to the main routine, the value of the program counter may be returned to the original value, but when returning from the interrupt, Since it is necessary to return to the state before the interrupt occurs, each restoration process is performed based on a different restoration instruction. Thus, in the conventional digital computer,
Since different return instructions are used for returning from a subroutine and for returning from an interrupt, the hardware configuration for instruction decoding becomes complicated, the cost increases, and the memory size required for the instructions increases. There are drawbacks.

【0006】本発明は、かかる事情に鑑みてなされたも
のであり、その目的は、命令の種類を減少でき、命令デ
コード回路の簡単化並びに命令後に要するメモリサイズ
の削減を図れるディジタル計算機およびプログラム復帰
方法を提供することにある。
The present invention has been made in view of the above circumstances, and an object thereof is to reduce the number of types of instructions, simplify the instruction decoding circuit, and reduce the memory size required after the instruction and the program restoration. To provide a method.

【0007】[0007]

【課題を解決するための手段】上記目的を達成するた
め、本発明のディジタル計算機では、サブルーチンの入
力時にサブルーチンからの入力を識別するコードと必要
な動作状態データとを退避させる手段と、割り込みの入
力時に割り込みからの入力を識別するコードと必要な動
作状態データとを退避させる手段と、同じ復帰命令を受
けて退避データを読み出し、識別コードに応じてサブル
ーチンまたは割り込みから復帰させる手段とを有するよ
うにした。
In order to achieve the above object, in the digital computer of the present invention, means for saving a code for identifying the input from the subroutine and the necessary operating state data at the time of the input of the subroutine, and an interrupt To have a means for saving the code identifying the input from the interrupt and the necessary operation state data at the time of input, and a means for receiving the same restoration instruction, reading the saved data, and returning from the subroutine or interrupt according to the identification code. I chose

【0008】本発明のディジタル計算機では、サブルー
チンの入力時に退避させる動作状態データと割り込みの
入力時に退避させる動作状態データとを同じデータフォ
ーマットとし、かつこれら動作状態データに、サブルー
チンからの入力および割り込みからの入力のうちのいず
れの入力であるかを識別するためのコードを付加して退
避させる手段を有するようにした。
In the digital computer of the present invention, the operating state data saved at the time of inputting a subroutine and the operating state data saved at the time of inputting an interrupt have the same data format, and these operating state data are input from the subroutine and interrupts. It is provided with a means for adding a code for discriminating which of the above inputs is the input and saving it.

【0009】本発明のディジタル計算機では、記憶手段
と、サブルーチンの入力時には、プログラムカウンタの
内容をアドレスデータとして、割り込みの入力時には、
プログラムカウンタの内容をアドレスデータとするとと
もに、フラグレジスタおよび割り込みレベルレジスタの
内容を内部状態データとし、かつ、これらデータに退避
動作の要因となった入力命令を識別するためのコードを
付して上記記憶手段に退避させる手段とを有するように
した。
In the digital computer of the present invention, the storage means and the contents of the program counter are used as address data at the time of the input of the subroutine, and at the time of the input of the interrupt.
The contents of the program counter are used as address data, the contents of the flag register and interrupt level register are used as internal state data, and a code for identifying the input instruction that caused the save operation is added to these data. A means for evacuating to the storage means is provided.

【0010】本発明のディジタル計算機では、復帰命令
を受けて上記記憶手段の退避データを読み出し、読み出
し退避データからアドレスデータを抽出してプログラム
カウンタにセットする手段と、読み出し退避データから
識別コードを検出し、退避データが割り込み時のデータ
の場合に、内部状態データを抽出してフラグレジスタお
よび割り込みレベルレジスタにセットする手段とを有す
るようにした。
In the digital computer of the present invention, means for receiving the return instruction, reading the save data from the storage means, extracting address data from the read save data and setting it in the program counter, and detecting the identification code from the read save data. However, when the saved data is data at the time of interruption, the internal state data is extracted and set in the flag register and the interrupt level register.

【0011】本発明のデータ復帰方法では、サブルーチ
ンの入力時にサブルーチンからの入力を識別するコード
と必要な動作状態データとを保存し、割り込みの入力時
に割り込みからの入力を識別するコードと必要な動作状
態データとを保存し、同じ復帰命令を用いてサブルーチ
ンまたは割り込みから復帰させるようにした。
In the data restoration method of the present invention, a code for identifying the input from the subroutine when the subroutine is input and the necessary operation state data are saved, and a code for identifying the input from the interrupt and the necessary operation are input when the interrupt is input. The state data and are saved, and the same return instruction is used to return from a subroutine or interrupt.

【0012】[0012]

【作用】本発明のディジタル計算機によれば、サブルー
チンの入力時には、サブルーチンからの入力を識別する
コードと必要な動作状態データとが退避される。一方、
割り込みの入力時には、割り込みからの入力を識別する
コードと必要な動作状態データとが退避される。ここ
で、サブルーチンの入力時および割り込みの入力時とも
同じ復帰命令を受けて退避データが読み出され、退避さ
れていた識別コードに応じてサブルーチンまたは割り込
みからの復帰動作が行われる。
According to the digital computer of the present invention, when the subroutine is input, the code for identifying the input from the subroutine and the necessary operation state data are saved. on the other hand,
At the time of inputting an interrupt, a code identifying the input from the interrupt and necessary operation state data are saved. Here, when the subroutine is input and when the interrupt is input, the save data is read in response to the same return instruction, and the return operation from the subroutine or the interrupt is performed according to the saved identification code.

【0013】本発明のディジタル計算機によれば、サブ
ルーチンの入力時に退避させる動作状態データと割り込
みの入力時に退避させる動作状態データとが、同じデー
タフォーマットで退避される。このデータ退避の際に
は、動作状態データに、サブルーチンからの入力および
割り込みからの入力のうちのいずれの入力であるかを識
別するためのコードが付加される。
According to the digital computer of the present invention, the operation state data saved when the subroutine is input and the operation state data saved when the interrupt is input are saved in the same data format. At the time of saving the data, a code for identifying which of the input from the subroutine and the input from the interrupt is added to the operation state data.

【0014】本発明のディジタル計算機によれば、サブ
ルーチンの入力時には、プログラムカウンタの内容がア
ドレスデータとして識別コードとともに記憶手段に退避
される。一方、割り込みの入力時には、プログラムカウ
ンタの内容がアドレスデータとされ、かつ、フラグレジ
スタおよび割り込みレベルレジスタの内容が内部状態デ
ータとして識別コードとともに記憶手段に退避される。
According to the digital computer of the present invention, when a subroutine is input, the contents of the program counter are saved as address data together with the identification code in the storage means. On the other hand, when an interrupt is input, the contents of the program counter are used as address data, and the contents of the flag register and interrupt level register are saved in the storage means as internal state data together with the identification code.

【0015】本発明のディジタル計算機によれば、復帰
命令を受けて退避データが読み出される。この読み出し
退避データから、アドレス抽出手段によりアドレスデー
タが抽出され、そのデータがプログラムカウンタにセッ
トされる。また、識別コード検出手段により読み出し退
避データから識別コードが検出され、この検出の結果、
退避データが割り込み時のデータの場合には、上述のア
ドレスデータのプログラムカウンタへのセット動作とと
もに、内部状態データが抽出されてフラグレジスタおよ
び割り込みレベルレジスタにセットされる。
According to the digital computer of the present invention, the save data is read in response to the return instruction. Address data is extracted from the read and saved data by the address extraction means, and the data is set in the program counter. Further, the identification code detecting means detects the identification code from the read and saved data, and as a result of this detection,
When the saved data is data at the time of interrupt, the internal state data is extracted and set in the flag register and the interrupt level register together with the setting operation of the address data in the program counter.

【0016】本発明のデータ復帰方法によれば、サブル
ーチンの入力時には、サブルーチンからの入力を識別す
るコードと必要な動作状態データとが保存される。一
方、割り込みの入力時には、割り込みからの入力を識別
するコードと必要な動作状態データとが保存される。復
帰時には、同じ復帰命令が用いられて、サブルーチンま
たは割り込みからの復帰が行われる。
According to the data restoration method of the present invention, when the subroutine is input, the code for identifying the input from the subroutine and the necessary operation state data are stored. On the other hand, when an interrupt is input, a code for identifying the input from the interrupt and necessary operating state data are stored. When returning, the same return instruction is used to return from the subroutine or interrupt.

【0017】[0017]

【実施例】図1は、本発明が適用される記号処理言語を
用いた並列分散コンピュータシステム(以下、単にコン
ピュータシステムという)の構成図である。コンピュー
タシステムは、計算の資源と評価に基づくアーキテクチ
ャACREを基本構成とする。アーキテクチャACREでは、計
算の実行時における計算データをメモリ管理や通信機能
などを含めて資源とし、また、計算を実行する過程を評
価として認識する。ACREは、資源と評価の機構を計算モ
ジュールとして具現化するアーキテクチャである。資源
は、データの静的表現であり、内部では資源の管理など
の処理を行うが、評価からは関知する必要がない。評価
は資源の動的振る舞いであり、資源に対して変化を与え
るものである。
1 is a block diagram of a parallel distributed computer system (hereinafter simply referred to as a computer system) using a symbol processing language to which the present invention is applied. The computer system is based on the architecture ACRE based on computational resources and evaluation. In architecture ACRE, calculation data at the time of execution of calculation is used as resources including memory management and communication function, and the process of executing calculation is recognized as an evaluation. ACRE is an architecture that embodies resource and evaluation mechanisms as calculation modules. A resource is a static representation of data, and internally performs processing such as resource management, but there is no need to be aware of it from evaluation. Evaluation is a dynamic behavior of a resource, which gives a change to the resource.

【0018】コンピュータシステムのプロセッシングエ
レメト(Processing Element)PEは、図1の(a) に示す
ように、高速な記号処理データ演算を実行する評価機構
(エバリュエータ)EUと、入出力や記憶管理を重視し
た資源(リソース)RSCからなる。リソースRSC
は、データの格納場所としてのデータストレージSTR
Gと、その管理機構や通信機能としてのリソースマネー
ジャRMにより構成されている。
The processing element PE of the computer system, as shown in FIG. 1A, has an evaluation mechanism (evaluator) EU for executing high-speed symbol processing data operation, input / output and storage management. It consists of important resources RSC. Resource RSC
Is a data storage STR as a data storage location.
G and a resource manager RM as its management mechanism and communication function.

【0019】また、アーキテクチャACREでは、計算資源
として捉えた並列処理の単位をアーキテクチャ ACRE に
おける資源に対応させ、資源間で情報伝達を行なうこと
により、並列処理の効率と並列処理システムの記述性の
向上を図ることができる。このとき、リソースRSCに
基づく情報通信によって、コンピュータシステムのプロ
セッシングエレメトPEとして専用エンジンや汎用プロ
セッサを組み込んだシステムの構成が容易となる。図1
の(b) はそのシステム構成例を示しており、この場合、
各プロセッシングエレメントPE間の情報通信は、リソ
ースマネージャRMが行う。なお、同図において、IR
C(InterResource Connection)は結合部を示している。
Further, in the architecture ACRE, the unit of parallel processing regarded as a computational resource is made to correspond to the resource in the architecture ACRE, and information is transmitted between the resources to improve the efficiency of parallel processing and the descriptiveness of the parallel processing system. Can be planned. At this time, the information communication based on the resource RSC facilitates the configuration of a system in which a dedicated engine or a general-purpose processor is incorporated as the processing element PE of the computer system. Figure 1
(B) shows an example of the system configuration.In this case,
Information communication between the processing elements PE is performed by the resource manager RM. In the figure, IR
C (Inter Resource Connection) indicates a connection part.

【0020】エバリュエータEUは、データ幅32ビッ
トのVLIW(Very Long Instruction Word)制御のプロ
セッサである。エバリュエータEUは、ユーザ定義の関
数やメソッドのコンパイルされたコードを高速実行する
ためのインストラクションキャッシュ(64 bits× 64Kwo
rds)ICと、データのフィールド演算を高速に実現する
ためのマスカ(MSK),シフタ(SFT)およびAL
Uと、関数やメソッドの呼び出しを高速化するためのデ
ータフィールド値による多方向分岐機能と、多方向分岐
のためのディスパッチ■(ルックアップ)テーブルDP
およびエバリュエータEUのシステムスタックSSのた
めの 64 Kwordsの制御用メモリCMと、記号処理計算を
実行する際のユーザ(フレーム)スタックUSおよびレ
ジスタファイルRFのための64 Kwords のローカルメモ
リLMと、命令のデコードやデータのシステムスタック
SSへの退避あるいはそのデータの読み出しなどを行う
システムコントローラSCとを有する。入出力や記憶管
理に要する演算は、リソースマネージャRMに対してリ
ソースマネージャインタフェ−スRMI/F を介してその
実行を要求する。
The evaluator EU is a VLIW (Very Long Instruction Word) controlled processor having a data width of 32 bits. The evaluator EU is an instruction cache (64 bits × 64 Kwo) for high-speed execution of compiled code of user-defined functions and methods.
rds) IC and masker (MSK), shifter (SFT) and AL for high-speed field calculation of data
U and multi-way branch function by data field value to speed up function and method call, and dispatch for multi-way branch ■ (Lookup) table DP
And a 64 Kwords control memory CM for the system stack SS of the evaluator EU, a 64 Kwords local memory LM for the user (frame) stack US and the register file RF when performing symbol processing calculations, and of the instructions It has a system controller SC that performs decoding, saves data in the system stack SS, and reads the data. The operations required for input / output and storage management are requested to be executed by the resource manager RM via the resource manager interface RMI / F.

【0021】リソースマネージャRMは、記憶管理、デ
バイス管理、プロセス管理、ファイル管理、入出力、他
のプロセッシングエレメントPEとの通信の機能をエバ
リュエータEUに提供する。リソースマネージャRMに
は、たとえばワークステーションWSが適用され、たと
えばワークステーションWSの X Window システム上に
アプリケーション開発時および実行時のインタラクティ
ブなヒューマンインタフェース環境を実現する。関数定
義やメソッド定義のインクリメンタルな修正・コンパイ
ル、エラー状態からの復帰・実行再開機能を有し、アプ
リケーションの実行時にユーザとの動的な対話ができる
ような入出力機能を提供する。加えて、リソースマネー
ジャRMは、エバリュエータEUとのインタフェースで
あるエバリュエータインタフェースEUI/F と、並列処
理時に他のプロセッシングエレメントPEとの通信を行
うための通信インタフェースCI/F と、データストレー
ジSTRGのメインメモリMM上の記号処理データの高
速アクセスのためのアクセラレータとしてのポインタマ
ニュピレータPMと、診断用インタフェースDI/F とを
有している。
The resource manager RM provides the evaluator EU with the functions of storage management, device management, process management, file management, input / output, and communication with other processing elements PE. For example, the workstation WS is applied to the resource manager RM, and realizes an interactive human interface environment at the time of application development and runtime on the X Window system of the workstation WS, for example. It has functions for incrementally correcting and compiling function definitions and method definitions, recovering from error status, and resuming execution, and provides input / output functions that enable dynamic interaction with the user when executing an application. In addition, the resource manager RM includes an evaluator interface EU I / F that is an interface with the evaluator EU, a communication interface CI / F for communicating with other processing elements PE during parallel processing, and a main memory of the data storage STRG. It has a pointer manipulator PM as an accelerator for high-speed access of symbol processing data on the MM, and a diagnostic interface DI / F.

【0022】また、記憶管理には、たとえば記号処理の
ための記憶構成・管理方式であるMOLDS(Memory Or
ganization for Linked Data Structures)が用いられ
る。MOLDSによる記憶管理は、従来の仮想記憶方式
に比べて、記号処理データの管理が10〜40倍高速で
あるという評価を得ている。
The memory management includes, for example, MODDS (Memory Or) which is a memory configuration / management system for symbol processing.
ganization for Linked Data Structures) is used. The memory management by MODLS has been evaluated as being 10 to 40 times faster in management of symbol processing data than the conventional virtual memory system.

【0023】データストレージSTRGのメインメモリ
MMは、エバリュエータEUからもメインメモリインタ
フェースMMI/F を介して直接アクセス可能なデュアル
ポートメモリからなり、排他的アクセス、記号処理演算
で有効な参照カウントなどの機能アクセスを提供する。
メインメモリMMは、これらの制御情報と2ワードのポ
インタを表現するため80bits × 256 Kwords の構成と
なっている。また、データストレージSTRGの二次記
憶SMとしては、ワークステーションWSのディスクシ
ステムが用いられる。
The main memory MM of the data storage STRG is a dual port memory which can be directly accessed from the evaluator EU via the main memory interface MMI / F, and has function access such as exclusive access and reference count effective in symbol processing operation. I will provide a.
The main memory MM has a structure of 80 bits × 256 Kwords for expressing these control information and a 2-word pointer. The disk system of the workstation WS is used as the secondary storage SM of the data storage STRG.

【0024】図3は、図2のエバリュエータEUにおけ
るシステムコントローラSCの主要部を概念的に示した
構成図である。図3において、1はアドレス・内部状態
退避部、2はアドレス・内部状態復帰部、PCはプログ
ラムカウンタ、FLGは割り込み時の内部状態を示すフ
ラグレジスタ、LVLは同じく割り込み時の内部状態を
示す割り込みレベルレジスタ、SRはサブルーチン呼び
出し命令、AIは割り込み命令、RIは復帰命令デコー
ド出力をそれぞれ示している。
FIG. 3 is a block diagram conceptually showing a main part of the system controller SC in the evaluator EU of FIG. In FIG. 3, 1 is an address / internal state saving unit, 2 is an address / internal state restoring unit, PC is a program counter, FLG is a flag register indicating the internal state at the time of interrupt, and LVL is an interrupt indicating the internal state at the time of interrupt. A level register, SR is a subroutine call instruction, AI is an interrupt instruction, and RI is a return instruction decode output.

【0025】アドレス・内部状態退避部1は、サブルー
チン呼び出し命令を受けると、プログラムカウンタPC
の内容をシスタムスタックSSに所定のフォーマット、
具体的には後記する図4に示すデータフォーマットによ
り退避し、割り込み命令AIを受けると、プログラムカ
ウンタPCの内容に加えて、フラグレジスタFLGと割
り込みレベルレジスタLVLの内容をシスタムスタック
SSに後記する図4に示すデータフォーマットにより退
避する。
When the address / internal state saving section 1 receives a subroutine call instruction, the program counter PC
Format the contents of the Cystam Stack SS,
Specifically, when saved by the data format shown in FIG. 4 to be described later and receiving the interrupt instruction AI, the contents of the flag register FLG and the interrupt level register LVL are added to the system stack SS in addition to the contents of the program counter PC. It is saved according to the data format shown in FIG.

【0026】図4は、アドレス・内部状態退避部1がサ
ブルーチン呼び出し命令および割り込み命令を受けた時
のシステムスタックSSへ保存するデータフォーマット
例を示している。退避データは、図4に示すように、3
2ビットで構成される。0〜15ビット目までの16ビ
ットからなるAフィールドは、復帰アドレス、すなわち
プログラムカウンタPCの値が退避される。16〜18
ビット目までの3ビットからなるFフィールドは、割り
込み時にフラグレジスタFLGに保存される内部状態、
すなわちフラグレジスタFLGの内容が退避される。2
0〜22ビット目までの3ビットからなるLフィールド
は、割り込み時にレベルレジスタLVLに保存される内
部状態、すなわち割り込みレベルレジスタLVLの内容
が退避される。23ビット目の1ビットからなるIフィ
ールドは、フラグレジスタFLGおよび割り込みレベル
レジスタLVLの内容が退避されているか否かを示す。
具体的には、「1」のとき、フラグレジスタFLGおよ
び割り込みレベルレジスタLVLの内容が退避されてい
ることを示し、「0」のとき、フラグレジスタFLGお
よび割り込みレベルレジスタLVLの内容が退避されて
いないことを示す。
FIG. 4 shows an example of a data format stored in the system stack SS when the address / internal state saving unit 1 receives a subroutine call instruction and an interrupt instruction. The saved data is 3 as shown in FIG.
It consists of 2 bits. A return address, that is, the value of the program counter PC is saved in the 16-bit A field of 0th to 15th bits. 16-18
The F field consisting of 3 bits up to the bit is an internal state stored in the flag register FLG at the time of interruption,
That is, the contents of the flag register FLG are saved. Two
In the L field consisting of 3 bits from the 0th to the 22nd bit, the internal state saved in the level register LVL at the time of interrupt, that is, the contents of the interrupt level register LVL is saved. The I field consisting of the 1st bit of the 23rd bit indicates whether or not the contents of the flag register FLG and the interrupt level register LVL have been saved.
Specifically, "1" indicates that the contents of the flag register FLG and interrupt level register LVL have been saved, and "0" indicates that the contents of the flag register FLG and interrupt level register LVL have been saved. Indicates that there is no.

【0027】アドレス・内部状態復帰部2は、復帰命令
のデコード出力RIを受けて、サブルーチン呼び出し時
のシステムスタックSSに退避されている復帰アドレス
としてのプログラムカウンタPCの値、または割り込み
発生時のプログラムカウンタPCの値、フラグレジスタ
FLGおよび割り込みレベルレジスタLVLの内容を読
み出して、プログラムカウンタPC、フラグレジスタF
LGおよび割り込みレベルレジスタLVLに復帰させ
る。
The address / internal state restoration unit 2 receives the decode output RI of the restoration instruction, and the value of the program counter PC as the restoration address saved in the system stack SS at the time of calling the subroutine or the program at the time of the interrupt occurrence. The value of the counter PC, the contents of the flag register FLG and the interrupt level register LVL are read, and the program counter PC and the flag register F are read.
The LG and the interrupt level register LVL are restored.

【0028】図5は、アドレス・内部状態復帰部2の構
成例を示すブロック図である。21は復帰アドレス抽出
回路、22は退避情報検出回路、23は内部状態抽出回
路、24,25はゲートスイッチ、26はアンド回路を
それぞれ示している。復帰アドレス抽出回路21は、シ
ステムスタックSSから読み出された退避データからA
フィールドのデータ、すなわち復帰アドレス(プログラ
ムカウンタPCの値)データを抽出する。退避情報検出
回路22は、システムスタックSSから読み出された退
避データからIフィールドのデータが「1」であるか
「0」であるかを検出し、そのレベルに応じたハイレベ
ル(「1」)またはローレベル(「0」)の信号をアン
ド回路26に出力する。内部状態抽出回路23は、シス
テムスタックSSから読み出された退避データからFフ
ィールドおよびLフィールドのデータ、すなわちに割り
込み時の内部状態データを抽出する。ゲートスイッチ2
4は、復帰命令デコード出力RIをハイレベルで入力す
ると、復帰アドレス抽出回路21により抽出された復帰
アドレスをプログラムカウンタPCにセットさせる。ゲ
ートスイッチ25は、アンド回路26のハイレベル出力
を入力すると、内部状態抽出回路23により抽出された
内部状態データをフラグレジスタFLGおよび割り込み
レベルレジスタLVLにセットさせる。アンド回路26
は、退避情報検出回路22と復帰命令デコード出力RI
との論理積をとり、結果に応じたレベルの信号をゲート
スイッチ25に出力する。
FIG. 5 is a block diagram showing a configuration example of the address / internal state restoration unit 2. Reference numeral 21 is a return address extraction circuit, 22 is a save information detection circuit, 23 is an internal state extraction circuit, 24 and 25 are gate switches, and 26 is an AND circuit. The return address extraction circuit 21 extracts A from the save data read from the system stack SS.
The field data, that is, the return address (value of the program counter PC) data is extracted. The save information detection circuit 22 detects whether the data of the I field is “1” or “0” from the save data read from the system stack SS, and the high level (“1”) corresponding to the level is detected. ) Or a low level (“0”) signal is output to the AND circuit 26. The internal state extraction circuit 23 extracts the data of the F field and the L field, that is, the internal state data at the time of interruption from the saved data read from the system stack SS. Gate switch 2
When the return instruction decode output RI is input at a high level, the reference numeral 4 sets the return address extracted by the return address extracting circuit 21 in the program counter PC. Upon receiving the high level output of the AND circuit 26, the gate switch 25 sets the internal state data extracted by the internal state extracting circuit 23 in the flag register FLG and the interrupt level register LVL. AND circuit 26
Is the save information detection circuit 22 and the return instruction decode output RI.
And a signal having a level corresponding to the result is output to the gate switch 25.

【0029】次に、上記構成によるサブルーチン呼び出
しまたは割り込み時のデータ退避動作並びに復帰命令時
の復帰動作を、図6および図7のフローチャートに基づ
いて説明する。
Next, the data saving operation at the time of a subroutine call or an interrupt and the return operation at the time of a return instruction according to the above configuration will be described with reference to the flowcharts of FIGS. 6 and 7.

【0030】たとえば、図6に示すように、アドレス・
内部状態退避部1にサブルーチン呼び出し命令SRが入
力されると(S1)、アドレス・内部状態退避部1によ
りプログラムカウンタPCの値が取り出され、Aフィー
ルドにその値がセットされるとともに(S2)、Iフィ
ールドが「0」にセットされて(S3)、図5に示す3
2ビットのフォーマットでシステムスタックSSの所定
の領域に格納される(S4)。
For example, as shown in FIG.
When the subroutine call instruction SR is input to the internal state saving unit 1 (S1), the address / internal state saving unit 1 extracts the value of the program counter PC and sets the value in the A field (S2). When the I field is set to "0" (S3), 3 shown in FIG.
It is stored in a predetermined area of the system stack SS in a 2-bit format (S4).

【0031】一方、アドレス・内部状態退避部1に割り
込み命令AIが入力されると(S5)、アドレス・内部
状態退避部1によりプログラムカウンタPCの値が取り
出され、Aフィールドにその値がセットされるとともに
(S6)、フラグレジスタFLGの内容がFフィールド
に、割り込みレベルレジスタLVLの内容がLフィール
ドにそれぞれセットされ(S7,S8)、さらにIフィ
ールドが「1」にセットされて(S9)、図5に示す3
2ビットのフォーマットでシステムスタックSSの所定
の領域に格納される(S4)。
On the other hand, when the interrupt instruction AI is input to the address / internal state saving unit 1 (S5), the address / internal state saving unit 1 extracts the value of the program counter PC and sets the value in the A field. (S6), the contents of the flag register FLG are set in the F field, the contents of the interrupt level register LVL in the L field (S7, S8), and the I field is set to "1" (S9). 3 shown in FIG.
It is stored in a predetermined area of the system stack SS in a 2-bit format (S4).

【0032】ここで、図8に示すように、アドレス・内
部状態復帰部2に復帰命令デコード出力RIがハイレベ
ルで入力されると(S10)、図6の手順でシステムス
タックSSに格納された退避データが読み出される(S
11)。読み出された退避データは、復帰アドレス抽出
回路21、退避情報検出回路22および内部状態抽出回
路23にそれぞれ入力される。
Here, as shown in FIG. 8, when the restore instruction decode output RI is input at a high level to the address / internal state restoring unit 2 (S10), it is stored in the system stack SS by the procedure of FIG. The saved data is read (S
11). The read save data is input to the return address extraction circuit 21, the save information detection circuit 22, and the internal state extraction circuit 23, respectively.

【0033】復帰アドレス抽出回路21では、システム
スタックSSから読み出された退避データからAフィー
ルドのデータ、すなわち復帰アドレス(プログラムカウ
ンタPCの値)データが抽出される(S12)。このと
き、ゲートスイッチ24にはハイレベルの復帰命令デコ
ード出力RIが入力され、ゲートスイッチ24は開状態
にあるため、抽出された復帰アドレスがプログラムカウ
ンタPCにセットされる(S13)。
The return address extraction circuit 21 extracts the A field data, that is, the return address (the value of the program counter PC) data from the save data read from the system stack SS (S12). At this time, the high-level return instruction decode output RI is input to the gate switch 24 and the gate switch 24 is in the open state, so the extracted return address is set in the program counter PC (S13).

【0034】退避情報検出回路22では、読み出された
退避データからIフィールドのデータが「1」であるか
「0」であるかが検出され、そのレベルに応じたハイレ
ベル(「1」)またはローレベル(「0」)の信号がア
ンド回路26に出力される(S14)。Iフィールドの
値が「1」の場合、アンド回路26の出力はハイレベル
で、Iフィールドの値が「0」の場合、アンド回路26
の出力はローレベルでゲートスイッチ26に入力され
る。ゲートスイッチ26は、アンド回路26の出力をハ
イレベルで入力すると開状態となり、ローレベルで入力
すると閉状態を保持する。このとき、内部状態抽出回路
23では、読み出された退避データからFフィールドお
よびLフィールドのデータが抽出される(S15)。F
フィールドおよびLフィールドのデータの抽出の際、I
フィールドの値が「0」の場合には(S16)、サブル
ーチンの復帰命令であり、読み出した退避データに内部
状態データが退避されていないものと判断して、Fおよ
びLフィールドの内容のフラグレジスタFLGおよび割
り込みレベルレジスタLVLへのセット動作は行われな
い(S17)。一方、Iフィールドの値が「1」の場合
には(S16)、割り込みの復帰命令であり、読み出し
た退避データに内部状態データが退避されているものと
判断して、抽出したFおよびLフィールドの内容が、フ
ラグレジスタFLGおよび割り込みレベルレジスタにそ
れぞれセットされる(S18,S19)。
The save information detection circuit 22 detects whether the data in the I field is "1" or "0" from the read save data, and the high level ("1") corresponding to the level is detected. Alternatively, a low level (“0”) signal is output to the AND circuit 26 (S14). When the value of the I field is "1", the output of the AND circuit 26 is high level, and when the value of the I field is "0", the AND circuit 26 is high.
Is output to the gate switch 26 at a low level. The gate switch 26 is opened when the output of the AND circuit 26 is input at a high level, and is kept closed when input at a low level. At this time, the internal state extraction circuit 23 extracts the F field data and the L field data from the read save data (S15). F
When extracting the data of the field and L field, I
When the value of the field is "0" (S16), it is a return instruction of the subroutine, and it is determined that the internal state data is not saved in the read save data, and the flag register of the contents of the F and L fields. The FLG and the interrupt level register LVL are not set (S17). On the other hand, when the value of the I field is “1” (S16), it is an interrupt return instruction, and it is determined that the internal state data is saved in the read save data, and the extracted F and L fields are extracted. Is set in the flag register FLG and the interrupt level register (S18, S19).

【0035】以上説明したように、本実施例によれば、
通常のサブルーチン呼び出し命令で退避されるアドレス
データ(プログラムカウンタPCの値)に加えて、割り
込み時に退避される計算機の内部状態データを、通常の
サブルーチン呼び出しで退避されているアドレスデータ
とセットにして、所定のフォーマットで格納し、かつそ
の格納の際にその退避データがサブルーチン呼び出し命
令によるものか割り込みによるものかを識別するコード
を付して退避し、復帰時にはその識別コードの値により
両者の識別を行って、データの復帰を行うようにしたの
で、単一の復帰命令によりサブルーチンからの復帰およ
び割り込みからの復帰を実現できる。その結果、命令の
種類を減少でき、命令デコード回路の簡単化並びに命令
後に要するメモリサイズの削減を図れる利点がある。
As described above, according to this embodiment,
In addition to the address data (the value of the program counter PC) saved by a normal subroutine call instruction, the internal state data of the computer saved at the time of an interrupt is set with the address data saved by a normal subroutine call, Stored in a predetermined format, and at the time of storing, save with a code that identifies whether the saved data is due to a subroutine call instruction or an interrupt, and at the time of restoration, identify both by the value of the identification code. Since the data is restored by doing so, the restoration from the subroutine and the restoration from the interrupt can be realized by a single restoration instruction. As a result, there are advantages that the number of types of instructions can be reduced, the instruction decoding circuit can be simplified, and the memory size required after the instruction can be reduced.

【0036】[0036]

【発明の効果】以上説明したように、本発明によれば、
命令の種類を減少でき、命令デコード回路の簡単化並び
に命令後に要するメモリサイズの削減を図れる。
As described above, according to the present invention,
The number of instructions can be reduced, the instruction decoding circuit can be simplified, and the memory size required after the instruction can be reduced.

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

【図1】本発明が適用されるコンピュータシステムの構
成図である。
FIG. 1 is a configuration diagram of a computer system to which the present invention is applied.

【図2】本発明に係るプロセッシングエレメントの構成
例を示す図である。
FIG. 2 is a diagram showing a configuration example of a processing element according to the present invention.

【図3】図2のエバリュエータEUにおけるシステムコ
ントローラの主要部を概念的に示した構成図である。
3 is a configuration diagram conceptually showing a main part of a system controller in the evaluator EU of FIG.

【図4】本発明に係るアドレス・内部状態退避部がサブ
ルーチン呼び出し命令および割り込み命令を受けた時の
システムスタックへ保存するデータフォーマット例を示
す図である。
FIG. 4 is a diagram showing an example of a data format stored in a system stack when an address / internal state saving unit according to the present invention receives a subroutine call instruction and an interrupt instruction.

【図5】本発明に係るアドレス・内部状態復帰部の構成
例を示すブロック図である。
FIG. 5 is a block diagram showing a configuration example of an address / internal state restoration unit according to the present invention.

【図6】本発明に係るアドレスデータ・内部状態データ
の退避動作を説明するためのフローチャートである。
FIG. 6 is a flowchart for explaining an operation of saving address data and internal state data according to the present invention.

【図7】本発明に係るアドレスデータ・内部状態データ
の復帰動作を説明するためのフローチャートである。
FIG. 7 is a flowchart for explaining a restoring operation of address data / internal state data according to the present invention.

【符号の説明】[Explanation of symbols]

PE…プロセッシングエレメント EU…エバリュエータ RSC…リソース RM…リソースマネージャ STRG…データストレージ IRG…結合部 PC…プログラムカウンタ FLG…フラグレジスタ LVL…割り込みレベルレジスタ 1…アドレス・内部状態退避部 2…アドレス・内部状態復帰部 21…復帰アドレス抽出回路 22…退避情報検出回路 23…内部状態抽出回路 24,25…ゲートスイッチ 26…アンド回路 PE ... Processing element EU ... Evaluator RSC ... Resource RM ... Resource manager STRG ... Data storage IRG ... Coupling unit PC ... Program counter FLG ... Flag register LVL ... Interrupt level register 1 ... Address / internal state saving unit 2 ... Address / internal state restoration Part 21 ... Return address extraction circuit 22 ... Save information detection circuit 23 ... Internal state extraction circuit 24, 25 ... Gate switch 26 ... AND circuit

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 サブルーチンの入力時にサブルーチンか
らの入力を識別するコードと必要な動作状態データとを
退避させる手段と、 割り込みの入力時に割り込みからの入力を識別するコー
ドと必要な動作状態データとを退避させる手段と、 同じ復帰命令を受けて退避データを読み出し、識別コー
ドに応じてサブルーチンまたは割り込みから復帰させる
手段とを有することを特徴とするディジタル計算機。
1. A means for saving a code for identifying an input from the subroutine and a necessary operation state data at the time of inputting the subroutine, and a code for identifying an input from the interrupt at the time of inputting an interrupt and the necessary operation state data. A digital computer comprising means for saving and means for receiving the same return instruction, reading out the saved data, and returning from a subroutine or interrupt according to an identification code.
【請求項2】 サブルーチンの入力時に退避させる動作
状態データと割り込みの入力時に退避させる動作状態デ
ータとを同じデータフォーマットとし、かつこれら動作
状態データに、サブルーチンからの入力および割り込み
からの入力のうちのいずれの入力であるかを識別するた
めのコードを付加して退避させる手段を有する請求項1
記載のディジタル計算機。
2. The same data format is used for the operation state data saved at the time of inputting a subroutine and the operation state data saved at the time of inputting an interrupt, and these operation state data have the same format as the input from the subroutine and the input from the interrupt. 2. A means for adding a code for identifying which input is input and saving the input.
The described digital computer.
【請求項3】 記憶手段と、 サブルーチンの入力時には、プログラムカウンタの内容
をアドレスデータとして、割り込みの入力時には、プロ
グラムカウンタの内容をアドレスデータとするととも
に、フラグレジスタおよび割り込みレベルレジスタの内
容を内部状態データとし、かつ、これらデータに退避動
作の要因となった入力命令を識別するためのコードを付
して上記記憶手段に退避させる手段とを有する請求項1
または請求項2記載のディジタル計算機。
3. The storage means and the contents of the program counter are used as address data when the subroutine is input, the contents of the program counter are used as the address data when the interrupt is input, and the contents of the flag register and the interrupt level register are set as internal states. 2. A means for saving the data as data, and adding a code for identifying the input instruction that causes the save operation to the data and saving the data in the storage means.
Alternatively, the digital computer according to claim 2.
【請求項4】 復帰命令を受けて上記記憶手段の退避デ
ータを読み出し、読み出し退避データからアドレスデー
タを抽出してプログラムカウンタにセットする手段と、 読み出し退避データから識別コードを検出し、退避デー
タが割り込み時のデータの場合に、内部状態データを抽
出してフラグレジスタおよび割り込みレベルレジスタに
セットする手段とを有する請求項1,2または3記載の
ディジタル計算機。
4. A means for receiving the return instruction, reading the save data from the storage means, extracting address data from the read save data and setting it in the program counter, and detecting the identification code from the read save data, saving the save data. 4. The digital computer according to claim 1, further comprising means for extracting internal state data and setting it in a flag register and an interrupt level register in the case of interrupt data.
【請求項5】 サブルーチンの入力時にサブルーチンか
らの入力を識別するコードと必要な動作状態データとを
保存し、 割り込みの入力時に割り込みからの入力を識別するコー
ドと必要な動作状態データとを保存し、 同じ復帰命令を用いてサブルーチンまたは割り込みから
復帰させることを特徴とするプログラム復帰方法。
5. A code for identifying the input from the subroutine and the necessary operating state data are stored when the subroutine is input, and a code for identifying the input from the interrupt and the required operating state data are stored when the interrupt is input. , A program recovery method characterized in that the same recovery instruction is used to recover from a subroutine or interrupt.
JP17760992A 1992-06-11 1992-06-11 Digital computer and program restoring method Pending JPH05341996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17760992A JPH05341996A (en) 1992-06-11 1992-06-11 Digital computer and program restoring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17760992A JPH05341996A (en) 1992-06-11 1992-06-11 Digital computer and program restoring method

Publications (1)

Publication Number Publication Date
JPH05341996A true JPH05341996A (en) 1993-12-24

Family

ID=16034001

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17760992A Pending JPH05341996A (en) 1992-06-11 1992-06-11 Digital computer and program restoring method

Country Status (1)

Country Link
JP (1) JPH05341996A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008535072A (en) * 2005-03-30 2008-08-28 アーム・リミテッド Selective subroutine return structure
JP2013233294A (en) * 2012-05-09 2013-11-21 Sophia Co Ltd Game machine

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008535072A (en) * 2005-03-30 2008-08-28 アーム・リミテッド Selective subroutine return structure
JP4703718B2 (en) * 2005-03-30 2011-06-15 アーム・リミテッド Selective subroutine return structure
KR101249693B1 (en) * 2005-03-30 2013-04-05 에이알엠 리미티드 Selecting subroutine return mechanisms
JP2013233294A (en) * 2012-05-09 2013-11-21 Sophia Co Ltd Game machine

Similar Documents

Publication Publication Date Title
US5345567A (en) System and method for modifying program status word system mask, system access key, and address space code with overlap enabled
US5748951A (en) Specialized millicode instructions which reduce cycle time and number of instructions necessary to perform complex operations
US5596733A (en) System for exception recovery using a conditional substitution instruction which inserts a replacement result in the destination of the excepting instruction
US6216222B1 (en) Handling exceptions in a pipelined data processing apparatus
US8347066B2 (en) Replay instruction morphing
KR0133237B1 (en) Backout logic for dual execution unit processor
CN111133418A (en) Allowing non-aborted transactions after an exception mask update instruction
US6243786B1 (en) Apparatus and method for generating an interrupt prohibited zone in pipelined data processors
JPH06309178A (en) Method and computer system for processing interruption by interruption processing cord
US5463778A (en) User controlled trap handler
US5819078A (en) Addressing extended memory using millicode by concatenating a small millicode address and address extension data
US5812813A (en) Apparatus and method for of register changes during execution of a micro instruction tracking sequence
US5327567A (en) Method and system for returning emulated results from a trap handler
JPH05341996A (en) Digital computer and program restoring method
US5673391A (en) Hardware retry trap for millicoded processor
JP2001519954A (en) A host microprocessor having a device for temporarily maintaining the state of a target processor
US5621909A (en) Specialized millicode instruction for range checking
KR19990082750A (en) Millicode flags with specialized update and branch instruction
KR102379886B1 (en) Vector instruction processing
US5754810A (en) Specialized millicode instruction for certain decimal operations
US6662296B1 (en) Method and system for testing millicode branch points
JP2557629B2 (en) Interrupt method
CN117555555B (en) Exception processing method, device, electronic equipment and storage medium
US12008372B2 (en) Techniques for reducing CPU privilege boundary crossings
US7243214B2 (en) Stall optimization for an in-order, multi-stage processor pipeline which analyzes current and next instructions to determine if a stall is necessary