JP3575052B2 - Electronic equipment - Google Patents

Electronic equipment Download PDF

Info

Publication number
JP3575052B2
JP3575052B2 JP07501494A JP7501494A JP3575052B2 JP 3575052 B2 JP3575052 B2 JP 3575052B2 JP 07501494 A JP07501494 A JP 07501494A JP 7501494 A JP7501494 A JP 7501494A JP 3575052 B2 JP3575052 B2 JP 3575052B2
Authority
JP
Japan
Prior art keywords
correction
task
information
value
control information
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.)
Expired - Fee Related
Application number
JP07501494A
Other languages
Japanese (ja)
Other versions
JPH07281886A (en
Inventor
巌 山本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP07501494A priority Critical patent/JP3575052B2/en
Publication of JPH07281886A publication Critical patent/JPH07281886A/en
Application granted granted Critical
Publication of JP3575052B2 publication Critical patent/JP3575052B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は、例えば電子機器に内蔵されて使用される1チップ・マイクロコンピュータのような電子装置に関し、特にリアルタイム・マルチタスク処理を行う場合に利用されるものである。
【0002】
【従来の技術】
例えば電子機器に内蔵されて使用される1チップ・マイクロコンピュータは、固定記憶手段(ROM)、処理手段(CPU)、入力手段、可変記憶手段(RAM)等が一体に集積された電子装置から構成されている。
【0003】
このような電子装置(1チップ・マイクロコンピュータ)において、処理手段(CPU)での処理のプログラムは、例えば固定記憶手段(ROM)に記憶されている。すなわちこの固定記憶手段(ROM)に記憶された情報(処理プログラム)に従って特定の処理が行われる。そこでこの固定記憶手段(ROM)を例えばマスクROMで形成することにより、このような電子装置は、特に量産化によってその価格を低廉にすることが可能である。
【0004】
一方、上述の電子装置は、民生用のカメラ一体形VTR、小型ビデオデッキ等の電子機器に内蔵されて使用されている。このような電子機器(民生用カメラ一体形VTR等)においては、近年商品の差別化を目的とした多機能化が進められている。このため固定記憶手段(ROM)に記憶される情報(処理プログラム)の量が増大し、特に処理プログラムの長大化に伴って、その不備(バグ)の発生は避けられない問題になっている。
【0005】
そこでこのような不備が装置の量産後に発見された場合には、既に量産された装置を廃棄して再度量産を行ったり、その不備を修正するための外部部品を設けるなどの処理を行う必要が生じる。しかし再度量産を行うには多大な追加経費が必要であり、また外部部品を設けることは部品の実装密度の高い電子機器では実施が困難である場合が多い。
【0006】
これに対して本願出願人は、先にこのような固定記憶手段に記憶される情報の不備を、製品の量産が行われた後に修正する手段を提案した(特開平4−346127号公報参照)。
【0007】
すなわちこの先願では、電子装置内に不備修正のための修正情報記憶手段とアクセス切り換え手段を設ける。そして固定記憶手段に記憶される情報が不備の部分を判別して、その部分ではアクセスを固定記憶手段から修正情報記憶手段に切り換える。またこの修正情報の中に次の固定記憶手段の不備の部分に関する情報を設け、この情報に基づいてアクセス切り換え手段の修正制御情報等を書き換えるようにしたものである。
【0008】
これによれば、固定記憶手段に記憶される情報が不備の部分を、修正情報記憶手段に記憶される情報で置き換えて不備の修正を行うと共に、この修正情報に基づいてアクセス切り換え手段の修正制御情報等を書き換えることによって、固定記憶手段に記憶される情報の不備の部分の数を予め限定せずに、必要な数の修正を行うことができる。
【0009】
ところで上述のような電子装置(1チップ・マイクロコンピュータ)において、近年μITRON等のリアルタイム・マルチタスク処理を行う装置が実施されるようになっている。すなわちこのようなリアルタイム・マルチタスク処理においては、実行プログラムが複数のタスクに分割されて形成され、これらの複数のタスクが所定の優先順位に従って任意に実行されるようになっている。
【0010】
この場合に上述の先願の装置において、固定記憶手段(ROM)に記憶される情報(処理プログラム)が常に所定の順番でアクセスされている場合には、任意の修正箇所で修正が行われた最後で次の修正箇所を指定することで、複数の不備の部分を順次修正することができる。
【0011】
ところが上述のリアルタイム・マルチタスク処理では、複数のタスクが任意に実行されるようになっている。このため上述のように任意の修正箇所で修正が行われた最後で次の修正箇所を指定するのでは、タスクが切り換えられた場合に、正しく次の修正箇所を指定することができなくなってしまう。すなわちリアルタイム・マルチタスク処理では、任意の修正箇所で修正が行われた最後で次の修正箇所を指定することは困難である。
【0012】
なお従来、割り込み処理によって別の情報がアクセスされる場合には、上述のアクセス切り換え手段の修正制御情報等をスタックメモリに退避させ、割り込み処理の先頭でその処理の修正制御情報を設定し、割り込み処理の終了時に修正制御情報を割り込み処理の前の状態に復帰させることによって、割り込み処理中の情報の修正も良好に行わせることができる(特開平5−204630号公報参照)。これは割り込み処理では、割り込み処理の終了時に必ず割り込みの行われた位置に戻るために、1つのスタックメモリで対処が可能なものである。
【0013】
しかしながら上述のリアルタイム・マルチタスク処理では、複数のタスクが任意に実行されるために、上述の割り込み処理と同様の方法では、それぞれの処理ごとにスタックメモリが必要になり、全ての処理に対処するためには膨大なスタックメモリの容量が必要になって実現が困難であった。
【0014】
【発明が解決しようとする課題】
この発明はこのような点に鑑みて成されたものであって、解決しようとする問題点は、従来の電子装置では、リアルタイム・マルチタスク処理で複数のタスクが任意に実行される場合に、その情報の不備の修正を容易に行うことができなかったというものである。
【0015】
【課題を解決するための手段】
本発明は、実行プログラムが複数のタスクに分割されて形成され、これらの複数のタスクが任意に実行されるようにした電子装置において、情報が固定的に記憶された固定記憶手段と、アドレス制御を行うアドレス制御手段と、外部からの情報が入力される入力手段と、この入力手段を介して外部から入力される修正情報が記憶される修正情報記憶手段と、上記固定記憶手段の修正箇所への上記アドレス制御手段によるアクセスを判別する判別手段と、この判別手段からの信号により上記アクセスを上記固定記憶手段から上記修正情報記憶手段へ切り換える切り換え手段と、上記タスクごとに上記修正制御情報をそれぞれ指示する値を記憶する第1の記憶手段と、上記第1の記憶手段を上記タスクごとに最初に用いられる上記修正制御情報を指示する値に初期化する手段と、上記アドレス制御手段への割り込み処理ごとに上記修正制御情報をそれぞれ指示する値を記憶する第2の記憶手段と、実行中の上記修正制御情報を指示する値を退避するスタックメモリとが一体に集積され、上記実行されるタスクが変更されるごとに上記判別手段及び上記切り換え手段の上記固定記憶手段の修正箇所に関する修正制御情報が書き換えられ、上記第1の記憶手段に記憶された値に基づいて上記判別手段及び上記切り換え手段への上記修正制御情報の書き換えが行われ、上記修正情報にはそれぞれ次の上記修正制御情報を指示する値が含められてこの値を用いて上記第1の記憶手段に記憶される値が書き換えられ、上記実行されるタスクのスタート時に上記第1の記憶手段を上記タスクごとに最初に用いられる上記修正制御情報を指示する値に初期化し、上記割り込み処理が行われたときには、上記第2の記憶手段に記憶された値に基づいて上記判別手段及び上記切り換え手段への上記修正制御情報の書き換えが行われると共に、上記割り込み処理の終了時に、上記スタックメモリに記憶された値に基づいて上記判別手段及び上記切り換え手段への上記修正制御情報の書き換えが行われることを特徴とする電子装置である。
【0020】
【作用】
これによれば、実行されるタスクが変更されるごとに、判別手段及び切り換え手段の固定記憶手段の修正箇所に関する修正制御情報が書き換えられることによって、リアルタイム・マルチタスク処理で複数のタスクが任意に実行される場合においても、固定記憶手段の情報の不備の修正を良好に行うことができる。
【0021】
また、タスクごとに修正制御情報をそれぞれ指示する値を記憶する第1の記憶手段が設けられ、この第1の記憶手段に記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができる。
【0022】
さらに、修正情報にはそれぞれ次の修正制御情報を指示する値が含められることによって必要な数の修正を容易に行うことができると共に、この値を用いて第1の記憶手段に記憶される値を書き換えることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができる。
【0023】
また、実行されるタスクのスタート時には、第1の記憶手段をタスクごとに最初に用いられる修正制御情報を指示する値に初期化する手段が設けられることによって、タスクが強制終了されたような場合にも、修正を良好に行うことができる。
【0024】
さらに、アドレス制御手段への割り込み処理ごとに修正制御情報をそれぞれ指示する値を記憶する第2の記憶手段が設けられ、割り込み処理が行われたときには、第2の記憶手段に記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えを行うと共に、実行中の修正制御情報を指示する値を退避するスタックメモリが設けられ、割り込み処理の終了時に、スタックメモリに記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、任意の割り込み処理に対しても修正を良好に行うことができる。
【0025】
【実施例】
図1において、100は電子装置としての1チップ・マイクロコンピュータの全体を示す。この電子装置100には、処理手段としてのCPU1、固定記憶手段としてのROM2、修正情報記憶手段としてのRAM3、入力手段4等が設けられる。このCPU1、ROM2、RAM3及び入力手段4は互いにデータバス5を介して接続される。またCPU1で形成されたアドレス出力がアドレスバス6を介してROM2及びRAM3のアドレス入力に接続される。
【0026】
また修正箇所を示す修正アドレスのレジスタ7とその修正データのレジスタ8とが設けられ、これらのレジスタ7、8がデータバス5に接続される。さらにこのレジスタ7に記憶されたアドレスとアドレスバス6のアドレスとの一致を検出する比較器9が設けられる。そしてこの比較器9のアドレスが一致したことを示す信号の出力部がアンド回路10に接続される。
【0027】
また後述する修正許可信号のレジスタ11と修正制御情報(PCB)を指示する値(PCBP)のレジスタ12が設けられ、これらのレジスタ11、12がデータバス5に接続される。さらにレジスタ11の出力部がアンド回路10に接続される。そしてこのアンド回路10の出力部が、ROM2及びレジスタ8の入出力部に接続され、これらの入出力部の接続が切り換えられる。なおレジスタ7〜レジスタ12の回路は、例えばmチャンネル分が並列に設けられる。
【0028】
さらに入力手段4には外部記憶装置200が接続される。この外部記憶装置200も電子機器内に設けられる。なおこの外部記憶装置200は、例えばEEPROMで構成され、通常は電子機器の調整工程で得られたパラメータ等が記憶されるものである。そしてこの外部記憶装置200からの情報は入力手段4を通じてRAM3に記憶されてCPU1での処理等に使用される。
【0029】
また、上述のROM2にはCPU1での処理のプログラムの情報が固定的に記憶される。すなわちこの処理プログラムには、例えば図中に示すように、まず基本プログラム(OS)20が設けられる。この基本プログラム20には、後述する割り込み処理や、タスクの優先順位等を定めてその実行を行うためのプログラム等が設けられる。
【0030】
さらにROM2には、目的とする処理を行う主プログラムが設けられる。この主プログラムは、例えば複数のタスク21、22・・・2nに分割されて形成される。そしてこれらの複数のタスク21、22・・・2nが上述の基本のプログラム20によって定められる所定の優先順位等に従って任意に実行される。またROM2には、任意の割り込み処理のためのプログラム2xも設けられる。
【0031】
また、上述のRAM3には、後述する修正制御情報(PCB:Patch Control Block )の記憶されるエリア31、各タスクごとに使用されるPCBをそれぞれ指示する値(PCBP:PCB Pointer )の記憶されるタスクPDS(Patch Date Select )エリア32(第1の記憶手段)、各割り込みごとに使用されるPCBをそれぞれ指示する値(PCBP)の記憶される割り込みPDSエリア33(第2の記憶手段)が設けられる。
【0032】
さらにRAM3には、後述する各タスクごとに最初に用いられるPCBをそれぞれ指示する値(PCBP)の記憶されるPDS初期化テーブルのエリア34、ROM2に記憶された情報を変更する修正情報の記憶されるエリア35、スタックエリア36、実行中のPCBを指示する値(PCBP)の記憶されるカレントPCBエリア37等が設けられる。
【0033】
このような電子装置100において、まず起動時には上述の基本プログラム20が実行される。そしてこの中の処理によって、上述の外部記憶装置200からの情報が入力手段4を通じてRAM3に記憶される。これによりRAM3には、上述のエリア31〜35にそれぞれの情報が記憶される。なおエリア32とエリア34には、起動時には同じ情報が記憶される。
【0034】
そして任意のタスクiが実行されるときには、まずRAM3のタスクPDSエリア32に記憶された、実行されるタスクで使用されるPCBをそれぞれ指示する値(PCBP)がレジスタ12に読み出される。すなわちタスクPDSエリア32には、例えば図2に示すように、各タスク1、2・・・nごとに、mチャンネル分の使用されるPCBをそれぞれ指示する値(PCBP)が記憶されている。このタスクPDSエリア32の値が、各修正チャンネル1、2・・・mごとにレジスタ12に書き込まれる。
【0035】
さらにこのレジスタ12の内容に従って、それぞれ指示されたPCBがRAM3のPCBエリア31から読み出され、それぞれ修正アドレスのレジスタ7と修正データのレジスタ8に書き込まれる。またレジスタ12の内容が、RAM3のカレントPCBエリア37に書き込まれる。また例えばPDS初期化テーブルエリア34に関連して各タスクの修正チャンネルごとに修正許可信号が記憶され、実行されるタスクに対応する修正許可信号がレジスタ11に書き込まれる。なおこれらの処理は、上述の基本プログラム20によって行われる。
【0036】
すなわち上述のPCBエリア31に記憶されるPCB(修正制御情報)は、例えば図3に示すように、ROM2の修正箇所の修正アドレスと修正データが対にされて順次記憶されている。またレジスタ12には、例えばこれらの各PCBの先頭のアドレスに相当するPCBをそれぞれ指示する値(PCBP)が記憶される。そして上述の処理では、これらのレジスタ12の値に従ってPCBエリア31に記憶されたPCBが読み出され、この中の修正アドレスがレジスタ7に書き込まれ、修正データがレジスタ8に書き込まれる。
【0037】
従ってこの装置において、上述の任意のタスクiが実行されている間に、レジスタ7に書き込まれた修正アドレスとアドレスバス6に供給される実行アドレスとが比較器9で比較され、それらの一致が判別される。そしてこれらの一致が比較器9で判別されると、この判別信号がアンド回路10を通じてROM2及びレジスタ8の入出力部に供給され、この判別信号の期間にROM2の入出力部が遮断され、レジスタ8の入出力部がデータバス5に接続される。
【0038】
これによって上述のROM2の修正箇所では、ROM2のデータに代わってレジスタ8の修正データがデータバス5に供給され、ROM2のデータの修正が行われる。このようにしてROM2に記憶されたデータの修正が行われる。
【0039】
そしてこの装置において、実行されるタスクが変更された場合には、RAM3のタスクPDSエリア32に記憶された、変更されたタスクで使用されるPCBをそれぞれ指示する値(PCBP)がレジスタ12に読み出される。さらにこのレジスタ12の内容に従って、それぞれ指示されたPCBがRAM3のPCBエリア31から読み出され、それぞれの修正アドレスと修正データがレジスタ7、8に書き込まれる。
【0040】
これによってこの変更されたタスクにおいても、上述のROM2の修正箇所では、ROM2のデータに代わってレジスタ8の修正データがデータバス5に供給され、ROM2のデータの修正が行われる。このようにしてROM2に記憶されたデータの修正が行われる。なおPCBエリア31は各タスクに共通に設けられる。また異なるタスクから同じPCBが指示されて、PCBが共用されるようにすることもできる。
【0041】
こうして上述の装置によれば、実行されるタスクが変更されるごとに、判別手段(レジスタ7)及び切り換え手段(レジスタ8)の固定記憶手段(ROM2)の修正箇所に関する修正制御情報(PCB)が書き換えられることによって、リアルタイム・マルチタスク処理で複数のタスクが任意に実行される場合においても、固定記憶手段の情報の不備の修正を良好に行うことができるものである。
【0042】
また、タスクごとに修正制御情報(PCB)をそれぞれ指示する値を記憶する第1の記憶手段(タスクPDSエリア32)が設けられ、この第1の記憶手段に記憶された値に基づいて判別手段(レジスタ7)及び切り換え手段(レジスタ8)への修正制御情報の書き換えが行われることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができるものである。
【0043】
さらに上述の装置において、レジスタ8の修正データには、例えばジャンプ命令とそのジャンプベクトルを設けることができる。この場合に、比較器9でレジスタ7の修正アドレスとアドレスバス6の実行アドレスとの一致が判別されるとジャンプ命令が実行される。そしてそのジャンプベクトルに、RAM3の修正情報エリア35の任意の修正情報の先頭のアドレスを指定しておくことによって、ROM2の修正箇所でRAM3の任意の修正情報が実行される。
【0044】
すなわちRAM3の修正情報エリア35には、例えば図4に示すようにそれぞれ任意の長さの修正情報が任意の数設けられている。そして比較器9でレジスタ7の修正アドレスとアドレスバス6の実行アドレスとの一致が判別されたときには、このRAM3の修正情報エリア35のジャンプベクトルで指定されたアドレスから必要な修正情報が読み出される。
【0045】
さらにこの修正情報には、例えばその末尾に次の修正箇所に関する情報が含められ、この次の修正箇所の情報を用いてレジスタ7、8の修正アドレスと修正データを書き換える処理が行われる。すなわち修正情報の末尾には、例えば次の修正箇所の修正制御情報(PCB)を指示する値(PCBP)が含められ、上述のレジスタ12の値がこの修正情報の末尾からの値に書き換えられる。
【0046】
そしてこのレジスタ12の値によって、PCBエリア31に記憶された次の修正箇所の修正制御情報(PCB)が読み出され、この中の修正アドレスと修正データがレジスタ7、8に書き込まれる。これによって、レジスタ7、8が次の修正箇所の修正アドレスと修正データに書き換えられ、ROM2の次の修正箇所の修正が行われる。このようにして、上述の修正チャンネル数m以上の、必要な数の修正箇所の修正を行うことができる。
【0047】
さらに、上述のレジスタ12の書き換えられた値と、上述のRAM3のカレントPCBエリア37に書き込まれた値が比較され、値が一致しないチャンネルのタスクPDSエリア32の値が書き換えられる。その後、レジスタ12の内容が、RAM3のカレントPCBエリア37に書き込まれる。これらの処理も、上述の基本プログラム20によって行われる。
【0048】
従ってこの装置において、任意のタスクiの処理が中断され、他のタスクが実行された後に元の任意のタスクiの処理が再開される場合にも、タスクPDSエリア32の値が再度レジスタ12に書き込まれることによって、再開後のタスクの次のROM2の修正箇所の修正が行われる。
【0049】
こうして上述の装置によれば、修正情報にはそれぞれ次の修正制御情報(PCB)を指示する値(PCBP)が含められることによって必要な数の修正を容易に行うことができると共に、この値を用いて第1の記憶手段(タスクPDSエリア32)に記憶される値を書き換えることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができるものである。
【0050】
さらに上述の装置において、タスクは強制終了される場合がある。このようなタスクの強制終了では、次にそのタスクの処理が開始されるときにはタスクの最初から処理が行われることになる。その場合に、上述のようにタスクPDSエリア32の値が書き換えられていると、タスクの処理が開始されたときに最初からのROM2の修正箇所の修正が行われない恐れが生じる。
【0051】
そこで上述の装置においては、RAM3に、各タスクごとに最初に用いられるPCBをそれぞれ指示する値(PCBP)の記憶されるPDS初期化テーブルのエリア34が設けられ、タスクの処理が開始されるときにタスクPDSエリア32の値の初期化が行われるようにされる。なおこれらの処理は、上述の基本プログラム20によって行われる。
【0052】
すなわちエリア34には、図5に示すようなPDS初期化テーブルが設けられる。このエリア34に設けられるPDS初期化テーブルは、上述のタスクPDSエリア32と同じ構成とされる。そして上述の任意のタスクiの処理が最初から行われるときには、このエリア34に設けられるPDS初期化テーブルの対応するタスクの値が、タスクPDSエリア32の任意のタスクiの部分に書き込まれるようにする。
【0053】
従って上述の装置において、タスクは強制終了され、次にそのタスクの処理が開始されるときには、タスクPDSエリア32がエリア34に設けられるPDS初期化テーブルの値で書き換えられ、最初からのROM2の修正箇所の修正を行うことができる。
【0054】
こうして上述の装置実行されるタスクのスタート時には、第1の記憶手段をタスクごとに最初に用いられる修正制御情報を指示する値に初期化する手段が設けられることによって、タスクが強制終了されたような場合にも、修正を良好に行うことができるものである。
【0055】
また上述の装置において、ROM2の割り込み処理のためのプログラム2xの最初には、上述のカレントPCBエリア37に記憶されたデータをスタックエリア36に退避させる処理と、RAM3の割り込みPDSエリア33に記憶された、実行される割り込みで使用されるPCBをそれぞれ指示する値(PCBP)をレジスタ12に書き込む処理が設けられる。
【0056】
すなわち割り込みPDSエリア33には、例えば図6に示すように、各割り込み1、2・・・nごとに、mチャンネル分の使用されるPCBをそれぞれ指示する値(PCBP)が記憶されている。なおこの割り込みPDSエリア33の構成は、上述のタスクPDSエリア32の構成と等しくされる。この割り込みPDSエリア33の値が、各修正チャンネル1、2・・・mごとにレジスタ12に書き込まれる。
【0057】
さらにこのレジスタ12の内容に従って、それぞれ指示されたPCBがRAM3のPCBエリア31から読み出され、それぞれ修正アドレスのレジスタ7と修正データのレジスタ8に書き込まれる。なおこれらの処理も上述の割り込み処理のためのプログラム2xに設けられる。これによって以下、上述のタスクの処理と同様にしてROM2の情報の修正が行われる。さらにPCBエリア31はタスク処理のものと共通に設けられ、タスク処理からと同じPCBが指示されて、PCBが共用されるようにすることもできる。
【0058】
また割り込みプログラム2xの最後には、スタックエリア32に退避させたデータをレジスタ12に再度書き込む処理が設けられる。そしてこのレジスタ12の内容に従って、それぞれ指示されたPCBがRAM3のPCBエリア31から読み出され、それぞれ修正アドレスのレジスタ7と修正データのレジスタ8に書き込まれる。
【0059】
従ってこの装置において、CPU1に割り込み要求がされると、割り込みの処理が行われる。そしてこの割り込みプログラム2xの最初で、カレントPCBエリア37に記憶されたデータがRAM3のスタックエリア36に退避される。さらにその割り込みに対応する修正制御情報(PCB)がレジスタ7及び8に書き込まれる。そして割り込みプログラムが進行し、そのアドレスがレジスタ7のアドレスと一致すると、レジスタ8の修正データによって修正が行われる。
【0060】
こうして上述の装置によれば、アドレス制御手段(CPU1)への割り込み処理ごとに修正制御情報をそれぞれ指示する値を記憶する第2の記憶手段(割り込みPDSエリア33)が設けられ、割り込み処理が行われたときには、第2の記憶手段に記憶された値に基づいて判別手段(レジスタ7)及び切り換え手段(レジスタ8)への修正制御情報の書き換えを行うと共に、実行中の修正制御情報を指示する値(カレントPCB)を退避するスタックメモリ36が設けられ、割り込み処理の終了時に、スタックメモリに記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、任意の割り込み処理に対しても修正を良好に行うことができるものである。
【0061】
なお上述の装置において、割り込み処理の際にも、例えば修正情報の末尾には次の修正箇所の修正制御情報(PCB)を指示する値(PCBP)が含められ、上述のレジスタ12の値がこの修正情報の末尾からの値に書き換えられる。ただしこの場合に、割り込み処理は常に所定の順番でその処理の最後まで実行されることが保証されているので、この次の修正箇所の修正制御情報(PCB)を指示する値(PCBP)によって割り込みPDSエリア33を書き換えることはせず、従って割り込みPDSの初期値テーブルを設ける必要もない。
【0062】
また上述の装置において、スタックエリア36をいわゆるプッシュダウンスタックの構成とすることによって、割り込み処理中にさらに割り込みを行う、多重割り込みにもこの装置を適用することができる。すなわちその場合には、割り込みごとにカレントPCBエリア37に記憶されたデータをスタックエリア36にプッシュダウンすると共に、割り込みが終了されるごとにポップアップされるデータをレジスタ12に再度書き込むことによって、多重割り込みの際にもこの装置を適用することができる。
【0063】
すなわち上述の装置において、全体の信号の流れは図7に示すようになる。この図7において、任意のタスクが実行されると、タスクPDSエリア32の対応するPCBPの値がレジスタ12に書き込まれ、この値に従ってPCBエリア31が検索されて修正制御情報(PCB)がレジスタ7、8に書き込まれる。そしてレジスタ7の修正アドレスがアドレスバス6のアドレスに一致されると、レジスタ8の修正データに従って情報が修正されるか、ジャンプ命令によって修正情報エリア35の修正情報が実行される。
【0064】
さらにこの修正情報の最後に設けられた次のPCBPの値がレジスタ12に書き込まれ、この値に従ってPCBエリア31が検索されてPCBがレジスタ7、8に書き込まれる。また事前にレジスタ12の値がカレントPCBエリア37に書き込まれ、このカレントPCBエリア37に値とレジスタ12の値が不一致になると、実行されているタスクのそのチャンネルのタスクPDSエリア32が書き換えられる。またタスクが最初から実行されるときは、PDS初期化テーブル34の値によって、実行されるタスクのタスクPDSエリア32が書き換えられる。
【0065】
また、割り込み処理が行われるときは、カレントPCBエリア37に書き込まれた値がスタックエリア36に書き込まれる。さらに割り込みPDSエリア33の対応するPCBPの値がレジスタ12に書き込まれ、この値に従ってPCBエリア31が検索されて修正制御情報(PCB)がレジスタ7、8に書き込まれる。そしてレジスタ7の修正アドレスがアドレスバス6のアドレスに一致されると、レジスタ8の修正データに従って情報が修正されるか、ジャンプ命令によって修正情報エリア35の修正情報が実行される。さらに割り込み処理が終了されると、スタックエリア36に書き込まれた値がレジスタ12に書き込まれる。
【0066】
このようにしてROM2に書き込まれた情報の修正が行われる。そしてこの場合に、上述の装置によれば、実行されるタスクが変更されるごとに、判別手段及び切り換え手段の固定記憶手段の修正箇所に関する修正制御情報が書き換えられることによって、リアルタイム・マルチタスク処理で複数のタスクが任意に実行される場合においても、固定記憶手段の情報の不備の修正を良好に行うことができるものである。
【0067】
また、タスクごとに修正制御情報をそれぞれ指示する値を記憶する第1の記憶手段が設けられ、この第1の記憶手段に記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができるものである。
【0068】
さらに、修正情報にはそれぞれ次の修正制御情報を指示する値が含められることによって必要な数の修正を容易に行うことができると共に、この値を用いて第1の記憶手段に記憶される値を書き換えることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができるものである。
【0069】
また、実行されるタスクのスタート時には、第1の記憶手段をタスクごとに最初に用いられる修正制御情報を指示する値に初期化する手段が設けられることによって、タスクが強制終了されたような場合にも、修正を良好に行うことができるものである。
【0070】
さらに、アドレス制御手段への割り込み処理ごとに修正制御情報をそれぞれ指示する値を記憶する第2の記憶手段が設けられ、割り込み処理が行われたときには、第2の記憶手段に記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えを行うと共に、実行中の修正制御情報を指示する値を退避するスタックメモリが設けられ、割り込み処理の終了時に、スタックメモリに記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、任意の割り込み処理に対しても修正を良好に行うことができるものである。
【0071】
さらに上述の装置において、例えばPDS初期化テーブルエリア34に関連して各タスクの修正チャンネルごとに修正許可信号が記憶され、実行されるタスクに対応する修正許可信号がレジスタ11に書き込まれる。このレジスタ11に書き込まれた修正許可信号がアンド回路10に供給される。
【0072】
これによって、レジスタ11に書き込まれた修正許可信号が“0”のチャンネルは比較器9からの一致信号がアンド回路10で遮断され、修正が行われない。従って修正許可信号を用いて不要な修正チャンネルを遮断し、誤動作等の発生を防止することができる。
【0073】
また同様に不要な修正チャンネルでは、タスクPDSエリア32あるいは割り込みPDSエリア33に書き込まれるPCBPの値を全て“0”(NULL)にしておくことにより、これらの不要な修正チャンネルが不動作となるようにする処理を行うこともできる。
【0074】
【発明の効果】
この発明によれば、実行されるタスクが変更されるごとに、判別手段及び切り換え手段の固定記憶手段の修正箇所に関する修正制御情報が書き換えられることによって、リアルタイム・マルチタスク処理で複数のタスクが任意に実行される場合においても、固定記憶手段の情報の不備の修正を良好に行うことができるようになった。
【0075】
また、タスクごとに修正制御情報をそれぞれ指示する値を記憶する第1の記憶手段が設けられ、この第1の記憶手段に記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができるようになった。
【0076】
さらに、修正情報にはそれぞれ次の修正制御情報を指示する値が含められることによって必要な数の修正を容易に行うことができると共に、この値を用いて第1の記憶手段に記憶される値を書き換えることによって、実行されるタスクが任意に変更されても、修正を良好に行うことができるようになった。
【0077】
また、実行されるタスクのスタート時には、第1の記憶手段をタスクごとに最初に用いられる修正制御情報を指示する値に初期化する手段が設けられることによって、タスクが強制終了されたような場合にも、修正を良好に行うことができるようになった。
【0078】
さらに、アドレス制御手段への割り込み処理ごとに修正制御情報をそれぞれ指示する値を記憶する第2の記憶手段が設けられ、割り込み処理が行われたときには、第2の記憶手段に記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えを行うと共に、実行中の修正制御情報を指示する値を退避するスタックメモリが設けられ、割り込み処理の終了時に、スタックメモリに記憶された値に基づいて判別手段及び切り換え手段への修正制御情報の書き換えが行われることによって、任意の割り込み処理に対しても修正を良好に行うことができるようになった。
【図面の簡単な説明】
【図1】本発明による電子装置の一例の構成図である。
【図2】タスクPDSエリアの説明のための図である。
【図3】修正制御情報(PCB)エリアの説明のための図である。
【図4】修正動作の説明のための図である。
【図5】PDS初期化テーブルの説明のための図である。
【図6】割り込みPDSエリアの説明のための図である。
【図7】全体の動作の説明のための図である。
【符号の説明】
1 処理手段としてのCPU
2 固定記憶手段としてのROM
20 基本プログラム(OS)
21、22・・・2n タスク
2x 割り込み処理のためのプログラム
3 修正情報記憶手段としてのRAM
31 修正制御情報(PCB)の記憶されるエリア
32 タスクPDSエリア(第1の記憶手段)
33 割り込みPDSエリア(第2の記憶手段)
34 PDS初期化テーブルのエリア
35 修正情報の記憶されるエリア
36 スタックエリア
37 カレントPCBエリア
4 入力手段
5 データバス
6 アドレスバス
7 修正箇所のアドレスのレジスタ
8 修正割り込みベクトルのレジスタ
9 比較器
10 アンド回路
11 修正許可信号のレジスタ
12 PCBPのレジスタ
100 電子装置としての1チップ・マイクロコンピュータ
200 外部記憶装置
[0001]
[Industrial applications]
The present invention relates to an electronic device such as a one-chip microcomputer built in and used in an electronic device, and is used particularly when performing real-time multitask processing.
[0002]
[Prior art]
For example, a one-chip microcomputer used by being built in an electronic device is configured by an electronic device in which fixed storage means (ROM), processing means (CPU), input means, variable storage means (RAM) and the like are integrally integrated. Have been.
[0003]
In such an electronic device (one-chip microcomputer), a processing program in the processing means (CPU) is stored in, for example, a fixed storage means (ROM). That is, a specific process is performed according to the information (processing program) stored in the fixed storage means (ROM). Therefore, by forming this fixed storage means (ROM) with, for example, a mask ROM, such an electronic device can be made inexpensive, especially by mass production.
[0004]
On the other hand, the above-described electronic devices are used by being built in electronic devices such as consumer-use camera-integrated VTRs and small VCRs. In such electronic devices (such as a consumer-use camera-integrated VTR, etc.), in recent years, multi-functionalization has been promoted for the purpose of differentiating products. For this reason, the amount of information (processing program) stored in the fixed storage means (ROM) increases, and in particular, as the processing program becomes longer, the occurrence of defects (bugs) is an unavoidable problem.
[0005]
Therefore, if such defects are found after mass production of the equipment, it is necessary to discard the already mass-produced equipment and carry out mass production again, or to perform processing such as providing external parts to correct the defects. Occurs. However, re-mass production requires a great deal of additional cost, and it is often difficult to provide external components in an electronic device with a high component mounting density.
[0006]
On the other hand, the applicant of the present application has proposed a means for correcting the deficiency of the information stored in the fixed storage means after the mass production of the product has been performed (see Japanese Patent Application Laid-Open No. 4-346127). .
[0007]
That is, in the prior application, a correction information storage unit for correcting a defect and an access switching unit are provided in the electronic device. Then, a part where the information stored in the fixed storage means is inadequate is determined, and in that part, the access is switched from the fixed storage means to the correction information storage means. Further, information relating to the defective portion of the next fixed storage means is provided in the correction information, and the correction control information and the like of the access switching means are rewritten based on this information.
[0008]
According to this, the information stored in the fixed storage unit is replaced with the information stored in the correction information storage unit to correct the defect, and the correction control of the access switching unit is performed based on the correction information. By rewriting the information or the like, a necessary number of corrections can be performed without previously limiting the number of defective portions of the information stored in the fixed storage unit.
[0009]
Meanwhile, in the above-described electronic device (one-chip microcomputer), a device for performing real-time multitask processing such as μITRON has recently been implemented. That is, in such a real-time multitask process, an execution program is divided into a plurality of tasks and formed, and these tasks are arbitrarily executed according to a predetermined priority.
[0010]
In this case, in the above-mentioned prior application, if the information (processing program) stored in the fixed storage means (ROM) is always accessed in a predetermined order, the correction is made at an arbitrary correction location. Finally, by specifying the next correction portion, a plurality of defective portions can be corrected sequentially.
[0011]
However, in the above-described real-time multitask processing, a plurality of tasks are arbitrarily executed. Therefore, if the next correction point is specified at the end of the correction at an arbitrary correction point as described above, it becomes impossible to correctly specify the next correction point when the task is switched. . That is, in the real-time multitask processing, it is difficult to designate the next correction point at the end of the correction at an arbitrary correction point.
[0012]
Conventionally, when another information is accessed by the interrupt processing, the correction control information and the like of the above-described access switching means are saved in the stack memory, the correction control information of the processing is set at the beginning of the interrupt processing, and the interrupt processing is performed. By returning the correction control information to the state before the interrupt processing at the end of the processing, it is possible to satisfactorily correct the information during the interrupt processing (see JP-A-5-204630). This is because the interrupt processing always returns to the position where the interrupt was made at the end of the interrupt processing, so that one stack memory can cope with it.
[0013]
However, in the above-described real-time multitask processing, since a plurality of tasks are arbitrarily executed, a stack memory is required for each processing in the same method as the above-described interrupt processing, and all processing is dealt with. For this purpose, a huge amount of stack memory is required, which is difficult to realize.
[0014]
[Problems to be solved by the invention]
The present invention has been made in view of such a point, and a problem to be solved is that, in a conventional electronic device, when a plurality of tasks are arbitrarily executed in real-time multitask processing, That is, the deficiency of the information could not be easily corrected.
[0015]
[Means for Solving the Problems]
Departure Ming is In an electronic device in which an execution program is formed by being divided into a plurality of tasks, and the plurality of tasks are arbitrarily executed, a fixed storage method in which information is fixedly stored is provided. Step and , Address control means to perform address control Step and , Input method to input information from outside Step and A correction information storage means for storing correction information externally input through the input means. Step and A discriminating means for discriminating access by the address control means to a correction location in the fixed storage means. Step and Switching means for switching the access from the fixed storage means to the correction information storage means according to a signal from the determination means. A step, first storage means for storing a value indicating the correction control information for each task, and storing the first storage means in a value indicating the correction control information used first for each task. Means for initializing, second storage means for storing a value indicating the correction control information for each interrupt process to the address control means, and a stack for saving a value indicating the correction control information being executed With memory Are integrated together And Each time the task to be executed is changed, the correction control information on the correction location of the fixed storage means of the determination means and the switching means is rewritten. The correction control information is rewritten to the determination means and the switching means based on the value stored in the first storage means, and the correction information includes a value indicating the next correction control information, respectively. And the value stored in the first storage means is rewritten by using this value, and the first storage means is used first for each of the tasks at the start of the task to be executed. The information is initialized to a value indicating the information, and when the interrupt processing is performed, the correction control information is rewritten to the determination unit and the switching unit based on the value stored in the second storage unit. At the same time, at the end of the interrupt processing, the correction control information is rewritten to the determination means and the switching means based on the value stored in the stack memory. It is An electronic device, comprising:
[0020]
[Action]
According to this, each time the task to be executed is changed, the correction control information on the correction portion of the fixed storage unit of the determination unit and the switching unit is rewritten, so that a plurality of tasks can be arbitrarily performed in the real-time multitask processing. Even when it is executed, it is possible to satisfactorily correct the deficiency of the information in the fixed storage means.
[0021]
Further, first storage means for storing a value indicating the correction control information for each task is provided. Based on the value stored in the first storage means, the first control means transmits the correction control information to the determination means and the switching means. By performing the rewriting, even if the task to be executed is arbitrarily changed, the task can be satisfactorily corrected.
[0022]
Further, since the correction information includes a value indicating the next correction control information, the required number of corrections can be easily performed, and the value stored in the first storage means can be stored using this value. Can be satisfactorily corrected even if the task to be executed is arbitrarily changed.
[0023]
Also, at the start of a task to be executed, a means for initializing the first storage means to a value indicating the correction control information used first for each task is provided, so that the task is forcibly terminated. Also, the correction can be performed satisfactorily.
[0024]
Further, there is provided a second storage means for storing a value indicating correction control information for each interruption processing to the address control means, and when the interruption processing is performed, the value stored in the second storage means is stored. A stack memory is provided for rewriting the correction control information to the discriminating means and the switching means on the basis of a value indicating the correction control information being executed, and a value stored in the stack memory at the end of the interrupt processing. The correction control information is rewritten to the determination unit and the switching unit based on the above, so that the correction can be satisfactorily performed for any interrupt processing.
[0025]
【Example】
In FIG. 1, reference numeral 100 denotes an entire one-chip microcomputer as an electronic device. The electronic device 100 includes a CPU 1 as a processing unit, a ROM 2 as a fixed storage unit, a RAM 3 as a correction information storage unit, an input unit 4, and the like. The CPU 1, the ROM 2, the RAM 3, and the input means 4 are connected to each other via a data bus 5. An address output formed by the CPU 1 is connected to address inputs of the ROM 2 and the RAM 3 via an address bus 6.
[0026]
Further, a register 7 of a correction address indicating a correction position and a register 8 of the correction data are provided, and these registers 7 and 8 are connected to the data bus 5. Further, a comparator 9 for detecting a match between the address stored in the register 7 and the address on the address bus 6 is provided. Then, an output section of a signal indicating that the addresses of the comparator 9 match is connected to the AND circuit 10.
[0027]
A register 11 for a correction permission signal and a register 12 for a value (PCBP) designating correction control information (PCB), which will be described later, are provided. These registers 11 and 12 are connected to the data bus 5. Further, the output of the register 11 is connected to the AND circuit 10. The output section of the AND circuit 10 is connected to the input / output sections of the ROM 2 and the register 8, and the connection of these input / output sections is switched. Note that the circuits of the registers 7 to 12 are provided for, for example, m channels in parallel.
[0028]
Further, an external storage device 200 is connected to the input means 4. This external storage device 200 is also provided in the electronic device. The external storage device 200 is formed of, for example, an EEPROM, and normally stores parameters and the like obtained in an adjustment process of the electronic device. The information from the external storage device 200 is stored in the RAM 3 through the input unit 4 and used for processing in the CPU 1 and the like.
[0029]
Further, in the ROM 2 described above, information of a program for processing in the CPU 1 is fixedly stored. That is, this processing program is provided with a basic program (OS) 20 first, for example, as shown in the figure. The basic program 20 is provided with an interrupt process, which will be described later, and a program for determining a task priority and the like and executing the task.
[0030]
Further, the ROM 2 is provided with a main program for performing a target process. This main program is formed, for example, by being divided into a plurality of tasks 21, 22,... 2n. The plurality of tasks 21, 22... 2n are arbitrarily executed according to a predetermined priority or the like determined by the basic program 20 described above. The ROM 2 is also provided with a program 2x for arbitrary interrupt processing.
[0031]
The RAM 3 stores an area 31 in which correction control information (PCB: Patch Control Block) described later is stored, and a value (PCBP: PCB Pointer) indicating a PCB used for each task. A task PDS (Patch Date Select) area 32 (first storage means) and an interrupt PDS area 33 (second storage means) for storing a value (PCBP) indicating a PCB used for each interrupt are provided. Can be
[0032]
Further, the RAM 3 stores an area 34 of a PDS initialization table in which a value (PCBP) indicating a PCB to be used first for each task described later is stored, and correction information for changing information stored in the ROM 2. Area 35, a stack area 36, a current PCB area 37 in which a value (PCBP) indicating the PCB being executed is stored.
[0033]
In such an electronic device 100, the above-described basic program 20 is first executed at the time of startup. The information from the above-described external storage device 200 is stored in the RAM 3 through the input unit 4 by the processing therein. As a result, the RAM 3 stores the respective information in the areas 31 to 35 described above. The same information is stored in the areas 32 and 34 at the time of startup.
[0034]
When an arbitrary task i is executed, first, a value (PCBP) indicating the PCB used in the task to be executed, which is stored in the task PDS area 32 of the RAM 3, is read out to the register 12. That is, in the task PDS area 32, for example, as shown in FIG. 2, for each of the tasks 1, 2,..., N, a value (PCBP) indicating a PCB to be used for m channels is stored. The value of the task PDS area 32 is written to the register 12 for each of the correction channels 1, 2,.
[0035]
Further, according to the contents of the register 12, the designated PCB is read from the PCB area 31 of the RAM 3 and written into the register 7 of the correction address and the register 8 of the correction data, respectively. Further, the contents of the register 12 are written in the current PCB area 37 of the RAM 3. Further, for example, a correction permission signal is stored for each correction channel of each task in association with the PDS initialization table area 34, and a correction permission signal corresponding to the task to be executed is written in the register 11. These processes are performed by the basic program 20 described above.
[0036]
That is, in the PCB (correction control information) stored in the above-described PCB area 31, for example, as shown in FIG. 3, a correction address and a correction data of a correction portion of the ROM 2 are sequentially stored in pairs. The register 12 stores, for example, a value (PCBP) indicating a PCB corresponding to the head address of each of these PCBs. In the above-described processing, the PCB stored in the PCB area 31 is read in accordance with the values of these registers 12, the correction address therein is written into the register 7, and the correction data is written into the register 8.
[0037]
Therefore, in this apparatus, while the above-mentioned arbitrary task i is being executed, the corrected address written in the register 7 and the execution address supplied to the address bus 6 are compared by the comparator 9, and their coincidence is determined. Is determined. When the coincidence is determined by the comparator 9, the determination signal is supplied to the input / output unit of the ROM 2 and the register 8 through the AND circuit 10, and the input / output unit of the ROM 2 is shut off during the period of the determination signal. 8 are connected to the data bus 5.
[0038]
As a result, in the above-mentioned correction portion of the ROM 2, the correction data of the register 8 is supplied to the data bus 5 instead of the data of the ROM 2, and the data of the ROM 2 is corrected. Thus, the data stored in the ROM 2 is corrected.
[0039]
In this apparatus, when the task to be executed is changed, a value (PCBP) indicating the PCB used in the changed task, which is stored in the task PDS area 32 of the RAM 3, is read out to the register 12. It is. Further, according to the contents of the register 12, the designated PCB is read out from the PCB area 31 of the RAM 3, and the respective correction addresses and correction data are written into the registers 7 and 8.
[0040]
As a result, even in this changed task, the correction data of the register 8 is supplied to the data bus 5 instead of the data of the ROM 2 at the above-described correction portion of the ROM 2, and the data of the ROM 2 is corrected. Thus, the data stored in the ROM 2 is corrected. Note that the PCB area 31 is provided commonly to each task. In addition, the same PCB can be designated by different tasks so that the PCB is shared.
[0041]
Thus, according to the above-described apparatus, each time the task to be executed is changed, the correction control information (PCB) relating to the correction location of the fixed storage means (ROM 2) of the determination means (register 7) and the switching means (register 8) By being rewritten, even when a plurality of tasks are arbitrarily executed in the real-time multitask processing, it is possible to satisfactorily correct the deficiency of the information in the fixed storage means.
[0042]
Further, a first storage means (task PDS area 32) is provided for storing a value indicating the modification control information (PCB) for each task, and a determination means is provided based on the value stored in the first storage means. By rewriting the correction control information in the (register 7) and the switching means (register 8), even if the task to be executed is arbitrarily changed, the correction can be performed satisfactorily.
[0043]
Further, in the above-described apparatus, the correction data of the register 8 can be provided with, for example, a jump instruction and its jump vector. In this case, when the comparator 9 determines that the corrected address of the register 7 matches the execution address of the address bus 6, a jump instruction is executed. Then, by specifying the start address of the arbitrary correction information in the correction information area 35 of the RAM 3 in the jump vector, the arbitrary correction information of the RAM 3 is executed at the correction position of the ROM 2.
[0044]
That is, in the modification information area 35 of the RAM 3, for example, as shown in FIG. 4, an arbitrary number of modification information having an arbitrary length is provided. When the comparator 9 determines that the correction address of the register 7 matches the execution address of the address bus 6, necessary correction information is read from the address specified by the jump vector in the correction information area 35 of the RAM 3.
[0045]
Further, the correction information includes, for example, information about the next correction portion at the end thereof, and a process of rewriting the correction addresses and correction data of the registers 7 and 8 using the information of the next correction portion is performed. That is, at the end of the correction information, for example, a value (PCBP) indicating the correction control information (PCB) of the next correction portion is included, and the value of the register 12 is rewritten to the value from the end of the correction information.
[0046]
Then, based on the value of the register 12, the correction control information (PCB) of the next correction portion stored in the PCB area 31 is read, and the correction address and correction data therein are written into the registers 7 and 8. As a result, the registers 7 and 8 are rewritten with the correction address and correction data of the next correction part, and the next correction part of the ROM 2 is corrected. In this way, it is possible to correct a required number of corrected portions that are equal to or more than the corrected channel number m.
[0047]
Further, the rewritten value of the register 12 is compared with the value written in the current PCB area 37 of the RAM 3 and the value of the task PDS area 32 of the channel whose value does not match is rewritten. Thereafter, the contents of the register 12 are written to the current PCB area 37 of the RAM 3. These processes are also performed by the basic program 20 described above.
[0048]
Therefore, in this device, even when the processing of any task i is interrupted and the processing of the original arbitrary task i is resumed after the execution of another task, the value of the task PDS area 32 is again stored in the register 12. By being written, the correction portion of the ROM 2 following the task after the restart is corrected.
[0049]
Thus, according to the above-described device, the necessary number of corrections can be easily performed by including the value (PCBP) indicating the next correction control information (PCB) in the correction information, and the value can be easily changed. By using this to rewrite the value stored in the first storage means (task PDS area 32), even if the task to be executed is arbitrarily changed, the correction can be performed satisfactorily.
[0050]
Further, in the above-described device, the task may be forcibly terminated. In such a forced termination of a task, the next time the processing of the task is started, the processing is performed from the beginning of the task. In this case, if the value of the task PDS area 32 is rewritten as described above, there is a possibility that the correction of the correction portion of the ROM 2 is not performed from the beginning when the processing of the task is started.
[0051]
Therefore, in the above-described apparatus, the RAM 3 is provided with an area 34 of the PDS initialization table in which a value (PCBP) indicating the first PCB to be used for each task is stored, and when the processing of the task is started. The initialization of the value of the task PDS area 32 is performed first. These processes are performed by the basic program 20 described above.
[0052]
That is, the area 34 is provided with a PDS initialization table as shown in FIG. The PDS initialization table provided in this area 34 has the same configuration as the task PDS area 32 described above. When the processing of the above-mentioned arbitrary task i is performed from the beginning, the value of the corresponding task in the PDS initialization table provided in this area 34 is written in the arbitrary task i portion of the task PDS area 32. I do.
[0053]
Therefore, in the above-described device, the task is forcibly terminated, and when the processing of the task is started next, the task PDS area 32 is rewritten with the value of the PDS initialization table provided in the area 34, and the ROM 2 is modified from the beginning. Corrections can be made.
[0054]
Thus, at the start of the task executed by the above-described apparatus, means for initializing the first storage means to a value indicating the correction control information used first for each task is provided, so that the task is forcibly terminated. In such a case, the correction can be performed well.
[0055]
In the above-described device, at the beginning of the interrupt processing program 2x of the ROM 2, the data stored in the current PCB area 37 is saved in the stack area 36, and the data is stored in the interrupt PDS area 33 of the RAM 3. In addition, a process is provided in which a value (PCBP) indicating each of the PCBs used in the interrupt to be executed is written in the register 12.
[0056]
That is, in the interrupt PDS area 33, for example, as shown in FIG. 6, for each of the interrupts 1, 2,..., N, a value (PCBP) indicating a PCB to be used for m channels is stored. The configuration of the interrupt PDS area 33 is made equal to the configuration of the task PDS area 32 described above. The value of the interrupt PDS area 33 is written to the register 12 for each of the correction channels 1, 2,..., M.
[0057]
Further, according to the contents of the register 12, the designated PCB is read from the PCB area 31 of the RAM 3 and written into the register 7 of the correction address and the register 8 of the correction data, respectively. These processes are also provided in the program 2x for the above-described interrupt process. Thus, the information in the ROM 2 is corrected in the same manner as in the processing of the above-described task. Further, the PCB area 31 is provided in common with that for the task processing, and the same PCB as that from the task processing is designated, so that the PCB can be shared.
[0058]
At the end of the interrupt program 2x, there is provided processing for writing the data saved in the stack area 32 to the register 12 again. In accordance with the contents of the register 12, the designated PCB is read from the PCB area 31 of the RAM 3 and written into the register 7 of the correction address and the register 8 of the correction data, respectively.
[0059]
Therefore, in this device, when an interrupt request is issued to the CPU 1, an interrupt process is performed. Then, at the beginning of the interrupt program 2x, the data stored in the current PCB area 37 is saved in the stack area 36 of the RAM 3. Further, correction control information (PCB) corresponding to the interrupt is written into the registers 7 and 8. Then, the interrupt program proceeds, and when the address matches the address of the register 7, the correction is performed by the correction data of the register 8.
[0060]
Thus, according to the above-described device, the second storage means (interrupt PDS area 33) for storing a value indicating the correction control information for each interrupt processing to the address control means (CPU 1) is provided. When it is determined, the correction control information is rewritten to the determination means (register 7) and the switching means (register 8) based on the value stored in the second storage means, and the correction control information being executed is indicated. A stack memory 36 for saving a value (current PCB) is provided. At the end of the interrupt process, the correction control information is rewritten to the determination means and the switching means based on the value stored in the stack memory. Can be satisfactorily corrected even for the interrupt processing of (1).
[0061]
In the above-described device, at the time of interrupt processing, for example, a value (PCBP) indicating the correction control information (PCB) of the next correction portion is included at the end of the correction information. It is rewritten with the value from the end of the correction information. However, in this case, since it is guaranteed that the interrupt processing is always executed in the predetermined order until the end of the processing, the interrupt processing is performed by the value (PCBP) indicating the correction control information (PCB) of the next correction part. The PDS area 33 is not rewritten, and therefore there is no need to provide an initial value table for the interrupt PDS.
[0062]
Further, in the above-described apparatus, by forming the stack area 36 as a so-called push-down stack, the apparatus can be applied to multiple interrupts in which an interrupt is further performed during interrupt processing. That is, in this case, the data stored in the current PCB area 37 is pushed down to the stack area 36 for each interrupt, and the data that is popped up is written again to the register 12 every time the interrupt is completed, thereby enabling the multiple interrupts. This device can also be applied in such a case.
[0063]
That is, in the above-described device, the entire signal flow is as shown in FIG. In FIG. 7, when an arbitrary task is executed, the value of the corresponding PCBP in the task PDS area 32 is written into the register 12, and the PCB area 31 is searched according to this value, and the correction control information (PCB) is stored in the register 7. , 8. When the correction address of the register 7 matches the address of the address bus 6, the information is corrected according to the correction data of the register 8, or the correction information in the correction information area 35 is executed by a jump instruction.
[0064]
Further, the value of the next PCBP provided at the end of the correction information is written into the register 12, the PCB area 31 is searched according to this value, and the PCB is written into the registers 7 and 8. In addition, the value of the register 12 is written in the current PCB area 37 in advance, and when the value of the register 12 does not match the value of the current PCB area 37, the task PDS area 32 of the channel of the task being executed is rewritten. When the task is executed from the beginning, the task PDS area 32 of the task to be executed is rewritten by the value of the PDS initialization table 34.
[0065]
When the interrupt processing is performed, the value written in the current PCB area 37 is written in the stack area 36. Further, the value of the corresponding PCBP in the interrupt PDS area 33 is written into the register 12, the PCB area 31 is searched according to this value, and the correction control information (PCB) is written into the registers 7 and 8. When the correction address of the register 7 matches the address of the address bus 6, the information is corrected according to the correction data of the register 8, or the correction information in the correction information area 35 is executed by a jump instruction. When the interrupt processing is completed, the value written to the stack area 36 is written to the register 12.
[0066]
Thus, the information written in the ROM 2 is corrected. In this case, according to the above-described apparatus, each time the task to be executed is changed, the correction control information on the correction location of the fixed storage unit of the determination unit and the switching unit is rewritten, thereby real-time multitask processing. Thus, even when a plurality of tasks are arbitrarily executed, it is possible to satisfactorily correct deficiencies in the information in the fixed storage means.
[0067]
Further, first storage means for storing a value indicating the correction control information for each task is provided. Based on the value stored in the first storage means, the first control means transmits the correction control information to the determination means and the switching means. Even if the task to be executed is arbitrarily changed by the rewriting, the task can be satisfactorily corrected.
[0068]
Furthermore, since the correction information includes a value indicating the next correction control information, the required number of corrections can be easily performed, and the value stored in the first storage means can be stored using this value. Can be satisfactorily corrected even if the task to be executed is arbitrarily changed.
[0069]
Also, at the start of a task to be executed, a means for initializing the first storage means to a value indicating the correction control information used first for each task is provided, so that the task is forcibly terminated. In addition, the correction can be performed satisfactorily.
[0070]
Further, there is provided a second storage means for storing a value indicating correction control information for each interruption processing to the address control means, and when the interruption processing is performed, the value stored in the second storage means is stored. A stack memory is provided for rewriting the correction control information to the discriminating means and the switching means on the basis of a value indicating the correction control information being executed, and a value stored in the stack memory at the end of the interrupt processing. By performing the rewriting of the correction control information to the determination unit and the switching unit based on the above, it is possible to satisfactorily perform the correction even for an arbitrary interrupt process.
[0071]
Further, in the above-described apparatus, for example, a correction permission signal is stored for each correction channel of each task in association with the PDS initialization table area 34, and a correction permission signal corresponding to the task to be executed is written in the register 11. The correction permission signal written in the register 11 is supplied to the AND circuit 10.
[0072]
As a result, the match signal from the comparator 9 is cut off by the AND circuit 10 for the channel for which the correction permission signal written to the register 11 is "0", and no correction is performed. Therefore, unnecessary correction channels can be cut off by using the correction permission signal, thereby preventing occurrence of malfunction or the like.
[0073]
Similarly, for unnecessary correction channels, the values of the PCBP written to the task PDS area 32 or the interrupt PDS area 33 are all set to “0” (NULL), so that these unnecessary correction channels do not operate. Can be performed.
[0074]
【The invention's effect】
According to the present invention, every time the task to be executed is changed, the correction control information on the correction location of the fixed storage unit of the determination unit and the switching unit is rewritten, so that a plurality of tasks can be arbitrarily performed in the real-time multitask processing. In this case, it is possible to satisfactorily correct the deficiency of the information in the fixed storage means.
[0075]
Further, first storage means for storing a value indicating the correction control information for each task is provided. Based on the value stored in the first storage means, the first control means transmits the correction control information to the determination means and the switching means. As a result of the rewriting, even if the task to be executed is arbitrarily changed, the task can be satisfactorily corrected.
[0076]
Further, since the correction information includes a value indicating the next correction control information, the required number of corrections can be easily performed, and the value stored in the first storage means can be stored using this value. Can be satisfactorily corrected even if the task to be executed is arbitrarily changed.
[0077]
Also, at the start of a task to be executed, a means for initializing the first storage means to a value indicating the correction control information used first for each task is provided, so that the task is forcibly terminated. In addition, the correction can be performed satisfactorily.
[0078]
Further, there is provided a second storage means for storing a value indicating correction control information for each interruption processing to the address control means, and when the interruption processing is performed, the value stored in the second storage means is stored. A stack memory is provided for rewriting the correction control information to the discriminating means and the switching means on the basis of a value indicating the correction control information being executed, and a value stored in the stack memory at the end of the interrupt processing. By rewriting the correction control information to the determination means and the switching means based on the above, it is possible to satisfactorily perform the correction for any interrupt processing.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of an example of an electronic device according to the present invention.
FIG. 2 is a diagram for explaining a task PDS area.
FIG. 3 is a diagram for explaining a correction control information (PCB) area.
FIG. 4 is a diagram for explaining a correction operation.
FIG. 5 is a diagram for explaining a PDS initialization table.
FIG. 6 is a diagram for explaining an interrupt PDS area.
FIG. 7 is a diagram for explaining the entire operation.
[Explanation of symbols]
1 CPU as processing means
2 ROM as fixed storage means
20 Basic Program (OS)
21,22 ... 2n tasks
2x Interrupt handling program
3 RAM as correction information storage means
31 Area where correction control information (PCB) is stored
32 task PDS area (first storage means)
33 interrupt PDS area (second storage means)
34 PDS initialization table area
35 Area where correction information is stored
36 Stack area
37 Current PCB area
4 Input means
5 Data bus
6 Address bus
7 Register of address of correction location
8 Register of modified interrupt vector
9 Comparator
10 AND circuit
11 Correction enable signal register
12 Register of PCBP
100 One-chip microcomputer as electronic device
200 External storage device

Claims (1)

実行プログラムが複数のタスクに分割されて形成され、これらの複数のタスクが任意に実行されるようにした電子装置において、
情報が固定的に記憶された固定記憶手段と、アドレス制御を行うアドレス制御手段と、外部からの情報が入力される入力手段と、この入力手段を介して外部から入力される修正情報が記憶される修正情報記憶手段と、上記固定記憶手段の修正箇所への上記アドレス制御手段によるアクセスを判別する判別手段と、この判別手段からの信号により上記アクセスを上記固定記憶手段から上記修正情報記憶手段へ切り換える切り換え手段と、上記タスクごとに上記修正制御情報をそれぞれ指示する値を記憶する第1の記憶手段と、上記第1の記憶手段を上記タスクごとに最初に用いられる上記修正制御情報を指示する値に初期化する手段と、上記アドレス制御手段への割り込み処理ごとに上記修正制御情報をそれぞれ指示する値を記憶する第2の記憶手段と、実行中の上記修正制御情報を指示する値を退避するスタックメモリとが一体に集積され、
上記実行されるタスクが変更されるごとに上記判別手段及び上記切り換え手段の上記固定記憶手段の修正箇所に関する上記修正制御情報が書き換えられ
上記第1の記憶手段に記憶された値に基づいて上記判別手段及び上記切り換え手段への上記修正制御情報の書き換えが行われ、
上記修正情報にはそれぞれ次の上記修正制御情報を指示する値が含められてこの値を用いて上記第1の記憶手段に記憶される値が書き換えられ、
上記実行されるタスクのスタート時に上記第1の記憶手段を上記タスクごとに最初に用いられる上記修正制御情報を指示する値に初期化し、
上記割り込み処理が行われたときには、上記第2の記憶手段に記憶された値に基づいて上記判別手段及び上記切り換え手段への上記修正制御情報の書き換えが行われると共に、
上記割り込み処理の終了時に、上記スタックメモリに記憶された値に基づいて上記判別手段及び上記切り換え手段への上記修正制御情報の書き換えが行われる
ことを特徴とする電子装置。
In an electronic device in which an execution program is formed by being divided into a plurality of tasks, and the plurality of tasks are arbitrarily executed,
Fixed storage means in which information is fixedly stored, address control means for performing address control, input means for inputting information from the outside, and correction information input from the outside via the input means. Correction information storage means, determination means for determining access to the correction location of the fixed storage means by the address control means, and the access from the fixed storage means to the correction information storage means by a signal from the determination means. Switching means for switching; first storage means for storing a value indicating the correction control information for each of the tasks; and first storage means for indicating the correction control information to be used first for each of the tasks. Means for initializing to a value, and a second memory for storing a value indicating the correction control information for each interruption to the address control means. A stack memory for saving a value instructing means, the modification control information being executed monolithically integrated,
The modification control information about the corrected portion of the fixed memory means of said determination means and said switching means each time the task to be the execution is changed is rewritten,
Rewriting of the correction control information to the determination unit and the switching unit is performed based on the value stored in the first storage unit,
The correction information includes a value indicating the next correction control information, and the value stored in the first storage unit is rewritten using the value,
At the start of the task to be executed, the first storage means is initialized to a value indicating the correction control information used first for each task,
When the interrupt processing is performed, the correction control information is rewritten to the determination unit and the switching unit based on the value stored in the second storage unit, and
The electronic device according to claim 1, wherein at the end of the interrupt processing, the correction control information is rewritten to the determination unit and the switching unit based on the value stored in the stack memory .
JP07501494A 1994-04-13 1994-04-13 Electronic equipment Expired - Fee Related JP3575052B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07501494A JP3575052B2 (en) 1994-04-13 1994-04-13 Electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP07501494A JP3575052B2 (en) 1994-04-13 1994-04-13 Electronic equipment

Publications (2)

Publication Number Publication Date
JPH07281886A JPH07281886A (en) 1995-10-27
JP3575052B2 true JP3575052B2 (en) 2004-10-06

Family

ID=13563911

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07501494A Expired - Fee Related JP3575052B2 (en) 1994-04-13 1994-04-13 Electronic equipment

Country Status (1)

Country Link
JP (1) JP3575052B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI469052B (en) * 2008-12-12 2015-01-11 Genesys Logic Inc Program updating system having correcting storage units and method thereof

Also Published As

Publication number Publication date
JPH07281886A (en) 1995-10-27

Similar Documents

Publication Publication Date Title
JP3230262B2 (en) Electronic device and fixed information correcting method thereof
KR100324834B1 (en) Electronics
JP3563768B2 (en) ROM program change device
US5504869A (en) High speed processing system capable of executing strings of instructions in order without waiting completion of previous memory access instruction
US5600807A (en) Programmable controller capable of updating a user program during operation by switching between user program memories
JP3575052B2 (en) Electronic equipment
KR100280590B1 (en) Electronic device
JPH04286001A (en) Programming method and device for programmable controller
US7203867B2 (en) Processor system, processor and arithmetic processing method
JPH05298462A (en) Electronic device
KR960001977B1 (en) Control method in programmable controller
JP2005025599A (en) Image processor
JPH06314190A (en) Electronic device
JPH05189268A (en) Electronic device
JPH04205144A (en) Microprocessor
JPH056280A (en) Interruption control system
JPH05241853A (en) Programmable controller
JPH0883188A (en) Multitask processing computer
JPH06324893A (en) Memory check method
JPH04332003A (en) Programmable controller
JPH06222917A (en) Electronic device
JPS63170703A (en) Loader command processing device
JPH0158522B2 (en)
JPH08249024A (en) Programmable controller
JPH0695710A (en) Method for changing sequence program of programmable controller

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040615

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040628

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080716

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees