JP2000029721A - Microcomputer - Google Patents
MicrocomputerInfo
- Publication number
- JP2000029721A JP2000029721A JP10198302A JP19830298A JP2000029721A JP 2000029721 A JP2000029721 A JP 2000029721A JP 10198302 A JP10198302 A JP 10198302A JP 19830298 A JP19830298 A JP 19830298A JP 2000029721 A JP2000029721 A JP 2000029721A
- Authority
- JP
- Japan
- Prior art keywords
- register
- information
- storage
- registers
- task
- 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.)
- Withdrawn
Links
Abstract
(57)【要約】
【課題】 タスク実行の切り換え処理の高速化を図るこ
とにある。
【解決手段】 複数のレジスタのうち、実際に使用され
るレジスタを示すレジスタ識別情報を上記記憶手段に記
憶させる第1制御手段(3)を設け、このレジスタ識別
情報に基づいて、実際に使用されたレジスタの保持情報
をスタック領域に待避するための第2制御手段(3)を
設ける。それにより、上記複数のレジスタのうちで、実
際に使用されないレジスタの保持情報がスタック領域へ
待避される無駄が回避されるので、タスク実行の切り換
え処理の高速化を図ることができる。
(57) [Summary] [PROBLEMS] To speed up a task execution switching process. SOLUTION: First control means (3) for storing register identification information indicating a register actually used among a plurality of registers in the storage means is provided, and based on the register identification information, first control means (3) is provided. Second control means (3) for saving the held information of the registered register in the stack area. Accordingly, it is possible to avoid wasting the information held in the registers that are not actually used among the plurality of registers in the stack area, thereby speeding up the task execution switching process.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、プログラムを構成
する一連の命令を実行することによって所定の演算処理
を行うマイクロコンピュータに関し、例えば1チップ型
のマイクロコンピュータ(シングルチップマイクロコン
ピュータ)に適用して有効な技術に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer for performing a predetermined arithmetic processing by executing a series of instructions constituting a program, and is applied to, for example, a one-chip microcomputer (single-chip microcomputer). Regarding effective technology.
【0002】[0002]
【従来の技術】シングルチップマイクロコンピュータ
は、CPU(中央処理装置)を中心に所要の周辺回路が
1個の半導体基板に含まれていて、その動作プログラム
を保有するプログラムROM(リード・オンリー・メモ
リ)を内蔵する。一方、マルチチップマイクロコンピュ
ータにおいては、その動作プログラムを格納するための
ROMを内蔵せず、必要な動作プログラムは、マルチチ
ップマイクロコンピュータの外部に配置された外部メモ
リ(ROM)から得るようにしている。2. Description of the Related Art A single-chip microcomputer includes a CPU (central processing unit) and necessary peripheral circuits contained in a single semiconductor substrate, and a program ROM (read-only memory) having an operation program for the semiconductor ROM. ) Built-in. On the other hand, a multichip microcomputer does not include a ROM for storing the operation program, and a necessary operation program is obtained from an external memory (ROM) arranged outside the multichip microcomputer. .
【0003】マルチタスク制御OS(オペレーティング
システム)におけるタスクの実行切り換えは、実行して
いるタスクを中断し、別のタスクの実行に切り換えるこ
とである。OSはタスクの実行切り換え時に、現在実行
しているタスクの動作環境(レジスタ及びスタック状
態)を全て保存した後に、次に実行すべきタスクの環境
を設定する。OSは実行の切り換えがどのようなタイミ
ングで起きても良いように、タスクの動作環境を全て保
存するようにしている。Switching of execution of a task in a multitask control OS (operating system) is to interrupt a task being executed and switch to execution of another task. The OS sets the environment of the task to be executed next after saving all the operating environments (registers and stack states) of the currently executed task when switching the execution of the task. The OS saves the entire operation environment of the task so that the execution may be switched at any timing.
【0004】[0004]
【発明が解決しようとする課題】しかしながら、上記の
ように、タスクの実行を切り換える場合には、タスクの
実行環境として全てのレジスタ及びスタック状態を保存
する従来方式では、タスクの切り換えに時間がかかって
しまう。特に、マイクロコンピュータの高機能化に伴っ
て取り扱われる情報量がさらに増えると、タスクの実行
環境として全てのレジスタ及びスタック状態を保存する
には、タスクの切り換えに要する時間が、マイクロコン
ピュータでの演算処理時間に大きく影響することが見い
だされた。However, as described above, when the execution of a task is switched, the conventional method of saving all registers and the stack state as the task execution environment takes a long time to switch the task. Would. In particular, if the amount of information handled with the advancement of microcomputers increases, the time required for task switching must be reduced in order to save all registers and stack states as a task execution environment. It has been found that it greatly affects the processing time.
【0005】本発明は、タスク実行の切り換え処理の高
速化を図ることにある。An object of the present invention is to speed up a task execution switching process.
【0006】[0006]
【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.
【0007】すなわち、情報保持のための複数のレジス
タ(PC,SR,SP,R0〜Rn)と、上記複数のレ
ジスタの保持内容を待避するためのスタック領域(7)
とを含んでマイクロコンピュータが形成されるとき、実
際に使用されるレジスタの判別情報を記録するための記
憶手段(RSR)と、命令実行毎に、実際に使用される
レジスタの判別情報を上記記憶手段に書き込むための第
1制御手段(3)と、上記記憶手段の記憶情報及びその
記憶情報に基づいて特定されるレジスタの記憶情報を上
記スタック領域に待避するための第2制御手段(3)と
を設ける。More specifically, a plurality of registers (PC, SR, SP, R0 to Rn) for holding information and a stack area (7) for saving the contents held by the plurality of registers.
And a storage means (RSR) for recording the identification information of the register actually used when the microcomputer is formed, and the identification information of the register actually used for each instruction execution. First control means (3) for writing to the means, and second control means (3) for saving the storage information of the storage means and the storage information of the register specified based on the storage information in the stack area. Are provided.
【0008】上記した手段によれば、上記第1制御手段
は、複数のレジスタのうち、実際に使用されるレジスタ
を示すレジスタ使用情報を上記記憶手段に記憶し、上記
第2制御手段はこの判別情報に基づいて、実際に使用さ
れたレジスタの保持情報をスタック領域に待避する。こ
のことが、上記複数のレジスタのうちで、実際に使用さ
れないレジスタの保持情報をスタック領域へ待避する無
駄を回避して、タスク実行の切り換え処理の高速化を達
成する。According to the above-mentioned means, the first control means stores register use information indicating a register actually used among the plurality of registers in the storage means, and the second control means makes the determination. Based on the information, the information held in the register actually used is saved in the stack area. This avoids wasteful saving of information held in registers that are not actually used among the plurality of registers in the stack area, and achieves high-speed task execution switching processing.
【0009】このとき、上記記憶手段の記憶情報及びそ
の記憶情報に基づいて特定されるレジスタの記憶情報が
上記第2制御手段により上記スタック領域に待避された
後に、上記記憶手段を初期化するための第3制御手段
(3)を設けることができる。At this time, after the storage information of the storage means and the storage information of the register specified based on the storage information are saved in the stack area by the second control means, the storage means is initialized. The third control means (3) can be provided.
【0010】また、中断されたタスクが再開される際
に、上記スタック領域に待避されているレジスタ使用情
報及び上記複数のレジスタの保持情報によってそれぞれ
対応する上記記憶手段及びレジスタの記憶状態を復帰す
るための第4制御手段(3)を設けることができる。When the interrupted task is resumed, the storage state of the corresponding storage means and the storage state of the corresponding register are restored based on the register use information saved in the stack area and the held information of the plurality of registers. Control means (3) can be provided.
【0011】[0011]
【発明の実施の形態】図5には本発明に係るシングルチ
ップマイクロコンピュータの構成例が示される。このシ
ングルチップマイクロコンピュータ1は、特に制限され
ないが、公知の半導体集積回路製造技術によって単結晶
シリコン基板などの一つの半導体基板に形成されてい
る。FIG. 5 shows a configuration example of a single-chip microcomputer according to the present invention. The single-chip microcomputer 1 is formed on a single semiconductor substrate such as a single-crystal silicon substrate by a known semiconductor integrated circuit manufacturing technique, although not particularly limited.
【0012】シングルチップマイクロコンピュータ1
は、CPU(中央処理装置)3、ROM(リード・オン
リ・メモリ)5、RAM(ランダム・アクセス・メモ
リ)7、タイマ9、シリアルコミュニケーションインタ
フェース(SCI)11、A/D変換器13、割込みコ
ントローラ15、並びに第1乃至第9ポート21〜29
などの機能ブロックを含み、それらは、内部アドレスバ
ス31や内部データバス33などによって互いに信号の
やり取りが可能となるように結合されている。Single-chip microcomputer 1
Are a CPU (Central Processing Unit) 3, a ROM (Read Only Memory) 5, a RAM (Random Access Memory) 7, a timer 9, a serial communication interface (SCI) 11, an A / D converter 13, an interrupt controller 15, and first to ninth ports 21 to 29
And the like, which are connected to each other via an internal address bus 31 and an internal data bus 33 so that signals can be exchanged with each other.
【0013】このシングルチップマイクロコンピュータ
1における主記憶装置は上記RAM7とROM5であ
り、RAM7はCPU3の作業領域又はデータの一時記
憶領域として利用される。ROM5は、特に制限されな
いが、CPU3の動作プログラムを保有する。特に制限
されないが、このROM5は、EPROMライタによっ
て情報をマイクロコンピュータの外部から書込み可能な
EPROM(エレクトリカリ・プログラマブル・リード
・オンリー・メモリ)とされる。The main storage devices of the single-chip microcomputer 1 are the RAM 7 and the ROM 5, and the RAM 7 is used as a work area of the CPU 3 or a temporary storage area of data. The ROM 5 holds an operation program of the CPU 3, although not particularly limited. Although not particularly limited, the ROM 5 is an EPROM (electrically programmable read only memory) in which information can be written from outside the microcomputer by an EPROM writer.
【0014】また、上記半導体基板の周縁部には、電極
パッドとして例えば多数のボンディングパッドが配置さ
れる。例えば、第1乃至第9ポート21〜29の入出力
端子に結合されたボンディングパッドP10〜P17,
P20〜P24,P30〜P37、P40〜P47、P
50〜P57、P60〜P63、P70〜P77、P8
0〜P87、P90〜P97や、クロックジェネレータ
17の入力端子に結合されたボンディングパッドXTA
L,EXTALなどが配置される。ボンディングパッド
XTAL,EXTALには、図示しない振動子が接続さ
れ、あるいは外部クロックが供給される。On the peripheral edge of the semiconductor substrate, for example, a large number of bonding pads are arranged as electrode pads. For example, bonding pads P10 to P17 coupled to the input / output terminals of the first to ninth ports 21 to 29,
P20 to P24, P30 to P37, P40 to P47, P
50 to P57, P60 to P63, P70 to P77, P8
0 to P87, P90 to P97, and a bonding pad XTA coupled to the input terminal of the clock generator 17.
L, EXTAL, etc. are arranged. An oscillator (not shown) is connected to the bonding pads XTAL and EXTAL, or an external clock is supplied.
【0015】このようにして構成されたチップ若しくは
ペレットとしてのシングルチップマイクロコンピュータ
1は組み立て工程において、パッケージのマウント部に
ダイボンディングされ、パッケージのリード端子にボン
ディングパッドがワイヤボンディングされた後に封止さ
れる。In the assembling process, the single-chip microcomputer 1 configured as a chip or a pellet as described above is die-bonded to the mounting portion of the package, and is sealed after the bonding pads are wire-bonded to the lead terminals of the package. You.
【0016】シングルチップマイクロコンピュータ1
は、各種ポートを介して外部とのインタフェースを行う
ようになっている。ポートの機能は動作モードの設定で
指定することができ、アドレス信号を外部に出力して外
部メモリや周辺デバイスをアクセスする動作モードもサ
ポートする。Single-chip microcomputer 1
Interface with the outside through various ports. The port function can be specified by setting the operation mode, and the operation mode that outputs an address signal to the outside to access an external memory or a peripheral device is also supported.
【0017】図1には上記CPU3の構成例が示され
る。FIG. 1 shows a configuration example of the CPU 3.
【0018】109は命令レジスタであり、この命令レ
ジスタ109は、内部バス103に結合され、内部バス
103を介して伝達された命令コードを保持する。この
命令レジスタ109の後段には、命令レジスタ109の
保持命令をデコードすることによって当該命令を解読す
るための命令デコーダ110が配置される。この命令デ
コード結果は、後段に配置された制御部111に入力さ
れる。この制御部111は、CPU3の内部及び外部に
対して適当な制御信号を送出して、上記命令デコーダ1
10でデコードされた命令で指定される必要な動作を、
いくつかのステップに分けて実行する。Reference numeral 109 denotes an instruction register. The instruction register 109 is connected to the internal bus 103 and holds an instruction code transmitted through the internal bus 103. At the subsequent stage of the instruction register 109, an instruction decoder 110 for decoding the instruction held by the instruction register 109 to decode the instruction is arranged. This instruction decode result is input to the control unit 111 arranged at the subsequent stage. The control unit 111 sends appropriate control signals to the inside and outside of the CPU 3 to
The required operation specified by the instruction decoded in 10 is
Perform in several steps.
【0019】算術論理演算ユニット(ALU)107
は、データに対して必要な数値演算、及び論理演算を行
うためのハードウェアユニットである。数値演算には加
算、減算、掛算、割算等があり、論理演算には論理和、
論理積の演算があり、2進法加算回路を基本として実行
される。そのようなALU107には、演算途中で生ず
る種々の状態を保持するためのフラグフリップフロップ
106が結合されている。また、ALU107での演算
のために一時的にデータを保持するための一時レジスタ
105や、各種レジスタ群116が内部バス103に結
合されている。Arithmetic Logic Unit (ALU) 107
Is a hardware unit for performing necessary numerical and logical operations on data. Numerical operations include addition, subtraction, multiplication, division, etc.
There is a logical product operation, which is executed based on a binary addition circuit. A flag flip-flop 106 for holding various states occurring during the operation is coupled to such an ALU 107. Further, a temporary register 105 for temporarily holding data for operation in the ALU 107 and various register groups 116 are coupled to the internal bus 103.
【0020】上記各種レジスタ群116には、特に制限
されないが、CPU3が次に実行すべき命令のアドレス
を格納するためのレジスタであるプログラムカウンタP
C、命令実行結果のステータスを格納するためのステー
タスレジスタSR、各種演算処理に適宜使用される汎用
レジスタR0〜Rnと、タスクスタック領域を指示する
ためのレジスタであるスタックポインタSP、そして、
実際に使用されるレジスタを示すレジスタ使用情報を保
持するためのレジスタ使用情報保持部RSRが含まれ
る。タスクスタック領域は、特に制限されないが、RA
M7に形成される。このレジスタ使用情報保持部RSR
は、他のレジスタと同様に命令によって記憶内容の参照
及び設定が可能とされる。Although not particularly limited, the various register groups 116 include a program counter P which is a register for storing an address of an instruction to be executed next by the CPU 3.
C, a status register SR for storing a status of an instruction execution result, general-purpose registers R0 to Rn appropriately used for various arithmetic processes, a stack pointer SP as a register for indicating a task stack area, and
A register use information holding unit RSR for holding register use information indicating a register actually used is included. The task stack area is not particularly limited.
M7 is formed. This register use information holding unit RSR
The memory contents can be referred to and set by an instruction like other registers.
【0021】上記レジスタ使用情報保持部RSRは、図
2に示されるように、上記各種レジスタの使用状況を記
憶するため、上記各種レジスタに対応した複数の記憶領
域RSR1〜RSRnを有する。As shown in FIG. 2, the register use information holding unit RSR has a plurality of storage areas RSR1 to RSRn corresponding to the various registers in order to store the use status of the various registers.
【0022】ROM5の命令がCPU3によりフェッチ
される毎に、その命令が使用するレジスタが求められ、
そして当該命令が実行された直後に、当該命令実行にお
いて使用されるレジスタに対応する記憶領域にフラグが
設定される。つまり、命令に含まれるオペランドは、オ
ペレーションの対称となるアドレスや数値であるから、
このオペランドをチェックすることにより、当該命令の
実行で実際に使用されるレジスタのアドレスを把握する
ことができ、後のタスクスタックにおいて、そのレジス
タを判別するための情報が設定される。例えば演算処理
により汎用レジスタRnが使用されると、それに対応す
る記憶領域RSR4に制御部111によって論理値
“1”のフラグが設定され、このフラグにより、汎用レ
ジスタRnについての使用有無の判別が可能とされる。Each time an instruction in the ROM 5 is fetched by the CPU 3, a register used by the instruction is obtained.
Immediately after the execution of the instruction, a flag is set in a storage area corresponding to a register used in the execution of the instruction. In other words, since the operands included in the instruction are addresses and numerical values that are symmetrical to the operation,
By checking this operand, the address of a register actually used in the execution of the instruction can be grasped, and information for determining the register is set in a later task stack. For example, when the general-purpose register Rn is used by the arithmetic processing, a flag of the logical value “1” is set by the control unit 111 in the storage area RSR4 corresponding to the general-purpose register Rn. It is said.
【0023】次に、本例の作用について説明する。Next, the operation of the present embodiment will be described.
【0024】図3には、タスク実行中断時の処理のフロ
ーチャートが示される。FIG. 3 shows a flowchart of the process when the task execution is interrupted.
【0025】OSがタスクの実行切り換えのためにレジ
スタ使用情報を利用するには、タスクの実行開始時に、
レジスタ使用情報記憶部RSRの記憶内容がクリアされ
る(ステップS31)。In order for the OS to use the register use information for switching the execution of a task, at the start of execution of the task,
The contents stored in the register use information storage unit RSR are cleared (step S31).
【0026】タスクの処理1(命令)が実行され、その
処理1で汎用レジスタR1,R2が使用されたものとす
る。その命令実行後、実際に使用されたレジスタR1,
R2に対応するレジスタ使用情報のフラグが制御部11
1により、論理値“1”に設定される(ステップS3
2)。It is assumed that processing 1 (instruction) of the task is executed and the general-purpose registers R1 and R2 are used in the processing 1. After execution of the instruction, the registers R1,
The flag of the register use information corresponding to R2 is
1 is set to the logical value "1" (step S3).
2).
【0027】タスクの実行が中断されるとき、タスクの
実行中断時の動作環境を保存するため、OSが実行さ
れ、制御部111が動作されることにより、レジスタ使
用情報のフラグが取得される(ステップS33)。When the execution of the task is interrupted, the OS is executed to save the operating environment at the time of the interruption of the task execution, and the control unit 111 is operated to acquire the flag of the register use information ( Step S33).
【0028】そしてOSにより制御部111が動作され
て、必要最小限のレジスタの記憶状態が、RAM7に形
成されたタスクスタック領域39へ保存される(ステッ
プS34)。例えば、汎用レジスタR0〜Rnのうち、
上記処理1で汎用レジスタR1,R2が使用されている
ことがレジスタ使用情報から明らかであるから、この汎
用レジスタR1,R2の記憶情報がタスクスタック領域
39へ保存される。また、ステータスレジスタSRやプ
ログラムカウンタPCについては当然に使用されている
から、それらについてもタスクスタック領域39へ保存
される。さらに、タスクの実行を中断し、退避したレジ
スタの判別情報としてレジスタ使用情報がタスクスタッ
ク領域39へ退避される。Then, the control unit 111 is operated by the OS, and the storage state of the minimum necessary registers is stored in the task stack area 39 formed in the RAM 7 (step S34). For example, among the general-purpose registers R0 to Rn,
Since it is clear from the register use information that the general-purpose registers R1 and R2 are used in the above process 1, the storage information of the general-purpose registers R1 and R2 is stored in the task stack area 39. Since the status register SR and the program counter PC are naturally used, they are also stored in the task stack area 39. Further, the execution of the task is interrupted, and the register use information is saved in the task stack area 39 as discrimination information of the saved register.
【0029】そして、タスクの実行が中断されているた
め、そのタスクのレジスタ使用情報がクリアされ(ステ
ップS35)、別のタスクの処理に備えられる。Then, since the execution of the task is suspended, the register use information of the task is cleared (step S35), and the task is prepared for processing of another task.
【0030】図4にはタスク実行再開時の処理のフロー
チャートが示される。FIG. 4 shows a flowchart of a process at the time of resuming task execution.
【0031】先に中断されたタスクの実行再開時におい
ては、OSの実行により制御部111が動作されて、中
断時に退避したレジスタ使用情報がタスクスタック領域
39から取得され(ステップS41)、それに基づいて
レジスタ使用情報記憶部RSRの記憶内容が、上記処理
中断時の内容に復帰される(ステップS42)。そし
て、回復したレジスタ使用情報のフラグに対応するレジ
スタ情報が求められ、レジスタR1,R2、プログラム
カウンタPC、ステータスレジスタSRの記憶情報の復
帰が行われる(ステップS42)。そのように復帰され
ることで、中断されたタスクの動作環境が回復されて、
タスクの実行が再開される(ステップS43)。At the time of resuming the execution of the previously interrupted task, the control unit 111 is operated by the execution of the OS, and the register use information saved at the time of the interruption is acquired from the task stack area 39 (step S41). Then, the contents stored in the register use information storage unit RSR are restored to the contents at the time of the interruption of the process (step S42). Then, register information corresponding to the recovered register use information flag is obtained, and the stored information of the registers R1 and R2, the program counter PC, and the status register SR is restored (step S42). By returning as such, the operating environment of the interrupted task is restored,
Execution of the task is resumed (step S43).
【0032】図6には、上記シングルチップマイクロコ
ンピュータ1が適用されるコンピュータシステムの構成
例が示される。FIG. 6 shows a configuration example of a computer system to which the single-chip microcomputer 1 is applied.
【0033】このコンピュータシステムは、バスBUS
を介して、シングルチップマイクロコンピュータ1、S
RAM(スタティック・ランダム・アクセス・メモリ)
133、ROM(リード・オンリ・メモリ)134、周
辺装置制御部135、表示制御系136などが、互いに
信号のやり取り可能に結合され、予め定められたプログ
ラムに従って所定のデータ処理を行うコンピュータシス
テムとして構成される。上記シングルチップマイクロコ
ンピュータ1は、本システムの論理的中核とされる。S
RAM133、及びROM134は内部記憶装置として
位置付けられている。そして、SDRAM132やSR
AM133には、シングルチップマイクロコンピュータ
1での計算や制御に必要なアプリケーションプログラム
やデータが格納される。周辺装置制御部135によっ
て、外部憶装置138の動作制御や、キーボード139
などからの情報入力制御が行われる。また、上記表示制
御系136によって、CRTディスプレイ140への情
報表示制御が行われる。This computer system has a bus BUS
Through the single-chip microcomputer 1, S
RAM (static random access memory)
133, a ROM (Read Only Memory) 134, a peripheral device control unit 135, a display control system 136, etc., are connected to each other so as to be able to exchange signals, and are configured as a computer system that performs predetermined data processing according to a predetermined program. Is done. The single-chip microcomputer 1 is the logical core of the present system. S
The RAM 133 and the ROM 134 are positioned as internal storage devices. And SDRAM 132 or SR
The AM 133 stores application programs and data necessary for calculation and control in the single-chip microcomputer 1. The peripheral device control unit 135 controls the operation of the external storage device 138 and the keyboard 139.
Information input control is performed. The display control system 136 controls information display on the CRT display 140.
【0034】上記した例によれば、以下の作用効果を得
ることができる。According to the above example, the following functions and effects can be obtained.
【0035】(1)制御部111は、複数のレジスタP
C,SR,SP,R0〜Rnのうち、実際に使用される
レジスタを示すレジスタ使用情報をレジスタ使用情報記
憶部RSRに記憶し、さらに制御部111はこのレジス
タ使用情報に基づいて、実際に使用されたレジスタの保
持情報をスタック領域に待避する。このため、上記複数
のレジスタのうちで、実際に使用されないレジスタの保
持情報をスタック領域へ待避する無駄を回避することが
できるので、その分、タスク実行の切り換え処理の高速
化を図ることができる。(1) The control unit 111 includes a plurality of registers P
Of the C, SR, SP, and R0 to Rn, register use information indicating a register actually used is stored in the register use information storage unit RSR, and the control unit 111 uses the register use information based on the register use information. The held information of the registered register is saved in the stack area. For this reason, it is possible to avoid wasteful saving of the held information of the register that is not actually used among the plurality of registers to the stack area, so that the task execution switching process can be speeded up accordingly. .
【0036】(2)上記(1)の作用効果により、タス
ク実行の切り換え処理の高速化を図ることができるの
で、そのようなシングルチップマイクロコンピュータ1
を含むコンピュータシステムにおけるデータ処理の高速
化を図ることができる。(2) Because of the effect of the above (1), the speed of the task execution switching process can be increased.
, The speed of data processing in a computer system including a computer can be increased.
【0037】以上本発明者によってなされた発明を具体
的に説明したが、本発明はそれに限定されるものではな
く、その要旨を逸脱しない範囲で種々変更可能であるこ
とはいうまでもない。Although the invention made by the inventor has been specifically described above, the present invention is not limited to this, and it goes without saying that various modifications can be made without departing from the gist of the invention.
【0038】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるプログ
ラムROM内蔵型シングルチップマイクロコンピュータ
に適用した場合について説明したが、本発明はそれに限
定されるものではなく、プログラムROM5を持たずに
汎用利用可能なマイクロコンピュータに適用することが
できる。In the above description, the case where the invention made by the present inventor is mainly applied to a single-chip microcomputer with a built-in program ROM, which is the field of application, has been described, but the present invention is not limited to this. Instead, the present invention can be applied to a microcomputer that can be generally used without having the program ROM 5.
【0039】本発明は、少なくとも情報保持のための複
数のレジスタを備えることを条件に適用することができ
る。The present invention can be applied on condition that at least a plurality of registers for holding information are provided.
【0040】[0040]
【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.
【0041】すなわち、第1制御手段は、複数のレジス
タのうち、実際に使用されるレジスタを示すレジスタ使
用情報を上記記憶手段に記憶し、第2制御手段はこのレ
ジスタ使用情報に基づいて、実際に使用されたレジスタ
の保持情報をスタック領域に待避する。それにより、上
記複数のレジスタのうちで、実際に使用されないレジス
タの保持情報がスタック領域へ待避される無駄が回避さ
れるので、タスク実行の切り換え処理の高速化を図るこ
とができる。That is, the first control means stores the register use information indicating the register actually used among the plurality of registers in the storage means, and the second control means stores the register use information based on the register use information. Saves the held information of the register used in the stack area. Accordingly, it is possible to avoid wasting the information held in the registers that are not actually used among the plurality of registers in the stack area, thereby speeding up the task execution switching process.
【図1】本発明にかかるマイクロコンピュータに含まれ
るCPUの構成例ブロック図である。FIG. 1 is a block diagram illustrating a configuration example of a CPU included in a microcomputer according to the present invention.
【図2】上記CPUに含まれるレジスタ使用情報記憶部
の説明図である。FIG. 2 is an explanatory diagram of a register use information storage unit included in the CPU.
【図3】上記CPUにおけるタスク実行中断時の処理を
示すフローチャートである。FIG. 3 is a flowchart showing a process when the task execution is interrupted in the CPU.
【図4】上記CPUにおけるタスク実行再開時の処理を
示すフローチャートである。FIG. 4 is a flowchart showing processing at the time of resuming task execution in the CPU.
【図5】上記CPUを含むシングルチップマイクロコン
ピュータの構成例ブロック図である。FIG. 5 is a block diagram illustrating a configuration example of a single-chip microcomputer including the CPU.
【図6】上記シングルチップマイクロコンピュータを含
むコンピュータシステムの構成例ブロック図である。FIG. 6 is a block diagram illustrating a configuration example of a computer system including the single-chip microcomputer.
3 CPU 39 タスクスタック領域 104 アキュムレータ 105 一時レジスタ 106 フラグフリップフロップ 107 ALU 109 命令レジスタ 110 命令デコーダ 111 制御部 116 レジスタ群 PC プログラムカウンタ SR スタックポインタ R0〜Rn 汎用レジスタ SP スタックポインタ RSR レジスタ使用情報記憶部 3 CPU 39 Task stack area 104 Accumulator 105 Temporary register 106 Flag flip-flop 107 ALU 109 Instruction register 110 Instruction decoder 111 Control unit 116 Register group PC program counter SR Stack pointer R0-Rn General-purpose register SP Stack pointer RSR Register usage information storage unit
Claims (3)
記複数のレジスタの保持内容を待避するためのスタック
領域とを含むマイクロコンピュータにおいて、 上記複数のレジスタのうち、実際に使用されるレジスタ
を示すレジスタ使用情報を記録するための記憶手段と、 命令実行毎に、上記レジスタ使用情報を上記記憶手段に
書き込むための第1制御手段と、 上記記憶手段の記憶情報及びその記憶情報に基づいて特
定されるレジスタの記憶情報を上記スタック領域に待避
するための第2制御手段と、 を含むことを特徴とするマイクロコンピュータ。1. A microcomputer including a plurality of registers for holding information and a stack area for saving contents held by the plurality of registers, wherein a register actually used among the plurality of registers is Storage means for recording the register use information shown, first control means for writing the register use information to the storage means each time an instruction is executed, and identification based on the storage information of the storage means and the storage information. And a second control unit for saving the storage information of the register to be stored in the stack area.
報に基づいて特定されるレジスタの記憶情報が上記第2
制御手段により上記スタック領域に待避された後に、上
記記憶手段を初期化するための第3制御手段を含む請求
項1記載のマイクロコンピュータ。2. The information stored in the storage means and the storage information in a register specified based on the storage information are stored in the second storage unit.
2. The microcomputer according to claim 1, further comprising third control means for initializing said storage means after being evacuated to said stack area by control means.
記スタック領域に待避されているレジスタ使用情報及び
上記複数のレジスタの保持情報に基づいてそれぞれ対応
する上記記憶手段及びレジスタの記憶状態を復帰するた
めの第4制御手段を含むことを特徴とする請求項2記載
のマイクロコンピュータ。3. When the interrupted task is restarted, the storage state of the corresponding storage means and the storage state of the corresponding register are respectively determined based on the register use information saved in the stack area and the held information of the plurality of registers. 3. The microcomputer according to claim 2, further comprising a fourth control unit for returning.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP10198302A JP2000029721A (en) | 1998-07-14 | 1998-07-14 | Microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP10198302A JP2000029721A (en) | 1998-07-14 | 1998-07-14 | Microcomputer |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2000029721A true JP2000029721A (en) | 2000-01-28 |
Family
ID=16388882
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP10198302A Withdrawn JP2000029721A (en) | 1998-07-14 | 1998-07-14 | Microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2000029721A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8195885B2 (en) | 2006-06-23 | 2012-06-05 | Denso Corporation | Electronic unit for saving state of task to be run in stack |
JP2019017929A (en) * | 2017-07-21 | 2019-02-07 | 株式会社三洋物産 | Game machine |
-
1998
- 1998-07-14 JP JP10198302A patent/JP2000029721A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8195885B2 (en) | 2006-06-23 | 2012-06-05 | Denso Corporation | Electronic unit for saving state of task to be run in stack |
JP2019017929A (en) * | 2017-07-21 | 2019-02-07 | 株式会社三洋物産 | Game machine |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6292888B1 (en) | Register transfer unit for electronic processor | |
US6243804B1 (en) | Single cycle transition pipeline processing using shadow registers | |
US5584031A (en) | System and method for executing a low power delay instruction | |
US4731736A (en) | Method and apparatus for coordinating execution of an instruction by a selected coprocessor | |
JPH05257712A (en) | Microprocessor device and method for restarting automated stop state | |
US5689714A (en) | Method and apparatus for providing low power control of peripheral devices using the register file of a microprocessor | |
KR970003321B1 (en) | System using microprocessor address lines coprocessor selection within a multi-coprocessor apparatus | |
JP2822782B2 (en) | Single chip microcomputer | |
US6986028B2 (en) | Repeat block with zero cycle overhead nesting | |
JP3970609B2 (en) | Processor system | |
US4914578A (en) | Method and apparatus for interrupting a coprocessor | |
US4758950A (en) | Method and apparatus for selectively delaying an interrupt of a coprocessor | |
JP2000029721A (en) | Microcomputer | |
JPH09505430A (en) | Microcontroller with reconfigurable program state word | |
JP2000137619A (en) | Microcomputer | |
JPH06230985A (en) | Task control circuit and microprocessor | |
JPH07219766A (en) | Arithmetic processor | |
JPH04280334A (en) | One chip microcomputer | |
JPH11143732A (en) | Microcomputer and emulator | |
WO1998044408A1 (en) | Microcomputer and electronic equipment | |
JPH05241880A (en) | Microprocessor and emulator | |
JPS6349941A (en) | Arithmetic processing unit | |
JPS5942331B2 (en) | Prosetsusasouchinoseigiohoshiki | |
JPS6354630A (en) | Data processor | |
JPH0325674A (en) | Information processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20051004 |