JP2011108140A - Data processor - Google Patents
Data processor Download PDFInfo
- Publication number
- JP2011108140A JP2011108140A JP2009264685A JP2009264685A JP2011108140A JP 2011108140 A JP2011108140 A JP 2011108140A JP 2009264685 A JP2009264685 A JP 2009264685A JP 2009264685 A JP2009264685 A JP 2009264685A JP 2011108140 A JP2011108140 A JP 2011108140A
- Authority
- JP
- Japan
- Prior art keywords
- time
- data processing
- processing
- unit
- task
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、データを汎用的に処理するデータ処理装置に係り、特にハードウェアとプロセッサー上で動作するソフトウェアとが共同してデータを処理するデータ処理装置に関する。 The present invention relates to a data processing apparatus that processes data for general purposes, and more particularly, to a data processing apparatus in which hardware and software operating on a processor jointly process data.
現在、特定の処理を実行するハードウェア装置を、プロセッサー等の制御装置によって制御する構成のデータ処理装置が広く使用されている。このようなデータ処理装置では、1つのプロセッサーが複数のタスクを優先順位にしたがって実行し、この過程において、タスクにおける比較的負荷が大きいデータ処理をハードウェアに依頼する。
ハードウェアに処理を依頼した場合、このプロセッサーは、このデータ処理に係るタスクを中断して次に実行すべきタスクを実行する。ハードウェアは依頼された処理が終了すると、処理の終了をプロセッサーに通知する。このとき、プロセッサーは、プロセッサーで実行中の処理に係るタスクがハードウェアに依頼した処理に係るタスクよりも優先度が低い場合、プロセッサーで実行中のタスクの処理を中断する。そして、ハードウェアに依頼した処理に係るタスクを必要に応じて引き続き実行する。
Currently, a data processing device having a configuration in which a hardware device that executes a specific process is controlled by a control device such as a processor is widely used. In such a data processing apparatus, a single processor executes a plurality of tasks according to priority, and in this process, requests hardware to process data with a relatively large load on the task.
When processing is requested to the hardware, the processor interrupts the task relating to the data processing and executes the task to be executed next. When the requested process ends, the hardware notifies the processor of the end of the process. At this time, when the task related to the process being executed by the processor has a lower priority than the task related to the process requested by the hardware, the processor interrupts the process of the task being executed by the processor. Then, the task related to the processing requested to the hardware is continuously executed as necessary.
以上のプロセッサー及びハードウェアの動作において、例えば、特許文献1では、ハードウェアからプロセッサーに対して行われる処理終了の通知方法において、ハードウェアにおける処理の進捗を管理し、ハードウェアにおける処理が実際に終了するタイミングよりも早いタイミングで、ハードウェアからプロセッサーに対して処理終了の通知を行うことで、プロセッサーにおける処理効率を高める提案がなされている。
In the above processor and hardware operations, for example, in
特許文献1では、ハードウェアにおける処理が一定時間で終了することが保証されているため、処理の進捗を管理し、ハードウェアにおける処理が実際に終了するタイミングよりも早いタイミングで、ハードウェアからプロセッサーに対して処理終了の通知を行うことができる。
しかしながら、処理が一定時間で終了することが保証されていない場合には、ハードウェアにおける処理が実際に終了するタイミングよりも早いタイミングで、ハードウェアからプロセッサーに対して処理終了の通知を行うことができないことがある。そのため、プロセッサーにおける処理効率を高めることができないという課題がある。
In
However, if it is not guaranteed that the process will end in a certain time, the hardware may notify the processor of the end of the process at a timing earlier than the timing at which the process in the hardware actually ends. There are things that cannot be done. Therefore, there is a problem that the processing efficiency in the processor cannot be increased.
本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の形態または適用例として実現することが可能である。 SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following forms or application examples.
[適用例1]複数のタスクを、当該タスクの優先順位に従って順次実行するタスク実行制御部と、前記タスク実行制御部から指示されたデータ処理を実行するデータ処理実行部と、を備え、前記データ処理実行部は、前記データ処理実行部におけるデータ処理が開始されてから終了するまでの実測処理時間を計測する処理時間計測部と、前記実測処理時間を記憶する実測処理時間記憶部と、前記実測処理時間記憶部に記憶された前記実測処理時間に基づいて、前記データ処理実行部で実行しようとするデータ処理の予測処理時間を算出する予測処理時間算出部と、前記予測処理時間に基づいて予測されたデータ処理の終了時点で、前記タスク実行制御部に予測終了タイミングを通知する予測終了タイミング通知部と、を備え、前記タスク実行制御部は、前記予測終了タイミングの通知を受けてタスクの実行順序を設定するタスク実行順序設定部と、を備えたことを特徴とするデータ処理装置。 Application Example 1 A task execution control unit that sequentially executes a plurality of tasks in accordance with the priority order of the tasks, and a data processing execution unit that executes data processing instructed by the task execution control unit, the data The process execution unit includes a process time measurement unit that measures an actual measurement process time from the start of data processing in the data process execution unit to an end, an actual measurement process time storage unit that stores the actual measurement process time, and the actual measurement Based on the measured processing time stored in the processing time storage unit, a predicted processing time calculation unit that calculates a predicted processing time of a data process to be executed by the data processing execution unit, and a prediction based on the predicted processing time A prediction end timing notifying unit for notifying the task execution control unit of a prediction end timing at the end of the processed data processing. Control unit, the data processing apparatus being characterized in that and a task execution order setting unit that sets the execution order of tasks notified of the predicted end time.
この構成によれば、データ処理実行部は、データ処理実行部におけるデータ処理が開始されてから終了するまでの実測処理時間を計測する処理時間計測部と、実測処理時間を記憶する実測処理時間記憶部と、実測処理時間記憶部に記憶された実測処理時間に基づいて、データ処理実行部で実行しようとするデータ処理の予測処理時間を算出する予測処理時間算出部と、を備える。これにより、データ実行処理部におけるデータ処理が一定時間で終了することが保証されていない場合であっても、予測処理時間に基づいてデータ処理の終了時点を予測する。そして、予測処理時間に基づいて予測されたデータ処理の終了時点で、タスク実行制御部に予測終了タイミングを通知する予測終了タイミング通知部を備える。そのため、データ実行処理部におけるデータ処理が一定時間で終了することが保証されていない場合であっても、データ処理実行部におけるデータ処理が実際に終了する前に、データ処理実行部からタスク実行制御部に対して予測終了タイミングを通知する機会を増すことができる。 According to this configuration, the data processing execution unit includes a processing time measurement unit that measures the actual measurement processing time from the start of data processing in the data processing execution unit to the end, and an actual measurement processing time storage that stores the actual measurement processing time. And a predicted processing time calculation unit that calculates a predicted processing time of data processing to be executed by the data processing execution unit based on the actual processing time stored in the actual processing time storage unit. As a result, even when data processing in the data execution processing unit is not guaranteed to end in a certain time, the end point of the data processing is predicted based on the prediction processing time. And the prediction end timing notification part which notifies a prediction end timing to a task execution control part at the time of completion | finish of the data process estimated based on prediction process time is provided. Therefore, even if the data processing in the data execution processing unit is not guaranteed to finish in a certain time, the task execution control from the data processing execution unit before the data processing in the data processing execution unit actually ends. The opportunity to notify the prediction end timing to the part can be increased.
また、タスク実行制御部は、予測終了タイミングの通知を受けてタスクの実行順序を設定するタスク実行順序設定部を備える。これにより、タスク実行制御部は、データ処理実行部におけるデータ処理が実際に終了する前に、データ処理実行部から予測終了タイミングの通知を受けると、タスク実行制御部がデータ処理実行部にデータ処理を依頼したタスクを再び実行する準備を行う。 In addition, the task execution control unit includes a task execution order setting unit that receives the notification of the prediction end timing and sets the task execution order. Thus, when the task execution control unit receives a notification of the prediction end timing from the data processing execution unit before the data processing in the data processing execution unit actually ends, the task execution control unit sends the data processing execution unit to the data processing execution unit. Prepare to execute the requested task again.
このため、データ処理実行部で実際にデータ処理が終了した後、直ちに、タスク実行制御部がデータ処理実行部にデータ処理を依頼したタスクの実行を再開できるので、タスク実行再開までの時間を短縮することができる。従って、タスク実行制御部における処理効率を高めることができる。 For this reason, the task execution control unit can resume the execution of the task requested to the data processing execution unit immediately after the data processing actually ends in the data processing execution unit, thereby shortening the time until the task execution restarts can do. Therefore, the processing efficiency in the task execution control unit can be increased.
[適用例2]前記予測処理時間算出部は、前記実測処理時間記憶部に記憶された前記実測処理時間を統計処理することによって、前記予測処理時間を算出することを特徴とする上記データ処理装置。 [Application Example 2] The data processing device, wherein the prediction processing time calculation unit calculates the prediction processing time by statistically processing the actual measurement processing time stored in the actual measurement processing time storage unit .
この構成によれば、統計処理を用いることで、実測処理時間記憶部に記憶された実測処理時間の集団における分布の傾向を分析できる。このため、分布の傾向が反映された予測終了時間に基づいて、データ処理が終了する時点を予測することができる。 According to this configuration, by using the statistical processing, it is possible to analyze the tendency of the distribution in the group of the actual measurement processing time stored in the actual measurement processing time storage unit. For this reason, it is possible to predict the time point at which the data processing ends based on the predicted end time reflecting the distribution trend.
[適用例3]前記予測終了タイミング通知部は、前記予測処理時間に補正を加えた前記予測終了タイミングを通知することを特徴とする上記データ処理装置。 Application Example 3 The data processing apparatus, wherein the prediction end timing notification unit notifies the prediction end timing obtained by correcting the prediction processing time.
この構成によれば、データ実行処理部におけるデータ処理が一定時間で終了することが保証されていない場合であっても、データ処理実行部におけるデータ処理が実際に終了する前に、データ処理実行部からタスク実行制御部に対して予測終了タイミングを通知する機会を増すことができる。また、予測処理時間と実際にデータ処理が終了した時間との差が小さい場合を増加させることができる。これにより、データ処理実行部でのデータ処理が終了するまでの間にタスク実行制御部において実行中であったタスクの実行時間を長くすることができる。これにより、タスク実行制御部の処理効率を上げることができる。 According to this configuration, even if the data processing in the data processing unit is not guaranteed to end in a certain time, the data processing unit before the data processing in the data processing unit actually ends Therefore, the opportunity for notifying the task execution control unit of the predicted end timing can be increased. Further, it is possible to increase the case where the difference between the predicted processing time and the time when the data processing is actually finished is small. Thereby, it is possible to lengthen the execution time of the task being executed in the task execution control unit until the data processing in the data processing execution unit is completed. Thereby, the processing efficiency of a task execution control part can be raised.
(第1実施形態)
以下、第1実施形態について図面を参照しつつ説明する。図1は、本実施形態のデータ処理装置100の構成を説明するための図である。本実施形態のデータ処理装置100は、複数のタスクをタスクの優先順位にしたがって順次実行するタスク実行制御部としてのCPU(Central Processing Unit)101と、CPU101の指示によってデータを処理するデータ処理実行部としてのハードウェア(HW)アクセラレーター104と、を備えるデータ処理装置である。メモリー102は、CPU101とHWアクセラレーター104と共にバス接続されており、CPU101のタスクの実行に使用される命令や命令の実行に使用されるテーブルやデータ等を保存する。
(First embodiment)
The first embodiment will be described below with reference to the drawings. FIG. 1 is a diagram for explaining the configuration of the
なお、本実施形態は、図1に示したように、HWアクセラレーター104を一つ備えるものに限定されるものではなく、複数のHWアクセラレーター104を備えるものであってもよい。このような場合、一つのCPUが複数のHWアクセラレーター104を制御するものであってもよいし、複数のCPUがあってもよい。
In addition, as shown in FIG. 1, this embodiment is not limited to the one provided with one
メモリー102は、CPU101が複数のタスクを適正に順次実行するためのタスク管理テーブル103を備えている。図2は、タスク管理テーブル103の一例である。
The
タスク管理テーブル103は、タスクを管理するためのタスク管理テーブルである。タスク管理テーブル103は、各タスクのタスク名(TASK ID)と、各タスクの進行状況を示すプログラムカウンター(PC)、タスク実行時のプロセッサーの状態や条件等を記録するプロセッサーステートレジスター(PSR)、スタックの位置を示すスタックポインター(SP)、タスクの実行状態を示すスティト(State)、優先順位(priority)、実行中のタスクの処理内容(register file)、HWアクセラレーターが複数ある場合の使用されているHWアクセラレーター、または唯一のHWアクセラレーターの使用、不使用の内容(HW)などを管理する。 The task management table 103 is a task management table for managing tasks. The task management table 103 includes a task name (TASK ID) of each task, a program counter (PC) indicating the progress of each task, a processor state register (PSR) that records a processor state and conditions at the time of task execution, Used when there are multiple stack pointers (SP) indicating the position of the stack, a state (State) indicating the execution state of the task, a priority (priority), processing contents of the task being executed (register file), and multiple HW accelerators The HW accelerator that is used, or the use of the only HW accelerator, content not used (HW), etc. are managed.
CPU101は、タスク管理テーブル103を用い、複数のタスクの実行順序を設定する。実行順序は、実行可能なタスクをより早期に実行されるものから一列に列記して表される。
The
このようなCPU101とタスク管理テーブル103とは、本実施形態の実行順序設定部として機能し、タスクの優先順位に基づいて次に処理すべきタスクを設定する。
The
HWアクセラレーター104は、タスクの実行にあたって比較的負荷の大きな処理を行うための装置である。このため、HWアクセラレーター104は、制御部105によって制御されてデータ処理を行う演算部111を備える。
The
制御部105は、処理時間計測部106、実測処理時間記憶部107、予測処理時間算出部108、予測終了タイミング通知部109、ステータス信号生成部110を備える。
The
処理時間計測部106は、演算部111によってデータ処理に要した時間を実測処理時間として計測する。処理時間計測部106は、カウンターから成り、演算部111におけるデータ処理に要したクロックサイクル数を計測し、実測処理時間として計測する。尚、計測の対象としては本実施形態のようなクロックサイクル数に限定されるものではなく、例えば実時間値であってもよい。また処理時間計測部106は、ステートマシンから成っていてもよく、例えば処理終了状態が複数存在する場合、各々の状態を示す値を計測値としてもよい。
The processing
実測処理時間記憶部107は、処理時間計測部106で計測された実測処理時間としてのクロックサイクル数を記憶するための記憶領域である。処理時間計測部106は、計測したクロックサイクル数を実測処理時間記憶部107に記憶させる。
The actual measurement processing
予測処理時間算出部108は、実測処理時間記憶部107に記憶されたクロックサイクル数をサンプルとして、予測処理時間を算出する。
The prediction processing time calculation unit 108 calculates the prediction processing time using the number of clock cycles stored in the actual measurement processing
予測終了タイミング通知部109は、予測処理時間算出部108で算出された予測処理時間に基づいて予測された終了時点に、矢印Aに示すように、予測終了タイミングをCPU101に対して通知する。
The prediction end timing notification unit 109 notifies the
HWアクセラレーター104は、ステータス信号生成部110及びステータスレジスター112を備えている。ステータス信号生成部110は、演算部111の処理が終了したか否かを示すフラグ信号(done_flag)を生成する。このフラグ信号は、本実施形態の電子データの処理の進捗状況を示す進捗情報(HWステータス)である。フラグ信号が「0」であるとき、演算部111によるデータ処理が実行されていることを示し、フラグ信号が「1」であるとき、演算部111によるデータ処理が終了していることを示している。
The
図3は、CPU101によって参照されるメモリーマップの一例を示した図である。図1のCPU101は、ステータスレジスター112に記録されたHWステータスを、メモリーマップ上の対応するアドレスを参照することで認識できる。対応するアドレスにはデータ処理の終了を示すフラグが書き込まれている。本実施形態ではメモリーマップのうちHWステータスが書き込まれるアドレスの範囲を予め設定しておく。CPU101は、割込み処理の後、メモリーマップの設定された範囲のアドレスに書き込まれたデータを、矢印Bに示すポーリング等によって参照し、フラグ信号を認識する。
FIG. 3 is a diagram illustrating an example of a memory map referred to by the
次に、本実施形態における予測処理時間算出部108が、実測処理時間を統計処理することによって予測処理時間を算出する方法について説明する。 Next, a method in which the predicted processing time calculation unit 108 according to the present embodiment calculates the predicted processing time by statistically processing the actually measured processing time will be described.
図4は、演算部111によって、過去にデータ処理されときのクロックサイクル数の実測値と予測値及びそれらの差を記載した一例としての表である。演算部111における1回目から5回目までの予測値は、初期値として70を設定する。演算部111における6回目から20回目までの予測値は、直近の過去5回分の実測値に基づいて算出された移動平均値が記載されている。 FIG. 4 is a table as an example in which the measured value and the predicted value of the number of clock cycles when the data is processed in the past by the calculation unit 111 and the difference between them are described. The prediction value from the first time to the fifth time in the calculation unit 111 is set to 70 as an initial value. The predicted values from the sixth time to the 20th time in the calculation unit 111 are described as moving average values calculated based on the latest measured values for the last five times.
実測処理時間記憶部107には、計測値5個分の記憶領域が備えられ、直近の過去5回分の実測値が記憶されている。予測処理時間算出部108は、実測処理時間記憶部107の記憶領域に記憶されている5回分の実測値に基づいて移動平均値を取り、その値を予測値(予測処理時間)として算出する。
The actual measurement processing
予測終了タイミング通知部109は、予測処理時間算出部108によって算出された予測値を任意に設定される補正値によって補正し、現在、演算部111で実行している処理の予測終了タイミング(予測終了時点)を設定する。本実施形態では、CPU101がタスクの切り替えに要する固定サイクル数を補正値とし、移動平均値から算出された予測値から補正値を差し引いた値を予測終了タイミングとして設定する。
The prediction end timing notification unit 109 corrects the prediction value calculated by the prediction processing time calculation unit 108 with a correction value that is arbitrarily set, and the prediction end timing (prediction end) of the process currently being executed by the calculation unit 111. Time). In the present embodiment, the
予測終了タイミング通知部109は、次の2つの条件のうちいずれか早い方が成立した時点において、CPU101に対して、終了通知を行い、割り込みを発生させる。
(1)予測終了タイミング通知部109が設定した予測終了タイミングとなったとき。
(2)演算部111でのデータ処理が終了したとき。
(1)のタイミングで終了通知する場合は、演算部111での処理は完全に終了していない。演算部111での処理が終了したら、ステータス信号生成部110は、フラグ信号を「1」に設定する。
The prediction end timing notification unit 109 notifies the
(1) When the prediction end timing set by the prediction end timing notification unit 109 is reached.
(2) When data processing in the calculation unit 111 is completed.
When the end notification is made at the timing of (1), the processing in the calculation unit 111 is not completely ended. When the processing in the calculation unit 111 is completed, the status
CPU101は割り込みによる終了通知を受けた後、タスク管理テーブル103で次に実行すべきタスクの優先度と、これまで演算部111で演算されていたデータ処理を含むタスクの優先度と、を比較し、優先度がより高いタスクを実行するようタスクの実行順序を設定する。
After receiving the end notification due to the interrupt, the
これまで演算部111で演算されていたデータ処理を含むタスクの実行がCPU101で再開された場合は、CPU101はステータスレジスター112のフラグを参照し、フラグが「1」の場合は、演算部111でのデータ処理が完全に終了しているので、CPU101で実行中のタスクにおける以降のステップを実行する。フラグが「0」の場合は、演算部111での処理が終了していないので、CPU101はステータスレジスター112のフラグが「1」になるまでポーリングを行う。
When execution of a task including data processing that has been calculated by the calculation unit 111 is resumed by the
図4の表における差の欄には、各回における予測値から実測値を差し引いた値が示されている。表の上段に示した△印は1回目から5回目において、差がプラスの値であるとき(3回目、4回目、5回目)を示し、○印は6回目から20回目において、差がプラスの値であるとき(7回目、9回目、11回目、12回目、17回目、18回目)を示す。 The difference column in the table of FIG. 4 shows a value obtained by subtracting the actual measurement value from the predicted value at each time. The △ mark shown in the upper part of the table indicates that the difference is a positive value from the first to the fifth time (third time, fourth time, fifth time), and the ◯ mark is a positive difference from the sixth time to the 20th time. (7th time, 9th time, 11th time, 12th time, 17th time, 18th time).
差がプラスの値は、予測値である予測処理時間が、実測値である実測処理時間より短いことを示す。この場合は、予測終了タイミング通知部109は、演算部111での演算が終了する前に、CPU101に対して終了通知を行う。反対に、差がマイナスの値は、予測値である予測処理時間が、実測値である実測処理時間より長いことを示す。この場合は、予測終了タイミング通知部109は、演算部111での演算が終了したときに、CPU101に対して終了通知を行う。
A positive value of the difference indicates that the predicted processing time that is the predicted value is shorter than the actual measured processing time that is the actually measured value. In this case, the prediction end timing notification unit 109 notifies the
次に、予測終了タイミングが演算部111でのデータ処理が実際に終了するタイミングより早かった場合において、図1のCPU101とHWアクセラレーター104の動作について説明する。
Next, operations of the
図5(a)は、本実施形態におけるデータ処理装置100のCPU101がタスクまたはタスクスイッチを実行する期間を示す図、図5(b)は、データ処理装置100の演算部111がデータ処理を行う期間を示す図である。
FIG. 5A is a diagram illustrating a period during which the
時点S201では、図5(a)に示すCPU101は、実行中のタスクAにおけるデータ処理をHWアクセラレーター104に依頼する。依頼を受けた図5(b)のHWアクセラレーター104は、演算部111によりデータ処理を開始する。
At time S201, the
時点S202では、CPU101は、タスクスイッチの実行を開始する。時点S203では、CPU101は、優先順位がタスクAに次ぐタスクBの処理を開始する。
In time S202, CPU101 starts execution of a task switch. At time S203, the
時点S204は、図1の予測処理時間算出部108で算出された予測処理時間に基づいて予測された終了時点である。時点S204では、図1の予測終了タイミング通知部109は、ステータスレジスター112のフラグの内容を参照する。この時点では演算部111でデータ処理が終了していないため、フラグの内容が「0」であるので、予測終了タイミング通知部109は、CPU101に対して、予測終了タイミングとしての予測終了通知を出力する。
Time S204 is an end time predicted based on the prediction processing time calculated by the prediction processing time calculation unit 108 in FIG. At time S204, the prediction end timing notification unit 109 in FIG. 1 refers to the contents of the flag in the
CPU101が予測終了通知を受信すると、CPU101は、タスク管理テーブル103を参照し、優先順位がタスクBより上位であるタスクAへの切り替えを行うためのタスクスイッチの実行を開始する。
When the
時点S205では、タスクAへの切り替えにより、CPU101は、図1のステータスレジスター112のフラグの内容を参照するポーリングを開始する。
At time S205, the
時点S206では、演算部111でデータ処理が完全に終了すると、ステータス信号生成部110はステータスレジスター112の内容を「1」に更新する。CPU101は、ステータスレジスター112を参照し、その内容が「1」であると、HWアクセラレーター104でのデータ処理が完全に終了したと判断し、タスクAの実行を再び開始する。
At time S206, when the data processing is completely completed by the calculation unit 111, the status
図7は、比較例としてのデータ処理装置500の構成図である。本実施形態と比較のため、図7のデータ処理装置500のCPU501とHWアクセラレーター504の動作内容について説明する。
FIG. 7 is a configuration diagram of a
データ処理装置500に備えられたCPU501、メモリー502、タスク管理テーブル503、HWアクセラレーター504、制御部505、演算部511は、本実施形態で説明した図1のデータ処理装置100に備えられたCPU101、メモリー102、タスク管理テーブル103、HWアクセラレーター104、制御部105、演算部111と、それぞれ同じ構成である。
The
データ処理装置500は、本実施形態で説明した図1の処理時間計測部106、実測処理時間記憶部107、予測処理時間算出部108、予測終了タイミング通知部109、ステータス信号生成部110、ステータスレジスター112を備えていない。
The
従って、データ処理装置500には、演算部511でのデータ処理が終了する前に、本実施形態のデータ処理装置100を用いて説明した予測終了通知を通知する機能はなく、演算部511でのデータ処理が実際に終了したときに、HWアクセラレーター504からCPU501に終了通知が通知される。
Therefore, the
図5(b)は、ここでは、比較例における図7のデータ処理装置500のHWアクセラレーター504がデータ処理を行う期間を示す図として説明する。
FIG. 5B is described here as a diagram illustrating a period during which the
図5(c)は、比較例におけるデータ処理装置500のCPU501がタスクまたはタスクスイッチを実行する期間を示す図である。図5(c)のCPU501における時点S201から時点S203までの動作内容は、図5(a)におけるCPU101の時点S201から時点S203までの動作内容と同じである。
FIG. 5C is a diagram illustrating a period during which the
比較例における時点S204では、HWアクセラレーター504からCPU501に対して予測終了タイミングとしての予測終了通知は出力されない。また、時点S205においても、ポーリングを行わない。そのため、時点S203でCPU501においてタスクBの処理が開始されると、時点S204、時点S205においてもCPU501でのタスクBが実行中である。
At time S204 in the comparative example, the prediction end notification as the prediction end timing is not output from the
比較例における時点S206では、演算部511でのデータ処理が終了すると、HWアクセラレーター504からCPU501に対して終了通知が通知される。
At time S <b> 206 in the comparative example, when the data processing in the
CPU501は、タスク管理テーブル503を参照し、優先順位がタスクBより上位であるタスクAへの切り替えを行うためのタスクスイッチの実行を開始する。時点S207では、CPU501においてタスクAの実行が再び開始される。
The
図5(b)、(c)を用いて説明した比較例では、時点S206で、HWアクセラレーター504からCPU501に対して終了通知がなされると、タスクスイッチが実行される。これに対して、図5(a)、(b)を用いて説明した本実施形態では、時点S204において、予測終了タイミング通知部109によって予測終了通知がCPU101に出力され、CPU101はタスクスイッチの実行を開始する。
In the comparative example described with reference to FIGS. 5B and 5C, when an end notification is given from the
そのため、比較例におけるCPU501においてタスクAの実行が再び開始された時点は時点S207である。これに対して、本実施形態におけるCPU101においてタスクAの実行が開始された時点は時点S206である。タスクAの実行が再び開始された時点は、比較例におけるタスクAの実行が再び開始された時点S207から、本実施形態におけるタスクAの実行が再び開始された時点S206までの期間Mだけ早められたことになる。すなわち、比較例におけるタスクスイッチが実行される期間(時点S206から時点S207までの期間M)だけタスクAの実行が再び開始された時点が本実施形態によって早められたことになる。
Therefore, the time point when the execution of the task A is started again in the
次に、演算部111でのデータ処理が終了するタイミングが予測終了タイミングより早かった場合において、CPU101とHWアクセラレーター104の動作について説明する。
Next, the operations of the
図6(a)は、本実施形態におけるデータ処理装置のCPUがタスクまたはタスクスイッチを実行する期間を示す図、図6(b)は、本実施形態または比較例におけるデータ処理装置のHWアクセラレーターがデータ処理を行う期間を示す図である。 FIG. 6A is a diagram showing a period during which the CPU of the data processing apparatus according to this embodiment executes a task or task switch, and FIG. 6B is a HW accelerator of the data processing apparatus according to this embodiment or a comparative example. It is a figure which shows the period which performs data processing.
時点S301では、図6(a)に示すCPU101は、実行中のタスクAにおけるデータ処理をHWアクセラレーター104に依頼する。依頼を受けた図6(b)のHWアクセラレーター104は、演算部111によりデータ処理を開始する。
At time S301, the
時点S302では、CPU101がタスク管理テーブル103を参照し、優先順位がタスクAに次ぐタスクBへの切り替えを行うためのタスクスイッチの実行が開始される。
At time S302, the
時点S303では、CPU101においてタスクBの処理が開始される。時点S304では、演算部111での処理が実際に終了し、HWアクセラレーター104からCPU101に対して終了通知が通知される。CPU101は、タスク管理テーブル103を参照し、タスクBより優先順位が高いタスクAへ切り替えを行うためのタスクスイッチの実行を開始する。
At time S303, the
時点S305は、予測終了タイミング通知部109が設定した予測終了タイミングである。予測終了タイミング通知部109は、ステータスレジスター112のフラグの内容を参照し、フラグの内容が「1」であるので、予測終了タイミング通知部109は、CPU101に対して、予測終了タイミングとしての予測終了通知を通知しない。時点S306では、CPU101においてタスクAの実行が再び開始される。
Time S305 is the prediction end timing set by the prediction end timing notification unit 109. The prediction end timing notification unit 109 refers to the content of the flag in the
本実施形態と比較のため、図7のデータ処理装置500におけるCPU501の動作内容について説明する。図6(c)は、比較例におけるデータ処理装置500のCPU501がタスクまたはタスクスイッチを実行する期間を示す図である。図6(b)は、ここでは、比較例におけるデータ処理装置500のHWアクセラレーター504がデータ処理を行う期間を示す図として説明する。
For comparison with the present embodiment, the operation content of the
比較例におけるデータ処理装置500は、予測終了タイミング通知部を備えていないので、予測終了通知は、HWアクセラレーター504からCPU501に対して通知されない。従って、図6(c)のCPU501における時点S301から時点S306までの動作内容は、図6(a)におけるCPU101の時点S301から時点S306までの動作内容と同じである。
Since the
すなわち、演算部111でのデータ処理が終了するタイミングが、予測終了タイミングより早かった場合は、本実施形態におけるCPU101でタスクAの実行が再び開始された時点S306は、比較例におけるCPU501でタスクAの実行が再び開始された時点S306と同じ時点となる。
That is, when the timing at which the data processing in the calculation unit 111 ends is earlier than the prediction end timing, the time point S306 when the execution of the task A is started again by the
以上、本実施形態で説明したように、データ処理装置100は、複数のタスクを、当該タスクの優先順位に従って順次実行するタスク実行制御部としてのCPU101と、CPU101から指示されたデータ処理を実行するデータ処理実行部としてのHWアクセラレーター104と、を備え、HWアクセラレーター104は、HWアクセラレーター104におけるデータ処理が開始されてから終了するまでの実測処理時間を計測する処理時間計測部106と、実測処理時間としてのクロックサイクル数を記憶する実測処理時間記憶部107と、実測処理時間記憶部107に記憶されたクロックサイクル数に基づいて、HWアクセラレーター104で実行しようとするデータ処理の予測処理時間としてのクロックサイクル数を算出する予測処理時間算出部108と、予測処理時間に基づいて予測されたデータ処理の終了時点S204で、CPU101に予測終了タイミングとしての予測終了通知を通知する予測終了タイミング通知部109と、を備え、CPU101は、予測終了タイミングの通知を受けてタスクの実行順序を設定するタスク実行順序設定部と、を備える。
As described above, the
この構成によれば、HWアクセラレーター104におけるデータ処理が一定時間で終了することが保証されていない場合であっても、予測処理時間に基づいてデータ処理の終了時点を予測する。これにより、HWアクセラレーター104におけるデータ処理が一定時間で終了することが保証されていない場合であっても、HWアクセラレーター104におけるデータ処理が実際に終了する前に、HWアクセラレーター104からCPU101に対して予測終了タイミングを通知する機会を増すことができる。
According to this configuration, even when the data processing in the
また、HWアクセラレーター104で実際にデータ処理が終了した後、直ちに、CPU101がHWアクセラレーター104にデータ処理を依頼したタスクの実行を再開できるので、タスク実行再開までの時間を短縮することができる。従って、CPU101における処理効率を高めることができる。
In addition, since the
また、予測処理時間算出部108は、実測処理時間記憶部107に記憶された実測処理時間を統計処理することによって、予測処理時間を算出する。
Further, the predicted processing time calculation unit 108 calculates the predicted processing time by statistically processing the actual processing time stored in the actual processing
この構成によれば、統計処理を用いることで、実測処理時間記憶部107に記憶された実測処理時間の集団における分布の傾向を分析できる。このため、分布の傾向が反映された予測終了時間に基づいて、データ処理が終了する時点を予測することができる。
According to this configuration, by using the statistical processing, it is possible to analyze the distribution tendency in the group of the actual measurement processing time stored in the actual measurement processing
本実施形態では、移動平均値を算出する方法を用いたが、統計計算としては、例えば最頻度値を求める計算、およびその派生等であってもよい。算術計算以外にも計測値を用いたデータ処理を行ってもよい。データ処理方法としては例えば複数の計測値によるパターンマッチングを行ってもよい。また複数の処理方法を適宜切り替えて使用するようにしたり、外部からパラメーターを設定したりしてもよい。 In the present embodiment, the method of calculating the moving average value is used. However, the statistical calculation may be, for example, a calculation for obtaining the most frequent value and its derivation. In addition to arithmetic calculation, data processing using measured values may be performed. As a data processing method, for example, pattern matching using a plurality of measurement values may be performed. In addition, a plurality of processing methods may be appropriately switched and used, or parameters may be set from the outside.
また、予測終了タイミング通知部109は、予測処理時間に補正を加えた予測終了タイミングを通知する。 Further, the prediction end timing notification unit 109 notifies the prediction end timing obtained by correcting the prediction processing time.
この構成によれば、予測処理時間に補正を加えることで、HWアクセラレーター104の演算部111におけるデータ処理が一定時間で終了することが保証されていない場合であっても、演算部111におけるデータ処理が実際に終了する前に、HWアクセラレーター104からCPU101に対して予測終了タイミングを通知する機会をさらに増すことができる。
According to this configuration, even if the data processing in the calculation unit 111 of the
(第2実施形態)
第2実施形態では、直前にデータ処理された1回の実測処理時間に基づいて、これから実行しようとするデータ処理の予測処理時間を算出する方法について説明する。
(Second Embodiment)
In the second embodiment, a method for calculating a predicted processing time of data processing to be executed from now on based on one actual measurement processing time for which data processing was performed immediately before will be described.
第2実施形態におけるデータ処理装置は、図1を用いて説明したデータ処理装置100の構成と同じである。
The data processing apparatus in the second embodiment has the same configuration as the
データ処理実行部としてのHWアクセラレーター104の演算部111がn回目の処理を開始しようとする時点での予測値をP(n)とし、n回目の処理に要した実測値をR(n)とする。
Let P (n) be the predicted value when the calculation unit 111 of the
(n+1)回目の処理開始時の予測値P(n+1)は、次式として定義する。
P(n+1)=P(n)+(R(n)−P(n))×F・・・(式1)
ここでFはF>0となる任意の係数である。また、n=0であるときは、
R(0)=0、P(0)=初期値(0以上)とする。
The predicted value P (n + 1) at the start of the (n + 1) -th process is defined as the following equation.
P (n + 1) = P (n) + (R (n) −P (n)) × F (Formula 1)
Here, F is an arbitrary coefficient that satisfies F> 0. When n = 0,
R (0) = 0, P (0) = initial value (0 or more).
式1から明らかなように、前回処理開始時の予測値を前回の実測値に近づけた値を次回の予測値としており、係数Fによって近づけ方の度合いを調整する。例えば、F=1の場合、前回の実測値がそのまま次回の予測値となる。
As is clear from
図8(a)、(b)は、演算部111における実測値としてのクロックサイクル数と、予測処理時間算出部108で計算された予測値としてのクロックサイクル数の一例の表である。図8(a)は、係数Fが1であるときの予測値P(n+1)の表を示し、図8(b)は、係数Fが0.8であるときの予測値P(n+1)の表を示す。 8A and 8B are tables showing an example of the number of clock cycles as an actual measurement value in the calculation unit 111 and the number of clock cycles as a prediction value calculated by the prediction processing time calculation unit 108. FIG. FIG. 8A shows a table of the predicted value P (n + 1) when the coefficient F is 1, and FIG. 8B shows the predicted value P (n + 1) when the coefficient F is 0.8. A table is shown.
図8(a)、(b)における差の欄は、n回目における実測値R(n)から予測値P(n)を差し引いた値を示す。第1実施形態で説明したように、差がプラスの値は、予測値である予測処理時間が、実測値である実測処理時間より短いことを示す。この場合は、演算部111での演算が実際に終了する前に、予測終了タイミング通知部109から予測終了通知がCPU101に対して通知され、演算部111での演算が実際に終了した時点で、ステータス信号生成部110がステータスレジスター112の内容を「1」に更新する。CPU101はステータスレジスター112を参照し内容が「1」であることを確認することでHWアクセラレーター104での処理が完全に終了したことを認識する。
The difference column in FIGS. 8A and 8B shows a value obtained by subtracting the predicted value P (n) from the actually measured value R (n) at the nth time. As described in the first embodiment, a value with a positive difference indicates that the prediction processing time that is a prediction value is shorter than the actual measurement processing time that is an actual measurement value. In this case, before the calculation in the calculation unit 111 actually ends, a prediction end notification is notified from the prediction end timing notification unit 109 to the
反対に、差がマイナスの値は、予測値である予測処理時間が、実測値である実測処理時間より長いことを示す。この場合は、HWアクセラレーター104から終了通知がCPU101に対して通知され、予測終了タイミング通知部109は、予測終了通知を通知しない。
On the other hand, a negative value of the difference indicates that the prediction processing time that is the prediction value is longer than the actual measurement processing time that is the actual measurement value. In this case, an end notification is notified from the
図8(a)、(b)における表の上段に示した○印は、図8(a)の表と、図8(b)の表を比較したとき、同じ回数における差がプラスの値であるとともに、同じ回数における差が小さい方であることを示す。○印が記載されている回数は、図8(a)の表では3回(4回目、9回目、15回目)であり、図8(b)の表では7回(3回目、6回目、8回目、12回目、14回目、17回目、19回目)である。 The circles shown in the upper part of the tables in FIGS. 8A and 8B indicate that the difference in the same number of times is a positive value when the table in FIG. 8A and the table in FIG. 8B are compared. In addition, it indicates that the difference in the same number is smaller. In the table of FIG. 8 (a), the number of times indicated with a circle is 3 times (4th time, 9th time, 15th time), and 7 times (3rd time, 6th time) in the table of FIG. 8 (b). 8th, 12th, 14th, 17th, 19th).
これは、図8(b)の係数Fが0.8であるときの方が、図8(a)の係数Fが1.0であるときの方より、予測値が実測値に近い回数が多かったことを意味する。 This is because when the coefficient F in FIG. 8B is 0.8, the number of times that the predicted value is closer to the actually measured value is smaller than when the coefficient F in FIG. 8A is 1.0. It means a lot.
このように、係数Fの値を変更して補正することによって、予測値が実測値に近い値となる場合を増加させることができる。このようにすることにより、予測終了タイミングを演算部111でのデータ処理の終了時点より早く通知してタスクAの実行再開に要する時間を短縮するとともに、演算部111で実行しているデータ処理を含むタスクAより優先度の低いタスクBの処理を実行している時間を長くすることができる(図5における時点S203から時点S204までの期間)。従って、CPU101における処理効率を向上させることができる。
In this way, by changing the value of the coefficient F and correcting, it is possible to increase the case where the predicted value is close to the actual measurement value. In this way, the prediction end timing is notified earlier than the end point of the data processing in the calculation unit 111 to reduce the time required to resume execution of the task A, and the data processing being executed in the calculation unit 111 is reduced. It is possible to lengthen the time during which processing of task B having a lower priority than task A is included (period from time S203 to time S204 in FIG. 5). Therefore, the processing efficiency in the
100…データ処理装置、101…CPU、103…タスク管理テーブル、104…HWアクセラレーター、106…処理時間計測部、107…実測処理時間記憶部、108…予測処理時間算出部、109…予測終了タイミング通知部。
DESCRIPTION OF
Claims (3)
前記タスク実行制御部から指示されたデータ処理を実行するデータ処理実行部と、を備え、
前記データ処理実行部は、前記データ処理実行部におけるデータ処理が開始されてから終了するまでの実測処理時間を計測する処理時間計測部と、
前記実測処理時間を記憶する実測処理時間記憶部と、
前記実測処理時間記憶部に記憶された前記実測処理時間に基づいて、前記データ処理実行部で実行しようとするデータ処理の予測処理時間を算出する予測処理時間算出部と、
前記予測処理時間に基づいて予測されたデータ処理の終了時点で、前記タスク実行制御部に予測終了タイミングを通知する予測終了タイミング通知部と、を備え、
前記タスク実行制御部は、前記予測終了タイミングの通知を受けてタスクの実行順序を設定するタスク実行順序設定部と、を備えたことを特徴とするデータ処理装置。 A task execution control unit that sequentially executes a plurality of tasks in accordance with the priority order of the tasks;
A data processing execution unit that executes data processing instructed by the task execution control unit,
The data processing execution unit is a processing time measurement unit that measures an actual measurement processing time from the start of data processing in the data processing execution unit to the end thereof;
An actual measurement processing time storage unit for storing the actual measurement processing time;
A predicted processing time calculation unit that calculates a predicted processing time of data processing to be executed by the data processing execution unit based on the actual measurement processing time stored in the actual measurement processing time storage unit;
A prediction end timing notifying unit that notifies the task execution control unit of a prediction end timing at the end of data processing predicted based on the prediction processing time,
The task execution control unit includes a task execution order setting unit that receives a notification of the prediction end timing and sets an execution order of tasks.
前記予測処理時間算出部は、前記実測処理時間記憶部に記憶された前記実測処理時間を統計処理することによって、前記予測処理時間を算出することを特徴とするデータ処理装置。 The data processing apparatus according to claim 1,
The data processing device, wherein the prediction processing time calculation unit calculates the prediction processing time by statistically processing the actual measurement processing time stored in the actual measurement processing time storage unit.
前記予測終了タイミング通知部は、前記予測処理時間に補正を加えた前記予測終了タイミングを通知することを特徴とするデータ処理装置。 The data processing apparatus according to claim 1 or 2, wherein
The prediction end timing notification unit notifies the prediction end timing obtained by correcting the prediction processing time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009264685A JP2011108140A (en) | 2009-11-20 | 2009-11-20 | Data processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009264685A JP2011108140A (en) | 2009-11-20 | 2009-11-20 | Data processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011108140A true JP2011108140A (en) | 2011-06-02 |
Family
ID=44231507
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009264685A Withdrawn JP2011108140A (en) | 2009-11-20 | 2009-11-20 | Data processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011108140A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015051712A1 (en) * | 2013-10-10 | 2015-04-16 | International Business Machines Corporation | Performance measurement of hardware accelerators |
US9104505B2 (en) | 2013-10-03 | 2015-08-11 | International Business Machines Corporation | Acceleration prediction in hybrid systems |
KR20180088437A (en) | 2015-11-30 | 2018-08-03 | 가부시키가이샤 페지 컴퓨팅 | Die and package, and method of making die and method of making package |
KR20180088438A (en) | 2015-11-30 | 2018-08-03 | 가부시키가이샤 페지 컴퓨팅 | Die and package |
-
2009
- 2009-11-20 JP JP2009264685A patent/JP2011108140A/en not_active Withdrawn
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9104505B2 (en) | 2013-10-03 | 2015-08-11 | International Business Machines Corporation | Acceleration prediction in hybrid systems |
US9164814B2 (en) | 2013-10-03 | 2015-10-20 | International Business Machines Corporation | Acceleration prediction in hybrid systems |
US9348664B2 (en) | 2013-10-03 | 2016-05-24 | International Business Machines Corporation | Acceleration prediction in hybrid systems |
WO2015051712A1 (en) * | 2013-10-10 | 2015-04-16 | International Business Machines Corporation | Performance measurement of hardware accelerators |
US9424159B2 (en) | 2013-10-10 | 2016-08-23 | International Business Machines Corporation | Performance measurement of hardware accelerators |
KR20180088437A (en) | 2015-11-30 | 2018-08-03 | 가부시키가이샤 페지 컴퓨팅 | Die and package, and method of making die and method of making package |
KR20180088438A (en) | 2015-11-30 | 2018-08-03 | 가부시키가이샤 페지 컴퓨팅 | Die and package |
US10691634B2 (en) | 2015-11-30 | 2020-06-23 | Pezy Computing K.K. | Die and package |
US10818638B2 (en) | 2015-11-30 | 2020-10-27 | Pezy Computing K.K. | Die and package |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9990229B2 (en) | Scheduling method and apparatus for applying laxity correction based on task completion proportion and preset time | |
CN102902581B (en) | Hardware accelerator and method, CPU, computing equipment | |
JP4707603B2 (en) | Processing time allocation method in real-time OS | |
JP2007034414A5 (en) | ||
US9043806B2 (en) | Information processing device and task switching method | |
JP2011108140A (en) | Data processor | |
JP2009163658A (en) | Input/output controller and its firmware update method | |
JP2005276097A (en) | Interruption request program and microcomputer | |
CN104303150B (en) | Method for managing the task execution in computer system | |
JP2007164421A (en) | Parallel processors, parallel processing method and parallel processing program | |
JP2006146758A (en) | Computer system | |
US9058207B2 (en) | Simulation apparatus, method, and computer-readable recording medium | |
JP2007193744A (en) | Information processing device, program and scheduling method | |
JP2010102567A (en) | Periodical task execution device, periodical task execution method, and program | |
JP6447442B2 (en) | Electronic control unit | |
JP2016184315A (en) | Electronic controller | |
JP2015141717A (en) | speculative interrupt signaling | |
JP2007102399A (en) | Data processor | |
US11947486B2 (en) | Electronic computing device having improved computing efficiency | |
JP6332091B2 (en) | Electronic control unit | |
JP5455111B2 (en) | Flow control device and flow control method | |
JP2007109038A (en) | Data processor | |
JP2010205046A (en) | Information processing apparatus | |
JP2013125336A (en) | Information processing device, time control method and time control program | |
JP2013167945A (en) | Information processing device, task wake-up control method, and task start-up control program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120920 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20130612 |