JP7380406B2 - Real-time arithmetic processing unit - Google Patents
Real-time arithmetic processing unit Download PDFInfo
- 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
Links
- 238000012545 processing Methods 0.000 title claims description 108
- 230000007704 transition Effects 0.000 claims description 69
- 238000012546 transfer Methods 0.000 claims description 9
- 238000012544 monitoring process Methods 0.000 description 30
- 239000000725 suspension Substances 0.000 description 22
- 102100039292 Cbp/p300-interacting transactivator 1 Human genes 0.000 description 17
- 101000888413 Homo sapiens Cbp/p300-interacting transactivator 1 Proteins 0.000 description 17
- 125000004122 cyclic group Chemical group 0.000 description 10
- 238000000034 method Methods 0.000 description 10
- 101100396152 Arabidopsis thaliana IAA19 gene Proteins 0.000 description 8
- 101100274486 Mus musculus Cited2 gene Proteins 0.000 description 8
- 101150096622 Smr2 gene Proteins 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 238000001514 detection method Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000004913 activation Effects 0.000 description 5
- 238000012805 post-processing Methods 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 230000000052 comparative effect Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000004043 responsiveness Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
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
本開示の目的は、回路規模の増大を極力抑制しつつ演算イベント割込に迅速に対応できるようにしたリアルタイム演算処理装置を提供することにある。 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
演算処理部は、プログラムカウンタブロック(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.
以下、幾つかの実施形態について図面を参照しながら説明する。以下の説明では、各実施形態で説明した構成と同一又は類似機能を備えた構成について同一符号又は類似符号を付し、第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
リアルタイム演算処理装置1は、外部の上位のスケジューラ10から演算イベントを受領すると、演算命令テーブル5の中に予め設定された2項演算命令に従って浮動小数点演算処理を実行する。
When the real-time
メッセージリスト4は、演算イベントに係るタスクの識別符号(ID)であるタスクIDと、当該タスクIDと紐付けられた開始アドレス及び終了アドレスとをFPUOS3の外にリスト化して格納している(図2も参照)。FPUOS3が、タスクIDを指定すると(図1のタスクID指定S8)、指定したタスクIDに対応した開始アドレス及び終了アドレスをメッセージリスト4の選択結果S9として返す。
The
また図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
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
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
また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
次に、図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
メッセージトレイ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
トレイ格納メッセージ数は、メッセージトレイ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
As for the transfer method, each time the task ID and priority parameters are stored in the
メッセージキュー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
タスク中断フラグは、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
またタスクトレイ状態TTRAY_STは、WORKER6がタスクを実行していない状態を表す非実行状態、又は、WORKER6がタスクを実行中である状態を表す実行状態、の何れかを表す。
Further, the task tray state TTRAY_ST represents either a non-execution state representing a state in which the
具体的に、タスクトレイ状態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
またタスクトレイ状態TTRAY_STの書込みアクセス権は、FPUOS3及びWORKER6の双方に与えられており、タスクトレイ状態TTRAY_STはFPUOS3及びWORKER6の双方から書込可能・書換可能に設定されている。
The write access right for the task tray state TTRAY_ST is given to both the
ただし、タスクトレイ状態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
FPUOS3は、イベントドリブン型で処理を実行するオペレーティングシステム演算に係るハードウェアブロックであり、演算イベントを管理する外部の上位ブロックとなるスケジューラ10から演算イベントの発生をインターフェース12(図1参照)を経由して受付ける。
The
FPUOS3は、図2に示すメッセージトレイ23にタスクID、優先度、トレイ格納メッセージ数が書込まれることで演算イベントに係るタスクメッセージMSGを受領する。
The
OSステートマシン22は、電源投入後にパワーオンリセット21が解除された後、基本動作として下記の4つの状態をサイクリックに遷移するようにハードウェア構成されている。4つの状態は、Send message(以降、Sendと略す)状態、Peek message(以降、Peekと略す)状態、Dispatch message(以降、Dispと略す)状態、Post processing(以降、Postと略す)状態である。
The
以下、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
<Send status>
When the
<Peek状態>
OSステートマシン22は、メッセージトレイ23からメッセージキュー24への転送を終えると、Peek状態に遷移する。OSステートマシン22は、Peek状態において、起動有無を判定すると共に、メッセージキュー24の中から起動するべきタスクメッセージMSGを選択する。
<Peek state>
When the
OSステートマシン22は、Peek状態において、メッセージキュー24の中にタスクメッセージMSGが無いと判定すると、スルーしてタスクメッセージMSGの起動無しとする。
When the
逆に、タスクメッセージMSGがメッセージキュー24の中に格納されている場合、OSステートマシン22は、Peek状態において、メッセージキュー24の優先度のパラメータと、状態のパラメータと、メッセージキュー24のキュー番号と、に基づいて起動するべきタスクメッセージMSGを選択する。同一優先度であってもキュー番号が若い番号であるほど、タスクメッセージMSGは優先的に選択される。
Conversely, when the task message MSG is stored in the
優先度のパラメータは、低優先度又は高優先度を含む複数段階の優先度を示すパラメータを示す。本実施形態において、優先度は低優先度又は高優先度の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
通常、OSステートマシン22は、Ready状態となっているメッセージキュー24のタスクメッセージMSGを選択し、選択したメッセージキュー24の状態をReady状態からPeek状態に遷移させる。OSステートマシン22は、タスクIDを選択することで起動するべきタスクメッセージMSGを選択する。
Normally, the
<Disp状態>
OSステートマシン22は、起動するべきタスクメッセージMSGの選択を終えると、Disp状態に遷移し、Peek状態で選定されたタスクメッセージMSGをタスクトレイ25に転送し、WORKER6にタスクメッセージMSGを実行指令する。
<Disp status>
When the
FPUOS3は、Disp状態において、メッセージキュー24の中の状態のパラメータがPeek状態に該当しているタスクIDをメッセージリスト4の中で検索し、照合されたタスクIDに紐づけられた開始アドレス及び終了アドレスを決定する。
In the Disp state, the
そしてOSステートマシン22は、メッセージリスト4の中で決定された開始アドレス/終了アドレスを、インタフェース27を経由してタスクトレイ25の中の通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR/通常終了アドレスNTT_STP_ADDRにそれぞれ格納する。
Then, the
そしてOSステートマシン22は、メッセージキュー24の状態をPeek状態からRun状態に遷移させ、タスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」に遷移させる。WORKER6は、タスクトレイ状態TTRAY_STをポーリングすることでタスク実行指令S5を受領する。
The
<Post状態>
FPUOS3が、WORKER6へのタスク実行指令S5を終えると、OSステートマシン22は、Post状態に遷移する。FPUOS3は、Post状態において、後処理としてメッセージキュー24を整理整頓する。具体的に、FPUOS3は、メッセージキュー24にNothing状態となっているタスクメッセージMSGがある場合にはメッセージキュー24を空にする。
<Post status>
When the
他方、WORKER6が、演算タスクを実行中にはメッセージキュー24に格納されるタスクメッセージMSGがNothing状態になることはない。WORKER6が、演算タスクを実行中の場合には、OSステートマシン22は、Post状態を通過しSend状態に戻ってサイクリックに状態遷移する。
On the other hand, while the
WORKER6が、演算タスクを実行終了すると、WORKER6はタスクトレイ状態TTRAY_STを「通常タスク完了状態ST3」に遷移させる。OSステートマシン22は、Disp状態に遷移し、実行中のメッセージキュー24の状態をRun状態からNothing状態に遷移させる。OSステートマシン22は、Post状態に遷移する。OSステートマシン22は、Post状態にてNothing状態のメッセージキュー24がある場合、当該メッセージキュー24を空にする。
When the
<タスク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
しかし本実施形態では、OSステートマシン22が、取り扱うデータを開始アドレス/終了アドレスそのものにするのではなく、タスクIDを用いている。タスクIDは、1ビット又は2ビット程度で表現可能であり、少なくとも開始アドレス/終了アドレスのアドレス番地よりも少ない情報量で表現可能となっている。このため、メッセージトレイ23及びメッセージキュー24のハードウェア記憶部に必要な記憶容量を少なくでき、メッセージトレイ23及びメッセージキュー24の回路規模を抑制できる。
However, in this embodiment, the
<バンク切替インタフェース28を用いる技術的意義の説明>
前述の構成では、タスクIDは1ビット又は2ビット程度の例を挙げたが、仮にタスクIDの種類が多くなると、タスクIDの情報量が多くなり、この場合、メッセージトレイ23やメッセージキュー24のハードウェア回路規模の増加に繋がる虞がある。
<Explanation of the technical significance of using the
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
このような場合、図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
メッセージリスト4のバンク情報保持領域にはバンク切替情報が記憶される。バンク切替情報は例えば1ビット程度の少数の情報量によるもので、少数の情報によりタスクIDと開始アドレス/終了アドレスとの関係性を大きく変更できる。このため、外部からバンク切替えするためのバンク切替インタフェース28を設けることで、記憶すべきタスクIDの情報量を削減でき、この結果、メッセージトレイ23及びメッセージキュー24を構成するハードウェア回路を小規模化できる。
Bank switching information is stored in the bank information holding area of
<WORKER6の詳細説明>
図1に例示したように、WORKER6は、プログラムカウンタブロック31、演算命令デコーダ32、及びセレクタ33を備える。FPUOS3とWORKER6とは、ハードウェア上、独立してASIC内に構成されている。
<Detailed explanation of WORKER6>
As illustrated in FIG. 1, the
WORKER6は、FPUOS3から演算イベントに係るタスクメッセージMSGに紐付いたメッセージリスト4、演算命令テーブル5の開始アドレスと終了アドレス(通常開始アドレスNTT_STA_ADDR/通常終了アドレスNTT_STP_ADDR、又は、優先開始アドレスPTT_STA_ADDR/優先終了アドレスPTT_STP_ADDR)を受付けると、プログラムカウンタブロック31を直接的に制御する。FPUOS3とプログラムカウンタブロック31とのインタフェース構造は、その詳細を後述する。
The
WORKER6は、FPUOS3から演算タスクに係る実行指令を受付けると、演算タスクの実行指令に紐付いて予め設定されたメッセージリスト4の開始アドレスから終了アドレスに至るまで、演算命令デコーダ32により演算命令テーブル5の中の演算命令セットを参照する。
When the
WORKER6は、演算命令デコーダ32にて参照した演算命令セットを、FPU演算命令S17、引数選択S27~S28に分解し、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8、及び、FPU9に出力する。
The
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
FPU第2引数汎用レジスタ群8もまた、複数の引数を記憶可能なレジスタの集合と、レジスタの集合の後段に接続されるレジスタ選択セレクタと(何れも図示せず)により構成されている。レジスタ選択セレクタは、セレクタ33の出力S16も入力するように接続されている。
The FPU second argument general-
前記したセレクタ33は、外部メモリ11から外部データS13を入力可能に接続されている。演算命令デコーダ32は、外部アドレス信号S12により外部メモリ11のアドレスを指定することで、入力する外部データS13を指定できる。またセレクタ33は、FPU9による浮動小数点演算結果、FPU第1引数汎用レジスタ群7の記憶値、FPU第2引数汎用レジスタ群8の記憶値、を入力可能に接続されている。
The
演算命令デコーダ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
これにより、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-
演算命令デコーダ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
演算命令デコーダ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-
FPU9は、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8の出力引数を用いて、FPU演算命令S17により指定される四則演算や比較、型変換等の演算を行うことができ、これにより浮動小数点の演算処理を実行できる。FPU9は、浮動小数点の演算結果をFPU演算結果S14として出力する。FPU9は、多種多様な入力データを引数として浮動小数点の演算タスクを実行できる。
The
WORKER6は、演算毎にプログラムカウンタブロック31のプログラムカウンタ41(図4参照)を更新しつつ、2項演算処理を順次実行し、終了アドレスまで到達すると、WORKER6は、FPUOS3にタスク完了通知を出力することで、一連の浮動小数点演算タスクを完了させることができる。
The
<<プログラムカウンタブロック31の構成及び基本動作>>
以下、プログラムカウンタブロック31の構成及び基本動作について、図4を参照しながら説明する。プログラムカウンタブロック31は、プログラムカウンタ41、一致比較部42、遷移検出部43、中断判定部44、開始アドレスセレクタ45、及び、終了アドレスセレクタ46を備える。
<<Configuration and basic operation of
The configuration and basic operation of the
開始アドレスセレクタ45は、タスクトレイ状態TTRAY_STに記憶された状態に基づいて、通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR、又は、優先タスクトレイPTASK_TRAYの優先開始アドレスPTT_STA_ADDRの何れかを選択し、プログラムカウンタ41に何れかの開始アドレスを出力する。
The
終了アドレスセレクタ46は、タスクトレイ状態TTRAY_STに記憶された状態に基づいて、通常タスクトレイNTASK_TRAYの通常終了アドレスNTT_STP_ADDR又は優先タスクトレイPTASK_TRAYの優先終了アドレスPTT_STP_ADDRの何れかを選択し、一致比較部42に何れかの終了アドレスを出力する。
The
遷移検出部43は、タスクトレイ状態TTRAY_STが「通常タスク空状態ST1」から「通常タスク実行状態ST2」へ遷移したこと、「通常タスク中断状態ST4」から「優先タスク実行状態ST5」へ遷移したことを検出し、これらのタイミングでロード指令S33をプログラムカウンタ41に出力する。
The
プログラムカウンタ41は、ロード指令S33を入力することで開始アドレスセレクタ45を通じて開始アドレスをロードし、当該開始アドレスから順にカウント開始し、一致比較部42にカウントしたアドレスカウンタ値を出力すると共に、演算命令テーブル5にカウントしたアドレスカウンタ値を演算命令テーブルアドレスS10として出力する。これにより、演算命令デコーダ32は、演算命令テーブルアドレスS10に対応した演算命令セット選択結果S11を参照し、当該演算命令をデコードできる。
The program counter 41 loads a start address through the
他方、一致比較部42は、プログラムカウンタ41のアドレスカウンタ値が終了アドレスセレクタ46により選択された終了アドレスと一致しているか否かを判定し、終了アドレス一致信号S32を出力したときにタスクトレイ状態TTRAY_STの状態を遷移させる。
On the other hand, the
このとき、図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
また中断判定部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
そして中断判定部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
遷移検出部43は、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」から「通常タスク実行状態ST2」へ遷移する時に再開ロード信号S30をトリガ出力する。遷移検出部43は、この再開ロード信号S30のトリガ出力にて中断時に通常開始アドレスNTT_STA_ADDRを格納する格納領域に退避した中断アドレスをプログラムカウンタ41に再ロードさせる。
The
すると、演算命令デコーダ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
次に、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
以下、この処理動作に係る詳細説明を行う。図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
図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ステートマシン22は、タイミングt2においてメッセージキューMQ1の状態をReadyから次ステートのPeek状態に遷移させ、起動タスクを決定する。OSステートマシン22は、Peek状態においてメッセージキュー24の中から起動するべきタスクメッセージMSG1を選択する。ここでは、タスクメッセージMSG1を選択したものとして説明する。OSステートマシン22は、タイミングt3においてDisp状態に遷移し、Peek状態で選択された起動待機中のタスクメッセージMSG1を起動する。
The
OSステートマシン22は、タイミングt4において、メッセージキューMQ1に係るタスクメッセージMSG1の状態をPeek状態からRun状態に遷移させると共に、タスクメッセージMSG1に紐づいたタスクIDの演算命令テーブル5の開始アドレス及び終了アドレスをメッセージリスト4の中で検索する。
At timing t4, the
そしてOSステートマシン22は、開始アドレス及び終了アドレスをインタフェース27を経由して読み出し、FPUOS3のタスクトレイ25の中の通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR及び通常終了アドレスNTT_STP_ADDRに格納し、タスクトレイ状態TTRAY_STを「通常タスク空状態ST1」から「通常タスク実行状態ST2」に遷移させる。
Then, the
WORKER6の側では、タスクトレイ状態TTRAY_STが「通常タスク空状態ST1」から「通常タスク実行状態ST2」へ遷移することをもって、通常開始アドレスNTT_STA_ADDRから通常終了アドレスNTT_STP_ADDRにかけた演算内容を演算命令テーブル5から読出しながら、FPU9、FPU第1引数汎用レジスタ群7、及び、FPU第2引数汎用レジスタ群8を用いて浮動小数点の2項演算を順次処理する。
On the
WORKER6が高優先度の演算タスクを実行中に、タイミングt5にて低優先度の演算イベントが発生すると、FPUOS3の中のメッセージトレイ23の第1トレイNo1に低優先度のタスクメッセージMSG2を格納させる。ここでは、低優先度のタスクメッセージMSGをタスクメッセージMSG2としている。
When a low-priority calculation event occurs at timing t5 while the
その後、OSステートマシン22がSend状態にされたとしても、メッセージキューMQ1が空状態ではない。このため、OSステートマシン22は、タイミングt6においてタスクメッセージMSG2をメッセージキューMQ2に転送すると共に、メッセージトレイ23の第1トレイNo1を空状態にクリーニングする。続いて、OSステートマシン22がPeek状態になると、起動タスクを選択しようとするが、すでに高優先度演算タスクが実行されている状態であるため、Peek状態では何もせずDisp状態に移行する。
After that, even if the
このとき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
WORKER6の側で特に最優先となる高優先度の演算タスクを実行しているときには、FPUOS3が低優先度の演算タスクをWORKER6に対して実行指令に移さないようにしているため、WORKER6は当該高優先度の演算タスクを中断することなく、当該演算タスクを最速処理できる。
When the
続いて、他の実行例を挙げて、FPUOS3による処理オーバーヘッド時間抑制効果を説明する。以下では、図6に例示したように、最優先よりも低い低優先度(第3優先度相当)の演算タスクを実行中に、この演算タスクよりも高優先度(第4優先度相当)の演算イベントが発生した時の挙動を例に挙げて動作概要を説明する。
Next, the effect of suppressing processing overhead time by the
WORKER6が、未処理状態にて待機している最中に、スケジューラ10から低優先度の演算イベントが発行されると、低優先度の演算イベントにて実行したいタスクのタスクIDと優先度がメッセージトレイ23に格納される。
When the
図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
OSステートマシン22は、タイミングt12においてメッセージキューMQ1の状態をReadyから次ステートのPeek状態に遷移させ、起動タスクを決定する。OSステートマシン22は、Peek状態においてメッセージキュー24の中から起動タスクを選択する。OSステートマシン22は、タイミングt13においてDisp状態に遷移し、Peek状態で選択された起動待機中のタスクを起動する。
The
OSステートマシン22は、タイミングt14においてメッセージキューMQ1のタスクメッセージMSG1の状態をPeek状態からRun状態に遷移させると共に、メッセージキューMQ1のタスクIDに紐づいた演算命令テーブル5の開始アドレス及び終了アドレスを検索する。
The
そしてOSステートマシン22は、開始アドレス及び終了アドレスをインターフェース27を経由して読み出し、FPUOS3のタスクトレイ25の通常タスクトレイNTASK_TRAYの通常開始アドレスNTT_STA_ADDR及び通常終了アドレスNTT_STP_ADDRに格納し、タスクトレイ状態TTRAY_STを「通常タスク空状態ST1」から「通常タスク実行状態ST2」に遷移させる。
Then, the
WORKER6の側では、タスクトレイ状態TTRAY_STが「通常タスク空状態ST1」から「通常タスク実行状態ST2」へ遷移することをもって、通常開始アドレスNTT_STA_ADDRから通常終了アドレスNTT_STP_ADDRにかけた演算内容を演算命令テーブル5から読出しながら、FPU9、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8を用いて浮動小数点の2項演算を順次処理する。
On the
<プログラムカウンタブロック31の動作概要>
OSステートマシン22がDisp状態とされている時、図4に示すプログラムカウンタブロック31は、遷移検出部43によるロード指令S33の出力のタイミングにおいて通常開始アドレスNTT_STA_ADDRをプログラムカウンタ41にロードする。
<Outline of operation of
When the
このロードしたタイミングにおいて、タスクトレイ状態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
演算命令デコーダ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
<低優先度の演算イベントを実行中に高優先度の演算イベントを発行>
他方、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
このとき、外部のスケジューラ10がメッセージトレイ23の第1トレイNo1に高優先度のタスクメッセージMSG2を格納させる。その後、OSステートマシン22はSend状態になると、メッセージキューMQ1が空状態ではないため、タイミングt16においてタスクメッセージMSG2をメッセージキューMQ2に転送すると共に、メッセージトレイ23を空状態にクリーニングする。
At this time, the
続いて、OSステートマシン22がPeek状態になると、起動するタスクメッセージMSGを選択しようとするが、WORKER6が低優先度のタスクメッセージMSG1を実行中の状態であるため、メッセージキューMQ2はReady状態をキープし、FPUOS3は、OSステートマシン22の状態がPeek状態のときにタスク中断フラグをセットする。
Subsequently, when the
FPUOS3は、タスク中断フラグをセットすることで、WORKER6に実行中の低優先度のタスクメッセージMSG1の中断指令を行い、低優先度のタスクメッセージMSG1の中断ハンドシェークを行う。サイクリックに遷移していたOSステートマシン22は、中断ハンドシェーク期間t17~t18においてDisp状態に保持される。
By setting the task suspension flag, the
<WORKER6による演算実行>
FPUOS3がタスク中断フラグをセットするタイミングt17以降、WORKER6がタスク中断フラグを認識する。WORKER6は、演算命令テーブル5を参照して演算命令セット選択結果S11を確認する。そして、WORKER6は、タイミングt18において演算命令を一時中断可能な区切りのよいタイミングで中断アドレスを判断し、処理中断を完了させると共に、判断した中断アドレスを退避させる。このとき、WORKER6は、中断アドレスをタスクトレイ25の通常開始アドレスNTT_STA_ADDRの格納領域に退避させる。
<Calculation execution using WORKER6>
After timing t17 when the
また中断判定部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
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ステートマシン22がサイクリック状態遷移を再開し、Peek状態まで遷移すると、FPUOS3は、タイミングt19においてタスク中断フラグをクリアする。
Thereafter, when the
またOSステートマシン22は、高優先度のタスクメッセージMSG2が格納されているメッセージキューMQ2の状態をReady状態からPeek状態に遷移させ、タスク起動待ち状態にした後、Disp状態に遷移させる。
Further, the
通常、OSステートマシン22は、Disp状態においてタスクトレイ25に、メッセージリスト4の開始アドレス及び終了アドレスを格納する。しかし、現状態では、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」であるため、通常タスクトレイNTASK_TRAYに中断アドレスを残留したまま保持しておく。
Normally, the
FPUOS3は、メッセージキュー24のPeek状態に紐付いたタスクIDの演算命令テーブル5の開始アドレス/終了アドレスを、メッセージリスト4の中で検索し、検索された開始アドレス/終了アドレスをインターフェース27を経由して読み出す。
The
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
<WORKER6によるタスク実行>
WORKER6の側では、タスクトレイ状態TTRAY_STが「優先タスク実行状態ST5」に遷移すると、開始アドレスセレクタ45が優先開始アドレスPTT_STA_ADDRを選択すると共に、終了アドレスセレクタ46が優先終了アドレスPTT_STP_ADDRを選択する。
<Task execution using WORKER6>
On the
遷移検出部43は、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」から「優先タスク実行状態ST5」へ遷移する時にロード指令S33を出力する機能を有しており、このロード指令S33のトリガ出力により優先開始アドレスPTT_STA_ADDRをプログラムカウンタ41にロードする。
The
このロード時点では、タスクトレイ状態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
従って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
高優先度演算タスクが、優先終了アドレス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
図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
他方、OSステートマシン22は、少なくともWORKER6が高優先度演算タスクを実行中にDisp状態に留まっている。このため、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」に遷移したことを確認することで、WORKER6が高優先度演算タスクを実行終了したことを即時把握できる。
On the other hand, the
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
FPUOS3は、メッセージキューMQ2をRun状態からNothing状態に遷移させる機能を、OSステートマシン22の任意の固定状態、ここではDisp状態に限定している。
The
なお仮に、OSステートマシン22がDisp状態にて待機することなくサイクリック遷移を継続し、Disp状態以外のタイミングでWORKER6がタスク処理を完了すると、次回のDisp状態までサイクリック遷移を待機する必要があり、リアルタイム応答性に劣ることになる。
Furthermore, if the
本実施形態では、OSステートマシン22は、WORKER6が高優先度演算タスクを実行している最中に、Disp状態に留まっているため、FPUOS3は、WORKER6による高優先度演算タスク処理を終了したタイミングt21にてこの状態遷移を受付けることができ、即時対応できる。
In this embodiment, since the
このように、WORKER6が高優先度演算タスクを実行中には、OSステートマシン22の状態をDisp状態に保持しているため、WORKER6が高優先度演算タスクを実行完了したときに、OSステートマシン22はWORKER6が実行完了したことを即時認識できる。この結果、OSステートマシン22は即時対応でき、タスク完了オーバーヘッド時間の増加を抑制できる。
In this way, while the
その後、OSステートマシン22が、サイクリック遷移を再開して再度Peek状態まで遷移すると、タイミングt23において、OSステートマシン22は、中断していたメッセージキューMQ1の状態をWait状態からPeek状態に遷移させることで、タスク起動待ち状態にした後、OSステートマシン22のサイクリック遷移をDisp状態に遷移させる。OSステートマシン22は、タイミングt23のDisp状態においてメッセージキューMQ1の状態をPeek状態からRun状態に遷移させる。
Thereafter, when the
通常、OSステートマシン22が、Disp状態に遷移すると、通常タスクトレイNTASK_TRAYにメッセージリスト4から開始アドレス及び終了アドレスを格納するが、タイミングt23においては、タスクトレイ状態TTRAY_STが「通常タスク中断状態ST4」であり、タスクトレイ25の通常開始アドレスNTT_STA_ADDRには中断アドレスが記憶されている。
Normally, when the
このためOSステートマシン22は、メッセージリスト4におけるアドレス検索処理をスキップし、タスクトレイ状態TTRAY_STを「通常タスク中断状態ST4」から「通常タスク実行状態ST2」に遷移させ、OSステートマシン22がサイクリック遷移を再開する。
Therefore, the
タスクトレイ25のタスクトレイ状態TTRAY_STが、「通常タスク中断状態ST4」から「通常タスク実行状態ST2」へ遷移すると、WORKER6の側では、遷移検出部43が「通常タスク中断状態ST4」から「通常タスク実行状態ST2」への遷移を検出し、このタイミングにて再開ロード信号S30を出力する。
When the task tray state TTRAY_ST of the
再開ロード信号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
一方、終了アドレスセレクタ46も、通常終了アドレスNTT_STP_ADDRの側を選択しているため、演算命令デコーダ32が、プログラムカウンタ41の指示する演算命令テーブル5を読み取り、通常終了アドレスNTT_STP_ADDRまで順次実行する。
On the other hand, since the
一致比較部42は、プログラムカウンタ41の示すアドレス値が通常終了アドレスNTT_STP_ADDRに一致したと判定すると、タスクトレイ状態TTRAY_STを「通常タスク実行状態ST2」から「通常タスク完了状態ST3」に遷移させる。これにより、低優先度演算タスク処理を再開、完了できる。
When the
WORKER6は、タイミングt24以降において、中断アドレスから通常終了アドレスNTT_STP_ADDRまでの実行アドレスに従った演算内容を演算命令テーブル5から読出し、FPU9、FPU第1引数汎用レジスタ群7、FPU第2引数汎用レジスタ群8を用いて、浮動小数点の2項演算を順次処理できる。
After timing t24, the
WORKER6が高優先度の演算タスクを実行中には、OSステートマシン22をDisp状態に保持しているため、WORKER6が高優先度演算タスクを実行完了したときに、OSステートマシン22はWORKER6が実行完了したことを即時認識できる。この結果、OSステートマシン22は即時対応でき、タスク完了オーバーヘッド時間の増加を抑制できる。
While the
<比較例>
現在、一般化されているマルチタスク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
In addition, when the
In addition, in this embodiment, during the interrupted handshake period t17 to t18 between the
また本実施形態において、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
(第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
そこで図8に示すように、動作監視用のウォッチドッグタイマ2としては、FPUOS3の動作を監視するためのFPUOS監視ウォッチドッグタイマ2a(オペレーティングシステム処理監視WDT相当)、及び、WORKER6の動作を監視するためのWORKER監視ウォッチドッグタイマ2b(演算処理監視WDT相当)を独立に設け、FPUOS3及びWORKER6をそれぞれ監視するように構成することが望ましい。これにより、FPUOS3のハードウェア構成、WORKER6のハードウェア構成のそれぞれの動作を独立して監視できる。
Therefore, as shown in FIG. 8, the
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ステートマシン22がデッドロックし、FPUOS監視WDT2aのカウント値がFPUOS監視WDT閾値を超えると、FPUOS監視WDT2aはWDTエラーを外部に出力する。
When the
他方、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
図9には、WORKER6が通常の演算タスクを実行中であることを示す「通常タスク実行状態ST2」から、WORKER6が演算タスクを正常終了するケースを実線により示している。また、「通常タスク実行状態ST2」から、WORKER6が演算タスクを異常終了するケースを破線により示している。
In FIG. 9, a solid line indicates a case where the
図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
しかし、「通常タスク実行状態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
なお、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監視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
本実施形態によれば、ウォッチドッグタイマ2が、FPUOS3、WORKER6を監視する機能を備えているため、FPUOS3もWORKER6もそれぞれ独立して監視できる。FPUOS3の動作を監視できると共に、WORKER6のデッドロック及び暴走を監視でき異常を検知できる。
According to this embodiment, the
(他の実施形態)
前述実施形態に限定されるものではなく、例えば、以下に示す変形又は拡張が可能である。
浮動小数点の演算は、単精度、倍精度等に限定されるものではない。また、浮動小数点演算処理を例示して演算処理する形態を説明したが、これに限定されるものではなく、例えば固定小数点演算処理に適用しても良い。
(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)の実行指令に従って演算処理を実行することに特化した演算処理部(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)及び前記演算処理部(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.
前記オペレーティングシステム処理部が前記第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.
前記オペレーティングシステム処理部が前記第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.
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)
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 |
-
2020
- 2020-04-28 JP JP2020079203A patent/JP7380406B2/en active Active
Patent Citations (1)
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 |