JP2008225710A - Computer system and process-switching method used in the system - Google Patents

Computer system and process-switching method used in the system Download PDF

Info

Publication number
JP2008225710A
JP2008225710A JP2007061114A JP2007061114A JP2008225710A JP 2008225710 A JP2008225710 A JP 2008225710A JP 2007061114 A JP2007061114 A JP 2007061114A JP 2007061114 A JP2007061114 A JP 2007061114A JP 2008225710 A JP2008225710 A JP 2008225710A
Authority
JP
Japan
Prior art keywords
register
register set
memory
computer system
sets
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
JP2007061114A
Other languages
Japanese (ja)
Inventor
Yoshiaki Sawada
佳明 澤田
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2007061114A priority Critical patent/JP2008225710A/en
Publication of JP2008225710A publication Critical patent/JP2008225710A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To reduce overhead by holding multiple sets of registers in a CPU and executing retreating and recovering processing to a memory at a necessary minimum, even when a process is switched. <P>SOLUTION: A computation control part 4A refers to storage areas 712, 722, etc., at the final use time set in register sets by using a CPU operation mode flag 41A, a register set-selecting means 42 and a process space-computing means 43 when a process to be executed, among a plurality of processes which are deployed for each process space 31, 32, etc., in a memory 3, does not use any of the register sets 71, 72, etc. Then, the computation control part 4A stores the storage contents of the register set, which is earliest in the final use time among the plurality of register sets, in the corresponding register retreating areas 311, 322, etc., in the memory 3, releases the register set and executes the process to be executed by using the released register set. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

この発明は、コンピュータシステム及び該システムで用いられるプロセス切替え方法に係り、詳しくは、複数のレジスタセットを備える(組込みシステムを含む)コンピュータシステム及び該システムで用いられるプロセス切替え方法に関する。   The present invention relates to a computer system and a process switching method used in the system, and more particularly to a computer system (including an embedded system) having a plurality of register sets and a process switching method used in the system.

この種のレジスタセットは、CPU(中央演算処理装置)の内部にあって、制御部によって処理される入出力データや、演算部の計算結果を一時記憶するための記憶装置であり、例えば、データレジスタやアドレスレジスタ等の汎用レジスタとプログラムカウンタやインデッククスレジスタ等の専用レジスタとの組からなっている。
ところで、従来の(組込みシステムを含む)コンピュータシステムでは、(同一プログラム内で関数コール呼び出し時の効率化を図ることを目的とするものを除けば、)レジスタセットは1セットのみしか保持しておらず、このため、マルチタスクOS(オペレーティング・システム)でのプログラムの処理単位としてのプロセスの切替えや、特権モード・非特権モード゛の切替えの度にレジスタの内容をメモリ(主記憶装置)に格納(退避)したり、あるいは、メモリの内容をレジスタに復帰(回復)させる処理が必要となるため、その分、本来の処理やデータ転送もそれだけ遅くなるので問題となっていた。
This type of register set is a storage device inside the CPU (Central Processing Unit) for temporarily storing input / output data processed by the control unit and calculation results of the calculation unit. It consists of a set of general-purpose registers such as registers and address registers and dedicated registers such as program counters and index registers.
By the way, in a conventional computer system (including an embedded system), only one register set is held (except for the purpose of improving the efficiency at the time of calling a function call in the same program). Therefore, the contents of the register are stored in the memory (main storage device) each time the process is switched as a program processing unit in the multitasking OS (operating system) or the privileged mode / non-privileged mode is switched. Since processing for saving (saving) or restoring (restoring) the contents of the memory to the register is necessary, the original processing and data transfer are delayed accordingly, which is a problem.

そこで、この種のプロセス切替え時のオーバヘッド(システム全体の負荷)を削減するために、例えば、特許文献1に記載の管理装置、特許文献2に記載のオペレーティング・システムの処理方式及び特許文献3に記載の中央処理装置が提供されている。   Therefore, in order to reduce this type of process switching overhead (overall system load), for example, the management apparatus described in Patent Document 1, the operating system processing method described in Patent Document 2, and Patent Document 3 The described central processing unit is provided.

特許文献1の管理装置では、1セットの汎用レジスタ群を備え、プログラムが使用した汎用レジスタの内容のみをメモリ(主記憶装置)に退避したり、メモリの内容をレジスタに復帰させることで、退避処理及び復帰処理を少なくして、オーバヘッドを削減するようにしている。   The management device of Patent Document 1 includes a set of general-purpose registers, and saves only the contents of the general-purpose registers used by the program to the memory (main storage device) or restores the contents of the memory to the registers. Processing and return processing are reduced to reduce overhead.

また、特許文献2に記載のオペレーティング・システムの処理方式では、プロセッサの持つレジスタウインドウ制御機構、もしくは類似した機構を操作し、アプリケーションソフトウェアのスレッドが一部の汎用レジスタを使用できないことにすることにより、スレッド間のコンテキストスイッチにおいて、退避、復帰するレジスタ数を少なくし、コンテキストスイッチのオーバヘッド時間を短縮するようにしている。   In addition, in the operating system processing method described in Patent Document 2, by operating the register window control mechanism of the processor or a similar mechanism, the application software thread cannot use some general-purpose registers. In the context switch between threads, the number of registers to be saved and restored is reduced, and the overhead time of the context switch is shortened.

特許文献3に記載の中央処理装置は、命令処理装置とメモリ(主記憶装置)と、複数のレジスタ群とから構成され、複数のプログラムの内容をそれぞれ個別のレジスタ群に保持して時分割処理を実行することで、プロセスの切替え時、レジスタ群に保存した内容をメモリに退避したり、メモリの内容をレジスタに復帰させる処理をなくし、これにより、中央処理装置の処理効率の向上を図るようにしている。
特開2004−021610号公報 特開2000−242505号公報 実開平06−15138号公報
The central processing unit described in Patent Document 3 includes an instruction processing device, a memory (main storage device), and a plurality of register groups. The contents of a plurality of programs are held in individual register groups, and time-division processing is performed. When the process is switched, the process of saving the contents saved in the register group to the memory or restoring the contents of the memory to the register is eliminated, thereby improving the processing efficiency of the central processing unit. I have to.
JP 2004-021610 A JP 2000-242505 A Japanese Utility Model Publication No. 06-15138

しかしながら、特許文献1の管理装置では、基本的に1セットの汎用レジスタ群しか設置されていないので、同時に実行可能なプロセスの数が増加した場合には、オーバヘッドの削減はそれほど期待できないので、不都合である。加えて、特許文献2に記載のオペレーティング・システムの処理方式では、アプリケーションソフトウェアのスレッドが一部の汎用レジスタを使用できない構成なので、ユーザプロセスの増加には対応できない、という不具合がある。   However, since the management apparatus of Patent Document 1 basically has only one set of general-purpose register groups, if the number of processes that can be executed simultaneously increases, the overhead cannot be reduced so much. It is. In addition, the operating system processing method described in Patent Document 2 has a problem that it cannot cope with an increase in user processes because the application software thread cannot use some general-purpose registers.

また、特許文献3の中央処理装置では、複数のレジスタ群が設けられているので、特許文献1や特許文献2の技術に較べれば、オーバヘッドの削減を期待できるものの、同時に実行可能なプロセスの数が、レジスタ群の設置数に制限されるので、同時に実行すべきプロセス数が、レジスタ群の設置数を超えるときは、マルチタスク制御が不可能又は混乱するので、不具合である。   Since the central processing unit of Patent Document 3 is provided with a plurality of register groups, the number of processes that can be executed simultaneously can be expected although a reduction in overhead can be expected as compared with the techniques of Patent Document 1 and Patent Document 2. However, since the number of register groups is limited, when the number of processes to be executed simultaneously exceeds the number of register groups, multitask control is impossible or confused, which is a problem.

この発明は、上述の事情に鑑みてなされたもので、レジスタセットの設置数の範囲であれば、プロセス切替え時のオーバヘッドを確実に削減できると共に、同時に実行すべきプロセス数が、レジスタセットの設置数を超えるときでも、円滑にマルチタスク制御ができるコンピュータシステム及び該システムで用いられるプロセス切替え方法を提供することを目的としている。   The present invention has been made in view of the above circumstances. If the number of register sets is within the range, the overhead at the time of process switching can be surely reduced, and the number of processes to be executed at the same time can be reduced. It is an object of the present invention to provide a computer system capable of smoothly performing multitask control even when the number exceeds, and a process switching method used in the system.

上記課題を解決するために、請求項1記載の発明は、複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えるコンピュータシステムにおけるプロセス切替え方法に係り、前記制御部が、前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、いずれか一のレジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行することを特徴としている。   In order to solve the above problem, the invention according to claim 1 is directly connected to a plurality of register sets each including a plurality of registers as a set, a memory for storing a user program and data, and the register set and the memory. The present invention relates to a process switching method in a computer system including a control unit that controls these, wherein the control unit sets a plurality of process spaces in the memory, sets a register save area for each process space, and A plurality of register sets are used for each process (processing unit of user program) to execute each process in parallel with switching, and a plurality of processes developed for each process space of the memory When the process to be executed does not use any register set, The stored contents of one of the register sets is stored in the corresponding register save area in the memory and the register set is released, and then the process to be executed using the released register set is performed. It is characterized by executing.

請求項2記載の発明は、複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えるコンピュータシステムにおけるプロセス切替え方法に係り、前記制御部が、前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、前記複数のレジスタセットのうち、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行することを特徴としている。   The invention according to claim 2 includes a plurality of register sets including a plurality of registers as a set, a memory for storing a user program and data, and a control unit that is directly connected to and controls the register set and the memory. According to a process switching method in a computer system, the control unit sets a plurality of process spaces in the memory, sets a register save area for each process space, and sets the plurality of register sets to a process ( Each process used for each user program processing unit) is executed in parallel with switching, and a process to be executed among a plurality of processes developed for each process space of the memory. However, when none of the register sets are used, the plurality of register sets In other words, the storage contents of the register set having the longest non-use period (or the oldest last use time) are stored in the corresponding register save area in the memory and the register set is released, and then the released register set The process to be executed is executed using a register set.

請求項3記載の発明は、請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記レジスタセットが、複数の汎用レジスタを備えてなることを特徴としている。   A third aspect of the present invention relates to a process switching method in the computer system according to the first or second aspect, wherein the register set includes a plurality of general purpose registers.

また、請求項4記載の発明は、請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記レジスタセットが、多目的に利用できる複数の汎用レジスタと、特別の目的で利用する単数又は複数の専用レジスタとを備えてなることを特徴としている。   The invention according to claim 4 relates to a process switching method in the computer system according to claim 1 or 2, wherein the register set has a plurality of general-purpose registers that can be used for multiple purposes and a single or a plurality of registers that are used for special purposes. And a dedicated register.

また、請求項5記載の発明は、請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記制御部が、どのレジスタセットを選択して前記プロセスを実行させるかを決定するレジスタセット選択機能と、実行されるプロセス毎にユニークに付与されるプロセスIDに基づいて、当該プロセスIDによって識別される前記プロセス空間が前記メモリ上のどのアドレスに格納されているかを決定するプロセス空間計算機能とを備えていることを特徴としている。   The invention according to claim 5 relates to a process switching method in the computer system according to claim 1 or 2, wherein the control unit determines which register set is selected to execute the process. And a process space calculation function for determining in which address on the memory the process space identified by the process ID is stored based on a process ID uniquely assigned to each process to be executed It is characterized by having.

また、請求項6記載の発明は、請求項1又は5記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記各レジスタセットが、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域とを有していることを特徴としている。   The invention according to claim 6 relates to a process switching method in the computer system according to claim 1 or 5, wherein each register set stores a final process ID for storing a process ID that last used the register set. And a storage area.

また、請求項7記載の発明は、請求項2、3、4又は5記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記各レジスタセットが、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域と、当該レジスタセットを使用し終わった直後の時刻を格納するための最終使用時刻記憶領域とを有し、前記制御部は、前記最終使用時刻記憶領域に格納されている前記直後の時刻を参照して、どのレジスタセットが、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットであるかを判断することを特徴としている。   The invention according to claim 7 relates to a process switching method in a computer system according to claim 2, 3, 4 or 5, in which each register set stores a process ID that last used the register set. The last process ID storage area and a last use time storage area for storing the time immediately after the use of the register set is completed, and the control unit is stored in the last use time storage area Referring to the time immediately after the above, it is characterized in determining which register set is the register set having the longest non-use period (or the oldest last use time).

また、請求項8記載の発明は、請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記メモリ内には、前記レジスタセットの個数よりも多い個数の前記プロセス空間が設定されることを特徴としている。   The invention according to claim 8 relates to a process switching method in the computer system according to claim 1 or 2, wherein a larger number of the process spaces than the number of the register sets are set in the memory. It is characterized by.

また、請求項9記載の発明は、請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記制御部が、所定のプロセスについては、複数の前記レジスタセットを使用して当該所定のプロセスを実行することを特徴としている。   The invention according to claim 9 relates to a process switching method in the computer system according to claim 1 or 2, wherein the control unit uses a plurality of the register sets for the predetermined process. It is characterized by performing.

また、請求項10記載の発明は、請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法に係り、前記制御部が、所定のプロセスについては、実行可能モジュールに格納された使用レジスタセット数に基づいて、複数の前記レジスタセットを選択し使用して当該所定のプロセスを実行することを特徴としている。   The invention according to claim 10 relates to a process switching method in the computer system according to claim 1 or 2, wherein the control unit, for a predetermined process, is based on the number of used register sets stored in the executable module. The predetermined process is executed by selecting and using a plurality of register sets.

また、請求項11記載の発明は、複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えると共に、プロセスを切替える機能を備えるコンピュータシステムに係り、前記制御部が、前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、いずれか一のレジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行する構成になされている、ことを特徴としている。   The invention according to claim 11 is a plurality of register sets including a plurality of registers as a set, a memory for storing a user program and data, and a control unit that is directly connected to and controls the register set and the memory. The control unit sets a plurality of process spaces in the memory, sets a register save area for each process space, and A register set is used for each process (processing unit of the user program), and each process is executed in parallel with switching, and among the plurality of processes developed for each process space of the memory If the process you are trying to run does not use any of the register sets, After storing the stored contents of one register set in the corresponding register save area in the memory and releasing the register set, the process to be executed is executed using the released register set. It is characterized by being composed.

また、請求項12記載の発明は、複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えると共に、プロセスを切替える機能を備えるコンピュータシステムに係り、前記制御部が、前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、前記複数のレジスタセットのうち、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行する構成になされている、ことを特徴としている。   According to a twelfth aspect of the present invention, a plurality of register sets including a plurality of registers as a set, a memory for storing a user program and data, and a control unit that is directly connected to and controls the register set and the memory The control unit sets a plurality of process spaces in the memory, sets a register save area for each process space, and A register set is used for each process (processing unit of the user program), and each process is executed in parallel with switching, and among the plurality of processes developed for each process space of the memory When the process to be executed does not use any register set, After storing the stored contents of the register set having the longest non-use period (or the oldest last use time) in the corresponding register save area in the memory and releasing the register set, It is characterized in that the process to be executed is executed using the released register set.

また、請求項13記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記レジスタセットが、複数の汎用レジスタを備えてなることを特徴としている。   A thirteenth aspect of the invention relates to the computer system of the eleventh or twelfth aspect, wherein the register set includes a plurality of general purpose registers.

また、請求項14記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記レジスタセットが、多目的に利用できる複数の汎用レジスタと、特別の目的で利用する単数又は複数の専用レジスタとを備えてなることを特徴としている。   The invention according to claim 14 relates to the computer system according to claim 11 or 12, wherein the register set includes a plurality of general-purpose registers that can be used for various purposes, and a single or a plurality of dedicated registers that are used for special purposes. It is characterized by comprising.

また、請求項15記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記制御部が、どのレジスタセットを選択して前記プロセスを実行させるかを決定するレジスタセット選択手段と、実行されるプロセス毎にユニークに付与されるプロセスIDに基づいて、当該プロセスIDによって識別される前記プロセス空間が前記メモリ上のどのアドレスに格納されているかを決定するプロセス空間計算手段とを備えていることを特徴としている。   The invention according to claim 15 relates to the computer system according to claim 11 or 12, wherein the control unit determines which register set is selected to execute the process, and execution. And a process space calculation means for determining in which address on the memory the process space identified by the process ID is stored based on a process ID uniquely assigned to each process. It is characterized by that.

また、請求項16記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記各レジスタセットが、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域とを有していることを特徴としている。   The invention according to claim 16 relates to the computer system according to claim 11 or 12, wherein each of the register sets has a final process ID storage area for storing a process ID that last used the register set. It is characterized by having.

また、請求項17記載の発明は、請求項12、13、14又は15記載のコンピュータシステムに係り、前記各レジスタセットが、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域と、当該レジスタセットを使用し終わった直後の時刻を格納するための最終使用時刻記憶領域とを有し、前記制御部は、前記最終使用時刻記憶領域に格納されている前記直後の時刻を参照して、どのレジスタセットが、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットであるかを判断することを特徴としている。   The invention according to claim 17 relates to the computer system according to claim 12, 13, 14 or 15, wherein each of the register sets stores a final process ID for storing a process ID that last used the register set. A storage area and a last use time storage area for storing a time immediately after the use of the register set is completed, and the control unit stores the time immediately after the last use time storage area. , It is characterized in that it is determined which register set is the register set having the longest non-use period (or the oldest last use time).

また、請求項18記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記メモリ内には、前記レジスタセットの個数よりも多い個数の前記プロセス空間が設定されていることを特徴としている。   The invention according to claim 18 relates to the computer system according to claim 11 or 12, characterized in that a larger number of the process spaces than the number of the register sets are set in the memory. Yes.

また、請求項19記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記制御部が、所定のプロセスについては、複数の前記レジスタセットを使用して当該所定のプロセスを実行することを特徴としている。   The invention according to claim 19 relates to the computer system according to claim 11 or 12, wherein, for the predetermined process, the control unit executes the predetermined process using a plurality of the register sets. It is characterized by.

また、請求項20記載の発明は、請求項11又は12記載のコンピュータシステムに係り、前記制御部が、所定のプロセスについては、実行可能モジュールに格納された使用レジスタセット数に基づいて、複数の前記レジスタセットを選択し使用して当該所定のプロセスを実行することを特徴としている。   The invention according to claim 20 relates to the computer system according to claim 11 or 12, wherein the control unit, for a predetermined process, uses a plurality of register sets based on the number of used register sets stored in the executable module. The predetermined process is executed by selecting and using the register set.

また、請求項21記載の発明は、請求項19又は21記載のコンピュータシステムに係り、前記所定のプロセスを実行する際に使用される前記レジスタセットの個数を格納するレジスタセット数記憶領域が付加されていることを特徴としている。   The invention according to claim 21 relates to the computer system according to claim 19 or 21, wherein a register set number storage area for storing the number of register sets used when executing the predetermined process is added. It is characterized by having.

この例の構成によれば、複数のレジスタセットを備え、前記レジスタセットの設置数の範囲であれば、前記複数のレジスタセットをプロセス毎に使用して、切替えを交えて、各プロセスを併行して実行できるので、プロセス切替え時のオーバヘッドを確実に削減できると共に、同時に実行すべきプロセス数が、レジスタセットの設置数を超えるときでも、いずれか一のレジスタセットの記憶内容を、メモリ内の対応するレジスタ退避エリアに格納して当該レジスタセットを開放し、開放された当該レジスタセットを使用できるようにしたので、円滑にマルチタスク制御を実施できる。   According to the configuration of this example, a plurality of register sets are provided, and if the number of the register sets is within the range, the plurality of register sets are used for each process, and each process is performed concurrently with switching. As a result, the overhead during process switching can be reliably reduced, and even if the number of processes to be executed simultaneously exceeds the number of installed register sets, the stored contents of one of the register sets can be handled in the memory. Since the register set is released by being stored in the register saving area to be used and the released register set can be used, multitask control can be performed smoothly.

CPUは、複数のレジスタセットを備えている。演算制御部4Aは、プロセス(ユーザプログラムの処理単位)毎に各レジスタセットを使用し、プロセスを時分割で切替えて、各プロセスを併行して実行する。メモリ内には、レジスタセットの個数よりも多い個数のプロセス空間が設定されている。   The CPU includes a plurality of register sets. The arithmetic control unit 4A uses each register set for each process (user program processing unit), switches the processes in a time-sharing manner, and executes the processes in parallel. A larger number of process spaces than the number of register sets are set in the memory.

図1は、この発明の第1実施例であるコンピュータシステムの要部構成を示す電気的ブロック図、また、図2は、同第1実施例であるコンピュータシステムの要部構成(以下、コンピュータ本体ともいう)をより詳細に示す電気的ブロック図である。
この例のコンピュータ本体は、図1に示すように、プログラム制御によるマルチタスク切替えにより、複数のプロセス(ユーザプログラムの処理単位)を併行して実行するとCPU(中央演算処理装置)1と、システムタイマ2と、CPU1Aが直接アクセスできるROMやRAM等のメモリ(主記憶装置)3とから概略構成されている。
FIG. 1 is an electrical block diagram showing a main part configuration of a computer system according to a first embodiment of the present invention. FIG. 2 shows a main part configuration of the computer system according to the first embodiment (hereinafter referred to as a computer main body). It is also an electrical block diagram showing in more detail.
As shown in FIG. 1, the computer main body of this example has a CPU (central processing unit) 1 and a system timer when a plurality of processes (user program processing units) are executed in parallel by multitask switching by program control. 2 and a memory (main storage device) 3 such as a ROM or a RAM that can be directly accessed by the CPU 1A.

上記CPU1Aは、同図に示すように、命令解釈、制御信号の生成及び論理演算を行う演算制御部4Aと、該演算制御部4Aに直結されて、演算結果や入出力データを一時記憶しておくためのレジスタ部5とから概略構成されている。   As shown in the figure, the CPU 1A is directly connected to an arithmetic control unit 4A for interpreting instructions, generating control signals and performing logical operations, and temporarily storing arithmetic results and input / output data. And a register unit 5 for storing.

上記レジスタ部5は、図2に示すように、オペレーティングシステム(OS)やシステム運用管理プログラム等の特別な権限を持ったプログラムが実行されるときに使用される特権モード用レジスタ部6と、プロセス(マルチタスクOSでのプログラムの処理単位)が実行されるときに使用され、かつ、オーバヘッド削減のために、複数のレジスタセットを備える非特権モード用レジスタ部7とからなっている。   As shown in FIG. 2, the register unit 5 includes a privilege mode register unit 6 used when a program having special authority such as an operating system (OS) or a system operation management program is executed, and a process. The non-privileged mode register unit 7 includes a plurality of register sets that are used when a (processing unit of a program in a multitasking OS) is executed and reduce overhead.

上記非特権モード用レジスタ部7は、図2に示すように、複数のレジスタセット(この例では、4つのレジスタセット)71、72、73、74を保持し、さらに、「最終プロセスID」記憶領域711、721、731、741と、「最終使用時刻」記憶領域712、722、732、742とが付加されている。   As shown in FIG. 2, the non-privileged mode register unit 7 holds a plurality of register sets (four register sets in this example) 71, 72, 73, 74, and further stores a “final process ID”. Areas 711, 721, 731, and 741 and “last use time” storage areas 712, 722, 732, and 742 are added.

各レジスタセット71、72、73、74は、フリップ・フロップ回路からなる複数のレジスタ、例えば、データレジスタやアドレスレジスタ等の複数の汎用レジスタとプログラムカウンタやステイタスレジスタやインデッククスレジスタ等の複数の専用レジスタとの組からなっている。   Each register set 71, 72, 73, 74 has a plurality of registers composed of flip-flop circuits, for example, a plurality of general purpose registers such as a data register and an address register, and a plurality of dedicated registers such as a program counter, a status register, and an index register. It consists of a pair with a register.

また、上記最終プロセスIDの記憶領域711、721、731、741は、当該レジスタセット71、72、73、74を最後に使用したプロセスIDが格納され、また、最終使用時刻の記憶領域712、722、732、742は、当該レジスタセット71、72、73、74を使用し終わった直後の時刻が格納されるようになっている。   The last process ID storage areas 711, 721, 731, and 741 store the process ID that last used the register set 71, 72, 73, and 74, and the last use time storage areas 712 and 722. , 732, and 742 store the time immediately after the use of the register sets 71, 72, 73, and 74 is completed.

上記システムタイマ2は、時を刻んでシステム時刻を生成し、生成したシステム時刻をCPUに提供する。システム時刻は、コンピュータシステムに唯一の存在であり、提供するシステム時刻の単位は、マシンクロックのようにコンピュータシステムが持つ最も細かい時刻精度である。   The system timer 2 generates a system time by ticking time, and provides the generated system time to the CPU. The system time is the only existence in the computer system, and the unit of the system time to be provided is the finest time accuracy of the computer system such as a machine clock.

上記メモリ3には、(ユーザプログラムの処理単位としての)プロセスや関連するデータを格納するために、複数のプロセス空間(この例では、5つのプロセス空間)31、32、33、34、35が設定されていて、各プロセス空間31、32、33、34、35には、対応するレジスタイメージ(レジスタセットの記憶内容)が格納されるレジスタ退避エリア311、322、333、344、355が設定されている。   In the memory 3, a plurality of process spaces (in this example, five process spaces) 31, 32, 33, 34, and 35 are stored in order to store processes (as processing units of user programs) and related data. Register save areas 311, 322, 333, 344, and 355 for storing corresponding register images (stored contents of register sets) are set in the process spaces 31, 32, 33, 34, and 35. ing.

上記演算制御部4Aは、CPU1Aが特権モードで動作しているか、非特権モードで動作しているかを示すCPU動作モードフラグ41Aと、プロセスを非特権モード用レジスタ部7の中のどのレジスタセット71、72、73、74を選択してプロセスを実行させるかを決定するレジスタセット選択手段42と、実行されるプロセスごとにユニークに付与されるプロセスID(IDentification)に基づいて、そのプロセスIDで指定されるプロセス空間31、32、33、34、35がメモリ3上のどのアドレスに格納されているかを決定するプロセス空間計算手段43とを備えている。   The arithmetic control unit 4A includes a CPU operation mode flag 41A indicating whether the CPU 1A is operating in the privileged mode or the non-privileged mode, and which register set 71 in the register unit 7 for the non-privileged mode. , 72, 73, 74 are selected by register ID selection means 42 for determining whether to execute the process, and specified by the process ID based on the process ID (IDentification) uniquely assigned to each process to be executed And a process space calculation means 43 for determining at which address on the memory 3 the process spaces 31, 32, 33, 34, and 35 are stored.

この例の演算制御部4Aは、CPU動作モードフラグ41Aとレジスタセット選択手段42とプロセス空間計算手段43を用いて、メモリ3内のプロセス空間31、32、33、34、35毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセット71、72、73、74をも使用していないときは、各レジスタセット71、72、73、74内に設定されている「最終使用時刻」記憶領域712、722、732、742を参照して、複数のレジスタセット71、72、73、74のうち、最終使用時刻が最も古い(すなわち、最も不使用期間が長い)レジスタセット71、72、73、74の記憶内容(レジスタイメージ)を、メモリ3内の対応するレジスタ退避エリア311、322、333、344、355に格納して当該レジスタセット71、72、73、74を開放した後、開放された当該レジスタセットを使用して、当該実行しようとするプロセスを実行する構成となっている。   The arithmetic control unit 4A in this example is expanded for each process space 31, 32, 33, 34, 35 in the memory 3 by using the CPU operation mode flag 41A, the register set selection means 42, and the process space calculation means 43. When a process to be executed among a plurality of processes does not use any register set 71, 72, 73, 74, it is set in each register set 71, 72, 73, 74. Referring to the “last use time” storage areas 712, 722, 732, and 742, among the plurality of register sets 71, 72, 73, and 74, a register having the oldest use time (ie, the longest non-use period) The stored contents (register images) of the sets 71, 72, 73, 74 are stored in the corresponding register save areas 311, 322, 333 in the memory 3. After opening the register set 71, 72, 73, and 74 stored in the 344,355, using the opened the register set, and has a configuration to execute a process to be the execution.

次に、図2を参照して、この例の動作について説明する。
システム起動後、ユーザプログラムが全く動作していない状況では、非特権モード用レジスタ7は、全て初期状態(0クリア)である。ここで、同図に示すように、メモリ3のプロセス空間31に展開されているプロセスID:1のプロセス(ユーザプログラム)が実行される場合の動作について説明する。
Next, the operation of this example will be described with reference to FIG.
In a situation where the user program is not operating at all after the system is started, all the non-privileged mode registers 7 are in the initial state (0 cleared). Here, as shown in the figure, the operation when the process (user program) with the process ID: 1 developed in the process space 31 of the memory 3 is executed will be described.

動作例1
まず、CPU動作モードフラグ41Aに非特権モードである旨のフラグがセットされ、これにより、CPU1Aが非特権モードで動作する。すると、レジスタセット選択手段42は、プロセス空間31に展開されているプロセスID:1のプロセス(ユーザプログラム)をどのレジスタセット71、72、73、74を選択(使用)して実行するかを決定する。決定に当っては、各レジスタセット71、72、73、74の最終プロセスIDの記憶領域711、721、731、741を参照し、プロセスID:1が格納されているレジスタセットがあれば、そのレジスタセットを使用してプログラムが実行される。
このときは、プロセス切替えによるメモリ2へのレジスタセット記憶内容の退避処理もメモリ2からのレジスタセット記憶内容の復帰処理も不要となるので、オーバヘッドは生じない。
Operation example 1
First, a flag indicating the non-privileged mode is set in the CPU operation mode flag 41A, whereby the CPU 1A operates in the non-privileged mode. Then, the register set selection means 42 determines which register set 71, 72, 73, 74 to select (use) and execute the process (user program) of process ID: 1 developed in the process space 31. To do. In determining, referring to the storage areas 711, 721, 731 and 741 of the final process ID of each register set 71, 72, 73 and 74, if there is a register set storing the process ID: 1 The program is executed using the register set.
At this time, neither processing for saving the contents of the register set stored in the memory 2 by process switching nor processing for restoring the contents of the register set stored in the memory 2 is required, so that no overhead occurs.

動作例2
もし、最終プロセスIDの記憶領域711、721、731、741を参照した結果、プロセスID:1が格納されているレジスタセットがなければ、各レジスタセット71、72、73、74の「最終使用時刻」記憶領域712、722、732、742を参照して、時刻が一番古いレジスタセットを選択使用してプログラムが実行される。
Operation example 2
If there is no register set in which process ID 1 is stored as a result of referring to the storage areas 711, 721, 731, and 741 of the final process ID, the “last use time” of each register set 71, 72, 73, and 74 is stored. Referring to the storage areas 712, 722, 732, and 742, the program is executed by selecting and using the register set with the oldest time.

今の場合は、非特権モード用レジスタ部7は全て初期状態なので、レジスタセット選択手段42は、レジスタセット71を選択すると共に、レジスタセット71用の「最終プロセスID」記憶領域711にプロセスIDの“1”を格納する。このときも、プロセス切替えによるメモリ2へのレジスタセット記憶内容の退避処理もメモリ2からのレジスタセット記憶内容の復帰処理も不要となるので、オーバヘッドは生じない。   In this case, all of the non-privileged mode register units 7 are in the initial state, so the register set selection unit 42 selects the register set 71 and stores the process ID in the “final process ID” storage area 711 for the register set 71. “1” is stored. At this time, neither the processing for saving the contents of the register set stored in the memory 2 by the process switching nor the processing for restoring the contents of the register set stored in the memory 2 is required, so that no overhead occurs.

動作例3
次にプロセスID:1のプロセス(ユーザプログラム)がCPU1Aを開放するのに伴い、プロセス切替えを行う場合、CPU1Aは、システムタイマ2から現在時刻を取得し、取得した現在時刻の値をレジスタセット71用の「最終使用時刻」記憶領域712に格納する。この状態で、プロセスID:1のプロセスが再度実行される際には、レジスタセット選択手段42により、レジスタセット71が選択され、プロセスID:1のプロセス(ユーザプログラム)が実行されることになる。このときも、プロセス切替えによるメモリ2へのレジスタセット記憶内容の退避処理もメモリ2からのレジスタセット記憶内容の復帰処理も不要となるので、オーバヘッドは生じない。
Operation example 3
Next, when the process (user program) with the process ID: 1 releases the CPU 1A and performs process switching, the CPU 1A acquires the current time from the system timer 2, and sets the acquired current time value in the register set 71. The “last use time” storage area 712 is stored. In this state, when the process with the process ID: 1 is executed again, the register set selecting unit 42 selects the register set 71 and the process with the process ID: 1 (user program) is executed. . At this time, neither the processing for saving the contents of the register set stored in the memory 2 by the process switching nor the processing for restoring the contents of the register set stored in the memory 2 is required, so that no overhead occurs.

動作例4
次に、図2に示す非特権モード用レジスタ部7において、レジスタセット71用の「最終プロセスID」記憶領域711にプロセスID:1、レジスタセット72用の「最終プロセスID」記憶領域721にプロセスID:2、レジスタセット73用の「最終プロセスID」記憶領域731にプロセスID:3、及びレジスタセット74用の「最終プロセスID」記憶領域741にプロセスID:4が格納されている状態で、プロセスID:1、プロセスID:2、プロセスID:3、プロセスID:4のプロセス(ユーザプログラム)が時分割で切替えられて実行される場合の動作について説明する。
Operation example 4
Next, in the non-privileged mode register unit 7 shown in FIG. 2, the process ID is 1 in the “final process ID” storage area 711 for the register set 71 and the process is in the “final process ID” storage area 721 for the register set 72. With the ID: 2, the process ID: 3 stored in the “final process ID” storage area 731 for the register set 73, and the process ID: 4 stored in the “final process ID” storage area 741 for the register set 74, An operation when the process (user program) of process ID: 1, process ID: 2, process ID: 3, and process ID: 4 is switched and executed in a time division manner will be described.

レジスタセット選択手段42は、時分割で。プロセス空間31に展開されているプロセスID:1のプロセス(ユーザプログラム)、プロセスID:2のプロセス、プロセスID:3のプロセス、プロセスID:4のプロセスをどのレジスタセット71、72、73、74を選択(使用)して実行するかを決定する。決定に当っては、各レジスタセット71、72、73、74の最終プロセスIDの記憶領域711、721、731、741を参照する。今の場合は、プロセスID:1、プロセスID:2、プロセスID:3及びプロセスID:4が格納されているレジスタセット71、72、73、74は全て存在するので、これらのレジスタセット71、72、73、74を使用して各プロセスが実行される。このときは、プロセス切替えによるメモリ2へのレジスタセット記憶内容の退避処理もメモリ2からのレジスタセット記憶内容の復帰処理も不要となるので、オーバヘッドは生じない。   The register set selection means 42 is time-shared. Which register set 71, 72, 73, 74 is a process (user program) of process ID: 1, a process of process ID: 2, a process of process ID: 3, and a process of process ID: 4 deployed in the process space 31. Select (use) to decide whether to execute. For the determination, the storage areas 711, 721, 731 and 741 of the final process ID of each register set 71, 72, 73 and 74 are referred to. In this case, since there are all register sets 71, 72, 73, and 74 in which process ID: 1, process ID: 2, process ID: 3, and process ID: 4 are stored, these register sets 71, Each process is executed using 72, 73, 74. At this time, neither processing for saving the contents of the register set stored in the memory 2 by process switching nor processing for restoring the contents of the register set stored in the memory 2 is required, so that no overhead occurs.

動作例5
次に、図2に示す非特権モード用レジスタ部7において、レジスタセット71用の「最終プロセスID」記憶領域711に“1”、レジスタセット72用の「最終プロセスID」記憶領域721に“2”、レジスタセット73用の「最終プロセスID」記憶領域731に“3”、及びレジスタセット74用の「最終プロセスID」記憶領域741に“4”が格納されている状態で、プロセスID:5のプロセス(ユーザプログラム)が実行される場合の動作について説明する。
Operation example 5
Next, in the non-privileged mode register section 7 shown in FIG. 2, “1” is stored in the “final process ID” storage area 711 for the register set 71, and “2” is stored in the “final process ID” storage area 721 for the register set 72. "3" is stored in the "final process ID" storage area 731 for the register set 73, and "4" is stored in the "final process ID" storage area 741 for the register set 74. The operation when this process (user program) is executed will be described.

レジスタセット選択手段42は、上記規則に従って、プロセスID:5が、いずれかのレジスタセット用の「最終プロセスID」記憶領域711、721、731、741に格納されているか否かを判断する。今の場合は、いずれの「最終プロセスID」記憶領域に格納されているID値も“5”でないため、レジスタセット選択手段42は、プロセスID:5が、いずれかのレジスタセット用の「最終プロセスID」記憶領域711、721、731、741にも格納されていないと判断する。   The register set selection unit 42 determines whether or not the process ID: 5 is stored in the “final process ID” storage areas 711, 721, 731, and 741 for any register set according to the above rule. In this case, since the ID value stored in any of the “final process ID” storage areas is not “5”, the register set selection unit 42 determines that the process ID: 5 is the “final process ID” for any register set. It is determined that the “process ID” storage areas 711, 721, 731, and 741 are not stored.

レジスタセット選択手段42は、次に、各レジスタセットの「最終使用時刻」記憶領域712、722、732、742を参照し、一番古い時刻が格納されているレジスタセットを選択する。   Next, the register set selection means 42 refers to the “last use time” storage areas 712, 722, 732, and 742 of each register set, and selects the register set in which the oldest time is stored.

今の場合、レジスタセット71用の「最終使用時刻」記憶領域712が一番古いと仮定すると、プロセスID:5のプロセス(ユーザプログラム)が、レジスタセット71を使用して実行されることになる。このままプロセスを実行すると、プロセスID:1が使用していたレジスタセット71のイメージが破壊されるため、プロセス空間計算手段43は、レジスタセット71の「最終プロセスID」記憶領域711(今の場合、“1”が格納されている)から、プロセスID:1用のレジスタ退避エリア311のアドレスを計算し、レジスタセット71のレジスタイメージをプロセスID:1用のレジスタ退避エリア311に格納する。それゆえ、動作例5の場合には、プロセス切替えによるメモリ2へのレジスタセット記憶内容の退避処理及びメモリ2からのレジスタセット記憶内容の復帰処理が必要となるので、オーバヘッドが生じる。   In this case, assuming that the “last use time” storage area 712 for the register set 71 is the oldest, the process (user program) with the process ID: 5 is executed using the register set 71. . If the process is executed as it is, the image of the register set 71 used by the process ID: 1 is destroyed. Therefore, the process space calculation unit 43 uses the “final process ID” storage area 711 (in this case, From “1” is stored), the address of the register save area 311 for process ID: 1 is calculated, and the register image of the register set 71 is stored in the register save area 311 for process ID: 1. Therefore, in the case of the operation example 5, the processing for saving the register set storage contents to the memory 2 by the process switching and the processing for restoring the register set storage contents from the memory 2 are necessary, so that overhead occurs.

このように、この第1実施例の構成によれば、CPU1Aの内部に複数のレジスタセットレジスタセット71、72、73、74を保持し、プロセス切替え時であっても、必要最低限でメモリへの退避・復帰処理を行うため、プロセス切替え時のオーバヘッドを削減できる。また、この例の構成によれば、メモリ3内には、レジスタセット71、72、73、74の個数よりも多い個数のプロセス空間31、32、33、34、35が設定されているので、同時に実行すべきプロセス数が、レジスタセットの設置数を超えるときでも、いずれか一のレジスタセットの記憶内容を、メモリ内の対応するレジスタ退避エリアに格納して当該レジスタセットを開放し、開放された当該レジスタセットを使用できるようにしたので、前記実行しようとするプロセスを実行する円滑にマルチタスク制御ができる。   As described above, according to the configuration of the first embodiment, a plurality of register sets 71, 72, 73, 74 are held in the CPU 1A, and even when the process is switched, the memory is transferred to the memory at the minimum necessary. The overhead at the time of process switching can be reduced. Further, according to the configuration of this example, the process space 31, 32, 33, 34, 35 more than the number of the register sets 71, 72, 73, 74 is set in the memory 3. Even when the number of processes to be executed simultaneously exceeds the number of installed register sets, the stored contents of any one register set are stored in the corresponding register save area in the memory, and the corresponding register set is released. Since the register set can be used, multitask control can be smoothly performed to execute the process to be executed.

図3は、この発明の第2実施例であるコンピュータシステムの要部構成を示す電気的ブロック図である。
この例のコンピュータシステムの構成が、上述の第1実施例のそれと大きく異なるところは、同図に示すように、CPU動作モ−ドフラグ41Bに使用レジスタセット数記憶領域8を設け、単一のプロセス(ユーザプログラム)が、CPU1Bが保持する複数のレジスタセット(例えば、2つのレジスタセットレジスタセット71、72)を用いて処理を実行できるようにした点である。
FIG. 3 is an electrical block diagram showing the main configuration of the computer system according to the second embodiment of the present invention.
The configuration of the computer system of this example is greatly different from that of the first embodiment described above, as shown in the figure, a CPU operation mode flag 41B is provided with a used register set number storage area 8 and a single process. The (user program) is configured to execute processing using a plurality of register sets (for example, two register set register sets 71 and 72) held by the CPU 1B.

ここで、上記使用レジスタセット数記憶領域8は、CPU動作モ−ドフラグ41Bに使用するレジスタセット数を格納できる記憶領域である。   Here, the used register set number storage area 8 is a storage area capable of storing the number of register sets used for the CPU operation mode flag 41B.

この例の構成において、実行可能モジュールに予め使用するレジスタセット数を格納(コンパイラがコンパイル時に設定)しておく。そして、プロセスが実行される際には、実行可能モジュール内に格納されている使用レジスタセット数を読み込み、CPU動作モードフラグ41Bの使用レジスタセット数記憶領域8に設定する。レジスタセット選択手段42は、使用レジスタセット数記憶領域8を参照して、必要とするレジスタセット数を確保する処理を行う。   In the configuration of this example, the number of register sets to be used is stored in advance in the executable module (set by the compiler at the time of compilation). When the process is executed, the number of used register sets stored in the executable module is read and set in the used register set number storage area 8 of the CPU operation mode flag 41B. The register set selection means 42 refers to the used register set number storage area 8 and performs a process of securing the required number of register sets.

以上、この発明の実施例を図面を参照して詳述してきたが、具体的な構成はこの実施例に限られるものではなく、この発明の要旨を逸脱しない範囲の設計の変更等があってもこの発明に含まれる。例えば、上述の実施例では、各レジスタセットが、複数の汎用レジスタと複数の専用レジスタとから構成されるようにしたが、これに限定するものではなく、レジスタセットが、多目的に利用できる複数の汎用レジスタのみから構成されても良く、また、複数の汎用レジスタと特別の目的で利用する単数の専用レジスタとから構成されるようにしても良い。   The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and there are design changes and the like without departing from the gist of the present invention. Are also included in the present invention. For example, in the above-described embodiment, each register set is composed of a plurality of general-purpose registers and a plurality of dedicated registers. However, the present invention is not limited to this, and a plurality of register sets can be used for multiple purposes. It may be composed of only general purpose registers, or may be composed of a plurality of general purpose registers and a single dedicated register used for a special purpose.

また、上述の第2実施例では、単一のプロセス(ユーザプログラム)が、2つのレジスタセットレジスタセット71、72を用いて処理を実行する場合について述べたが、使用レジスタセット数は任意であり、必要に応じて増減でき、CPU1Bが保持する全てのレジスタセットを用いても良い。また、レジスタセットの保持数は任意であり、プロセス空間の設定数も任意である。
また、複数のレジスタセットのうち、最終使用時刻が最も古い(すなわち、最も不使用期間が長い)レジスタセットの記憶内容を、メモリのレジスタ退避エリアに退避させるようにしたが、これに限定されない。例えば、使用の頻度等を考慮して、退避すべきレジスタセットを決めるようにしても良い。
In the second embodiment described above, the case where a single process (user program) executes processing using two register set register sets 71 and 72 is described. However, the number of register sets used is arbitrary. All the register sets held by the CPU 1B may be used as necessary. Further, the number of register sets held is arbitrary, and the number of process space settings is also arbitrary.
Further, the stored contents of the register set having the oldest use time (that is, the longest non-use period) among the plurality of register sets are saved in the register save area of the memory, but the present invention is not limited to this. For example, the register set to be saved may be determined in consideration of the frequency of use.

計算機システムに限らず、組込みシステムにも適用できる。   It can be applied not only to computer systems but also to embedded systems.

この発明の第1実施例であるコンピュータシステムの要部構成を示す電気的ブロック図である。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is an electrical block diagram showing a main configuration of a computer system according to a first embodiment of the present invention. 同第1実施例であるコンピュータシステムの要部構成をより詳細に示す電気的ブロック図である。It is an electrical block diagram which shows the principal part structure of the computer system which is the 1st Example in detail. この発明の第2実施例であるコンピュータシステムの要部構成を示す電気的ブロック図である。It is an electrical block diagram which shows the principal part structure of the computer system which is 2nd Example of this invention.

符号の説明Explanation of symbols

1A、1B CPU(コンピュータシステムの一部)
2 システムタイマ
3 メモリ
31、32、33、34、35 プロセス空間
311、322、333、344、355 レジスタ退避エリア
4A、4B 演算制御部(制御部)
41A,41B CPU動作モードフラグ
8 レジスタセット数記憶領域
42 レジスタセット選択手段
43 プロセス空間計算手段
5 レジスタ部
6 特権モード用レジスタ部
7 非特権モード用レジスタ部
711、721、731、741 最終プロセスID記憶領域
712、722、732、742 最終使用時刻記憶領域
1A, 1B CPU (part of computer system)
2 System timer 3 Memory 31, 32, 33, 34, 35 Process space 311, 322, 333, 344, 355 Register save area 4A, 4B Operation control unit (control unit)
41A, 41B CPU operation mode flag 8 Register set number storage area 42 Register set selection means 43 Process space calculation means 5 Register part 6 Privileged mode register part 7 Non-privileged mode register part 711, 721, 731, 741 Final process ID storage Area 712, 722, 732, 742 Last use time storage area

Claims (21)

複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えるコンピュータシステムにおけるプロセス切替え方法であって、
前記制御部は、
前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、
前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、
前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、いずれか一のレジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行する
ことを特徴とするコンピュータシステムにおけるプロセス切替え方法。
A process switching method in a computer system comprising a plurality of register sets including a plurality of registers, a memory for storing user programs and data, and a control unit that is directly connected to and controls the register set and the memory There,
The controller is
Setting a plurality of process spaces in the memory, setting a register saving area for each process space; and
The plurality of register sets are used for each process (processing unit of user program), and each process is executed concurrently with switching.
When a process to be executed among a plurality of processes expanded for each process space of the memory does not use any register set, the storage contents of any one register set are The process switching in the computer system, wherein the process to be executed is executed using the released register set after storing the corresponding register save area in the memory and releasing the register set Method.
複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えるコンピュータシステムにおけるプロセス切替え方法であって、
前記制御部は、
前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、
前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、
前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、前記複数のレジスタセットのうち、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行する
ことを特徴とするコンピュータシステムにおけるプロセス切替え方法。
A process switching method in a computer system comprising a plurality of register sets including a plurality of registers, a memory for storing user programs and data, and a control unit that is directly connected to and controls the register set and the memory There,
The controller is
Setting a plurality of process spaces in the memory, setting a register saving area for each process space; and
The plurality of register sets are used for each process (processing unit of user program), and each process is executed concurrently with switching.
When a process to be executed among a plurality of processes expanded for each process space of the memory does not use any register set, the most unused period of the plurality of register sets After storing the stored contents of the register set with the longest (or the oldest use time) in the corresponding register save area in the memory and releasing the register set, use the released register set A process switching method in a computer system, wherein the process to be executed is executed.
前記レジスタセットは、複数の汎用レジスタを備えてなることを特徴とする請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法。   3. The process switching method in a computer system according to claim 1, wherein the register set includes a plurality of general purpose registers. 前記レジスタセットは、多目的に利用できる複数の汎用レジスタと、特別の目的で利用する単数又は複数の専用レジスタとを備えてなることを特徴とする請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法。   3. The process switching method in a computer system according to claim 1, wherein the register set includes a plurality of general-purpose registers that can be used for multiple purposes, and one or more dedicated registers that are used for special purposes. . 前記制御部は、
どのレジスタセットを選択して前記プロセスを実行させるかを決定するレジスタセット選択機能と、
実行されるプロセス毎にユニークに付与されるプロセスIDに基づいて、当該プロセスIDによって識別される前記プロセス空間が前記メモリ上のどのアドレスに格納されているかを決定するプロセス空間計算機能とを備えていることを特徴とする請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法。
The controller is
A register set selection function for determining which register set is selected to execute the process;
A process space calculation function for determining in which address on the memory the process space identified by the process ID is stored based on a process ID uniquely assigned to each process to be executed 3. A process switching method in a computer system according to claim 1, wherein the process is switched.
前記各レジスタセットは、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域とを有していることを特徴とする請求項1又は5記載のコンピュータシステムにおけるプロセス切替え方法。   6. The process switching method in a computer system according to claim 1, wherein each of the register sets has a final process ID storage area for storing a process ID that last used the register set. . 前記各レジスタセットは、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域と、当該レジスタセットを使用し終わった直後の時刻を格納するための最終使用時刻記憶領域とを有し、前記制御部は、前記最終使用時刻記憶領域に格納されている前記直後の時刻を参照して、どのレジスタセットが、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットであるかを判断することを特徴とする請求項2、3、4又は5記載のコンピュータシステムにおけるプロセス切替え方法。   Each register set includes a final process ID storage area for storing a process ID that last used the register set, and a last use time storage area for storing a time immediately after the use of the register set is completed. The control unit refers to the time immediately after stored in the last use time storage area, and which register set has the longest non-use period (or the last use time is the oldest) 6. The process switching method in a computer system according to claim 2, wherein it is determined whether the set is a set. 前記メモリ内には、前記レジスタセットの個数よりも多い個数の前記プロセス空間が設定されることを特徴とする請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法。   3. The process switching method in a computer system according to claim 1, wherein a larger number of the process spaces than the number of the register sets are set in the memory. 前記制御部は、所定のプロセスについては、複数の前記レジスタセットを使用して当該所定のプロセスを実行することを特徴とする請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法。   3. The process switching method in the computer system according to claim 1, wherein the control unit executes the predetermined process for a predetermined process using a plurality of the register sets. 前記制御部は、所定のプロセスについては、実行可能モジュールに格納された使用レジスタセット数に基づいて、複数の前記レジスタセットを選択し使用して当該所定のプロセスを実行することを特徴とする請求項1又は2記載のコンピュータシステムにおけるプロセス切替え方法。   The control unit, for a predetermined process, selects and uses a plurality of the register sets based on the number of used register sets stored in an executable module, and executes the predetermined process. Item 3. A process switching method in the computer system according to Item 1 or 2. 複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えると共に、プロセスを切替える機能を備えるコンピュータシステムであって、
前記制御部は、
前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、
前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、
前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、いずれか一のレジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行する構成になされている、
ことを特徴とするコンピュータシステム。
Provided with a plurality of register sets having a plurality of registers as a set, a memory for storing user programs and data, a control unit that is directly connected to and controls the register set and the memory, and a function for switching processes A computer system comprising:
The controller is
Setting a plurality of process spaces in the memory, setting a register saving area for each process space; and
The plurality of register sets are used for each process (processing unit of user program), and each process is executed concurrently with switching.
When a process to be executed among a plurality of processes expanded for each process space of the memory does not use any register set, the storage contents of any one register set are It is configured to execute the process to be executed using the released register set after storing the corresponding register save area in the memory and releasing the register set.
A computer system characterized by that.
複数のレジスタをセットとして備える複数のレジスタセットと、ユーザプログラムやデータを格納するメモリと、前記レジスタセットと前記メモリとに直結されてこれらを制御する制御部とを備えると共に、プロセスを切替える機能を備えるコンピュータシステムであって、
前記制御部は、
前記メモリ内に複数のプロセス空間を設定し、前記プロセス空間毎にレジスタ退避エリアを設定し、かつ、
前記複数のレジスタセットを、プロセス(ユーザプログラムの処理単位)毎に使用して各プロセスを、切替えを交えて、併行して実行すると共に、
前記メモリの前記プロセス空間毎に展開されている複数のプロセスのうち、実行しようとするプロセスが、いずれのレジスタセットをも使用していないときは、前記複数のレジスタセットのうち、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットの記憶内容を、前記メモリ内の対応する前記レジスタ退避エリアに格納して当該レジスタセットを開放した後、開放された当該レジスタセットを使用して前記実行しようとするプロセスを実行する構成になされている、
ことを特徴とするコンピュータシステム。
Provided with a plurality of register sets having a plurality of registers as a set, a memory for storing user programs and data, a control unit that is directly connected to and controls the register set and the memory, and a function for switching processes A computer system comprising:
The controller is
Setting a plurality of process spaces in the memory, setting a register saving area for each process space; and
The plurality of register sets are used for each process (processing unit of user program), and each process is executed concurrently with switching.
When a process to be executed among a plurality of processes expanded for each process space of the memory does not use any register set, the most unused period of the plurality of register sets After storing the stored contents of the register set with the longest (or the oldest use time) in the corresponding register save area in the memory and releasing the register set, use the released register set Configured to execute the process to be executed,
A computer system characterized by that.
前記レジスタセットは、複数の汎用レジスタを備えてなることを特徴とする請求項11又は12記載のコンピュータシステム。   The computer system according to claim 11 or 12, wherein the register set includes a plurality of general-purpose registers. 前記レジスタセットは、多目的に利用できる複数の汎用レジスタと、特別の目的で利用する単数又は複数の専用レジスタとを備えてなることを特徴とする請求項11又は12記載のコンピュータシステム。   13. The computer system according to claim 11, wherein the register set includes a plurality of general-purpose registers that can be used for various purposes and a single or a plurality of dedicated registers that are used for special purposes. 前記制御部は、
どのレジスタセットを選択して前記プロセスを実行させるかを決定するレジスタセット選択手段と、
実行されるプロセス毎にユニークに付与されるプロセスIDに基づいて、当該プロセスIDによって識別される前記プロセス空間が前記メモリ上のどのアドレスに格納されているかを決定するプロセス空間計算手段とを備えていることを特徴とする請求項11又は12記載のコンピュータシステム。
The controller is
Register set selection means for determining which register set to select to execute the process;
Based on a process ID uniquely assigned to each process to be executed, a process space calculation means for determining in which address on the memory the process space identified by the process ID is stored The computer system according to claim 11 or 12, characterized in that
前記各レジスタセットは、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域とを有していることを特徴とする請求項11又は15記載のコンピュータシステム。   16. The computer system according to claim 11, wherein each of the register sets has a final process ID storage area for storing a process ID that last used the register set. 前記各レジスタセットは、当該レジスタセットを最後に使用したプロセスIDを格納するための最終プロセスID記憶領域と、当該レジスタセットを使用し終わった直後の時刻を格納するための最終使用時刻記憶領域とを有し、前記制御部は、前記最終使用時刻記憶領域に格納されている前記直後の時刻を参照して、どのレジスタセットが、最も不使用期間が長い(又は最終使用時刻が最も古い)レジスタセットであるかを判断することを特徴とする請求項12、13、14又は15記載のコンピュータシステム。   Each register set includes a final process ID storage area for storing a process ID that last used the register set, and a last use time storage area for storing a time immediately after the use of the register set is completed. The control unit refers to the time immediately after stored in the last use time storage area, and which register set has the longest non-use period (or the last use time is the oldest) 16. The computer system according to claim 12, 13, 14 or 15, wherein it is determined whether the set is a set. 前記メモリ内には、前記レジスタセットの個数よりも多い個数の前記プロセス空間が設定されていることを特徴とする請求項11又は12記載のコンピュータシステム。   The computer system according to claim 11 or 12, wherein a larger number of the process spaces than the number of the register sets are set in the memory. 前記制御部は、所定のプロセスについては、複数の前記レジスタセットを使用して当該所定のプロセスを実行することを特徴とする請求項11又は12記載のコンピュータシステム。   13. The computer system according to claim 11, wherein the control unit executes the predetermined process using a plurality of the register sets for the predetermined process. 前記制御部は、所定のプロセスについては、実行可能モジュールに格納された使用レジスタセット数に基づいて、複数の前記レジスタセットを選択し使用して当該所定のプロセスを実行することを特徴とする請求項11又は12記載のコンピュータシステム。   The control unit, for a predetermined process, selects and uses a plurality of the register sets based on the number of used register sets stored in an executable module, and executes the predetermined process. Item 13. The computer system according to Item 11 or 12. 前記所定のプロセスを実行する際に使用される前記レジスタセットの個数を格納するレジスタセット数記憶領域が付加されていることを特徴とする請求項19又は21記載のコンピュータシステム。

The computer system according to claim 19 or 21, further comprising a register set number storage area for storing the number of register sets used when executing the predetermined process.

JP2007061114A 2007-03-09 2007-03-09 Computer system and process-switching method used in the system Pending JP2008225710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007061114A JP2008225710A (en) 2007-03-09 2007-03-09 Computer system and process-switching method used in the system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007061114A JP2008225710A (en) 2007-03-09 2007-03-09 Computer system and process-switching method used in the system

Publications (1)

Publication Number Publication Date
JP2008225710A true JP2008225710A (en) 2008-09-25

Family

ID=39844276

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007061114A Pending JP2008225710A (en) 2007-03-09 2007-03-09 Computer system and process-switching method used in the system

Country Status (1)

Country Link
JP (1) JP2008225710A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016511493A (en) * 2013-03-15 2016-04-14 クアルコム,インコーポレイテッド Method and apparatus for saving and restoring system memory management unit context
JP2017037370A (en) * 2015-08-06 2017-02-16 富士通株式会社 Computing device, process control method and process control program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016511493A (en) * 2013-03-15 2016-04-14 クアルコム,インコーポレイテッド Method and apparatus for saving and restoring system memory management unit context
JP2017037370A (en) * 2015-08-06 2017-02-16 富士通株式会社 Computing device, process control method and process control program

Similar Documents

Publication Publication Date Title
JP4610593B2 (en) Dual thread processor
US20070266387A1 (en) Multithreaded computer system and multithread execution control method
JP2017037370A (en) Computing device, process control method and process control program
US10571993B2 (en) Micro controller unit
JP2005050208A (en) Memory managing system in multi-task system and task controller
JP2013225208A (en) Information processing apparatus, information processing method and program
JP2004157636A (en) Data processing apparatus
JP6427575B2 (en) Handling of time-consuming instructions
JP5289688B2 (en) Processor system and operating system program processing method for operating processor system
JP2009175960A (en) Virtual multiprocessor system
JP2008225710A (en) Computer system and process-switching method used in the system
JP3644042B2 (en) Multitask processing device
JPWO2008155801A1 (en) Information processing apparatus and register control method
JPH0916409A (en) Microcomputer
JP4114946B2 (en) Data processing device
JP2003058381A (en) Processor realizing exception processing setting by program
JP5803721B2 (en) Data processing device
JPH02242434A (en) Task scheduling method
US20150363227A1 (en) Data processing unit and method for operating a data processing unit
US20080222336A1 (en) Data processing system
KR20190077235A (en) Semiconductor device
WO2011114495A1 (en) Multi-core processor system, thread switching control method, and thread switching control program
Moisuc et al. Hardware event handling in the hardware real-time operating systems
JPH11184828A (en) Test system for multiprocessor system
JP2008077388A (en) Multiprocessor control system, method and program