JP2005338952A - Program branching method - Google Patents

Program branching method Download PDF

Info

Publication number
JP2005338952A
JP2005338952A JP2004153630A JP2004153630A JP2005338952A JP 2005338952 A JP2005338952 A JP 2005338952A JP 2004153630 A JP2004153630 A JP 2004153630A JP 2004153630 A JP2004153630 A JP 2004153630A JP 2005338952 A JP2005338952 A JP 2005338952A
Authority
JP
Japan
Prior art keywords
program
processing unit
branch
programs
switching
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
JP2004153630A
Other languages
Japanese (ja)
Inventor
Yosuke Asano
陽介 浅野
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 JP2004153630A priority Critical patent/JP2005338952A/en
Publication of JP2005338952A publication Critical patent/JP2005338952A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To achieve program switching through a simple process without requiring a large memory storage capacity. <P>SOLUTION: This program branching method includes allocating a memory that stores a plurality of programs 3, 4, 5 to a CPU 1 as a program area 2; determining branching by memory switching process parts 6, 7, 8 to selectively switch either of the plurality of programs 3, 4, 5; implementing a branching process to selectively switch either of the plurality of programs 3, 4, 5 in accordance with the determination of branching by the memory switching process parts 6, 7, 8; and causing the CPU 1 to implement a process that matches either of the programs 3, 4, 5 selectively switched to match the branching process. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、複数のプログラムを切替えるプログラム分岐方法に関する。   The present invention relates to a program branching method for switching a plurality of programs.

従来、小さなプログラム領域で複数のプログラムを実行しなければならない場合には、メモリからプログラムデータを制御手段の実行領域にコピーした後にプログラムによる処理を開始しなければならなかった。   Conventionally, when it is necessary to execute a plurality of programs in a small program area, it is necessary to start processing by the program after copying the program data from the memory to the execution area of the control means.

図6は、従来のプログラムコピーの動作を示すフローチャートである。
図6において、制御手段の動作を起動すると(ステップS41)、まず、複数のプログラムのいずれかを選択的に切り替えるための分岐の判断をする(ステップS42)。ここで、分岐の判断は制御手段のレジスタ、ポートの状態を条件とする。
FIG. 6 is a flowchart showing a conventional program copy operation.
In FIG. 6, when the operation of the control means is started (step S41), first, a branch is determined for selectively switching one of a plurality of programs (step S42). Here, the determination of branching is made on condition of the state of the register and port of the control means.

次に、外部のメモリ領域から制御手段によるプログラムの実行領域へプログラムコードをコピーする(ステップS43)。これにより、分岐先を決定してその処理へ移ることにより、実行領域へコピーされたプログラムに応じた処理71、処理72、又は処理73のいずれかが制御手段により実行される。   Next, the program code is copied from the external memory area to the program execution area by the control means (step S43). Thus, by determining the branch destination and proceeding to the processing, any one of the processing 71, processing 72, or processing 73 corresponding to the program copied to the execution area is executed by the control means.

また、特許文献1に記載の方法ではブート専用のブロック、各パーティションへ切り替えるブロックを用いることによりプログラム切り替えを実現するようにしていた。
また、特許文献2に記載の方法では処理の切り替え時にハードウエアが次に呼び出す関数のアドレスを計算することによりプログラム切り替えを実現するようにしていた。
特開2003-280915号公報 特開2003-263329号公報
In the method described in Patent Document 1, program switching is realized by using a boot-dedicated block and a block for switching to each partition.
In the method described in Patent Document 2, the program switching is realized by calculating the address of the function that the hardware calls next when switching the processing.
Japanese Patent Laid-Open No. 2003-280915 JP 2003-263329 A

上述した従来のプログラムコピーの方法では、小さなプログラム領域で複数のプログラムを実行しなければならない場合、メモリからプログラムデータを実行領域にコピーした後に処理を開始しなければならなかったという不都合があった。   In the conventional program copy method described above, when a plurality of programs must be executed in a small program area, there is a disadvantage that the process must be started after the program data is copied from the memory to the execution area. .

また、特許文献1に記載の方法ではブート専用のブロック、各パーティションへ切り替えるブロックがあるが、ブート処理は他の処理と異なる扱いであるため、簡単にプログラム切り替えを実現することができなかった。また、この方法では各パーティションへの処理の移動のみでパーティション間の切り替えはできなかった。   Further, in the method described in Patent Document 1, there are a boot-dedicated block and a block for switching to each partition. However, since the boot process is handled differently from other processes, program switching cannot be easily realized. Also, with this method, switching between partitions was not possible only by transferring processing to each partition.

また、特許文献2に記載の方法では処理の切り替え時にハードウエアが次に呼び出す関数のアドレスを計算しているが、アドレスの計算を行うため処理が複雑になるため、ハードウエアの付加が重くなり、また切り替え部分をハードウエアで実装するため汎用性がなくなる。   Further, in the method described in Patent Document 2, the address of the function to be called next by the hardware at the time of switching the process is calculated. However, since the process is complicated because the address is calculated, the addition of hardware becomes heavy. Moreover, since the switching part is implemented by hardware, versatility is lost.

そこで、本発明は、大きなメモリ記憶容量を必要とせず、簡単な処理でプログラム切り替えを実現することができるプログラム分岐方法を提供することを目的とするものである。   Therefore, an object of the present invention is to provide a program branching method that can realize program switching with a simple process without requiring a large memory storage capacity.

上記課題を解決し、本発明の目的を達成するため、本発明のプログラム分岐方法は、複数のプログラムが記憶されているメモリ領域自体を実行領域に割り当てるステップと、複数のプログラムのいずれかを選択的に切り替えるための分岐の判断をするステップと、分岐の判断に従って複数のプログラムのいずれかを選択的に切り替える分岐の処理をするステップと、分岐の処理に対応するように選択的に切り替えられたプログラムに応じた処理を実行するステップとを備えるものである。   In order to solve the above problems and achieve the object of the present invention, a program branching method of the present invention includes a step of allocating a memory area itself storing a plurality of programs to an execution area, and selecting one of the plurality of programs The step of making a branch decision for switching automatically, the step of making a branch process for selectively switching one of a plurality of programs according to the decision of the branch, and selectively switching to correspond to the branch process And a step of executing processing according to the program.

これによれば、実行しなければならないプログラムが記憶されたメモリ領域自体を制御手段の実行領域に割り当てることにより、従来のようなプログラムコード自体のコピー処理の必要がなくなる。   According to this, by assigning the memory area itself in which the program to be executed is stored to the execution area of the control means, it is not necessary to copy the program code itself as in the prior art.

異なるプログラムが書かれた複数のメモリを選択的に制御手段の実行領域に割り付けることで処理の分岐を行うため、あるプログラムコードが置かれたメモリが割り付けられているアドレス空間に別のプログラムコードが置かれたメモリを割り付けることでオーバーヘッドなく処理の切り替えが行うことができる。   Since a plurality of memories in which different programs are written are selectively allocated to the execution area of the control means, the process branches, so that another program code is placed in the address space to which the memory in which a certain program code is placed is allocated. By allocating the placed memory, processing can be switched without overhead.

また、本発明のプログラム分岐方法は、複数のプログラムが記憶されているメモリ領域自体を実行領域に割り当てるステップと、複数のプログラムのいずれかを選択的に切り替えるための分岐の判断をするステップと、分岐の判断に従って複数のプログラムのいずれかを選択的に切り替える分岐の処理をするステップと、分岐の処理に対応するように選択的に切り替えられたプログラムに応じた処理を実行するステップと、選択的に切り替えられたプログラムに応じた処理の実行領域を残すステップとを備えるものである。   The program branching method of the present invention includes a step of assigning a memory area itself storing a plurality of programs to an execution area, a step of determining a branch for selectively switching one of the plurality of programs, A step of performing a branch process for selectively switching one of a plurality of programs according to the determination of the branch, a step of executing a process according to the program selectively switched to correspond to the branch process, and a selective process And a step of leaving an execution area for processing according to the program switched to (1).

これによれば、実行しなければならないプログラムが記憶されたメモリ領域自体を制御手段の実行領域に割り当てることにより、従来のようなプログラムコード自体のコピー処理の必要がなくなる。また、選択的に切り替えられたプログラムに応じた処理の実行領域を残すことにより、切り替えの前後でプログラムに応じた処理の実行領域を一致させることができので、切り替え処理を効率的に行うことができる。   According to this, by assigning the memory area itself in which the program to be executed is stored to the execution area of the control means, it is not necessary to copy the program code itself as in the prior art. In addition, by leaving the execution area of the process corresponding to the selectively switched program, the execution area of the process corresponding to the program can be matched before and after the switching, so that the switching process can be performed efficiently. it can.

異なるプログラムが書かれた複数のメモリを選択的に制御手段の実行領域に割り付けることで処理の分岐を行うため、あるプログラムコードが置かれたメモリが割り付けられているアドレス空間に別のプログラムコードが置かれたメモリを割り付け、選択的に切り替えられたプログラムに応じた処理の実行領域を残すことでオーバーヘッドなく処理の切り替えが行うことができる。   Since a plurality of memories in which different programs are written are selectively allocated to the execution area of the control means, the process branches, so that another program code is placed in the address space to which the memory in which a certain program code is placed is allocated. Processing can be switched without overhead by allocating the placed memory and leaving a processing execution area corresponding to the selectively switched program.

本発明によれば、従来のようなプログラムコード自体のコピー処理の必要がなくなるため、大きなメモリ記憶容量を必要とせず、簡単な処理でプログラム切り替えを実現することができる。また、オーバーヘッドなく処理の切り替えが行うことができる。   According to the present invention, since it is not necessary to copy the program code itself as in the prior art, program switching can be realized by simple processing without requiring a large memory storage capacity. In addition, processing can be switched without overhead.

以下に、本発明の実施の形態について、適宜図面を参照しながら説明する。
図1は、本発明の実施の形態によるプログラム分岐装置の構成を示す図である。
図1において、制御手段としてのCPU(Central Processing Unit)1は、ROM(Read Only Memory),RAM(Random access Memory)などで構成されるワークエリアと呼ばれる実行領域のうちのプログラム領域2に割り付けられたプログラムの動作を実行するように構成される。
Embodiments of the present invention will be described below with reference to the drawings as appropriate.
FIG. 1 is a diagram showing a configuration of a program branching apparatus according to an embodiment of the present invention.
In FIG. 1, a CPU (Central Processing Unit) 1 as a control means is allocated to a program area 2 in an execution area called a work area composed of ROM (Read Only Memory), RAM (Random access Memory), and the like. Configured to perform the operations of the program.

ここで、複数のプログラムとして、メモリ切替処理部6及びブート処理部3、メモリ切替処理部7及び第1の処理部4、メモリ切替処理部8及び第2の処理部5が記憶されているメモリ領域自体を実行領域であるプログラム領域2に割り当てるように構成される。つまり、メモリ切替処理部6及びブート処理部3、メモリ切替処理部7及び第1の処理部4、メモリ切替処理部8及び第2の処理部5は、制御手段としてのCPU1に対してプログラム領域2の同じメモリアドレス領域に割り当てられる。具体的には、同じアドレスに配置した複数のメモリを選択することで処理を切り替えることになる。   Here, the memory in which the memory switching processing unit 6 and the boot processing unit 3, the memory switching processing unit 7 and the first processing unit 4, the memory switching processing unit 8 and the second processing unit 5 are stored as a plurality of programs. The area itself is configured to be assigned to the program area 2 which is an execution area. That is, the memory switching processing unit 6 and the boot processing unit 3, the memory switching processing unit 7 and the first processing unit 4, the memory switching processing unit 8 and the second processing unit 5 are connected to the CPU 1 as a control unit in the program area. Are assigned to two identical memory address areas. Specifically, the processing is switched by selecting a plurality of memories arranged at the same address.

また、メモリ切替処理部6、メモリ切替処理部7、メモリ切替処理部8は、制御手段としてのCPU1により、複数のプログラムとして、ブート処理部3、第1の処理部4、第2の処理部5のいずれかを選択的に切り替えるための分岐の判断をするように構成される。ここで、メモリ切替処理部6、メモリ切替処理部7、メモリ切替処理部8は全て同一のプログラムで構成される。また、メモリを切り替える条件は制御手段としてのCPU1のポート、レジスタなどのメモリ外の情報を用いるように構成される。   In addition, the memory switching processing unit 6, the memory switching processing unit 7, and the memory switching processing unit 8 are executed as a plurality of programs by the CPU 1 serving as a control unit, as a boot processing unit 3, a first processing unit 4, and a second processing unit. 5 is configured to determine a branch for selectively switching any one of 5. Here, the memory switching processing unit 6, the memory switching processing unit 7, and the memory switching processing unit 8 are all configured by the same program. The memory switching condition is configured to use information outside the memory such as a port and a register of the CPU 1 as a control means.

また、メモリ切替処理部6、メモリ切替処理部7、メモリ切替処理部8は、制御手段としてのCPU1により、分岐の判断に従って複数のプログラムとして、ブート処理部3、第1の処理部4、第2の処理部5のいずれかを選択的に切り替える分岐の処理をするように構成される。   The memory switching processing unit 6, the memory switching processing unit 7, and the memory switching processing unit 8 are performed by the CPU 1 serving as a control unit as a plurality of programs according to the determination of branching, as a boot processing unit 3, a first processing unit 4, and a second processing unit. 2 is configured to perform a branching process for selectively switching one of the two processing units 5.

また、制御手段としてのCPU1は、分岐の処理に対応するように選択的に切り替えられたプログラムとして、ブート処理部3、第1の処理部4、第2の処理部5に応じた処理を実行するように構成される。   Further, the CPU 1 as the control means executes processing according to the boot processing unit 3, the first processing unit 4, and the second processing unit 5 as a program selectively switched so as to correspond to branch processing. Configured to do.

これにより、9に示すように、メモリ切替処理部6、メモリ切替処理部7、メモリ切替処理部8による切替処理によってプログラム領域2に割り付けられるプログラムデータが選択される。そして、制御手段としてのCPU1は、メモリ切替処理部6、メモリ切替処理部7、メモリ切替処理部8による切替処理によって、実行領域のうちのプログラム領域2に割り付けられたプログラムとしてのブート処理部3、第1の処理部4、第2の処理部5の動作を実行する。   As a result, as shown in 9, program data to be allocated to the program area 2 is selected by the switching process by the memory switching processing unit 6, the memory switching processing unit 7, and the memory switching processing unit 8. Then, the CPU 1 as the control means has a boot processing unit 3 as a program allocated to the program area 2 in the execution area by the switching process by the memory switching processing unit 6, the memory switching processing unit 7, and the memory switching processing unit 8. The operations of the first processing unit 4 and the second processing unit 5 are executed.

図2は、割込要因に対応したメモリ切替の動作を示すフローチャートである。図2は、上述したメモリを切り替える条件が、割込み要因に対応する場合の動作を示すものである。
図2において、制御手段としてのCPU1は、割込があるか否かを判断する(ステップS1)。具体的には、CPU1は、一定時間毎に発生するタイマー割込みや、CPU1によって制御される被制御部の状態遷移による割込みなどを検出する。
FIG. 2 is a flowchart showing the memory switching operation corresponding to the interrupt factor. FIG. 2 shows an operation when the above-described memory switching condition corresponds to an interrupt factor.
In FIG. 2, CPU1 as a control means judges whether there exists interruption (step S1). Specifically, the CPU 1 detects a timer interruption that occurs at regular intervals, an interruption due to a state transition of a controlled unit that is controlled by the CPU 1, and the like.

CPU1は、割込があると判断したとき、割込要因が何であるかを判断する(ステップS2)。具体的には、CPU1は、パワーオンスイッチのオン操作時のリセット動作による割込要因や、CPU1によって制御される被制御部の状態が他の状態に遷移したときの割込要因などを検出する。   When CPU 1 determines that there is an interrupt, CPU 1 determines what the interrupt factor is (step S2). Specifically, the CPU 1 detects an interrupt factor due to a reset operation when the power-on switch is turned on, an interrupt factor when the state of the controlled unit controlled by the CPU 1 transitions to another state, and the like. .

CPU1は、割込要因に対応してメモリ切替を行う(ステップS3)。具体的には、CPU1は、パワーオンスイッチのオン操作時のリセット動作による割込要因のときは、図1に示したメモリ切替処理部6による切替処理によってブート処理部3がプログラム領域2に割り付けられるように選択される。また、CPU1によって制御される被制御部の状態が他の状態に遷移したときの割込要因のときは、図1に示したメモリ切替処理部7、メモリ切替処理部8による切替処理によって第1の処理部4、第2の処理部5がプログラム領域2に割り付けられるように選択される。   The CPU 1 performs memory switching corresponding to the interrupt factor (step S3). Specifically, the CPU 1 assigns the boot processing unit 3 to the program area 2 by the switching process by the memory switching processing unit 6 shown in FIG. 1 when the interrupt factor is caused by the reset operation when the power-on switch is turned on. Selected to be. Further, when an interrupt factor is generated when the state of the controlled unit controlled by the CPU 1 is changed to another state, the first switching process is performed by the memory switching processing unit 7 and the memory switching processing unit 8 illustrated in FIG. The processing unit 4 and the second processing unit 5 are selected so as to be allocated to the program area 2.

図3は、分岐によるプログラム全体の切替の動作を示すフローチャートである。
図3において、メモリ切替処理部は、分岐の判断を行う(ステップS11、ステップS21、ステップS31)。具体的には、図1に示したメモリ切替処理部は、制御手段としてのCPU1により、複数のプログラムとして、第1の処理部、第2の処理部、第3の処理部のいずれかを選択的に切り替えるための分岐の判断をする。
FIG. 3 is a flowchart showing the operation of switching the whole program by branching.
In FIG. 3, the memory switching processing unit determines branching (step S11, step S21, step S31). Specifically, the memory switching processing unit shown in FIG. 1 selects any one of the first processing unit, the second processing unit, and the third processing unit as a plurality of programs by the CPU 1 as the control unit. Judgment of branch to switch automatically.

分岐が必要であると判断されたときは、次に、メモリ切替処理部は、分岐(切替)処理を行う(ステップS12、ステップS22、ステップS32)。具体的には、図1に示したメモリ切替処理部(ステップS12、ステップS22、ステップS32)は、制御手段としてのCPU1により、第1の処理部による第1の処理(ステップS13)、第2の処理部による第2の処理(ステップS23)、第3の処理部による第3の処理(ステップS33)のいずれかを選択的に切り替える分岐の処理をする。   If it is determined that branching is necessary, the memory switching processing unit next performs branching (switching) processing (step S12, step S22, step S32). Specifically, the memory switching processing unit (step S12, step S22, step S32) shown in FIG. 1 is performed by the CPU 1 serving as a control unit by the first processing (step S13), the second processing by the first processing unit. A branching process for selectively switching between the second process (step S23) by the processing unit and the third process (step S33) by the third processing unit is performed.

メモリ切替処理部(ステップS12、ステップS22、ステップS32)の分岐(切替)処理により、31に示すように、全てをプログラムごと(ステップS11〜ステップS13、ステップS21〜ステップS23、ステップS31〜ステップS33)
切り替える。
By branching (switching) processing of the memory switching processing unit (step S12, step S22, step S32), as shown in 31, all of them are programmed (step S11 to step S13, step S21 to step S23, step S31 to step S33). )
Switch.

ここで、第1の処理部による第1の処理(ステップS13)に切り替えられたときは、図1に示した制御手段としてのCPU1は、分岐の処理に対応するように選択的に切り替えられたプログラムとして、第1の処理部に応じた処理を実行する(ステップS13)。   Here, when the process is switched to the first process (step S13) by the first processing unit, the CPU 1 as the control means shown in FIG. 1 is selectively switched to correspond to the branch process. As a program, a process corresponding to the first processing unit is executed (step S13).

また、第2の処理部による第2の処理(ステップS23)に切り替えられたときは、図1に示した制御手段としてのCPU1は、分岐の処理に対応するように選択的に切り替えられたプログラムとして、第2の処理部に応じた処理を実行する(ステップS23)。   When the second processing unit switches to the second processing (step S23), the CPU 1 as the control unit shown in FIG. 1 selectively switches to correspond to the branch processing. As a result, processing corresponding to the second processing unit is executed (step S23).

また、第3の処理部による第3の処理(ステップS33)に切り替えられたときは、図1に示した制御手段としてのCPU1は、分岐の処理に対応するように選択的に切り替えられたプログラムとして、第3の処理部に応じた処理を実行する(ステップS33)。   When switched to the third processing (step S33) by the third processing unit, the CPU 1 as the control means shown in FIG. 1 is selectively switched so as to correspond to the branch processing. Then, the process according to the third processing unit is executed (step S33).

このように、メモリ切替処理部(ステップS12、ステップS22、ステップS32)は、第1の処理部による第1の処理(ステップS13)、第2の処理部による第2の処理(ステップS23)、第3の処理部による第3の処理(ステップS33)を呼び出すように動作する。   As described above, the memory switching processing unit (step S12, step S22, step S32) includes the first processing by the first processing unit (step S13), the second processing by the second processing unit (step S23), The third processing unit operates so as to call the third processing (step S33).

ここでは、前提として、まず、切替処理の数分のプログラムを記憶したメモリが同じアドレスに配置されている。次に、全てのメモリに記録されているプログラムの先頭部分にメモリ切り替えを管理するメモリ切替処理部を搭載していて、メモリ切替処理部の後部にそれぞれのプログラムの処理部を実装している。   Here, as a premise, first, memories storing programs for the number of switching processes are arranged at the same address. Next, a memory switching processing unit for managing memory switching is mounted at the head of the program recorded in all memories, and the processing unit for each program is mounted at the rear of the memory switching processing unit.

そして、処理を開始すると、まずメモリに記録されているプログラムの先頭部分に搭載されているメモリ切替処理部により分岐の判断及び切替処理が行われる。ここでは、31に示すように、分岐(切替)によって全てをプログラムごと切り替える。   Then, when the process is started, branch determination and switching processing are first performed by the memory switching processing unit mounted at the head portion of the program recorded in the memory. Here, as shown at 31, all of the programs are switched by branching (switching).

次に、切替えられたメモリ上に記憶されているプログラムが図1に示した制御手段としてのCPU1により実行され、プログラムの実行処理が終わると再びメモリ切替処理部による分岐の判断及び切替処理へ戻って、これらの判断及び処理を繰り返す。   Next, the program stored in the switched memory is executed by the CPU 1 as the control means shown in FIG. 1, and when the execution of the program is completed, the memory switching processing unit returns to branch determination and switching processing again. These determinations and processing are repeated.

図4は、ハードウエア構成を示す図である。
図4において、制御手段としてのCPU41には、第1のメモリ43、第2のメモリ44、第3のメモリ45のそれぞれが同じアドレス領域に割り当てられている。CPU41は、例えばチップセレクト信号などの同じアドレス信号ADを第1のメモリ43、第2のメモリ44、第3のメモリ45に対して供給する。
FIG. 4 is a diagram illustrating a hardware configuration.
In FIG. 4, the CPU 41 as the control means is assigned with the first memory 43, the second memory 44, and the third memory 45 in the same address area. The CPU 41 supplies the same address signal AD such as a chip select signal to the first memory 43, the second memory 44, and the third memory 45.

ここで、スイッチ42から、第1のメモリ43、第2のメモリ44、第3のメモリ45に対して、たとえばチップイネーブル信号などの選択信号CHが供給される。この選択信号CHは、同じアドレス領域に割り当てられた第1のメモリ43、第2のメモリ44、第3のメモリ45のアドレス領域を有効にする信号であればよい。   Here, a selection signal CH such as a chip enable signal is supplied from the switch 42 to the first memory 43, the second memory 44, and the third memory 45, for example. The selection signal CH may be any signal that enables the address areas of the first memory 43, the second memory 44, and the third memory 45 assigned to the same address area.

CPU41に対して同じアドレス領域に配置された第1のメモリ43、第2のメモリ44、第3のメモリ45に対して、CPU41は、例えばチップセレクト信号などの同じアドレス信号ADを第1のメモリ43、第2のメモリ44、第3のメモリ45に対して供給して、第1のメモリ43、第2のメモリ44、第3のメモリ45のいずれかを選択する。   For the first memory 43, the second memory 44, and the third memory 45 arranged in the same address area with respect to the CPU 41, the CPU 41 sends the same address signal AD such as a chip select signal to the first memory. 43, the second memory 44, and the third memory 45 to select one of the first memory 43, the second memory 44, and the third memory 45.

そして、CPU41は、スイッチ42からの選択信号CHによって選択された第1のメモリ43、第2のメモリ44、第3のメモリのいずれかに記憶されたプログラムデータを出力する。   Then, the CPU 41 outputs the program data stored in any of the first memory 43, the second memory 44, and the third memory selected by the selection signal CH from the switch 42.

なお、ここで、選択信号CHを管理しているスイッチ42に対してCPU41からの選択信号CHに基づいて切り替え処理が可能に構成される。   Here, the switch 42 that manages the selection signal CH is configured to be able to perform switching processing based on the selection signal CH from the CPU 41.

図5は、OS処理に応じたプログラム分岐装置の構成を示す図である。
図5において、制御手段としてのCPU51は、ROM,RAMなどで構成されるワークエリアと呼ばれる実行領域のうちのプログラム領域53に割り付けられたプログラムの動作を実行するように構成される。
FIG. 5 is a diagram illustrating a configuration of a program branching apparatus according to the OS process.
In FIG. 5, a CPU 51 as a control means is configured to execute an operation of a program allocated to a program area 53 in an execution area called a work area composed of ROM, RAM, and the like.

ここで、複数のプログラムとして、オペレーティングシステム(OS(Operating System))処理部57、第1のタスク処理部54、プログラムカウンタ部61及びスタックポインタ部62と、オペレーティングシステム(OS)処理部58、第2のタスク処理部55、プログラムカウンタ部63及びスタックポインタ部64と、オペレーティングシステム(OS)処理部59、第3のタスク処理部56、プログラムカウンタ部65及びスタックポインタ部66は、制御手段としてのCPU51に対してプログラム領域53の同じメモリアドレス領域に割り当てられる。具体的には、同じアドレスに配置した複数のメモリを選択することで処理を切り替えることになる。   Here, as a plurality of programs, an operating system (OS (Operating System)) processing unit 57, a first task processing unit 54, a program counter unit 61 and a stack pointer unit 62, an operating system (OS) processing unit 58, a first 2 task processing unit 55, program counter unit 63 and stack pointer unit 64, operating system (OS) processing unit 59, third task processing unit 56, program counter unit 65 and stack pointer unit 66 serve as control means. The CPU 51 is assigned to the same memory address area of the program area 53. Specifically, the processing is switched by selecting a plurality of memories arranged at the same address.

また、オペレーティングシステム(OS)処理部57、オペレーティングシステム(OS)処理部58、オペレーティングシステム(OS)処理部59は、制御手段としてのCPU51により、複数のプログラムとして、第1のタスク処理部54、第2のタスク処理部55、第3のタスク処理部56のいずれかを選択的に切り替えるための分岐の判断をするように構成される。ここで、オペレーティングシステム(OS)処理部57、オペレーティングシステム(OS)処理部58、オペレーティングシステム(OS)処理部59は全て異なるプログラムで構成される。また、メモリを切り替える条件は制御手段としてのCPU51のポート、レジスタなどのメモリ外の情報を用いるように構成される。   In addition, the operating system (OS) processing unit 57, the operating system (OS) processing unit 58, and the operating system (OS) processing unit 59 are converted into a plurality of programs by the first task processing unit 54, It is configured to determine a branch for selectively switching between the second task processing unit 55 and the third task processing unit 56. Here, the operating system (OS) processing unit 57, the operating system (OS) processing unit 58, and the operating system (OS) processing unit 59 are all configured by different programs. The memory switching condition is configured to use information outside the memory such as a port and a register of the CPU 51 as a control means.

また、オペレーティングシステム(OS)処理部57、オペレーティングシステム(OS)処理部58、オペレーティングシステム(OS)処理部59は、制御手段としてのCPU51により、分岐の判断に従って複数のプログラムとして、第1のタスク処理部54、第2のタスク処理部55、第3のタスク処理部56のいずれかを選択的に切り替える分岐の処理をするように構成される。   In addition, the operating system (OS) processing unit 57, the operating system (OS) processing unit 58, and the operating system (OS) processing unit 59 are processed by the CPU 51 as the control unit as a plurality of programs according to the branch determination as the first task. It is configured to perform a branch process for selectively switching any one of the processing unit 54, the second task processing unit 55, and the third task processing unit 56.

また、制御手段としてのCPU51は、分岐の処理に対応するように選択的に切り替えられたプログラムとして、第1のタスク処理部54、第2のタスク処理部55、第3のタスク処理部56に応じた処理を実行するように構成される。   Further, the CPU 51 serving as the control means sends the first task processing unit 54, the second task processing unit 55, and the third task processing unit 56 as programs that are selectively switched so as to correspond to the branch processing. It is comprised so that the process according to this may be performed.

また、プログラムカウンタ部61及びスタックポインタ部62と、プログラムカウンタ部63及びスタックポインタ部64と、プログラムカウンタ部65及びスタックポインタ部66は、選択的に切り替えられたプログラムとして、第1のタスク処理部54、第2のタスク処理部55、第3のタスク処理部56に応じた処理の実行領域を残すように構成される。   The program counter unit 61 and the stack pointer unit 62, the program counter unit 63 and the stack pointer unit 64, the program counter unit 65 and the stack pointer unit 66 are the first task processing unit as a selectively switched program. 54, the second task processing unit 55 and the third task processing unit 56 are configured to leave a processing execution area.

ここで、プログラムカウンタ部61,63,65は、第1のタスク処理部54、第2のタスク処理部55、第3のタスク処理部56によるプログラムのアドレスを計数する。また、スタックポインタ部62,64,66は、プログラムカウンタ部61,63,65によるプログラムのアドレスを指して残す。   Here, the program counter units 61, 63, 65 count the addresses of the programs by the first task processing unit 54, the second task processing unit 55, and the third task processing unit 56. Further, the stack pointer portions 62, 64, 66 indicate and leave the program addresses by the program counter portions 61, 63, 65.

また、スタックRAM52は、スタックポインタ部62と、スタックポインタ部64と、スタックポインタ部66により残したプログラムのアドレスを読み出し可能に記憶する。   Further, the stack RAM 52 stores the address of the program left by the stack pointer unit 62, the stack pointer unit 64, and the stack pointer unit 66 in a readable manner.

これにより、67に示すように、オペレーティングシステム(OS)処理部57、オペレーティングシステム(OS)処理部58、オペレーティングシステム(OS)処理部59による切替処理によってプログラム領域53に割り付けられるプログラムデータが選択される。   As a result, as shown in 67, the program data allocated to the program area 53 is selected by the switching process by the operating system (OS) processing unit 57, the operating system (OS) processing unit 58, and the operating system (OS) processing unit 59. The

そして、制御手段としてのCPU51は、オペレーティングシステム(OS)処理部57、オペレーティングシステム(OS)処理部58、オペレーティングシステム(OS)処理部59による切替処理によって、実行領域のうちのプログラム領域53に割り付けられたプログラムとしての第1のタスク処理部54、第2のタスク処理部55、第3のタスク処理部56の動作を実行する。   Then, the CPU 51 as the control means allocates to the program area 53 in the execution area by the switching process by the operating system (OS) processing unit 57, the operating system (OS) processing unit 58, and the operating system (OS) processing unit 59. The operations of the first task processing unit 54, the second task processing unit 55, and the third task processing unit 56 as the programmed programs are executed.

本発明の実施の形態によるプログラム分岐装置の構成を示す図である。It is a figure which shows the structure of the program branching apparatus by embodiment of this invention. 割込み要因に対応したメモリ切替の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of memory switching corresponding to the interruption factor. 分岐によるプログラム全体の切替の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the switching of the whole program by a branch. ハードウエア構成を示す図である。It is a figure which shows a hardware configuration. OS処理に応じたプログラム分岐装置の構成を示す図である。It is a figure which shows the structure of the program branch apparatus according to OS process. 従来のプログラムコピーの動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the conventional program copy.

符号の説明Explanation of symbols

1…CPU、2…プログラム領域、3…ブート処理部、4…第1の処理部、5…第2の処理部、6…メモリ切替処理部、7…メモリ切替処理部、8…メモリ切替処理部、9…切替処理によってプログラム領域2に割り付けられるプログラムデータが選択される、31…分岐(切替)によって全てをプログラムごと切り替える、41…CPU、42…スイッチ、43…第1のメモリ、44…第2のメモリ、45…第3のメモリ、AD…同じアドレス信号、CH…選択信号、51…CPU、53…プログラム領域、54…第1のタスク処理部、55…第2のタスク処理部、56…第3のタスク処理部、57…オペレーティングシステム(OS)処理部、58…オペレーティングシステム(OS)処理部、59…オペレーティングシステム(OS)処理部、61…プログラムカウンタ部、62…スタックポインタ部、63…プログラムカウンタ部、64…スタックポインタ部、65…プログラムカウンタ部、66…スタックポインタ部、67…オペレーティングシステム(OS)による切替処理によってプログラム領域53に割り付けられるプログラムデータが選択される、 DESCRIPTION OF SYMBOLS 1 ... CPU, 2 ... Program area | region, 3 ... Boot process part, 4 ... 1st process part, 5 ... 2nd process part, 6 ... Memory switch process part, 7 ... Memory switch process part, 8 ... Memory switch process , 9... Program data assigned to the program area 2 is selected by the switching process. 31... All the programs are switched by branching (switching). 41... CPU, 42. 2nd memory, 45 ... 3rd memory, AD ... Same address signal, CH ... Selection signal, 51 ... CPU, 53 ... Program area, 54 ... 1st task processing part, 55 ... 2nd task processing part, 56 ... third task processing unit, 57 ... operating system (OS) processing unit, 58 ... operating system (OS) processing unit, 59 ... operating system (OS) Management unit 61... Program counter unit 62 62 Stack pointer unit 63 Program counter unit 64 Stack pointer unit 65 Program counter unit 66 Stack pointer unit 67 Switching process by operating system (OS) Program data allocated to the program area 53 is selected.

Claims (8)

メモリ領域に記憶されている複数のプログラムを制御手段の実行領域に切替えて読み出してプログラムに応じた処理を実行するプログラム分岐方法において、
上記複数のプログラムが記憶されている上記メモリ領域自体を上記実行領域に割り当てるステップと、
上記複数のプログラムのいずれかを選択的に切り替えるための分岐の判断をするステップと、
上記分岐の判断に従って上記複数のプログラムのいずれかを選択的に切り替える分岐の処理をするステップと、
上記分岐の処理に対応するように選択的に切り替えられたプログラムに応じた処理を実行するステップと
を備えたことを特徴とするプログラム分岐方法。
In a program branching method for switching a plurality of programs stored in a memory area to an execution area of a control means and reading and executing processing according to the program,
Assigning the memory area itself storing the plurality of programs to the execution area;
Determining a branch for selectively switching one of the plurality of programs;
A step of performing a branch process for selectively switching one of the plurality of programs according to the determination of the branch;
And a step of executing a process according to a program selectively switched so as to correspond to the branch process.
請求項1記載のプログラム分岐方法において、
上記複数のプログラムは、上記分岐の処理をするステップに応じた切替処理部と、上記複数のプログラムに応じたプログラム処理部
を備えることを特徴とするプログラム分岐方法。
The program branching method according to claim 1, wherein
The plurality of programs includes a switching processing unit corresponding to the step of performing the branching process, and a program processing unit corresponding to the plurality of programs.
請求項1記載のプログラム分岐方法において、
上記分岐の判断をするステップと、上記分岐の処理をするステップと、上記処理を実行するステップは繰り返して実行される
を備えたことを特徴とするプログラム分岐方法。
The program branching method according to claim 1, wherein
A program branching method comprising: the step of determining the branch, the step of performing the branch process, and the step of executing the process are repeatedly executed.
請求項1記載のプログラム分岐方法において、
上記分岐の判断をするステップは割り込み処理の有無を判断し、上記分岐の処理をするステップは上記割り込み処理の割り込み要因に対応して分岐の処理をする
ことを特徴とするプログラム分岐方法。
The program branching method according to claim 1, wherein
The program branching method characterized in that the step of determining the branch determines whether or not there is an interrupt process, and the step of performing the branch process performs a branch process corresponding to the interrupt factor of the interrupt process.
メモリ領域に記憶されている複数のプログラムを制御手段の実行領域に切替えて読み出してプログラムに応じた処理を実行するプログラム分岐方法において、
上記複数のプログラムが記憶されている上記メモリ領域自体を上記実行領域に割り当てるステップと、
上記複数のプログラムのいずれかを選択的に切り替えるための分岐の判断をするステップと、
上記分岐の判断に従って上記複数のプログラムのいずれかを選択的に切り替える分岐の処理をするステップと、
上記分岐の処理に対応するように選択的に切り替えられたプログラムに応じた処理を実行するステップと、
上記選択的に切り替えられたプログラムに応じた処理の実行領域を残すステップと、
を備えたことを特徴とするプログラム分岐方法。
In a program branching method for switching a plurality of programs stored in a memory area to an execution area of a control means and reading and executing processing according to the program,
Assigning the memory area itself storing the plurality of programs to the execution area;
Determining a branch for selectively switching one of the plurality of programs;
A step of performing a branch process for selectively switching one of the plurality of programs according to the determination of the branch;
Executing a process corresponding to the program selectively switched to correspond to the branch process;
Leaving an execution area for processing according to the selectively switched program;
A program branching method comprising:
請求項5記載のプログラム分岐方法において、
上記複数のプログラムは、上記分岐の処理をするステップに応じたオペレーティングシステム(OS)処理部と、上記複数のプログラムに応じたプログラム処理部と、上記プログラム処理部によるプログラムのアドレスを計数するプログラムカウンタ部と、上記プログラムカウンタ部によるプログラムのアドレスを残すスタックポインタ部
を備えることを特徴とするプログラム分岐方法。
The program branching method according to claim 5, wherein
The plurality of programs include an operating system (OS) processing unit corresponding to the step of performing the branching process, a program processing unit corresponding to the plurality of programs, and a program counter that counts program addresses by the program processing unit. And a stack pointer section for leaving the address of the program by the program counter section.
請求項5記載のプログラム分岐方法において、
上記分岐の判断をするステップと、上記分岐の処理をするステップと、上記処理を実行するステップと、上記処理の実行領域を残すステップは繰り返して実行される
を備えたことを特徴とするプログラム分岐方法。
The program branching method according to claim 5, wherein
The program branch comprising: the step of determining the branch, the step of performing the branch process, the step of executing the process, and the step of leaving the execution area of the process are repeatedly executed. Method.
請求項5記載のプログラム分岐方法において、
上記分岐の判断をするステップはオペレーティングシステム(OS)処理及び割り込み処理の有無を判断し、上記分岐の処理をするステップは上記オペレーティングシステム(OS)処理に基づく処理要求及び上記割り込み処理の割り込み要因に対応して分岐の処理をする
ことを特徴とするプログラム分岐方法。
The program branching method according to claim 5, wherein
The step of determining the branch determines whether or not there is an operating system (OS) process and an interrupt process, and the step of performing the branch process determines a processing request based on the operating system (OS) process and an interrupt factor of the interrupt process. A program branching method characterized by branching correspondingly.
JP2004153630A 2004-05-24 2004-05-24 Program branching method Pending JP2005338952A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004153630A JP2005338952A (en) 2004-05-24 2004-05-24 Program branching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004153630A JP2005338952A (en) 2004-05-24 2004-05-24 Program branching method

Publications (1)

Publication Number Publication Date
JP2005338952A true JP2005338952A (en) 2005-12-08

Family

ID=35492490

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004153630A Pending JP2005338952A (en) 2004-05-24 2004-05-24 Program branching method

Country Status (1)

Country Link
JP (1) JP2005338952A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010244679A (en) * 2009-04-06 2010-10-28 Samsung Electronics Co Ltd Method of dynamically relocating code and disk drive

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010244679A (en) * 2009-04-06 2010-10-28 Samsung Electronics Co Ltd Method of dynamically relocating code and disk drive

Similar Documents

Publication Publication Date Title
JP2017037370A (en) Computing device, process control method and process control program
KR20070090649A (en) Apparatus and method for providing cooperative scheduling on multi-core system
US7694182B2 (en) Debugging system and method
US20080133899A1 (en) Context switching method, medium, and system for reconfigurable processors
JP2008522277A (en) Efficient switching between prioritized tasks
JP2007334403A (en) System and method for supporting trouble of computer system
JP4170364B2 (en) Processor
JP2009252128A (en) Memory control apparatus and method of controlling the same
TWI592803B (en) Method of operating embedded system and control chip thereof
JP2005338952A (en) Program branching method
JP2007226640A (en) Memory diagnosis processing circuit and memory diagnosis processing method
JP3956305B2 (en) Nonvolatile semiconductor memory device and data processing device
JP2000215068A (en) Multitask scheduling device
JP2007122337A (en) Arithmetic unit
KR100401560B1 (en) Kernel Stack Dynamic Allocation Method In Operating System
JP2001229038A (en) Multi-operating computer system
JP2005071141A (en) Method and device for managing stack and stack management program
JP2004178427A (en) Central processing unit
JP2001134449A (en) Data processor and its control method
JP3695078B2 (en) Programmable controller with pulse output instructions
JPH07230358A (en) Multiplexed volume device
JPS62151942A (en) Task changing-over system
JP5789237B2 (en) Memory management device
JP2007122421A (en) Memory management method
JP2017187895A (en) Memory managing device, and memory managing method