JP7380406B2 - Real-time arithmetic processing unit - Google Patents

Real-time arithmetic processing unit Download PDF

Info

Publication number
JP7380406B2
JP7380406B2 JP2020079203A JP2020079203A JP7380406B2 JP 7380406 B2 JP7380406 B2 JP 7380406B2 JP 2020079203 A JP2020079203 A JP 2020079203A JP 2020079203 A JP2020079203 A JP 2020079203A JP 7380406 B2 JP7380406 B2 JP 7380406B2
Authority
JP
Japan
Prior art keywords
task
state
processing unit
priority
arithmetic
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.)
Active
Application number
JP2020079203A
Other languages
Japanese (ja)
Other versions
JP2021174365A (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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2020079203A priority Critical patent/JP7380406B2/en
Publication of JP2021174365A publication Critical patent/JP2021174365A/en
Application granted granted Critical
Publication of JP7380406B2 publication Critical patent/JP7380406B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、リアルタイム演算処理装置に関する。 The present invention relates to a real-time arithmetic processing device.

従来より、広く使用されているマイコンは、主にCPU、メモリ、及び周辺回路を用いて構成されている。従来、開発者は、所望の処理内容をソフトウェアとしてメモリに実装し、マイコンがメモリに記憶されたソフトウェアを実行することで各種処理を実現できる。この手法はソフトウェアをアップデートすることで比較的簡単に処理を変更でき、フレキシビリティ性を確保できる。 Conventionally, microcomputers that have been widely used are mainly configured using a CPU, memory, and peripheral circuits. BACKGROUND ART Conventionally, developers have been able to implement various types of processing by implementing desired processing contents in a memory as software, and having a microcomputer execute the software stored in the memory. With this method, the processing can be changed relatively easily by updating the software, ensuring flexibility.

従来の一般的なマイコンの場合、ROMにアプリケーション、OS(オペレーティングシステム)、割込みハンドラといったソフトウェアであったり、割込み時のジャンプ先割込みハンドラのジャンプアドレスがマシンコード化されて実装される。このときマイコンに構成されるCPUは、プログラムカウンタに基づいて命令系アドレスバスが指し示すROM内の命令コードを命令系データバスを経由して読み出すと共にCPU内命令レジスタに格納する。CPU内命令デコーダ部が命令レジスタに格納された命令コードを各種制御信号に置換し、CPU内汎用レジスタ、ALU(Arithmetic Logic Unit:算術論理演算装置)や、RAM、その他の周辺機能を制御するようにしている。 In the case of a conventional general microcomputer, software such as an application, an OS (operating system), and an interrupt handler is implemented in a ROM, and a jump address of an interrupt handler to which a jump is made at the time of an interrupt is encoded in machine code. At this time, the CPU configured in the microcomputer reads out the instruction code in the ROM pointed to by the instruction address bus via the instruction data bus based on the program counter, and stores it in the instruction register in the CPU. The instruction decoder section in the CPU replaces the instruction code stored in the instruction register with various control signals to control general-purpose registers in the CPU, ALU (Arithmetic Logic Unit), RAM, and other peripheral functions. I have to.

特許文献1記載のように、CPUのマルチコア技術が提案されており、処理能力改善の手法を提供している。しかし、特許文献1記載の構成では、マルチコア構成を採用しているため、逆に回路規模が大きくなってしまうという事情がある。 As described in Patent Document 1, a CPU multi-core technology has been proposed and provides a method for improving processing performance. However, since the configuration described in Patent Document 1 employs a multi-core configuration, the circuit size conversely increases.

特許5453825号公報Patent No. 5453825

本開示の目的は、回路規模の増大を極力抑制しつつ演算イベント割込に迅速に対応できるようにしたリアルタイム演算処理装置を提供することにある。 An object of the present disclosure is to provide a real-time arithmetic processing device that can quickly respond to arithmetic event interrupts while suppressing an increase in circuit scale as much as possible.

請求項1記載の発明によれば、オペレーティングシステム処理部(3)と、演算処理部(6)とを同一のICチップ内にそれぞれハードウェア上で独立して構成している。オペレーティングシステム処理部(3)及び演算処理部(6)は独立に処理可能になる。 According to the first aspect of the invention, the operating system processing section (3) and the arithmetic processing section (6) are configured independently in terms of hardware within the same IC chip. The operating system processing section (3) and the arithmetic processing section (6) can now process independently.

ここで、オペレーティングシステム処理部(3)は、外部から演算イベントが発行されると時間軸及び優先度に基づいて実行順序を判断し演算イベントに係るタスクを実行指令すると共にタスクの管理を行うことに特化している。また演算処理部(6)は、オペレーティングシステム処理部(3)の実行指令に従って演算処理を実行することに特化している。 Here, when a calculation event is issued from the outside, the operating system processing unit (3) determines the execution order based on the time axis and priority, issues an execution command to the task related to the calculation event, and manages the tasks. is specialized in. Further, the arithmetic processing section (6) is specialized in executing arithmetic processing according to execution instructions from the operating system processing section (3).

また請求項1記載の発明は、タスクに紐付いた開始アドレス及び終了アドレスを記憶するメッセージリスト(4)と、演算命令セットを記憶する演算命令テーブル(5)とを備えている。 The invention according to claim 1 also includes a message list (4) that stores a start address and an end address associated with a task, and an arithmetic instruction table (5) that stores an arithmetic instruction set.

演算処理部は、プログラムカウンタブロック(31)及び演算命令デコーダ(32)を備え、オペレーティングシステム処理部(3)から前記演算イベントに係るタスクの実行指令を受付けると、タスクに紐付いた開始アドレス及び前記終了アドレスをメッセージリスト(4)から受領し、開始アドレスから終了アドレスにかけてプログラムカウンタ(41)のカウンタ値の示すアドレスにおける演算命令テーブル(5)の演算命令セットを参照して演算処理を実行する。 The arithmetic processing unit includes a program counter block (31) and an arithmetic instruction decoder (32), and upon receiving an instruction to execute a task related to the arithmetic event from the operating system processing unit (3), the arithmetic processing unit receives the start address associated with the task and the arithmetic instruction decoder (32). The end address is received from the message list (4), and arithmetic processing is executed by referring to the arithmetic instruction set in the arithmetic instruction table (5) at the address indicated by the counter value of the program counter (41) from the start address to the end address.

このため、オペレーティングシステム処理部(3)及び演算処理部(6)は各ハードウェア構成毎に処理内容を分担して並行処理できるようになり、回路規模の増大を極力抑制しつつ演算イベント割込に迅速に対応できるようになる。 Therefore, the operating system processing unit (3) and the arithmetic processing unit (6) can divide the processing content for each hardware configuration and perform parallel processing. will be able to respond quickly.

また、オペレーティングシステム処理部(3)と前記演算処理部(6)との間のインタフェースとして、演算タスクの非実行状態(ST1、ST3、ST4)、実行状態(ST2、ST5)の状態の間の予め定められた遷移を、オペレーティングシステム処理部(3)及び演算処理部(6)から共に認識可能にするタスクトレイ(25)を備える。 In addition, as an interface between the operating system processing unit (3) and the arithmetic processing unit (6), it serves as an interface between the non-execution state (ST1, ST3, ST4) and the execution state (ST2, ST5) of the arithmetic task. A task tray (25) is provided that allows predetermined transitions to be recognized by both the operating system processing unit (3) and the arithmetic processing unit (6).

請求項1記載の発明によれば、タスクトレイは、演算タスクの非実行状態、実行状態の状態の間の予め定められた遷移を、オペレーティングシステム処理部及び演算処理部から共に認識可能にしている。このため、オペレーティングシステム処理部及び演算処理部は、タスクトレイにおける演算タスクの非実行状態、実行状態の間の遷移を認識でき、演算タスクの非実行状態/実行状態を互いにハンドシェークできる。 According to the first aspect of the invention , the task tray allows both the operating system processing section and the arithmetic processing section to recognize a predetermined transition between the non-execution state and the execution state of the arithmetic task. Therefore, the operating system processing unit and the calculation processing unit can recognize the transition between the non-execution state and the execution state of the calculation task in the task tray, and can handshake the non-execution state/execution state of the calculation task with each other.

第1実施形態に係るリアルタイム演算処理装置のハードウェア構成図Hardware configuration diagram of a real-time arithmetic processing device according to the first embodiment FPUOS機能ブロックのハードウェア構成を概略的に説明する図Diagram schematically explaining the hardware configuration of the FPUOS functional block タスクトレー状態における状態遷移図State transition diagram in task tray state FPUOS機能ブロックとプログラムカウンタブロックとのインターフェース構造を概略的に説明する電気的構成図Electrical configuration diagram schematically explaining the interface structure between the FPUOS functional block and the program counter block 演算タスク処理の流れを説明するタイミングチャートのその1Timing chart part 1 explaining the flow of calculation task processing 演算タスク処理の流れを説明するタイミングチャートのその2Timing chart part 2 explaining the flow of calculation task processing 演算タスク処理の流れを説明するタイミングチャートのその3Timing chart part 3 explaining the flow of calculation task processing 第2実施形態に係るリアルタイム演算処理装置のハードウェア構成図Hardware configuration diagram of a real-time arithmetic processing device according to the second embodiment ウォッチドッグタイマのカウント値の変化を概略的に示すタイミングチャートTiming chart schematically showing changes in watchdog timer count value

以下、幾つかの実施形態について図面を参照しながら説明する。以下の説明では、各実施形態で説明した構成と同一又は類似機能を備えた構成について同一符号又は類似符号を付し、第2実施形態以降では、必要に応じて説明を省略する。 Hereinafter, some embodiments will be described with reference to the drawings. In the following description, components having the same or similar functions as those described in each embodiment will be denoted by the same or similar symbols, and the description of the second embodiment and subsequent embodiments will be omitted as necessary.

(第1実施形態)
図1から図7に第1実施形態の説明図を示す。まず図1を参照し、リアルタイム演算処理装置1の全体のハードウェア構成を説明する。リアルタイム演算処理装置1は、FPUOS機能ブロック3(以下、FPUOS3と略す:オペレーティングシステム処理部相当)、メッセージリスト4、演算命令テーブル5、WORKER6(演算処理部相当)、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8、及びFPU9(浮動小数点演算処理部相当)を、同一のASIC内、すなわちICチップ内に構成している。なお、ハードウェア構成を監視するためのウォッチドッグタイマ2(図8参照)も設けられているが、後述の第2実施形態にて説明する。
(First embodiment)
Explanatory diagrams of the first embodiment are shown in FIGS. 1 to 7. First, with reference to FIG. 1, the overall hardware configuration of the real-time arithmetic processing device 1 will be described. The real-time arithmetic processing device 1 includes an FPUOS functional block 3 (hereinafter abbreviated as FPUOS3: equivalent to an operating system processing unit), a message list 4, an arithmetic instruction table 5, a WORKER 6 (equivalent to an arithmetic processing unit), and a group of FPU first argument general-purpose registers 7. , the FPU second argument general-purpose register group 8, and the FPU 9 (corresponding to a floating point arithmetic processing unit) are configured within the same ASIC, that is, within the IC chip. Note that a watchdog timer 2 (see FIG. 8) for monitoring the hardware configuration is also provided, but this will be explained in a second embodiment below.

リアルタイム演算処理装置1は、外部の上位のスケジューラ10から演算イベントを受領すると、演算命令テーブル5の中に予め設定された2項演算命令に従って浮動小数点演算処理を実行する。 When the real-time arithmetic processing device 1 receives an arithmetic event from an external higher-level scheduler 10, it executes floating-point arithmetic processing according to a binary arithmetic instruction preset in the arithmetic instruction table 5.

メッセージリスト4は、演算イベントに係るタスクの識別符号(ID)であるタスクIDと、当該タスクIDと紐付けられた開始アドレス及び終了アドレスとをFPUOS3の外にリスト化して格納している(図2も参照)。FPUOS3が、タスクIDを指定すると(図1のタスクID指定S8)、指定したタスクIDに対応した開始アドレス及び終了アドレスをメッセージリスト4の選択結果S9として返す。 The message list 4 stores a task ID, which is an identification code (ID) of a task related to a calculation event, and a start address and an end address associated with the task ID in a list outside the FPUOS 3 (Fig. (See also 2). When the FPUOS 3 specifies a task ID (task ID specification S8 in FIG. 1), it returns the start address and end address corresponding to the specified task ID as the selection result S9 of the message list 4.

また図1に示す演算命令テーブル5には演算命令テーブルアドレスに対応して演算命令セットが展開されている。WORKER6が、プログラムカウンタブロック31から演算命令テーブル5に演算命令テーブルアドレスS10を指定すると、当該演算命令テーブルアドレスS10に対応した演算命令セットを演算命令セット選択結果S11として返す。 Further, in the arithmetic instruction table 5 shown in FIG. 1, arithmetic instruction sets are developed corresponding to the arithmetic instruction table addresses. When the WORKER 6 specifies the arithmetic instruction table address S10 from the program counter block 31 to the arithmetic instruction table 5, the arithmetic instruction set corresponding to the arithmetic instruction table address S10 is returned as an arithmetic instruction set selection result S11.

FPUOS3は、FPU9に係るオペレーティングシステム機能をASICの中のハードウェアブロックにより実現したブロックである。外部のスケジューラ10が演算イベントを発行すると、FPUOS3はスケジューラ10から演算イベントを受領する。 The FPUOS3 is a block that implements the operating system functions related to the FPU9 using a hardware block in the ASIC. When the external scheduler 10 issues a calculation event, the FPUOS 3 receives the calculation event from the scheduler 10.

FPUOS3は、演算イベントに係るタスクを時間軸及び優先度に基づいて実行順序を判断する。FPUOS3は、タスクに付与されたタスクIDと紐付けてメッセージリスト4から演算開始アドレス及び演算終了アドレスを読出し、WORKER6にタスクを実行指令する。図1に示すタスク実行指令S5参照。なおWORKER6は、タスク実行指令S5を受領し、当該タスクの実行を完了するとタスク完了S6として返す。 The FPUOS 3 determines the execution order of tasks related to calculation events based on the time axis and priority. The FPUOS 3 reads out the calculation start address and the calculation end address from the message list 4 in association with the task ID assigned to the task, and instructs the WORKER 6 to execute the task. See task execution command S5 shown in FIG. Note that the WORKER 6 receives the task execution command S5, and when the execution of the task is completed, returns it as a task completion S6.

またFPUOS3は、前述のようにタスクを実行指令すると共に、WORKER6により実行されているタスクの管理を行うことに特化した機能ブロックである。FPUOS3は、オペレーティングシステム処理部相当として機能する。またWORKER6は、FPUOS3からの実行指令に従って演算処理を実行することに特化した機能ブロックである。 Further, the FPUOS 3 is a functional block specialized for instructing the execution of tasks as described above and for managing the tasks being executed by the WORKER 6. The FPUOS 3 functions as an operating system processing unit. Further, the WORKER 6 is a functional block specialized for executing arithmetic processing according to an execution command from the FPUOS 3.

次に、図2を参照してFPUOS3の構成例を説明する。FPUOS3は、パワーオンリセット21(POR)、OSステートマシン22、メッセージトレイ23、メッセージキュー24、及びタスクトレイ25を備え、またメッセージリスト4との間のインタフェース26~29を備える。 Next, a configuration example of the FPUOS 3 will be described with reference to FIG. 2. The FPUOS 3 includes a power-on reset 21 (POR), an OS state machine 22, a message tray 23, a message queue 24, and a task tray 25, and also includes interfaces 26 to 29 with the message list 4.

メッセージトレイ23には、タスクIDと優先度とのパラメータをタスクメッセージMSGとしてn対格納可能とされていると共に、トレイ格納メッセージ数のパラメータの格納領域が確保されている。タスクIDは、入力した時間順に割り振られるタスクメッセージMSGの識別番号を示す。タスクIDは、メッセージリスト4に格納される開始アドレス及び終了アドレスの情報量より少ない情報量により表現可能な識別番号である。タスクメッセージMSGにはそれぞれ優先度が設定される。 The message tray 23 can store n pairs of task ID and priority parameters as task messages MSG, and has a storage area for parameters equal to the number of messages stored in the tray. The task ID indicates the identification number of the task message MSG assigned in the order of input time. The task ID is an identification number that can be expressed using a smaller amount of information than the start address and end address stored in the message list 4. A priority is set for each task message MSG.

トレイ格納メッセージ数は、メッセージトレイ23に格納したタスクメッセージMSGの総数を示す。このトレイ格納メッセージ数に従ってタスクメッセージMSGはメッセージキュー24に転送される。
転送方法は、メッセージトレイ23にタスクIDと優先度のパラメータが格納される度に、FPUOS3はトレイ格納メッセージ数をアップカウントする時分割転送を行っても良いし、また並列に1サイクルで転送しても良い。また、タスクメッセージMSGが、メッセージトレイ23からメッセージキュー24に転送されると、FPUOS3はトレイ格納メッセージ数をダウンカウントする。
The number of messages stored in the tray indicates the total number of task messages MSG stored in the message tray 23. The task message MSG is transferred to the message queue 24 according to the number of messages stored in the tray.
As for the transfer method, each time the task ID and priority parameters are stored in the message tray 23, the FPUOS 3 may perform time-sharing transfer in which the number of messages stored in the tray is incremented, or it may be transferred in parallel in one cycle. It's okay. Further, when the task message MSG is transferred from the message tray 23 to the message queue 24, the FPUOS 3 counts down the number of messages stored in the tray.

メッセージキュー24は、優先度とタスクIDと状態とのパラメータの組合せのタスクメッセージMSGをn対格納可能に構成される。タスクトレイ25には、タスク中断フラグ、タスクトレイ状態TTRAY_ST、通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR及び通常終了アドレスNTT_STP_ADDR、及び、優先タスクトレイPTASK_TRAYの優先開始アドレスPTT_STA_ADDR及び優先終了アドレスPTT_STP_ADDR、のパラメータの格納領域が確保されている。タスクトレイ25は、FPUOS3とWORKER6との間のインタフェースとして設けられるもので、タスクトレイ25に確保される各パラメータは、FPUOS3の側、及び、WORKER6の側から共に認識可能(読取可能)にされている。 The message queue 24 is configured to be able to store n pairs of task messages MSG with parameter combinations of priority, task ID, and status. The task tray 25 has a storage area for parameters such as the task suspension flag, the task tray state TTRAY_ST, the normal start address NTT_STA_ADDR and normal end address NTT_STP_ADDR of the normal task tray NTASK_TRAY, and the priority start address PTT_STA_ADDR and priority end address PTT_STP_ADDR of the priority task tray PTASK_TRAY. has been done. The task tray 25 is provided as an interface between the FPUOS 3 and the WORKER 6, and each parameter secured in the task tray 25 is made recognizable (readable) from both the FPUOS 3 side and the WORKER 6 side.

タスク中断フラグは、FPUOS3からセットされることでタスクを中断することを表すフラグであり、FPUOS3及びWORKER6の双方から認識可能なフラグである。タスク中断フラグは、演算タスクを中断するための中断ハンドシェーク期間(図6のt17~t18)の間に用いられるフラグであり、タスク中断フラグをセット及びクリアする権限は、WORKER6には与えられておらず、FPUOS3の側に与えられている。 The task suspension flag is a flag that is set by the FPUOS 3 to indicate that the task is suspended, and is a flag that can be recognized by both the FPUOS 3 and the WORKER 6. The task suspension flag is a flag used during the suspension handshake period (t17 to t18 in FIG. 6) for suspending the calculation task, and the WORKER 6 is not given the authority to set or clear the task suspension flag. First, it is given to the FPUOS3 side.

またタスクトレイ状態TTRAY_STは、WORKER6がタスクを実行していない状態を表す非実行状態、又は、WORKER6がタスクを実行中である状態を表す実行状態、の何れかを表す。 Further, the task tray state TTRAY_ST represents either a non-execution state representing a state in which the WORKER 6 is not executing a task, or an execution state representing a state in which the WORKER 6 is executing a task.

具体的に、タスクトレイ状態TTRAY_STは、図3に例示したように、「タスク空状態ST1」、「通常タスク実行状態ST2」、「通常タスク完了状態ST3」、「通常タスク中断状態ST4」、「優先タスク実行状態ST5」、のうち何れかの状態に設定される。 Specifically, as illustrated in FIG. 3, the task tray state TTRAY_ST includes "task empty state ST1," "normal task execution state ST2," "normal task completed state ST3," "normal task suspended state ST4," and "priority task state ST4." task execution state ST5".

この中で、タスク空状態ST1、通常タスク完了状態ST3、通常タスク中断状態ST4では、WORKER6が何れのタスクも実行していないタスク非実行状態になっており、通常タスク実行状態ST2、通常タスク中断状態ST4では、WORKER6が何らかのタスクを実行しているタスク実行状態となっている。 Among these, in the task empty state ST1, the normal task completed state ST3, and the normal task suspended state ST4, the WORKER 6 is in a task non-execution state in which it is not executing any task, and in the normal task execution state ST2 and the normal task suspended state. In state ST4, the WORKER 6 is in a task execution state in which it is executing some task.

またタスクトレイ状態TTRAY_STの書込みアクセス権は、FPUOS3及びWORKER6の双方に与えられており、タスクトレイ状態TTRAY_STはFPUOS3及びWORKER6の双方から書込可能・書換可能に設定されている。 The write access right for the task tray state TTRAY_ST is given to both the FPUOS 3 and the WORKER 6, and the task tray state TTRAY_ST is set to be writable and rewritable from both the FPUOS 3 and the WORKER 6.

ただし、タスクトレイ状態TTRAY_STの書込みアクセス権は、FPUOS3及びWORKER6の間で競合を避けるように設定されている。タスクトレイ状態TTRAY_STの書込みアクセス権は、タスク非実行状態ではFPUOS3の側にあり、タスク実行状態ではWORKER6の側にある。 However, the write access right for the task tray state TTRAY_ST is set to avoid conflict between the FPUOS 3 and the WORKER 6. The write access right for the task tray state TTRAY_ST is on the FPUOS 3 side in the task non-execution state, and on the WORKER 6 side in the task execution state.

FPUOS3は、イベントドリブン型で処理を実行するオペレーティングシステム演算に係るハードウェアブロックであり、演算イベントを管理する外部の上位ブロックとなるスケジューラ10から演算イベントの発生をインターフェース12(図1参照)を経由して受付ける。 The FPUOS 3 is a hardware block related to operating system calculations that executes processing in an event-driven manner, and receives the occurrence of calculation events from the scheduler 10, which is an external upper block that manages calculation events, via the interface 12 (see Figure 1). and accept it.

FPUOS3は、図2に示すメッセージトレイ23にタスクID、優先度、トレイ格納メッセージ数が書込まれることで演算イベントに係るタスクメッセージMSGを受領する。 The FPUOS 3 receives the task message MSG related to the calculation event by writing the task ID, priority, and number of messages stored in the tray in the message tray 23 shown in FIG.

OSステートマシン22は、電源投入後にパワーオンリセット21が解除された後、基本動作として下記の4つの状態をサイクリックに遷移するようにハードウェア構成されている。4つの状態は、Send message(以降、Sendと略す)状態、Peek message(以降、Peekと略す)状態、Dispatch message(以降、Dispと略す)状態、Post processing(以降、Postと略す)状態である。 The OS state machine 22 is configured in hardware so that after the power-on reset 21 is released after the power is turned on, the OS state machine 22 cyclically transitions between the following four states as a basic operation. The four states are the Send message (hereinafter abbreviated as Send) state, the Peek message (hereinafter abbreviated as Peek) state, the Dispatch message (hereinafter abbreviated as Disp) state, and the Post processing (hereinafter abbreviated as Post) state. .

以下、OSステートマシン22によるサイクリックの状態遷移に伴い、WORKER6が実行する通常タスク処理の基本的流れを説明する。
<Send状態>
OSステートマシン22は、Send状態に遷移すると、外部からメッセージトレイ23に受領したタスクメッセージMSGをメッセージキュー24に転送する。このとき、メッセージキュー24が空状態であれば、タスクメッセージMSGは、メッセージキュー24の先頭から順に格納される。また、他のタスクメッセージMSGが、メッセージキュー24に既に存在する場合には、既に格納されているタスクIDの次の番号にタスクメッセージMSGが時系列的に順に書き込まれる。メッセージキュー24は、このような先入れ先出し型のキュー構造に構成されている。
The basic flow of normal task processing executed by the WORKER 6 in response to cyclic state transitions by the OS state machine 22 will be described below.
<Send status>
When the OS state machine 22 transitions to the Send state, it transfers the task message MSG received from the outside into the message tray 23 to the message queue 24. At this time, if the message queue 24 is empty, the task messages MSG are stored in order from the head of the message queue 24. Furthermore, if another task message MSG already exists in the message queue 24, the task message MSG is written in chronological order to the number next to the already stored task ID. The message queue 24 has such a first-in, first-out queue structure.

<Peek状態>
OSステートマシン22は、メッセージトレイ23からメッセージキュー24への転送を終えると、Peek状態に遷移する。OSステートマシン22は、Peek状態において、起動有無を判定すると共に、メッセージキュー24の中から起動するべきタスクメッセージMSGを選択する。
<Peek state>
When the OS state machine 22 finishes transferring the message from the message tray 23 to the message queue 24, it transitions to the Peek state. In the Peek state, the OS state machine 22 determines whether to activate or not, and selects a task message MSG to be activated from the message queue 24.

OSステートマシン22は、Peek状態において、メッセージキュー24の中にタスクメッセージMSGが無いと判定すると、スルーしてタスクメッセージMSGの起動無しとする。 When the OS state machine 22 determines that there is no task message MSG in the message queue 24 in the Peek state, the OS state machine 22 skips the process and determines that the task message MSG will not be activated.

逆に、タスクメッセージMSGがメッセージキュー24の中に格納されている場合、OSステートマシン22は、Peek状態において、メッセージキュー24の優先度のパラメータと、状態のパラメータと、メッセージキュー24のキュー番号と、に基づいて起動するべきタスクメッセージMSGを選択する。同一優先度であってもキュー番号が若い番号であるほど、タスクメッセージMSGは優先的に選択される。 Conversely, when the task message MSG is stored in the message queue 24, the OS state machine 22 stores the priority parameter, the state parameter, and the queue number of the message queue 24 in the Peek state. The task message MSG to be activated is selected based on and. Even if the priority is the same, the smaller the queue number, the more preferentially the task message MSG is selected.

優先度のパラメータは、低優先度又は高優先度を含む複数段階の優先度を示すパラメータを示す。本実施形態において、優先度は低優先度又は高優先度の2段階に設定される例を説明するが、3段階以上であっても良い。状態のパラメータは、メッセージキュー24の状態を示し、準備状態(以下Ready状態)、初動状態又は起動状態(以下Peek状態)、実行状態(以下Run状態)、待機状態(以下Wait状態)、終了状態(以下Nothing状態)の何れかに設定される。Run状態以外の状態では、WORKER6の側でタスクメッセージMSGを実行していない非実行状態を示している。 The priority parameter indicates a parameter indicating multiple levels of priority including low priority and high priority. In this embodiment, an example will be described in which the priority is set to two levels, low priority and high priority, but it may be set to three or more levels. The state parameter indicates the state of the message queue 24, and includes a preparation state (hereinafter referred to as Ready state), an initial state or startup state (hereinafter referred to as Peek state), an execution state (hereinafter referred to as Run state), a standby state (hereinafter referred to as Wait state), and an end state. (hereinafter referred to as Nothing state). States other than the Run state indicate a non-execution state in which the task message MSG is not being executed on the WORKER 6 side.

通常、OSステートマシン22は、Ready状態となっているメッセージキュー24のタスクメッセージMSGを選択し、選択したメッセージキュー24の状態をReady状態からPeek状態に遷移させる。OSステートマシン22は、タスクIDを選択することで起動するべきタスクメッセージMSGを選択する。 Normally, the OS state machine 22 selects the task message MSG of the message queue 24 that is in the Ready state, and transitions the state of the selected message queue 24 from the Ready state to the Peek state. The OS state machine 22 selects a task message MSG to be activated by selecting a task ID.

<Disp状態>
OSステートマシン22は、起動するべきタスクメッセージMSGの選択を終えると、Disp状態に遷移し、Peek状態で選定されたタスクメッセージMSGをタスクトレイ25に転送し、WORKER6にタスクメッセージMSGを実行指令する。
<Disp status>
When the OS state machine 22 finishes selecting the task message MSG to be activated, it transits to the Disp state, transfers the task message MSG selected in the Peek state to the task tray 25, and instructs the WORKER 6 to execute the task message MSG.

FPUOS3は、Disp状態において、メッセージキュー24の中の状態のパラメータがPeek状態に該当しているタスクIDをメッセージリスト4の中で検索し、照合されたタスクIDに紐づけられた開始アドレス及び終了アドレスを決定する。 In the Disp state, the FPUOS 3 searches the message list 4 for a task ID whose state parameter in the message queue 24 corresponds to the Peek state, and searches the start address and end address associated with the matched task ID. Determine the address.

そしてOSステートマシン22は、メッセージリスト4の中で決定された開始アドレス/終了アドレスを、インタフェース27を経由してタスクトレイ25の中の通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR/通常終了アドレスNTT_STP_ADDRにそれぞれ格納する。 Then, the OS state machine 22 stores the start address/end address determined in the message list 4 via the interface 27 in the normal start address NTT_STA_ADDR/normal end address NTT_STP_ADDR of the normal task tray NTASK_TRAY in the task tray 25, respectively. do.

そしてOSステートマシン22は、メッセージキュー24の状態をPeek状態からRun状態に遷移させ、タスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」に遷移させる。WORKER6は、タスクトレイ状態TTRAY_STをポーリングすることでタスク実行指令S5を受領する。 The OS state machine 22 then transitions the state of the message queue 24 from the Peek state to the Run state, and transitions the task tray state TTRAY_ST to the "normal task execution state ST2." The WORKER 6 receives the task execution command S5 by polling the task tray state TTRAY_ST.

<Post状態>
FPUOS3が、WORKER6へのタスク実行指令S5を終えると、OSステートマシン22は、Post状態に遷移する。FPUOS3は、Post状態において、後処理としてメッセージキュー24を整理整頓する。具体的に、FPUOS3は、メッセージキュー24にNothing状態となっているタスクメッセージMSGがある場合にはメッセージキュー24を空にする。
<Post status>
When the FPUOS 3 finishes issuing the task execution command S5 to the WORKER 6, the OS state machine 22 transitions to the Post state. In the Post state, the FPUOS 3 organizes the message queue 24 as post-processing. Specifically, the FPUOS 3 empties the message queue 24 if there is a task message MSG in the Nothing state in the message queue 24.

他方、WORKER6が、演算タスクを実行中にはメッセージキュー24に格納されるタスクメッセージMSGがNothing状態になることはない。WORKER6が、演算タスクを実行中の場合には、OSステートマシン22は、Post状態を通過しSend状態に戻ってサイクリックに状態遷移する。 On the other hand, while the WORKER 6 is executing an arithmetic task, the task message MSG stored in the message queue 24 never enters the Nothing state. When the WORKER 6 is executing an arithmetic task, the OS state machine 22 passes through the Post state, returns to the Send state, and undergoes a cyclic state transition.

WORKER6が、演算タスクを実行終了すると、WORKER6はタスクトレイ状態TTRAY_STを「通常タスク完了状態ST3」に遷移させる。OSステートマシン22は、Disp状態に遷移し、実行中のメッセージキュー24の状態をRun状態からNothing状態に遷移させる。OSステートマシン22は、Post状態に遷移する。OSステートマシン22は、Post状態にてNothing状態のメッセージキュー24がある場合、当該メッセージキュー24を空にする。 When the WORKER 6 finishes executing the calculation task, the WORKER 6 transitions the task tray state TTRAY_ST to the "normal task completion state ST3". The OS state machine 22 transits to the Disp state, and transitions the state of the message queue 24 being executed from the Run state to the Nothing state. The OS state machine 22 transitions to the Post state. If there is a message queue 24 in the Nothing state in the Post state, the OS state machine 22 empties the message queue 24.

<タスクIDを用いる技術的意義の説明>
通常、メッセージリスト4に格納される開始アドレス/終了アドレスは、2^nビット、例えば16ビット、32ビットなど多ビット表現される。アドレス番地が比較的大きな値になると、このアドレス番地を他の情報と紐付けて記憶保持するためのレジスタなどのハードウェア記憶部を必要以上に多く必要とし、特にメッセージトレイ23及びメッセージキュー24のハードウェア回路の規模が大きくなりやすい。
<Explanation of technical significance of using task ID>
Usually, the start address/end address stored in the message list 4 is expressed in multiple bits such as 2^n bits, for example 16 bits or 32 bits. When an address number becomes a relatively large value, an unnecessarily large number of hardware storage units such as registers are required to associate this address address with other information and store it. The scale of the hardware circuit tends to increase.

しかし本実施形態では、OSステートマシン22が、取り扱うデータを開始アドレス/終了アドレスそのものにするのではなく、タスクIDを用いている。タスクIDは、1ビット又は2ビット程度で表現可能であり、少なくとも開始アドレス/終了アドレスのアドレス番地よりも少ない情報量で表現可能となっている。このため、メッセージトレイ23及びメッセージキュー24のハードウェア記憶部に必要な記憶容量を少なくでき、メッセージトレイ23及びメッセージキュー24の回路規模を抑制できる。 However, in this embodiment, the OS state machine 22 uses the task ID instead of handling data using the start address/end address itself. The task ID can be expressed with about 1 or 2 bits, and can be expressed with at least an amount of information smaller than the address address of the start address/end address. Therefore, the storage capacity required for the hardware storage section of the message tray 23 and the message queue 24 can be reduced, and the circuit scale of the message tray 23 and the message queue 24 can be suppressed.

<バンク切替インタフェース28を用いる技術的意義の説明>
前述の構成では、タスクIDは1ビット又は2ビット程度の例を挙げたが、仮にタスクIDの種類が多くなると、タスクIDの情報量が多くなり、この場合、メッセージトレイ23やメッセージキュー24のハードウェア回路規模の増加に繋がる虞がある。
<Explanation of the technical significance of using the bank switching interface 28>
In the above configuration, an example was given in which the task ID is about 1 bit or 2 bits, but if the number of types of task ID increases, the amount of information in the task ID increases, and in this case, the amount of information in the message tray 23 and message queue 24 increases. This may lead to an increase in the hardware circuit scale.

このような場合、図2に示すように、スケジューラ10とメッセージリスト4との間を仲介し外部からバンク切替えするためのバンク切替インタフェース28を設けることが望ましく、またメッセージリスト4には、当該メッセージリスト4の中の情報をバンク切替えするバンク情報保持領域を備えることが望ましい。これにより、外部のスケジューラ10が、メッセージリスト4に紐づけられたタスクIDと開始アドレス/終了アドレスとの関係性をバンク切替えできるようになる。 In such a case, as shown in FIG. It is desirable to provide a bank information holding area for switching banks of information in list 4. This allows the external scheduler 10 to bank-switch the relationship between the task ID associated with the message list 4 and the start address/end address.

メッセージリスト4のバンク情報保持領域にはバンク切替情報が記憶される。バンク切替情報は例えば1ビット程度の少数の情報量によるもので、少数の情報によりタスクIDと開始アドレス/終了アドレスとの関係性を大きく変更できる。このため、外部からバンク切替えするためのバンク切替インタフェース28を設けることで、記憶すべきタスクIDの情報量を削減でき、この結果、メッセージトレイ23及びメッセージキュー24を構成するハードウェア回路を小規模化できる。 Bank switching information is stored in the bank information holding area of message list 4. The bank switching information is based on a small amount of information, for example, about 1 bit, and the relationship between the task ID and the start address/end address can be changed significantly with a small amount of information. Therefore, by providing a bank switching interface 28 for externally switching banks, the amount of task ID information to be stored can be reduced, and as a result, the hardware circuits configuring the message tray 23 and message queue 24 can be reduced in size. can be converted into

<WORKER6の詳細説明>
図1に例示したように、WORKER6は、プログラムカウンタブロック31、演算命令デコーダ32、及びセレクタ33を備える。FPUOS3とWORKER6とは、ハードウェア上、独立してASIC内に構成されている。
<Detailed explanation of WORKER6>
As illustrated in FIG. 1, the WORKER 6 includes a program counter block 31, an arithmetic instruction decoder 32, and a selector 33. The FPUOS 3 and the WORKER 6 are configured independently in the ASIC in terms of hardware.

WORKER6は、FPUOS3から演算イベントに係るタスクメッセージMSGに紐付いたメッセージリスト4、演算命令テーブル5の開始アドレスと終了アドレス(通常開始アドレスNTT_STA_ADDR/通常終了アドレスNTT_STP_ADDR、又は、優先開始アドレスPTT_STA_ADDR/優先終了アドレスPTT_STP_ADDR)を受付けると、プログラムカウンタブロック31を直接的に制御する。FPUOS3とプログラムカウンタブロック31とのインタフェース構造は、その詳細を後述する。 The WORKER 6 receives the start address and end address (normal start address NTT_STA_ADDR/normal end address NTT_STP_ADDR, or priority start address PTT_STA_ADDR/priority end address) of the message list 4 and calculation instruction table 5 linked to the task message MSG related to the calculation event from the FPUOS 3. PTT_STP_ADDR), the program counter block 31 is directly controlled. The details of the interface structure between the FPUOS 3 and the program counter block 31 will be described later.

WORKER6は、FPUOS3から演算タスクに係る実行指令を受付けると、演算タスクの実行指令に紐付いて予め設定されたメッセージリスト4の開始アドレスから終了アドレスに至るまで、演算命令デコーダ32により演算命令テーブル5の中の演算命令セットを参照する。 When the WORKER 6 receives an execution command related to an arithmetic task from the FPUOS 3, the WORKER 6 uses the arithmetic instruction decoder 32 to read the arithmetic instruction table 5 from the start address to the end address of the message list 4 that is set in advance in association with the execution instruction of the arithmetic task. Refer to the arithmetic instruction set inside.

WORKER6は、演算命令デコーダ32にて参照した演算命令セットを、FPU演算命令S17、引数選択S27~S28に分解し、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8、及び、FPU9に出力する。 The WORKER 6 decomposes the arithmetic instruction set referenced by the arithmetic instruction decoder 32 into an FPU arithmetic instruction S17, argument selection S27 to S28, and FPU first argument general-purpose register group 7, FPU second argument general-purpose register group 8, and Output to FPU9.

FPU第1引数汎用レジスタ群7は、複数の引数を記憶可能なレジスタの集合と、レジスタの集合の後段に接続されるレジスタ選択セレクタと(何れも図示せず)により構成されている。レジスタ選択セレクタは、セレクタ33の出力S15も入力するように接続されている。 The FPU first argument general-purpose register group 7 is composed of a set of registers capable of storing a plurality of arguments, and a register selection selector (none of which is shown) connected to the rear stage of the register set. The register selection selector is also connected to input the output S15 of the selector 33.

FPU第2引数汎用レジスタ群8もまた、複数の引数を記憶可能なレジスタの集合と、レジスタの集合の後段に接続されるレジスタ選択セレクタと(何れも図示せず)により構成されている。レジスタ選択セレクタは、セレクタ33の出力S16も入力するように接続されている。 The FPU second argument general-purpose register group 8 also includes a set of registers capable of storing a plurality of arguments, and a register selection selector (none of which is shown) connected to the rear stage of the register set. The register selection selector is also connected to input the output S16 of the selector 33.

前記したセレクタ33は、外部メモリ11から外部データS13を入力可能に接続されている。演算命令デコーダ32は、外部アドレス信号S12により外部メモリ11のアドレスを指定することで、入力する外部データS13を指定できる。またセレクタ33は、FPU9による浮動小数点演算結果、FPU第1引数汎用レジスタ群7の記憶値、FPU第2引数汎用レジスタ群8の記憶値、を入力可能に接続されている。 The selector 33 described above is connected to be able to input external data S13 from the external memory 11. The arithmetic instruction decoder 32 can specify the input external data S13 by specifying the address of the external memory 11 using the external address signal S12. Further, the selector 33 is connected so as to be able to input the floating point calculation result by the FPU 9, the stored value of the FPU first argument general-purpose register group 7, and the stored value of the FPU second argument general-purpose register group 8.

演算命令デコーダ32は、入力される演算命令テーブル5の演算命令セットに基づいて、セレクタ33の入力元及び出力先を選択する。セレクタ33は、演算命令デコーダ32から入力した演算命令デコーダ選択S29に基づいて、前述の入力値を、FPU第1引数汎用レジスタ群7にFPU第1引数汎用レジスタ入力選択結果として出力S15を振り分けたり、FPU第2引数汎用レジスタ群8にFPU第2引数汎用レジスタ入力選択結果として出力S16を振り分ける。 The arithmetic instruction decoder 32 selects the input source and output destination of the selector 33 based on the input arithmetic instruction set of the arithmetic instruction table 5. The selector 33 distributes the above-mentioned input value to the FPU first argument general-purpose register group 7 as an output S15 as the FPU first argument general-purpose register input selection result based on the operation instruction decoder selection S29 inputted from the operation instruction decoder 32. , the output S16 is distributed to the FPU second argument general-purpose register group 8 as the FPU second argument general-purpose register input selection result.

これにより、FPU第1引数汎用レジスタ群7の何れかのレジスタや、FPU第2引数汎用レジスタ群8の何れかのレジスタには、外部メモリ11の外部データS13、又は、FPU9による浮動小数点演算結果を保持させることができる。 As a result, any register in the FPU first argument general-purpose register group 7 or any register in the FPU second argument general-purpose register group 8 may contain the external data S13 in the external memory 11 or the floating-point operation result by the FPU 9. can be held.

演算命令デコーダ32は、引数選択S27に基づいてFPU第1引数汎用レジスタ群7の何れかのレジスタに記憶された記憶値をFPU9に出力したり、セレクタ33の出力S15を直接FPU9に出力できる。 The arithmetic instruction decoder 32 can output the stored value stored in any register of the FPU first argument general-purpose register group 7 to the FPU 9 based on the argument selection S27, or output the output S15 of the selector 33 directly to the FPU 9.

演算命令デコーダ32は、引数選択S28に基づいてFPU第2引数汎用レジスタ群8の何れかのレジスタに記憶された記憶値をFPU9に出力したり、セレクタ33の出力S16を直接FPU9に出力できる。 The arithmetic instruction decoder 32 can output the stored value stored in any register of the FPU second argument general-purpose register group 8 to the FPU 9 based on the argument selection S28, or output the output S16 of the selector 33 directly to the FPU 9.

FPU9は、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8の出力引数を用いて、FPU演算命令S17により指定される四則演算や比較、型変換等の演算を行うことができ、これにより浮動小数点の演算処理を実行できる。FPU9は、浮動小数点の演算結果をFPU演算結果S14として出力する。FPU9は、多種多様な入力データを引数として浮動小数点の演算タスクを実行できる。 The FPU 9 can use the output arguments of the FPU first argument general-purpose register group 7 and the FPU second argument general-purpose register group 8 to perform operations such as four arithmetic operations, comparisons, and type conversions specified by the FPU operation instruction S17. , which allows floating point arithmetic processing to be performed. The FPU 9 outputs the floating point calculation result as an FPU calculation result S14. The FPU 9 can execute floating point arithmetic tasks using a wide variety of input data as arguments.

WORKER6は、演算毎にプログラムカウンタブロック31のプログラムカウンタ41(図4参照)を更新しつつ、2項演算処理を順次実行し、終了アドレスまで到達すると、WORKER6は、FPUOS3にタスク完了通知を出力することで、一連の浮動小数点演算タスクを完了させることができる。 The WORKER 6 sequentially executes binary operation processing while updating the program counter 41 (see FIG. 4) of the program counter block 31 for each operation, and when the end address is reached, the WORKER 6 outputs a task completion notification to the FPUOS 3. This allows a series of floating point arithmetic tasks to be completed.

<<プログラムカウンタブロック31の構成及び基本動作>>
以下、プログラムカウンタブロック31の構成及び基本動作について、図4を参照しながら説明する。プログラムカウンタブロック31は、プログラムカウンタ41、一致比較部42、遷移検出部43、中断判定部44、開始アドレスセレクタ45、及び、終了アドレスセレクタ46を備える。
<<Configuration and basic operation of program counter block 31>>
The configuration and basic operation of the program counter block 31 will be explained below with reference to FIG. The program counter block 31 includes a program counter 41 , a match comparison section 42 , a transition detection section 43 , an interruption determination section 44 , a start address selector 45 , and an end address selector 46 .

開始アドレスセレクタ45は、タスクトレイ状態TTRAY_STに記憶された状態に基づいて、通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR、又は、優先タスクトレイPTASK_TRAYの優先開始アドレスPTT_STA_ADDRの何れかを選択し、プログラムカウンタ41に何れかの開始アドレスを出力する。 The start address selector 45 selects either the normal start address NTT_STA_ADDR of the normal task tray NTASK_TRAY or the priority start address PTT_STA_ADDR of the priority task tray PTASK_TRAY based on the state stored in the task tray state TTRAY_ST, and sets the program counter 41 to either one. Outputs the starting address of.

終了アドレスセレクタ46は、タスクトレイ状態TTRAY_STに記憶された状態に基づいて、通常タスクトレイNTASK_TRAYの通常終了アドレスNTT_STP_ADDR又は優先タスクトレイPTASK_TRAYの優先終了アドレスPTT_STP_ADDRの何れかを選択し、一致比較部42に何れかの終了アドレスを出力する。 The end address selector 46 selects either the normal end address NTT_STP_ADDR of the normal task tray NTASK_TRAY or the priority end address PTT_STP_ADDR of the priority task tray PTASK_TRAY based on the state stored in the task tray state TTRAY_ST, and causes the match comparison unit 42 to select either one. Output the end address.

遷移検出部43は、タスクトレイ状態TTRAY_STが「通常タスク空状態ST1」から「通常タスク実行状態ST2」へ遷移したこと、「通常タスク中断状態ST4」から「優先タスク実行状態ST5」へ遷移したことを検出し、これらのタイミングでロード指令S33をプログラムカウンタ41に出力する。 The transition detection unit 43 detects that the task tray state TTRAY_ST has transitioned from the "normal task empty state ST1" to the "normal task execution state ST2" and from the "normal task suspended state ST4" to the "priority task execution state ST5". The load command S33 is detected and outputted to the program counter 41 at these timings.

プログラムカウンタ41は、ロード指令S33を入力することで開始アドレスセレクタ45を通じて開始アドレスをロードし、当該開始アドレスから順にカウント開始し、一致比較部42にカウントしたアドレスカウンタ値を出力すると共に、演算命令テーブル5にカウントしたアドレスカウンタ値を演算命令テーブルアドレスS10として出力する。これにより、演算命令デコーダ32は、演算命令テーブルアドレスS10に対応した演算命令セット選択結果S11を参照し、当該演算命令をデコードできる。 The program counter 41 loads a start address through the start address selector 45 by inputting the load command S33, starts counting sequentially from the start address, outputs the counted address counter value to the match comparison unit 42, and also outputs the operation command The counted address counter value is outputted to table 5 as arithmetic instruction table address S10. Thereby, the arithmetic instruction decoder 32 can decode the arithmetic instruction by referring to the arithmetic instruction set selection result S11 corresponding to the arithmetic instruction table address S10.

他方、一致比較部42は、プログラムカウンタ41のアドレスカウンタ値が終了アドレスセレクタ46により選択された終了アドレスと一致しているか否かを判定し、終了アドレス一致信号S32を出力したときにタスクトレイ状態TTRAY_STの状態を遷移させる。 On the other hand, the match comparison unit 42 determines whether the address counter value of the program counter 41 matches the end address selected by the end address selector 46, and when outputting the end address match signal S32, changes the task tray state TTRAY_ST. Transition the state of.

このとき、図3に例示したように、タスクトレイ状態TTRAY_STが「通常タスク実行状態ST2」であれば一致比較部42の指令によりタスクトレイ状態TTRAY_STは「通常タスク完了状態ST3」に遷移する。またタスクトレイ状態TTRAY_STが「優先タスク実行状態ST5」であれば一致比較部42の指令によりタスクトレイ状態TTRAY_STは「通常タスク中断状態ST4」に遷移する。 At this time, as illustrated in FIG. 3, if the task tray state TTRAY_ST is the "normal task execution state ST2", the task tray state TTRAY_ST transitions to the "normal task completion state ST3" by the instruction from the match comparison unit 42. Further, if the task tray state TTRAY_ST is the "priority task execution state ST5", the task tray state TTRAY_ST transitions to the "normal task suspension state ST4" by a command from the match comparison unit 42.

また中断判定部44は、タスク中断フラグのセット/リセット状態に基づいて、現在実行中のタスクを継続するか中断するかを判定する。中断判定部44は、タスク中断フラグがセットされたタイミング以降、演算命令テーブル5から出力される演算命令セット選択結果S11を確認する。 Furthermore, the interruption determination unit 44 determines whether to continue or interrupt the currently executing task based on the set/reset state of the task interruption flag. The interruption determination unit 44 checks the operation instruction set selection result S11 output from the operation instruction table 5 after the timing when the task interruption flag is set.

また中断判定部44は、確認した演算命令セットに基づいて中断アドレスを決定し、プログラムカウンタ41のアドレスカウンタ値が中断アドレスに到達した後に、通常開始アドレスNTT_STA_ADDRを格納する格納領域に中断アドレスを退避させる。中断アドレスを退避させる格納領域は、通常開始アドレスNTT_STA_ADDRの格納領域に限られるものではなく、例えば、プログラムカウンタブロック31の内部に別途レジスタを設けて中断アドレスを退避させるようにしても良い。 Further, the interruption determination unit 44 determines an interruption address based on the confirmed arithmetic instruction set, and after the address counter value of the program counter 41 reaches the interruption address, saves the interruption address to a storage area that normally stores the start address NTT_STA_ADDR. let The storage area in which the interruption address is saved is not limited to the storage area for the normal start address NTT_STA_ADDR; for example, a separate register may be provided inside the program counter block 31 to save the interruption address.

そして中断判定部44は、WORKER中断完了S31を出力しタスクトレイ25のタスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」から「通常タスク中断状態ST4」に遷移させる。 Then, the interruption determination unit 44 outputs WORKER interruption completion S31 and causes the task tray state TTRAY_ST of the task tray 25 to transition from the "normal task execution state ST2" to the "normal task interruption state ST4."

遷移検出部43は、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」から「通常タスク実行状態ST2」へ遷移する時に再開ロード信号S30をトリガ出力する。遷移検出部43は、この再開ロード信号S30のトリガ出力にて中断時に通常開始アドレスNTT_STA_ADDRを格納する格納領域に退避した中断アドレスをプログラムカウンタ41に再ロードさせる。 The transition detection unit 43 triggers and outputs the restart load signal S30 when the task tray state TTRAY_ST transitions from the "normal task suspended state ST4" to the "normal task execution state ST2." The transition detection unit 43 causes the program counter 41 to reload the interruption address that was saved in the storage area where the normal start address NTT_STA_ADDR is stored at the time of interruption by the trigger output of the restart load signal S30.

すると、演算命令デコーダ32は、プログラムカウンタ41のカウント値の示す通常タスクに係る演算命令コードをデコード再開し、FPU9が通常タスクに係る演算処理を実行再開する。その後の流れは、前述と同様である。 Then, the arithmetic instruction decoder 32 resumes decoding the arithmetic instruction code related to the normal task indicated by the count value of the program counter 41, and the FPU 9 resumes execution of the arithmetic processing related to the normal task. The subsequent flow is the same as described above.

次に、FPUOS3によるオーバーヘッド削減効果について比較例と共に説明する。
<比較例の説明>
従来より用いられるマイコンでは、アプリケーション未処理中に割込みが発生すると、割込みベクタにジャンプし、割込みハンドラ処理にジャンプし、割込みハンドラ処理の先頭で、汎用レジスタやステータスレジスタ、ジャンプ元のプログラムカウンタ等、中断元に戻るための情報を退避する割込み時にコンテキストスイッチが行われる。
Next, the overhead reduction effect of FPUOS3 will be explained together with a comparative example.
<Explanation of comparative example>
In conventional microcontrollers, when an interrupt occurs while an application is not being processed, it jumps to the interrupt vector, jumps to interrupt handler processing, and at the beginning of interrupt handler processing, registers such as general-purpose registers, status registers, and the program counter of the jump source, etc. A context switch is performed at the time of an interrupt to save information for returning to the point of interruption.

その後、割込みハンドラが、メイン処理として各種割込みに応じたタスク選定を行い、OSに向けて選定したタスクをメッセージ送信し、割込みハンドラの後処理として復帰時コンテキストスイッチを行うことで中断元に復帰する。その後、OS内にてメッセージ受信し、アプリケーションタスクを起動する。 After that, the interrupt handler selects a task according to each interrupt as its main process, sends a message to the OS about the selected task, and returns to the source of interruption by performing a context switch upon return as post-processing of the interrupt handler. . Thereafter, a message is received within the OS and an application task is started.

システムがアプリケーションタスクを実行するときに、その先頭で起動元に戻るための情報を退避するアプリ起動時コンテキストスイッチを行い、アプリケーションタスクのメイン処理を実行する。 When the system executes an application task, it performs a context switch at the start of the application to save information to return to the startup source, and then executes the main processing of the application task.

高優先度タスク実行中に割込みが発生すると、前述同様に割込みハンドラ処理にジャンプすると共に、割込み時コンテキストスイッチが行われ、割込みハンドラのメイン処理として、各種割込みに応じたタスク選定を行い、OSに向けて選定したタスクをメッセージ送信し、割込みハンドラの後処理として復帰時コンテキストスイッチを行って中断元に復帰する。 When an interrupt occurs during the execution of a high-priority task, a jump is made to the interrupt handler processing as described above, a context switch is performed at the time of the interrupt, and as the main processing of the interrupt handler, tasks are selected according to various interrupts, and the OS It sends a message to the selected task, performs a context switch on return as post-processing of the interrupt handler, and returns to the source of interruption.

一般的なマイコンでは、割込みが発生すると、割込み時及び復帰時におけるコンテキストスイッチのオーバーヘッド時間と、割込みハンドラ処理時間分、アプリケーションタスク処理が中断される構造となっている。このため、割込発生時にアプリケーションのタスク処理が中断されるため、タスク処理のスピードが劣ってしまう。 A typical microcomputer is structured such that when an interrupt occurs, application task processing is interrupted for the overhead time of context switching at the time of the interrupt and return, and the interrupt handler processing time. Therefore, the task processing of the application is interrupted when an interrupt occurs, resulting in a decrease in the speed of task processing.

<本実施形態の動作説明>
これに対し、本実施形態では、FPUOS3とWORKER6とがハードウェア的に独立して構成されている。このため、実行タスクを中断させることなくアプリケーションタスクを処理でき、割込み時及び復帰時におけるコンテキストスイッチのオーバーヘッド時間分だけ短縮できる。
<Explanation of operation of this embodiment>
In contrast, in this embodiment, the FPUOS 3 and the WORKER 6 are configured independently in terms of hardware. Therefore, the application task can be processed without interrupting the execution task, and the overhead time of the context switch at the time of interrupt and return can be reduced.

以下、この処理動作に係る詳細説明を行う。図5は、WORKER6が最優先となる高優先度(第1優先度相当)の演算タスクを実行している最中に低優先度(第2優先度相当)の演算イベントが発生した場合のケースを示している。 A detailed explanation of this processing operation will be given below. Figure 5 shows a case where a low-priority (equivalent to second priority) arithmetic event occurs while WORKER6 is executing a high-priority (equivalent to first priority) arithmetic task. It shows.

まずWORKER6が演算タスクを実行待機している最中に、最優先の高優先度の演算イベントが発生すると、FPUOS3は、OSステートマシン22によりメッセージトレイ23にタスクIDと優先度とを紐づけてタスクメッセージMSG1を格納する。ここでは、高優先度のタスクメッセージMSGをタスクメッセージMSG1と定義している。 First, when a high-priority calculation event occurs while the WORKER 6 is waiting to execute a calculation task, the FPUOS 3 associates the task ID and priority in the message tray 23 with the OS state machine 22. Stores task message MSG1. Here, the high priority task message MSG is defined as task message MSG1.

図5に示すタスクメッセージMSG1の格納タイミングt1は、OSステートマシン22のSend message状態(以降、Send状態と略す)を過ぎていることを想定している。この場合、OSステートマシン22は、Peek message状態(以降、Peek状態と略す)、Dispatch message状態(以降、Disp状態と略す)、Post processing状態(以降、Post状態と略す)を遷移後の次のSend状態のタイミングt2にて、メッセージトレイ23の第1トレイNo1からメッセージキューMQ1にタスクメッセージMSG1を転送すると共に、メッセージトレイ23の第1トレイNo1を空状態にクリーニングする。 The storage timing t1 of the task message MSG1 shown in FIG. 5 is assumed to be after the Send message state (hereinafter abbreviated as Send state) of the OS state machine 22. In this case, the OS state machine 22 transitions from Peek message state (hereinafter abbreviated as Peek state), Dispatch message state (hereinafter abbreviated as Disp state), and Post processing state (hereinafter abbreviated as Post state) to the next state after transition. At timing t2 in the Send state, the task message MSG1 is transferred from the first tray No. 1 of the message tray 23 to the message queue MQ1, and the first tray No. 1 of the message tray 23 is cleaned to an empty state.

OSステートマシン22は、タイミングt2においてメッセージキューMQ1の状態をReadyから次ステートのPeek状態に遷移させ、起動タスクを決定する。OSステートマシン22は、Peek状態においてメッセージキュー24の中から起動するべきタスクメッセージMSG1を選択する。ここでは、タスクメッセージMSG1を選択したものとして説明する。OSステートマシン22は、タイミングt3においてDisp状態に遷移し、Peek状態で選択された起動待機中のタスクメッセージMSG1を起動する。 The OS state machine 22 transitions the state of the message queue MQ1 from Ready to the next state, Peek state, at timing t2, and determines the activation task. The OS state machine 22 selects the task message MSG1 to be activated from the message queue 24 in the Peek state. Here, the explanation will be given assuming that task message MSG1 is selected. The OS state machine 22 transits to the Disp state at timing t3, and starts the task message MSG1 selected in the Peek state and waiting to be started.

OSステートマシン22は、タイミングt4において、メッセージキューMQ1に係るタスクメッセージMSG1の状態をPeek状態からRun状態に遷移させると共に、タスクメッセージMSG1に紐づいたタスクIDの演算命令テーブル5の開始アドレス及び終了アドレスをメッセージリスト4の中で検索する。 At timing t4, the OS state machine 22 transitions the state of the task message MSG1 related to the message queue MQ1 from the Peek state to the Run state, and also changes the start address and end address of the operation instruction table 5 of the task ID linked to the task message MSG1. Search for the address in message list 4.

そしてOSステートマシン22は、開始アドレス及び終了アドレスをインタフェース27を経由して読み出し、FPUOS3のタスクトレイ25の中の通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR及び通常終了アドレスNTT_STP_ADDRに格納し、タスクトレイ状態TTRAY_STを「通常タスク空状態ST1」から「通常タスク実行状態ST2」に遷移させる。 Then, the OS state machine 22 reads the start address and end address via the interface 27, stores them in the normal start address NTT_STA_ADDR and normal end address NTT_STP_ADDR of the normal task tray NTASK_TRAY in the task tray 25 of the FPUOS 3, and sets the task tray state TTRAY_ST to " A transition is made from the "normal task empty state ST1" to the "normal task execution state ST2."

WORKER6の側では、タスクトレイ状態TTRAY_STが「通常タスク空状態ST1」から「通常タスク実行状態ST2」へ遷移することをもって、通常開始アドレスNTT_STA_ADDRから通常終了アドレスNTT_STP_ADDRにかけた演算内容を演算命令テーブル5から読出しながら、FPU9、FPU第1引数汎用レジスタ群7、及び、FPU第2引数汎用レジスタ群8を用いて浮動小数点の2項演算を順次処理する。 On the WORKER 6 side, when the task tray state TTRAY_ST transitions from "normal task empty state ST1" to "normal task execution state ST2", the contents of the operation from the normal start address NTT_STA_ADDR to the normal end address NTT_STP_ADDR are read from the operation instruction table 5. Meanwhile, floating-point binary operations are sequentially processed using the FPU 9, the FPU first argument general-purpose register group 7, and the FPU second argument general-purpose register group 8.

WORKER6が高優先度の演算タスクを実行中に、タイミングt5にて低優先度の演算イベントが発生すると、FPUOS3の中のメッセージトレイ23の第1トレイNo1に低優先度のタスクメッセージMSG2を格納させる。ここでは、低優先度のタスクメッセージMSGをタスクメッセージMSG2としている。 When a low-priority calculation event occurs at timing t5 while the WORKER 6 is executing a high-priority calculation task, a low-priority task message MSG2 is stored in the first tray No. 1 of the message tray 23 in the FPUOS 3. . Here, the low-priority task message MSG is designated as task message MSG2.

その後、OSステートマシン22がSend状態にされたとしても、メッセージキューMQ1が空状態ではない。このため、OSステートマシン22は、タイミングt6においてタスクメッセージMSG2をメッセージキューMQ2に転送すると共に、メッセージトレイ23の第1トレイNo1を空状態にクリーニングする。続いて、OSステートマシン22がPeek状態になると、起動タスクを選択しようとするが、すでに高優先度演算タスクが実行されている状態であるため、Peek状態では何もせずDisp状態に移行する。 After that, even if the OS state machine 22 is placed in the Send state, the message queue MQ1 is not in the empty state. Therefore, the OS state machine 22 transfers the task message MSG2 to the message queue MQ2 at timing t6, and also cleans the first tray No. 1 of the message tray 23 to an empty state. Subsequently, when the OS state machine 22 enters the Peek state, it tries to select a startup task, but since a high-priority calculation task is already being executed, it does nothing in the Peek state and shifts to the Disp state.

このときFPUOS3の側では、タスクトレイ状態TTRAY_STが通常タスク実行状態ST2に維持されていることから、WORKER6の側で実行しているタスクメッセージMSGが、タスクメッセージMSG1であることを把握できる。 At this time, on the FPUOS3 side, since the task tray state TTRAY_ST is maintained in the normal task execution state ST2, it can be understood that the task message MSG being executed on the WORKER6 side is the task message MSG1.

またさらに、FPUOS3が、WORKER6とは独立したハードウェアにより構成されている。このため、WORKER6が高優先度の演算タスクを実行している最中に、低優先度の演算イベントが発生したとしても、WORKER6は、タイミングt5以降において高優先度の演算タスクの実行を中断することなく、高優先度の演算タスクを集中的に処理できる。 Furthermore, the FPUOS 3 is configured by hardware independent of the WORKER 6. Therefore, even if a low-priority calculation event occurs while WORKER 6 is executing a high-priority calculation task, WORKER 6 suspends execution of the high-priority calculation task after timing t5. High-priority computational tasks can be processed intensively without any problems.

WORKER6の側で特に最優先となる高優先度の演算タスクを実行しているときには、FPUOS3が低優先度の演算タスクをWORKER6に対して実行指令に移さないようにしているため、WORKER6は当該高優先度の演算タスクを中断することなく、当該演算タスクを最速処理できる。 When the WORKER 6 is executing a high-priority calculation task that has the highest priority, the FPUOS 3 prevents the low-priority calculation task from being sent to the WORKER 6 as an execution command. The calculation task can be processed at the fastest speed without interrupting the priority calculation task.

続いて、他の実行例を挙げて、FPUOS3による処理オーバーヘッド時間抑制効果を説明する。以下では、図6に例示したように、最優先よりも低い低優先度(第3優先度相当)の演算タスクを実行中に、この演算タスクよりも高優先度(第4優先度相当)の演算イベントが発生した時の挙動を例に挙げて動作概要を説明する。 Next, the effect of suppressing processing overhead time by the FPUOS 3 will be explained using other execution examples. In the following, as illustrated in Figure 6, while a calculation task with a low priority (equivalent to the 3rd priority) lower than the highest priority is being executed, a calculation task with a higher priority (equivalent to the 4th priority) is executed. An overview of the operation will be explained using an example of the behavior when a calculation event occurs.

WORKER6が、未処理状態にて待機している最中に、スケジューラ10から低優先度の演算イベントが発行されると、低優先度の演算イベントにて実行したいタスクのタスクIDと優先度がメッセージトレイ23に格納される。 When the scheduler 10 issues a low-priority calculation event while the WORKER 6 is waiting in an unprocessed state, a message containing the task ID and priority of the task to be executed in the low-priority calculation event is sent. It is stored in the tray 23.

図6に示すように、低優先度の演算イベントに係るタスクメッセージMSG1のメッセージトレイ23への格納タイミングt11は、OSステートマシン22のSend状態を過ぎている。このため、OSステートマシン22は、Peek状態、Disp状態、Post状態を遷移した後の次のSend状態の終了タイミングにて、メッセージトレイ23からメッセージキューMQ1にタスクメッセージMSG1を転送すると共に、メッセージトレイ23の第1トレイNo1を空状態にクリーニングする。 As shown in FIG. 6, the storage timing t11 of the task message MSG1 related to a low-priority calculation event in the message tray 23 has passed the Send state of the OS state machine 22. Therefore, the OS state machine 22 transfers the task message MSG1 from the message tray 23 to the message queue MQ1 at the end timing of the next Send state after transitioning through the Peek state, Disp state, and Post state, and also transfers the task message MSG1 from the message tray 23 to the message queue MQ1. The first tray No. 23 is cleaned to an empty state.

OSステートマシン22は、タイミングt12においてメッセージキューMQ1の状態をReadyから次ステートのPeek状態に遷移させ、起動タスクを決定する。OSステートマシン22は、Peek状態においてメッセージキュー24の中から起動タスクを選択する。OSステートマシン22は、タイミングt13においてDisp状態に遷移し、Peek状態で選択された起動待機中のタスクを起動する。 The OS state machine 22 transitions the state of the message queue MQ1 from Ready to the next state, Peek state, at timing t12, and determines the activation task. The OS state machine 22 selects an activation task from the message queue 24 in the Peek state. The OS state machine 22 transits to the Disp state at timing t13, and starts the task selected in the Peek state and waiting to be started.

OSステートマシン22は、タイミングt14においてメッセージキューMQ1のタスクメッセージMSG1の状態をPeek状態からRun状態に遷移させると共に、メッセージキューMQ1のタスクIDに紐づいた演算命令テーブル5の開始アドレス及び終了アドレスを検索する。 The OS state machine 22 transitions the state of the task message MSG1 of the message queue MQ1 from the Peek state to the Run state at timing t14, and also changes the start address and end address of the operation instruction table 5 linked to the task ID of the message queue MQ1. search for.

そしてOSステートマシン22は、開始アドレス及び終了アドレスをインターフェース27を経由して読み出し、FPUOS3のタスクトレイ25の通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR及び通常終了アドレスNTT_STP_ADDRに格納し、タスクトレイ状態TTRAY_STを「通常タスク空状態ST1」から「通常タスク実行状態ST2」に遷移させる。 Then, the OS state machine 22 reads the start address and end address via the interface 27, stores them in the normal start address NTT_STA_ADDR and the normal end address NTT_STP_ADDR of the normal task tray NTASK_TRAY of the task tray 25 of the FPUOS 3, and sets the task tray state TTRAY_ST to "normal task". A transition is made from the "empty state ST1" to the "normal task execution state ST2."

WORKER6の側では、タスクトレイ状態TTRAY_STが「通常タスク空状態ST1」から「通常タスク実行状態ST2」へ遷移することをもって、通常開始アドレスNTT_STA_ADDRから通常終了アドレスNTT_STP_ADDRにかけた演算内容を演算命令テーブル5から読出しながら、FPU9、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8を用いて浮動小数点の2項演算を順次処理する。 On the WORKER 6 side, when the task tray state TTRAY_ST transitions from "normal task empty state ST1" to "normal task execution state ST2", the contents of the operation from the normal start address NTT_STA_ADDR to the normal end address NTT_STP_ADDR are read from the operation instruction table 5. Meanwhile, floating-point binary operations are sequentially processed using the FPU 9, the FPU first argument general-purpose register group 7, and the FPU second argument general-purpose register group 8.

<プログラムカウンタブロック31の動作概要>
OSステートマシン22がDisp状態とされている時、図4に示すプログラムカウンタブロック31は、遷移検出部43によるロード指令S33の出力のタイミングにおいて通常開始アドレスNTT_STA_ADDRをプログラムカウンタ41にロードする。
<Outline of operation of program counter block 31>
When the OS state machine 22 is in the Disp state, the program counter block 31 shown in FIG. 4 loads the normal start address NTT_STA_ADDR into the program counter 41 at the timing when the transition detection unit 43 outputs the load command S33.

このロードしたタイミングにおいて、タスクトレイ状態TTRAY_STは、「通常タスク実行状態ST2」とされている。このため、開始アドレスセレクタ45は、通常開始アドレスNTT_STA_ADDRの格納領域を選択し、プログラムカウンタ41に通常開始アドレスNTT_STA_ADDRをロードする。他方、終了アドレスセレクタ46は、通常タスクトレイNTASK_TRAYに格納される通常終了アドレスNTT_STP_ADDRを選択し、一致比較部42に通常終了アドレスNTT_STP_ADDRを入力させる。 At this loading timing, the task tray state TTRAY_ST is set to the "normal task execution state ST2." Therefore, the start address selector 45 selects the storage area of the normal start address NTT_STA_ADDR, and loads the normal start address NTT_STA_ADDR into the program counter 41. On the other hand, the end address selector 46 selects the normal end address NTT_STP_ADDR stored in the normal task tray NTASK_TRAY, and causes the match comparison unit 42 to input the normal end address NTT_STP_ADDR.

演算命令デコーダ32は、演算命令テーブル5の中でプログラムカウンタ41の指し示すアドレスを指定し演算命令コードをデコードする。プログラムカウンタ41は、クロック入力に伴いカウントを進行させることで演算命令テーブル5を参照しながら演算命令コードを順次デコードし、FPU9は、通常終了アドレスNTT_STP_ADDRまで演算命令を実行する。 The arithmetic instruction decoder 32 specifies the address pointed to by the program counter 41 in the arithmetic instruction table 5 and decodes the arithmetic instruction code. The program counter 41 sequentially decodes the arithmetic instruction codes while referring to the arithmetic instruction table 5 by advancing the count in accordance with the clock input, and the FPU 9 executes the arithmetic instructions up to the normal end address NTT_STP_ADDR.

<低優先度の演算イベントを実行中に高優先度の演算イベントを発行>
他方、WORKER6が、タイミングt14以降にて低優先度の演算タスクを実行中に、タイミングt15にて高優先度の演算イベントを発生すると、FPUOS3は、当該高優先度の演算イベントに係るタスクを低優先度の演算イベントに係るタスクよりも優先してWORKER6に実行指令する。
<Issue a high-priority calculation event while a low-priority calculation event is being executed>
On the other hand, when the WORKER 6 generates a high-priority calculation event at timing t15 while executing a low-priority calculation task after timing t14, the FPUOS 3 lowers the task related to the high-priority calculation event. An execution command is given to the WORKER 6 with priority over the task related to the priority calculation event.

このとき、外部のスケジューラ10がメッセージトレイ23の第1トレイNo1に高優先度のタスクメッセージMSG2を格納させる。その後、OSステートマシン22はSend状態になると、メッセージキューMQ1が空状態ではないため、タイミングt16においてタスクメッセージMSG2をメッセージキューMQ2に転送すると共に、メッセージトレイ23を空状態にクリーニングする。 At this time, the external scheduler 10 stores the high priority task message MSG2 in the first tray No.1 of the message tray 23. Thereafter, when the OS state machine 22 enters the Send state, since the message queue MQ1 is not empty, it transfers the task message MSG2 to the message queue MQ2 at timing t16, and cleans the message tray 23 to an empty state.

続いて、OSステートマシン22がPeek状態になると、起動するタスクメッセージMSGを選択しようとするが、WORKER6が低優先度のタスクメッセージMSG1を実行中の状態であるため、メッセージキューMQ2はReady状態をキープし、FPUOS3は、OSステートマシン22の状態がPeek状態のときにタスク中断フラグをセットする。 Subsequently, when the OS state machine 22 enters the Peek state, it tries to select the task message MSG to be activated, but since the WORKER 6 is in the state of executing the low priority task message MSG1, the message queue MQ2 changes to the Ready state. The FPUOS 3 sets the task suspension flag when the state of the OS state machine 22 is in the Peek state.

FPUOS3は、タスク中断フラグをセットすることで、WORKER6に実行中の低優先度のタスクメッセージMSG1の中断指令を行い、低優先度のタスクメッセージMSG1の中断ハンドシェークを行う。サイクリックに遷移していたOSステートマシン22は、中断ハンドシェーク期間t17~t18においてDisp状態に保持される。 By setting the task suspension flag, the FPUOS 3 instructs the WORKER 6 to suspend the low-priority task message MSG1 being executed, and performs a handshake to suspend the low-priority task message MSG1. The OS state machine 22, which has been cyclically transitioning, is held in the Disp state during the interrupted handshake period t17 to t18.

<WORKER6による演算実行>
FPUOS3がタスク中断フラグをセットするタイミングt17以降、WORKER6がタスク中断フラグを認識する。WORKER6は、演算命令テーブル5を参照して演算命令セット選択結果S11を確認する。そして、WORKER6は、タイミングt18において演算命令を一時中断可能な区切りのよいタイミングで中断アドレスを判断し、処理中断を完了させると共に、判断した中断アドレスを退避させる。このとき、WORKER6は、中断アドレスをタスクトレイ25の通常開始アドレスNTT_STA_ADDRの格納領域に退避させる。
<Calculation execution using WORKER6>
After timing t17 when the FPUOS 3 sets the task suspension flag, the WORKER 6 recognizes the task suspension flag. The WORKER 6 refers to the arithmetic instruction table 5 and confirms the arithmetic instruction set selection result S11. Then, at timing t18, the WORKER 6 determines the interruption address at a well-defined timing that allows temporary interruption of the arithmetic instruction, completes the processing interruption, and saves the determined interruption address. At this time, the WORKER 6 saves the interruption address to the storage area of the task tray 25 for the normal start address NTT_STA_ADDR.

また中断判定部44は、WORKER中断完了S31を経由してタスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」から「通常タスク中断状態ST4」に遷移させる。 Further, the interruption determination unit 44 transitions the task tray state TTRAY_ST from the "normal task execution state ST2" to the "normal task interruption state ST4" via WORKER interruption completion S31.

FPUOS3の側では、当該FPUOS3とは独立して動作するWORKER6の演算処理中断の応答を待機している。FPUOS3は、タスクトレイ状態TTRAY_STが「通常タスク実行状態ST2」から「通常タスク中断状態ST4」へ遷移したことをもって、WORKER6が演算実行を中断したと判断する。 On the FPUOS 3 side, the FPUOS 3 waits for a response from the WORKER 6, which operates independently of the FPUOS 3, to interrupt the arithmetic processing. The FPUOS 3 determines that the WORKER 6 has interrupted the calculation execution when the task tray state TTRAY_ST has transitioned from the "normal task execution state ST2" to the "normal task suspension state ST4."

FPUOS3は、タイミングt18にてメッセージキューMQ1の状態をRun状態からWait状態に遷移させると共に、Disp状態からサイクリック遷移を再開し、Post状態に遷移する。 At timing t18, the FPUOS3 transitions the state of the message queue MQ1 from the Run state to the Wait state, restarts the cyclic transition from the Disp state, and transitions to the Post state.

FPUOS3とWORKER6との間の中断ハンドシェーク期間t17~t18の間、OSステートマシン22は、Disp状態に留まっている。OSステートマシン22は、サイクリックに状態を遷移させずDisp状態に留まているため、FPUOS3は、WORKER6による演算タスクの実行に係る中断応答に対し即時対応できる。これにより、タスク中断オーバーヘッド時間の増加を抑制できる。 During the interrupted handshake period t17-t18 between the FPUOS3 and the WORKER6, the OS state machine 22 remains in the Disp state. Since the OS state machine 22 does not cyclically change the state and remains in the Disp state, the FPUOS 3 can immediately respond to an interruption response related to the execution of a calculation task by the WORKER 6. This makes it possible to suppress an increase in task interruption overhead time.

その後、OSステートマシン22がサイクリック状態遷移を再開し、Peek状態まで遷移すると、FPUOS3は、タイミングt19においてタスク中断フラグをクリアする。 Thereafter, when the OS state machine 22 resumes cyclic state transition and transitions to the Peek state, the FPUOS 3 clears the task suspension flag at timing t19.

またOSステートマシン22は、高優先度のタスクメッセージMSG2が格納されているメッセージキューMQ2の状態をReady状態からPeek状態に遷移させ、タスク起動待ち状態にした後、Disp状態に遷移させる。 Further, the OS state machine 22 changes the state of the message queue MQ2 in which the high-priority task message MSG2 is stored from the Ready state to the Peek state, makes it wait for task activation, and then changes it to the Disp state.

通常、OSステートマシン22は、Disp状態においてタスクトレイ25に、メッセージリスト4の開始アドレス及び終了アドレスを格納する。しかし、現状態では、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」であるため、通常タスクトレイNTASK_TRAYに中断アドレスを残留したまま保持しておく。 Normally, the OS state machine 22 stores the start address and end address of the message list 4 in the task tray 25 in the Disp state. However, in the current state, the task tray state TTRAY_ST is the "normal task interruption state ST4", so the interruption address remains in the normal task tray NTASK_TRAY.

FPUOS3は、メッセージキュー24のPeek状態に紐付いたタスクIDの演算命令テーブル5の開始アドレス/終了アドレスを、メッセージリスト4の中で検索し、検索された開始アドレス/終了アドレスをインターフェース27を経由して読み出す。 The FPUOS 3 searches the message list 4 for the start address/end address of the operation instruction table 5 of the task ID associated with the Peek state of the message queue 24, and sends the searched start address/end address via the interface 27. and read it out.

FPUOS3は、読み出した開始アドレス/終了アドレスを、タイミングt20にて優先タスクトレイPTASK_TRAYの優先開始アドレスPTT_STA_ADDR及び優先終了アドレスPTT_STP_ADDRの格納領域に格納し、タスクトレイ状態TTRAY_STを「通常タスク中断状態ST4」から「優先タスク実行状態ST5」に遷移させる。OSステートマシン22は、Disp状態に留まるように保持させると共に、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」に戻ることをポーリングする。 The FPUOS3 stores the read start address/end address in the storage area of the priority start address PTT_STA_ADDR and priority end address PTT_STP_ADDR of the priority task tray PTASK_TRAY at timing t20, and changes the task tray state TTRAY_ST from the "normal task suspended state ST4" to the "priority task tray state ST4". "Task execution state ST5". The OS state machine 22 maintains the Disp state and polls for the task tray state TTRAY_ST to return to the "normal task suspension state ST4."

<WORKER6によるタスク実行>
WORKER6の側では、タスクトレイ状態TTRAY_STが「優先タスク実行状態ST5」に遷移すると、開始アドレスセレクタ45が優先開始アドレスPTT_STA_ADDRを選択すると共に、終了アドレスセレクタ46が優先終了アドレスPTT_STP_ADDRを選択する。
<Task execution using WORKER6>
On the WORKER 6 side, when the task tray state TTRAY_ST transitions to the "priority task execution state ST5", the start address selector 45 selects the priority start address PTT_STA_ADDR, and the end address selector 46 selects the priority end address PTT_STP_ADDR.

遷移検出部43は、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」から「優先タスク実行状態ST5」へ遷移する時にロード指令S33を出力する機能を有しており、このロード指令S33のトリガ出力により優先開始アドレスPTT_STA_ADDRをプログラムカウンタ41にロードする。 The transition detection unit 43 has a function of outputting a load command S33 when the task tray state TTRAY_ST transitions from the "normal task suspension state ST4" to the "priority task execution state ST5", and by the trigger output of this load command S33. Load the priority start address PTT_STA_ADDR into the program counter 41.

このロード時点では、タスクトレイ状態TTRAY_STは「優先タスク実行状態ST5」に遷移している。開始アドレスセレクタ45は、優先開始アドレスPTT_STA_ADDRの側を選択しているため、プログラムカウンタ41は、優先開始アドレスPTT_STA_ADDRをロードする。その後、演算命令デコーダ32は、プログラムカウンタ41の指し示す演算命令テーブル5の中の演算命令コードをデコードする。 At this loading time, the task tray state TTRAY_ST has transitioned to the "priority task execution state ST5." Since the start address selector 45 selects the priority start address PTT_STA_ADDR, the program counter 41 loads the priority start address PTT_STA_ADDR. Thereafter, the arithmetic instruction decoder 32 decodes the arithmetic instruction code in the arithmetic instruction table 5 pointed to by the program counter 41.

従ってWORKER6は、「優先タスク実行状態ST5」への遷移をもって、優先開始アドレスPTT_STA_ADDRから優先終了アドレスPTT_STP_ADDRまでのアドレスに従った演算内容について、演算命令テーブル5を参照しながら、FPU9、FPU第1引数汎用レジスタ群7、及びFPU第2引数汎用レジスタ群8を用いて、浮動小数点の2項演算を順次処理する。これにより、最小限のレイテンシにて高優先度演算タスクを起動できる。 Therefore, upon transition to the "priority task execution state ST5", the WORKER 6, while referring to the operation instruction table 5, determines the operation contents according to the addresses from the priority start address PTT_STA_ADDR to the priority end address PTT_STP_ADDR, Using the general-purpose register group 7 and the FPU second argument general-purpose register group 8, floating-point binary operations are sequentially processed. This allows high-priority calculation tasks to be activated with minimal latency.

高優先度演算タスクが、優先終了アドレスPTT_STP_ADDRまで実行されると、プログラムカウンタ41が優先終了アドレスPTT_STP_ADDRに一致することで一致比較部42がアクティブとなる。一致比較部42は、終了アドレス一致信号S32を出力することで、タスクトレイ状態TTRAY_STを「優先タスク実行状態ST5」から「通常タスク中断状態ST4」に遷移させる。 When the high-priority calculation task is executed up to the priority end address PTT_STP_ADDR, the program counter 41 matches the priority end address PTT_STP_ADDR, and the match comparison unit 42 becomes active. The match comparison unit 42 causes the task tray state TTRAY_ST to transition from the "priority task execution state ST5" to the "normal task suspension state ST4" by outputting the end address match signal S32.

図7は図6に続くタイミングチャートである。WORKER6が、優先開始アドレスPTT_STA_ADDRから優先終了アドレスPTT_STP_ADDRまで実行を完了すると、図7のタイミングt21にてタスクトレイ状態TTRAY_STを「優先タスク実行状態ST5」から「通常タスク中断状態ST4」に遷移させる。 FIG. 7 is a timing chart following FIG. 6. When the WORKER 6 completes execution from the priority start address PTT_STA_ADDR to the priority end address PTT_STP_ADDR, it transitions the task tray state TTRAY_ST from the "priority task execution state ST5" to the "normal task suspension state ST4" at timing t21 in FIG.

他方、OSステートマシン22は、少なくともWORKER6が高優先度演算タスクを実行中にDisp状態に留まっている。このため、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」に遷移したことを確認することで、WORKER6が高優先度演算タスクを実行終了したことを即時把握できる。 On the other hand, the OS state machine 22 remains in the Disp state at least while the WORKER 6 is executing a high priority calculation task. Therefore, by confirming that the task tray state TTRAY_ST has transitioned to the "normal task suspension state ST4", it is possible to immediately know that the WORKER 6 has finished executing the high priority calculation task.

OSステートマシン22は、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」に遷移したことを確認した後、メッセージキューMQ2の状態をRun状態からNothing状態に遷移させる。OSステートマシン22は、サイクリック遷移を再開し、Post状態に遷移する。 After confirming that the task tray state TTRAY_ST has transitioned to the "normal task suspension state ST4," the OS state machine 22 transitions the state of the message queue MQ2 from the Run state to the Nothing state. The OS state machine 22 restarts the cyclic transition and transitions to the Post state.

FPUOS3は、メッセージキューMQ2をRun状態からNothing状態に遷移させる機能を、OSステートマシン22の任意の固定状態、ここではDisp状態に限定している。 The FPUOS 3 limits the function of transitioning the message queue MQ2 from the Run state to the Nothing state to any fixed state of the OS state machine 22, here the Disp state.

なお仮に、OSステートマシン22がDisp状態にて待機することなくサイクリック遷移を継続し、Disp状態以外のタイミングでWORKER6がタスク処理を完了すると、次回のDisp状態までサイクリック遷移を待機する必要があり、リアルタイム応答性に劣ることになる。 Furthermore, if the OS state machine 22 continues the cyclic transition without waiting in the Disp state and the WORKER 6 completes task processing at a timing other than the Disp state, it is necessary to wait for the cyclic transition until the next Disp state. This results in poor real-time responsiveness.

本実施形態では、OSステートマシン22は、WORKER6が高優先度演算タスクを実行している最中に、Disp状態に留まっているため、FPUOS3は、WORKER6による高優先度演算タスク処理を終了したタイミングt21にてこの状態遷移を受付けることができ、即時対応できる。 In this embodiment, since the OS state machine 22 remains in the Disp state while the WORKER 6 is executing the high-priority calculation task, the FPUOS 3 determines the timing when the WORKER 6 finishes processing the high-priority calculation task. This state transition can be accepted at t21 and can be dealt with immediately.

このように、WORKER6が高優先度演算タスクを実行中には、OSステートマシン22の状態をDisp状態に保持しているため、WORKER6が高優先度演算タスクを実行完了したときに、OSステートマシン22はWORKER6が実行完了したことを即時認識できる。この結果、OSステートマシン22は即時対応でき、タスク完了オーバーヘッド時間の増加を抑制できる。 In this way, while the WORKER 6 is executing a high-priority arithmetic task, the state of the OS state machine 22 is maintained in the Disp state, so when the WORKER 6 completes execution of the high-priority arithmetic task, the OS state machine 22 22 can immediately recognize that WORKER 6 has completed execution. As a result, the OS state machine 22 can respond immediately, and an increase in task completion overhead time can be suppressed.

その後、OSステートマシン22が、サイクリック遷移を再開して再度Peek状態まで遷移すると、タイミングt23において、OSステートマシン22は、中断していたメッセージキューMQ1の状態をWait状態からPeek状態に遷移させることで、タスク起動待ち状態にした後、OSステートマシン22のサイクリック遷移をDisp状態に遷移させる。OSステートマシン22は、タイミングt23のDisp状態においてメッセージキューMQ1の状態をPeek状態からRun状態に遷移させる。 Thereafter, when the OS state machine 22 restarts the cyclic transition and transits to the Peek state again, at timing t23, the OS state machine 22 transitions the suspended state of the message queue MQ1 from the Wait state to the Peek state. This causes the OS state machine 22 to make a cyclic transition to the Disp state after entering the task activation wait state. The OS state machine 22 transitions the state of the message queue MQ1 from the Peek state to the Run state in the Disp state at timing t23.

通常、OSステートマシン22が、Disp状態に遷移すると、通常タスクトレイNTASK_TRAYにメッセージリスト4から開始アドレス及び終了アドレスを格納するが、タイミングt23においては、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」であり、タスクトレイ25の通常開始アドレスNTT_STA_ADDRには中断アドレスが記憶されている。 Normally, when the OS state machine 22 transitions to the Disp state, it stores the start address and end address from the message list 4 in the normal task tray NTASK_TRAY, but at timing t23, the task tray state TTRAY_ST is the "normal task suspended state ST4". , an interruption address is stored in the normal start address NTT_STA_ADDR of the task tray 25.

このためOSステートマシン22は、メッセージリスト4におけるアドレス検索処理をスキップし、タスクトレイ状態TTRAY_STを「通常タスク中断状態ST4」から「通常タスク実行状態ST2」に遷移させ、OSステートマシン22がサイクリック遷移を再開する。 Therefore, the OS state machine 22 skips the address search process in the message list 4, transitions the task tray state TTRAY_ST from the "normal task suspension state ST4" to the "normal task execution state ST2", and the OS state machine 22 makes a cyclic transition. resume.

タスクトレイ25のタスクトレイ状態TTRAY_STが、「通常タスク中断状態ST4」から「通常タスク実行状態ST2」へ遷移すると、WORKER6の側では、遷移検出部43が「通常タスク中断状態ST4」から「通常タスク実行状態ST2」への遷移を検出し、このタイミングにて再開ロード信号S30を出力する。 When the task tray state TTRAY_ST of the task tray 25 transitions from the "normal task suspended state ST4" to the "normal task execution state ST2," the transition detection unit 43 on the WORKER 6 side changes from the "normal task suspended state ST4" to the "normal task execution state ST2'' is detected, and a restart load signal S30 is output at this timing.

再開ロード信号S30がトリガ出力されると、中断時に退避した中断アドレスがプログラムカウンタ41にロードされる。再開ロードする時点において、タスクトレイ状態TTRAY_STは「通常タスク実行状態ST2」となっている。このため開始アドレスセレクタ45は、通常開始アドレスNTT_STA_ADDRの側を選択し、通常開始アドレスNTT_STA_ADDRの格納領域に退避された中断アドレスをプログラムカウンタ41にロードする。プログラムカウンタ41に中断アドレスがロードされると、中断アドレスから演算命令テーブル5の中の演算命令コードが順次実行される。 When the restart load signal S30 is triggered, the interruption address saved at the time of interruption is loaded into the program counter 41. At the time of restart loading, the task tray state TTRAY_ST is the "normal task execution state ST2." Therefore, the start address selector 45 selects the normal start address NTT_STA_ADDR, and loads the interruption address saved in the storage area of the normal start address NTT_STA_ADDR into the program counter 41. When the interrupt address is loaded into the program counter 41, the operation instruction codes in the operation instruction table 5 are sequentially executed starting from the interruption address.

一方、終了アドレスセレクタ46も、通常終了アドレスNTT_STP_ADDRの側を選択しているため、演算命令デコーダ32が、プログラムカウンタ41の指示する演算命令テーブル5を読み取り、通常終了アドレスNTT_STP_ADDRまで順次実行する。 On the other hand, since the end address selector 46 also selects the normal end address NTT_STP_ADDR, the arithmetic instruction decoder 32 reads the arithmetic instruction table 5 indicated by the program counter 41 and sequentially executes them up to the normal end address NTT_STP_ADDR.

一致比較部42は、プログラムカウンタ41の示すアドレス値が通常終了アドレスNTT_STP_ADDRに一致したと判定すると、タスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」から「通常タスク完了状態ST3」に遷移させる。これにより、低優先度演算タスク処理を再開、完了できる。 When the match comparison unit 42 determines that the address value indicated by the program counter 41 matches the normal end address NTT_STP_ADDR, it transitions the task tray state TTRAY_ST from the "normal task execution state ST2" to the "normal task completion state ST3." This allows the low-priority arithmetic task processing to be restarted and completed.

WORKER6は、タイミングt24以降において、中断アドレスから通常終了アドレスNTT_STP_ADDRまでの実行アドレスに従った演算内容を演算命令テーブル5から読出し、FPU9、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8を用いて、浮動小数点の2項演算を順次処理できる。 After timing t24, the WORKER 6 reads the operation contents according to the execution address from the interruption address to the normal end address NTT_STP_ADDR from the operation instruction table 5, and reads the contents of the operation according to the execution address from the interruption address to the normal end address NTT_STP_ADDR, and sends the contents to the FPU 9, the FPU first argument general-purpose register group 7, and the FPU second argument general-purpose register group. 8 can be used to sequentially process binary floating-point operations.

WORKER6が高優先度の演算タスクを実行中には、OSステートマシン22をDisp状態に保持しているため、WORKER6が高優先度演算タスクを実行完了したときに、OSステートマシン22はWORKER6が実行完了したことを即時認識できる。この結果、OSステートマシン22は即時対応でき、タスク完了オーバーヘッド時間の増加を抑制できる。 While the WORKER 6 is executing a high-priority arithmetic task, the OS state machine 22 is held in the Disp state, so when the WORKER 6 completes executing the high-priority arithmetic task, the OS state machine 22 is executed by the WORKER 6. You can immediately recognize that it has been completed. As a result, the OS state machine 22 can respond immediately, and an increase in task completion overhead time can be suppressed.

<比較例>
現在、一般化されているマルチタスクOSでは、複数のプロセスのタスクが衝突したときにコンテキストスイッチ等を発生することを考慮に入れると、処理オーバーヘッドを生じることから高速演算には不向きである。
<Comparative example>
Multitasking OSs that are currently popular are not suitable for high-speed calculations because they generate processing overhead, taking into consideration that context switches and the like occur when tasks of multiple processes collide.

<本実施形態のまとめ>
本実施形態では、FPUOS3とWORKER6とがハードウェア的に分離して独立して構成されている。このため、高優先度の実行タスクを中断させることなくアプリケーションタスクを処理でき、割込み時及び復帰時におけるコンテキストスイッチのオーバーヘッド時間分だけ短縮できる。
また、WORKER6の側で特に最優先となる高優先度の演算タスクを実行しているときには、FPUOS3が低優先度の演算タスクをWORKER6に対して実行指令に移さないようにしているため、WORKER6は当該高優先度の演算タスクを中断することなく、当該演算タスクを最速処理できる。
また、本実施形態においては、FPUOS3とWORKER6との間の中断ハンドシェーク期間t17~t18の間、低優先度の演算タスクに係るメッセージキューMQ1をRun状態に保持したまま、OSステートマシン22はDisp状態に留まっている。OSステートマシン22は、サイクリックに状態を遷移させずDisp状態に留まっており、メッセージキュー24をRun状態に保持しているため、FPUOS3は、WORKER6による演算タスクの実行に係る中断応答に対し、メッセージキュー24をWait状態に即時変更でき、即時対応できる。これにより、タスク中断オーバーヘッド時間の増加を抑制できる。
<Summary of this embodiment>
In this embodiment, the FPUOS 3 and the WORKER 6 are configured separately and independently in terms of hardware. Therefore, the application task can be processed without interrupting the high-priority execution task, and the overhead time of the context switch at the time of interrupt and return can be reduced.
In addition, when the WORKER 6 is executing a high-priority arithmetic task that has the highest priority, the FPUOS 3 prevents the low-priority arithmetic task from being transferred to the WORKER 6 as an execution command. The arithmetic task can be processed at the fastest speed without interrupting the high-priority arithmetic task.
In addition, in this embodiment, during the interrupted handshake period t17 to t18 between the FPUOS 3 and the WORKER 6, the OS state machine 22 is kept in the Disp state while the message queue MQ1 related to the low priority calculation task is kept in the Run state. remains in place. Since the OS state machine 22 does not cyclically change the state and remains in the Disp state and maintains the message queue 24 in the Run state, the FPUOS 3 responds to the interruption response related to the execution of the calculation task by the WORKER 6. The message queue 24 can be immediately changed to the Wait state, allowing immediate response. This makes it possible to suppress an increase in task interruption overhead time.

また本実施形態において、WORKER6が、高優先度の演算タスクに係るタスクメッセージMSG2を実行開始するタイミング以降、「通常タスク中断状態ST4」にタスクトレイ状態TTRAY_STを遷移させるまでの期間t20~t21には、FPUOS3は、高優先度のタスクメッセージMSG2に係るメッセージキューMQ2をRun状態に保持したまま、OSステートマシン22がDisp状態に留まるステート制御を実行している。このため、WORKER6が高優先度の演算タスクを実行完了したときに、OSステートマシン22はWORKER6が実行完了したことを即時認識できる。この結果、OSステートマシン22は即時対応でき、タスク完了オーバーヘッド時間の増加を抑制できる。 Furthermore, in this embodiment, during the period t20 to t21 from when the WORKER 6 starts executing the task message MSG2 related to the high-priority calculation task to when the task tray state TTRAY_ST transitions to the "normal task suspension state ST4", The FPUOS3 executes state control in which the OS state machine 22 remains in the Disp state while maintaining the message queue MQ2 associated with the high priority task message MSG2 in the Run state. Therefore, when the WORKER 6 completes execution of a high-priority arithmetic task, the OS state machine 22 can immediately recognize that the WORKER 6 has completed execution. As a result, the OS state machine 22 can respond immediately, and an increase in task completion overhead time can be suppressed.

(第3実施形態)
図8及び図9に第3実施形態の追加説明図を示している。従来のマイコンが、OS処理もアプリケーション処理も1つのハードウェアを用いて順次処理する場合、デッドロックしたか否かはOSが定期的に所定の状態に遷移するか否かを監視することで判定できる。この場合、ウォッチドッグタイマを1つ設ければデッドロックしたか否かを判定できる。
(Third embodiment)
Additional explanatory diagrams of the third embodiment are shown in FIGS. 8 and 9. When conventional microcontrollers perform both OS processing and application processing sequentially using a single piece of hardware, it is possible to determine whether a deadlock has occurred by monitoring whether the OS periodically transitions to a predetermined state. can. In this case, if one watchdog timer is provided, it can be determined whether a deadlock has occurred.

しかし、前述した第1実施形態の構成では、FPUOS3及びWORKER6がハードウェア上独立して構成されているため、ウォッチドッグタイマが一つだけ設けられていても、一方のハードウェア構成(例えば、FPUOS3)を監視可能になるものの、他方のハードウェア構成(例えば、WORKER6)は監視不能になるといった問題を生じる。 However, in the configuration of the first embodiment described above, since the FPUOS 3 and the WORKER 6 are configured independently in terms of hardware, even if only one watchdog timer is provided, one of the hardware configurations (for example, FPUOS 3 ) can be monitored, but the other hardware configuration (for example, WORKER 6) cannot be monitored.

そこで図8に示すように、動作監視用のウォッチドッグタイマ2としては、FPUOS3の動作を監視するためのFPUOS監視ウォッチドッグタイマ2a(オペレーティングシステム処理監視WDT相当)、及び、WORKER6の動作を監視するためのWORKER監視ウォッチドッグタイマ2b(演算処理監視WDT相当)を独立に設け、FPUOS3及びWORKER6をそれぞれ監視するように構成することが望ましい。これにより、FPUOS3のハードウェア構成、WORKER6のハードウェア構成のそれぞれの動作を独立して監視できる。 Therefore, as shown in FIG. 8, the watchdog timer 2 for operation monitoring includes an FPUOS monitoring watchdog timer 2a (corresponding to an operating system processing monitoring WDT) for monitoring the operation of the FPUOS 3, and an operation monitoring watchdog timer 2a for monitoring the operation of the WORKER 6. It is desirable to independently provide a WORKER monitoring watchdog timer 2b (corresponding to an arithmetic processing monitoring WDT) to monitor the FPUOS 3 and WORKER 6, respectively. As a result, the operations of the hardware configuration of the FPUOS 3 and the hardware configuration of the WORKER 6 can be independently monitored.

FPUOS監視ウォッチドッグタイマ2a(以下、FPUOS監視WDT2a)はフリーランカウンタにより構成され、カウント値をフリーランカウントする。OSステートマシン22が、Send状態からPost状態までサイクリックに遷移する度に、FPUOS監視WDT2aはカウント値をクリアする。 The FPUOS monitoring watchdog timer 2a (hereinafter referred to as FPUOS monitoring WDT 2a) is constituted by a free-run counter, and counts the count value in free-run. Every time the OS state machine 22 cyclically transitions from the Send state to the Post state, the FPUOS monitoring WDT 2a clears the count value.

OSステートマシン22がデッドロックし、FPUOS監視WDT2aのカウント値がFPUOS監視WDT閾値を超えると、FPUOS監視WDT2aはWDTエラーを外部に出力する。 When the OS state machine 22 deadlocks and the count value of the FPUOS monitoring WDT 2a exceeds the FPUOS monitoring WDT threshold, the FPUOS monitoring WDT 2a outputs a WDT error to the outside.

他方、WORKER監視WDT2bはフリーランカウンタにより構成され、「通常タスク実行状態ST2」にてフリーランカウントされる。WORKER監視WDT2bは、FPUOS3のタスクトレイ状態TTRAY_STが「通常タスク実行状態ST2」以外になるとクリアされる。WORKER監視WDT2bのカウント値が、所定のWORKER監視WDT閾値を超えると、WORKER監視WDT2bはWDTエラーを出力する。 On the other hand, the WORKER monitoring WDT 2b is constituted by a free run counter, and free runs are counted in the "normal task execution state ST2". The WORKER monitoring WDT 2b is cleared when the task tray state TTRAY_ST of the FPUOS 3 becomes other than the "normal task execution state ST2". When the count value of the WORKER monitoring WDT 2b exceeds a predetermined WORKER monitoring WDT threshold, the WORKER monitoring WDT 2b outputs a WDT error.

図9には、WORKER6が通常の演算タスクを実行中であることを示す「通常タスク実行状態ST2」から、WORKER6が演算タスクを正常終了するケースを実線により示している。また、「通常タスク実行状態ST2」から、WORKER6が演算タスクを異常終了するケースを破線により示している。 In FIG. 9, a solid line indicates a case where the WORKER 6 normally ends the calculation task from the "normal task execution state ST2" indicating that the WORKER 6 is executing the normal calculation task. Furthermore, a broken line indicates a case where the WORKER 6 abnormally terminates the calculation task from the "normal task execution state ST2".

図9に示す「通常タスク実行状態ST2」が正常終了する実線ケースでは、WORKER6が暴走することなく正常動作し続ける。この際、WORKER6及びFPU9は、通常開始アドレスNTT_STA_ADDRから通常終了アドレスNTT_STP_ADDRまで演算タスクを終了する。すると、WORKER6の中のプログラムカウンタブロック31が、タスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」から「通常タスク完了状態ST3」へ書き換える。このとき、ウォッチドッグタイマ2は、タイミングt31においてWORKER監視WDT2bをクリアする。このため、WDTエラーが出力されることはない。 In the solid line case shown in FIG. 9 in which the "normal task execution state ST2" ends normally, the WORKER 6 continues to operate normally without going out of control. At this time, the WORKER 6 and the FPU 9 complete the calculation task from the normal start address NTT_STA_ADDR to the normal end address NTT_STP_ADDR. Then, the program counter block 31 in the WORKER 6 rewrites the task tray state TTRAY_ST from the "normal task execution state ST2" to the "normal task completion state ST3." At this time, the watchdog timer 2 clears the WORKER monitoring WDT 2b at timing t31. Therefore, no WDT error is output.

しかし、「通常タスク実行状態ST2」にて正常終了しないと、タスクトレイ状態TTRAY_STには「通常タスク実行状態ST2」と保持され続けるため、WORKER監視WDT2bのカウント値がWORKER監視WDT閾値をいずれ超える。するとウォッチドッグタイマ2は、タイミングt32においてWDTエラーを出力する。これにより、WORKER6のデッドロックを回避できると共に、WORKER6の暴走を監視できる。 However, if the process does not end normally in the "normal task execution state ST2", the task tray state TTRAY_ST continues to be held as the "normal task execution state ST2", so that the count value of the WORKER monitoring WDT 2b will eventually exceed the WORKER monitoring WDT threshold. Then, the watchdog timer 2 outputs a WDT error at timing t32. Thereby, deadlock of the WORKER 6 can be avoided, and runaway of the WORKER 6 can be monitored.

なお、FPUOS監視WDT閾値は、FPUOS3がタスクトレイ25にタスク中断フラグをセットしたタイミングt17から、WORKER6の側でタスクトレイ状態TTRAY_STを演算タスクを中断する「通常タスク中断状態ST4」に遷移させるタイミングt18までの時間T1(図6参照)、を少なくとも超える時間をカウント可能な閾値に設定することが望ましい。すなわち、FPUOS監視WDT閾値は、時間T1に所定の第1マージン時間を加算した時間以上をカウント可能な閾値に設定することが望ましい(第1条件)。 Note that the FPUOS monitoring WDT threshold is determined from timing t17 when the FPUOS 3 sets the task suspension flag in the task tray 25 to timing t18 when the WORKER 6 side transitions the task tray state TTRAY_ST to the "normal task suspension state ST4" in which the calculation task is suspended. It is desirable to set a threshold value that can count at least a time exceeding time T1 (see FIG. 6). That is, it is desirable to set the FPUOS monitoring WDT threshold to a threshold that can count a time equal to or longer than the time T1 plus a predetermined first margin time (first condition).

しかも、FPUOS監視WDT閾値は、WORKER6が高優先度の演算タスクを実行開始してから実行完了するまでの時間T2(図6及び図7参照)、を少なくとも超える時間をカウント可能な閾値に設定することが望ましい。すなわち、FPUOS監視WDT閾値は、時間T2に所定の第2マージン時間を加算した時間をカウント可能な値に設定することが望ましい(第2条件)。FPUOS監視WDT閾値は、前記した第1条件及び第2条件の双方を満たす閾値とすることが望ましい。 Moreover, the FPUOS monitoring WDT threshold is set to a threshold that can count the time that exceeds at least the time T2 (see FIGS. 6 and 7) from when the WORKER 6 starts executing a high-priority calculation task to when the execution is completed. This is desirable. That is, it is desirable that the FPUOS monitoring WDT threshold is set to a value that can count the time obtained by adding a predetermined second margin time to time T2 (second condition). The FPUOS monitoring WDT threshold value is preferably a threshold value that satisfies both the first condition and the second condition described above.

本実施形態によれば、ウォッチドッグタイマ2が、FPUOS3、WORKER6を監視する機能を備えているため、FPUOS3もWORKER6もそれぞれ独立して監視できる。FPUOS3の動作を監視できると共に、WORKER6のデッドロック及び暴走を監視でき異常を検知できる。 According to this embodiment, the watchdog timer 2 has a function of monitoring the FPUOS 3 and the WORKER 6, so that the FPUOS 3 and the WORKER 6 can be independently monitored. In addition to being able to monitor the operation of the FPUOS 3, deadlock and runaway of the WORKER 6 can be monitored and abnormalities can be detected.

(他の実施形態)
前述実施形態に限定されるものではなく、例えば、以下に示す変形又は拡張が可能である。
浮動小数点の演算は、単精度、倍精度等に限定されるものではない。また、浮動小数点演算処理を例示して演算処理する形態を説明したが、これに限定されるものではなく、例えば固定小数点演算処理に適用しても良い。
(Other embodiments)
The present invention is not limited to the above-mentioned embodiment, and for example, the following modifications or expansions are possible.
Floating point operations are not limited to single precision, double precision, etc. Furthermore, although the embodiment has been described with reference to floating point arithmetic processing, the present invention is not limited to this, and may be applied to, for example, fixed point arithmetic processing.

前述した複数の実施形態の構成、機能を組み合わせても良い。前述実施形態の一部を、課題を解決できる限りにおいて省略した態様も実施形態と見做すことが可能である。また、特許請求の範囲に記載した文言によって特定される発明の本質を逸脱しない限度において考え得るあらゆる態様も実施形態と見做すことが可能である。 The configurations and functions of the plurality of embodiments described above may be combined. A mode in which a part of the above embodiment is omitted as long as the problem can be solved can also be regarded as an embodiment. In addition, all conceivable aspects can be regarded as embodiments as long as they do not deviate from the essence of the invention specified by the words written in the claims.

本発明は、前述した実施形態に準拠して記述したが、当該実施形態や構造に限定されるものではないと理解される。本発明は、様々な変形例や均等範囲内の変形をも包含する。加えて、様々な組み合わせや形態、さらには、それらに一要素、それ以上、あるいはそれ以下、を含む他の組み合わせや形態をも、本発明の範畴や思想範囲に入るものである。 Although the present invention has been described based on the embodiments described above, it is understood that the present invention is not limited to the embodiments or structures. The present invention also includes various modifications and equivalent modifications. In addition, various combinations and configurations, as well as other combinations and configurations that include one, more, or fewer elements, fall within the scope and spirit of the present invention.

図面中、1はリアルタイム演算処理装置、3はFPUOS(オペレーティングシステム処理部)、4はメッセージリスト、5は演算命令テーブル、6はWORKER(演算処理部)、25はタスクトレイ、TTRAY_STはタスクトレイ状態、31はプログラムカウンタブロック、32は演算命令デコーダ、41はプログラムカウンタ、を示す。
In the drawing, 1 is a real-time arithmetic processing unit, 3 is an FPUOS (operating system processing unit), 4 is a message list, 5 is an arithmetic instruction table, 6 is a WORKER (arithmetic processing unit), 25 is a task tray, TTRAY_ST is a task tray state, 31 32 is a program counter block, 32 is an arithmetic instruction decoder, and 41 is a program counter.

Claims (4)

外部から演算イベントが発行されると時間軸及び優先度に基づいて実行順序を判断し前記演算イベントに係るタスクを実行指令すると共に前記タスクの管理を行うことに特化したオペレーティングシステム処理部(3)と、
前記オペレーティングシステム処理部(3)の実行指令に従って演算処理を実行することに特化した演算処理部(6)とを、
同一のICチップ内にそれぞれハードウェア上で独立して構成され、
前記タスクに紐付いた開始アドレス及び終了アドレスを記憶するメッセージリスト(4)と、
演算命令セットを記憶する演算命令テーブル(5)と、を備え、
前記演算処理部は、プログラムカウンタ(41)及び演算命令デコーダ(32)を備え、前記オペレーティングシステム処理部(3)から前記演算イベントに係る前記タスクの実行指令を受付けると、前記タスクに紐付いた前記開始アドレス及び前記終了アドレスをメッセージリスト(4)から受領し、前記開始アドレスから前記終了アドレスにかけて前記プログラムカウンタ(41)のカウンタ値の示すアドレスにおける前記演算命令テーブル(5)の演算命令セットを参照して演算処理を実行するものであり、
前記オペレーティングシステム処理部(3)と前記演算処理部(6)との間のインタフェースとして、
前記タスクの非実行状態(ST1、ST3、ST4)、実行状態(ST2、ST5)の状態の間の予め定められた遷移を、前記オペレーティングシステム処理部(3)及び前記演算処理部(6)から共に認識可能にするタスクトレイ(25)を備えるリアルタイム演算処理装置。
When a calculation event is issued from the outside, an operating system processing unit (3 )and,
an arithmetic processing unit (6) specialized for executing arithmetic processing according to execution instructions of the operating system processing unit (3);
Each is configured independently on the hardware within the same IC chip,
a message list (4) that stores a start address and an end address associated with the task;
an arithmetic instruction table (5) that stores an arithmetic instruction set;
The arithmetic processing unit includes a program counter (41) and an arithmetic instruction decoder (32), and upon receiving an instruction to execute the task related to the arithmetic event from the operating system processing unit (3), the arithmetic processing unit executes the execution command associated with the task. Receive the start address and the end address from the message list (4), and refer to the arithmetic instruction set of the arithmetic instruction table (5) at the address indicated by the counter value of the program counter (41) from the start address to the end address. It performs arithmetic processing by
As an interface between the operating system processing unit (3) and the arithmetic processing unit (6),
A predetermined transition between the non-execution state (ST1, ST3, ST4) and the execution state (ST2, ST5) of the task is determined from the operating system processing unit (3) and the arithmetic processing unit (6). A real-time arithmetic processing device equipped with a task tray (25) that allows both to be recognized .
前記タスクトレイは、前記オペレーティングシステム処理部(3)及び前記演算処理部の双方から書込可能なタスクトレイ状態(TTRAY_ST)の格納領域を備え、
前記タスクトレイ状態の書込みアクセス権は、前記オペレーティングシステム処理部(3)及び前記演算処理部(6)の間で競合を避けるように設定され、
前記演算処理部による前記タスクの非実行状態では、前記オペレーティングシステム処理部(3)にアクセス権が付与され、
前記演算処理部による前記タスクの実行状態では、前記演算処理部にアクセス権が付与される請求項1記載のリアルタイム演算処理装置。
The task tray includes a storage area for a task tray state (TTRAY_ST) that can be written by both the operating system processing unit (3) and the arithmetic processing unit,
The write access right for the task tray state is set to avoid conflict between the operating system processing unit (3) and the arithmetic processing unit (6),
When the task is not executed by the arithmetic processing unit, access rights are granted to the operating system processing unit (3),
The real-time arithmetic processing device according to claim 1 , wherein when the task is executed by the arithmetic processing unit, access rights are granted to the arithmetic processing unit.
前記演算処理部(6)が最優先となる第1優先度の前記タスクを実行中に、前記オペレーティングシステム処理部(3)が前記第1優先度よりも低い第2優先度のタスクに係る演算イベントが発生した場合、
前記オペレーティングシステム処理部が前記第2優先度の前記タスクを前記演算処理部に対して実行指令に移さないようにした請求項2記載のリアルタイム演算処理装置。
While the arithmetic processing unit (6) is executing the task with the first priority, which is the highest priority, the operating system processing unit (3) performs an operation on a task with a second priority lower than the first priority. If an event occurs,
3. The real-time arithmetic processing device according to claim 2, wherein said operating system processing section does not transfer said task of said second priority to said arithmetic processing section as an execution command.
前記演算処理部(6)が最優先よりも低い第3優先度の前記タスクを実行中に、前記オペレーティングシステム処理部(3)に前記第3優先度よりも高い第4優先度のタスクに係る演算イベントが発生した場合、
前記オペレーティングシステム処理部が前記第4優先度の前記タスクを前記第3優先度よりも優先して前記演算処理部に実行指令するようにした請求項2記載のリアルタイム演算処理装置。
While the arithmetic processing unit (6) is executing the task with a third priority lower than the highest priority, the operating system processing unit (3) is executed with a task related to a fourth priority higher than the third priority. When a calculation event occurs,
3. The real-time arithmetic processing device according to claim 2, wherein the operating system processing section instructs the arithmetic processing section to execute the task of the fourth priority over the third priority.
JP2020079203A 2020-04-28 2020-04-28 Real-time arithmetic processing unit Active JP7380406B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020079203A JP7380406B2 (en) 2020-04-28 2020-04-28 Real-time arithmetic processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020079203A JP7380406B2 (en) 2020-04-28 2020-04-28 Real-time arithmetic processing unit

Publications (2)

Publication Number Publication Date
JP2021174365A JP2021174365A (en) 2021-11-01
JP7380406B2 true JP7380406B2 (en) 2023-11-15

Family

ID=78279719

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020079203A Active JP7380406B2 (en) 2020-04-28 2020-04-28 Real-time arithmetic processing unit

Country Status (1)

Country Link
JP (1) JP7380406B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318796A (en) 2000-02-29 2001-11-16 Leben Co Ltd Program execution control method using internal and external event driven system, recording medium and program preparation support system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318796A (en) 2000-02-29 2001-11-16 Leben Co Ltd Program execution control method using internal and external event driven system, recording medium and program preparation support system

Also Published As

Publication number Publication date
JP2021174365A (en) 2021-11-01

Similar Documents

Publication Publication Date Title
US10949249B2 (en) Task processor
JP5166877B2 (en) Hardware multithread system and method
US9870252B2 (en) Multi-threaded processing with reduced context switching
US8996761B2 (en) Virtual queue processing circuit and task processor
JP5405320B2 (en) Virtual machine control device, virtual machine control method, and virtual machine control program
EP2857968B1 (en) Task processor
WO2006074027A2 (en) Mechanism to schedule threads on os-sequestered without operating system intervention
US20080140896A1 (en) Processor and interrupt controlling method
US20040031034A1 (en) System, method and software for reducing interrupt latency while polling in system management mode
JPH10505444A (en) Processing system, processor, instruction stream storage memory and compiler
US10996981B2 (en) Processor zero overhead task scheduling
EP2495656B1 (en) Enhanced prioritising and unifying interrupt controller
JP7380406B2 (en) Real-time arithmetic processing unit
JP7338548B2 (en) Real-time processor
JP7331768B2 (en) Real-time processor
KR101838474B1 (en) Exception control in a multiprocessor system
JP7322797B2 (en) Real-time processor
JP3659048B2 (en) Operating system and computer
JP2010049700A (en) Task processing apparatus
JPH05224961A (en) Time waiting processing system for task
JP2001290664A (en) Multi-task control processor system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230725

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230911

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: 20231003

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231016

R151 Written notification of patent or utility model registration

Ref document number: 7380406

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151