JP2007102399A - Data processor - Google Patents

Data processor Download PDF

Info

Publication number
JP2007102399A
JP2007102399A JP2005289679A JP2005289679A JP2007102399A JP 2007102399 A JP2007102399 A JP 2007102399A JP 2005289679 A JP2005289679 A JP 2005289679A JP 2005289679 A JP2005289679 A JP 2005289679A JP 2007102399 A JP2007102399 A JP 2007102399A
Authority
JP
Japan
Prior art keywords
data processing
task
progress
progress information
execution
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
Application number
JP2005289679A
Other languages
Japanese (ja)
Inventor
Ryuichi Sato
竜一 佐藤
Masahiro Kitano
正博 北野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2005289679A priority Critical patent/JP2007102399A/en
Publication of JP2007102399A publication Critical patent/JP2007102399A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To enhance the processing efficiency of task switching of a data processor which executes a task by making software to be executed on a processor and hardware exclusive for specific processing cooperatively execute a task. <P>SOLUTION: This data processor is composed of: a CPU 101 for successively executing a plurality of tasks according to the priority of tasks; and an HW accelerator 103 for processing electronic data according to the instruction of the CPU 101. The HW accelerator 103 records an HW status showing the progress circumstances of processing to be executed in a status register 107, and the CPU 101 recognizes the recorded HW status, and successively executes tasks by switching the tasks. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、電子データを汎用的に処理するデータ処理装置に係り、特にハードウェアとプロセッサ上で動作するソフトウェアとが共同してデータを処理するデータ処理装置に関する。   The present invention relates to a data processing apparatus that processes electronic data for general use, 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, one processor executes a plurality of tasks in accordance with the priority order, and requests a process having a relatively large load among the tasks in this process.
When processing is requested to the hardware, this processor interrupts the task related to this processing and executes the task to be executed next. When the execution of the requested process ends, the hardware notifies the processor of the end of the process. At this time, if the process being executed has a lower priority than the process requested to the hardware, the processor interrupts the process being executed. Then, the task that has been requested by the hardware and completed processing is continuously executed as necessary.

以上のプロセッサ及びハードウェアの動作において、ハードウェアからプロセッサに対して行われる処理終了の通知は、一般的に割込みが用いられる。従来のデータ処理装置の多くは、プロセッサに対する割込みをトリガとしてタスクを切替えている。このような従来技術としては、例えば、特許文献1が挙げられる。
特開平7−271344号公報
In the operations of the processor and hardware described above, an interrupt is generally used for notification of the end of processing performed from the hardware to the processor. Many conventional data processing apparatuses switch tasks by using an interrupt to a processor as a trigger. As such a conventional technique, for example, Patent Document 1 is cited.
JP-A-7-271344

しかしながら、特許文献1に記載された発明は、プロセッサがタスクを割込みのみをトリガとして切替えるため、実行中のタスクを中断するための処理を割込みがなされてから開始することになる。なお、タスクを中断するための処理とは、中断直前の処理内容を処理再開に備えて保存しておく処理をいうものとする。
また、特許文献1に記載された発明は、割込みがなされない限りタスクを順次実行するため、プロセッサに依頼した優先順位のよりタスクの処理が終了する直前であっても、優先順位のより低いタスクの実行が開始される。このような場合、特許文献1に記載された発明では、優先順位のより低いタスクの実行開始のために優先順位がより高いタスクの実行開始が遅れる可能性が生じる。
However, in the invention described in Patent Document 1, since the processor switches a task using only an interrupt as a trigger, a process for interrupting a task being executed is started after an interrupt is made. The process for interrupting a task refers to a process for storing the processing content immediately before the interruption in preparation for the resumption of the process.
In the invention described in Patent Document 1, since tasks are sequentially executed unless an interrupt is made, a task with a lower priority is issued even immediately before the task processing is completed than the priority requested by the processor. The execution of is started. In such a case, in the invention described in Patent Document 1, there is a possibility that the execution start of a task with a higher priority is delayed due to the start of execution of a task with a lower priority.

このような特許文献1は、タスク切替によるオーバーヘッドが大きく、タスク切替の処理効率をより高めることが望まれている。
本発明は、上記した点に鑑みてなされたものであり、プロセッサ上で実行されるソフトウェアと特定の処理に専用のハードウェアとが共同してタスクを実行するデータ処理装置のタスク切替の処理効率をより高めることを目的とする。
Such Patent Document 1 has a large overhead due to task switching, and it is desired to further improve the task switching processing efficiency.
The present invention has been made in view of the above points, and the task switching processing efficiency of a data processing apparatus in which software executed on a processor and hardware dedicated to a specific process execute a task jointly The purpose is to further increase.

以上の課題を解決するため、本発明のデータ処理装置は、複数のタスクを、当該タスクの優先順位にしたがって順次実行する制御手段と、前記制御手段の指示によって電子データを処理するデータ処理実行手段と、を備えるデータ処理装置であって、前記データ処理実行手段は、実行される電子データの処理の進捗状況を示す進捗情報を記録する進捗情報記録手段を備え、前記制御手段は、前記進捗情報記録手段によって記録された進捗情報を認識する進捗状況認識手段を備え、前記進捗状況認識手段によって認識された進捗情報を含む情報に基づいてタスクを切替え、順次実行することを特徴とする。   In order to solve the above problems, a data processing apparatus according to the present invention includes a 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 processes electronic data in accordance with instructions from the control unit The data processing execution means includes progress information recording means for recording progress information indicating a progress status of processing of electronic data to be executed, and the control means includes the progress information. Progress status recognition means for recognizing the progress information recorded by the recording means is provided, and tasks are switched based on information including the progress information recognized by the progress status recognition means, and executed sequentially.

このような発明によれば、複数のタスクを優先順位にしたがって順次実行し、この過程でデータ処理実行手段にタスクの一部の処理を実行させることができる。また、データ処理実行手段によって実行される電子データの処理の進捗状況を示す進捗情報を記録し、制御手段に進捗情報を認識させることができるので、本実施形態のデータ処理装置は、制御手段がデータ処理実行手段の処理の進捗状況を把握し、状況に応じてタスクを切替えることができる。   According to such an invention, a plurality of tasks can be sequentially executed according to the priority order, and in this process, the data processing execution means can execute a part of the tasks. In addition, since the progress information indicating the progress status of the processing of the electronic data executed by the data processing execution means can be recorded and the control means can recognize the progress information, the data processing apparatus of the present embodiment has the control means The processing progress of the data processing execution means can be grasped, and tasks can be switched according to the situation.

このような本発明は、プロセッサ上で実行されるソフトウェアと特定の処理に専用のハードウェアとが共同してタスクを実行するデータ処理装置のタスク切替の処理効率をより高めることができる。
また、本発明のデータ処理装置は、前記制御手段が、タスクの実行順序を設定する実行順序設定手段を備え、前記実行順序設定手段は、前記進捗状況認識手段によって認識された進捗状況によって前記実行順序設定手段によって設定された実行順序を変更することを特徴とする。
Such an embodiment of the present invention can further improve the task switching processing efficiency of a data processing apparatus in which software executed on a processor and hardware dedicated to a specific process execute a task.
In the data processing apparatus of the present invention, the control means includes execution order setting means for setting an execution order of tasks, and the execution order setting means executes the execution according to the progress situation recognized by the progress situation recognition means. The execution order set by the order setting means is changed.

このような発明によれば、制御手段がタスクの実行順序を設定し、設定された実行順書を進捗状況認識手段によって認識された進捗状況によって変更することができる。
このような発明によれば、いったん設定されたタスクの実行順序をデータ処理装置における処理の進捗状況に応じて変更することが可能になり、処理の進捗状況に柔軟に対応してより処理効率の高い順序を設定することができる。
According to such an invention, the control means can set the task execution order, and the set execution order can be changed according to the progress situation recognized by the progress situation recognition means.
According to such an invention, it is possible to change the execution order of tasks once set according to the progress of processing in the data processing apparatus, and flexibly respond to the progress of processing, thereby improving the processing efficiency. High order can be set.

また、本発明のデータ処理装置は、前記進捗情報記録手段が前記データ処理実行手段内のレジスタに進捗情報を記録すると共に、前記進捗状況認識手段は、前記進捗情報記録手段に割り当てられたメモリマップ上の対応するアドレスを参照して進捗情報を認識することを特徴とする。
このような発明によれば、レジスタに進捗情報を記録し、記録された進捗情報を、レジスタに予め割り当てられたアドレスを参照することによって認識することができる。このため、進捗情報参照にかかる手順や時間を軽減し、変化する進捗情報をリアルタイムで参照しやすくすることができる。
In the data processing apparatus of the present invention, the progress information recording means records progress information in a register in the data processing execution means, and the progress status recognition means is a memory map assigned to the progress information recording means. The progress information is recognized by referring to the corresponding address above.
According to such an invention, the progress information can be recorded in the register, and the recorded progress information can be recognized by referring to the address previously assigned to the register. For this reason, it is possible to reduce the procedure and time for referring to the progress information, and to easily refer to the changing progress information in real time.

また、本発明のデータ処理装置は、前記進捗情報記録手段が、前記データ処理実行手段におけるデータ処理のうち残りのデータ処理にかかるサイクル数を進捗情報として記録することを特徴とする。
このような発明によれば、データ処理実行手段におけるデータ処理にかかる残り時間によってデータ処理の進捗状況を把握することができる。このため、設定された実行順序にしたがってタスクを実行するべきか、データ処理実行手段の処理を待ってタスクの実行を再開すべきかの判断を容易にすることができる。
In the data processing apparatus of the present invention, the progress information recording means records the number of cycles for the remaining data processing among the data processing in the data processing execution means as progress information.
According to such an invention, the progress status of the data processing can be grasped by the remaining time required for the data processing in the data processing execution means. For this reason, it is possible to easily determine whether the task should be executed according to the set execution order or whether the execution of the task should be resumed after waiting for the processing of the data processing execution means.

また、本発明のデータ処理装置は、前記進捗情報記録手段が、前記データ処理実行手段におけるデータ処理の残りが所定のデータ処理量であるしきい値以下であるか否かを判定し、しきい値以下であった場合、データ処理の残りがしきい値以下であることを示すフラグを進捗情報として記録することを特徴とする。
このような発明によれば、データ処理の残り量に基づいて判断する処理を省き、設定された実行順序にしたがってタスクを実行するべきか、データ処理実行手段の処理を待ってタスクの実行を再開すべきかの判断をいっそう容易にすることができる。
In the data processing apparatus of the present invention, the progress information recording unit determines whether or not the remaining data processing in the data processing execution unit is equal to or less than a threshold value that is a predetermined data processing amount, and a threshold value. When the value is less than or equal to the value, a flag indicating that the remaining data processing is less than or equal to the threshold value is recorded as progress information.
According to such an invention, it is possible to omit the determination based on the remaining amount of data processing and execute the task according to the set execution order, or wait for the processing of the data processing execution means to resume the execution of the task Judgment of what to do can be made easier.

また、本発明のデータ処理装置は、前記しきい値を記録すると共に、記録されたしきい値を変更することが可能なしきい値記録手段を備えることを特徴とする。
このような発明によれば、設定された実行順序にしたがってタスクを実行するべきか、データ処理実行手段の処理を待ってタスクの実行を再開すべきかを判断する基準をユーザのニーズやデータ処理の内容等に応じて変更することが可能になる。
The data processing apparatus of the present invention is characterized by comprising threshold recording means capable of recording the threshold and changing the recorded threshold.
According to such an invention, the criteria for determining whether the task should be executed according to the set execution order or whether the execution of the task should be resumed after waiting for the processing of the data processing execution means is determined based on the user needs and the data processing. It can be changed according to the contents.

以下、図を参照して本発明に係るデータ処理装置の一実施の形態を説明する。
図1は、本実施形態のデータ処理装置の構成を説明するための図である。本実施形態のデータ処理装置は、複数のタスクを、このタスクの優先順位にしたがって順次実行するCPU(Central Processing Unit)101と、CPU101の指示によって電子データ(以降単にデータ)を処理するハードウェア(HW)アクセラレータ103と、を備えるデータ処理装置である。図1中に示したメモリ102は、データ処理装置のタスクの実行に使用される命令や命令の実行に使用されるテーブルやデータ等を保存するための構成である。
Hereinafter, an embodiment of a data processing apparatus according to the present invention will be described with reference to the drawings.
FIG. 1 is a diagram for explaining the configuration of the data processing apparatus according to the present embodiment. The data processing apparatus according to the present embodiment includes a CPU (Central Processing Unit) 101 that sequentially executes a plurality of tasks according to the priority order of the tasks, and hardware (hereinafter simply referred to as data) that processes electronic data according to instructions from the CPU 101. HW) accelerator 103. The memory 102 shown in FIG. 1 has a configuration for storing instructions used for executing tasks of the data processing apparatus, tables and data used for executing the instructions, and the like.

CPU101、メモリ102、HWアクセラレータ103は、互いにバスによって接続されている。また、本実施形態は、図1に示したように、HWアクセラレータ103を一つ備えるものに限定されるものではなく、複数のHWアクセラレータ103を備えるものであってもよい。このような場合、CPU101は、1つで複数のHWアクセラレータ103を制御するものであってもよいし、複数あってもよい。   The CPU 101, the memory 102, and the HW accelerator 103 are connected to each other by a bus. Further, as illustrated in FIG. 1, the present embodiment is not limited to the one provided with one HW accelerator 103, and may include a plurality of HW accelerators 103. In such a case, one CPU 101 may control a plurality of HW accelerators 103, or a plurality of CPUs may be provided.

CPU101は、複数のタスクを適正に順次実行するため、タスク管理テーブル108を備えている。タスク管理テーブル108の一例を、図2に示す。
図2に示したタスク管理テーブル108は、タスクA、タスクB、タスクCを含むタスクを管理するためのタスク管理テーブルである。タスク管理テーブル108は、各タスクのタスク名と、各タスクの進行状況を示すプログラムカウンタ(PC)、タスク実行時のプロセッサの状態や条件等を記録するプロセッサステートレジスタ(PSR)、スタックの位置を示すスタックポインタ(SP)、タスクの状態を示すスティト(State)、優先順位(priority)、実行中のタスクの処理内容(register file)、HWアクセラレータが複数ある場合の使用されているHWアクセラレータ、または唯一のHWアクセラレータの使用、不使用(HW)を管理する。
The CPU 101 includes a task management table 108 in order to properly execute a plurality of tasks sequentially. An example of the task management table 108 is shown in FIG.
The task management table 108 illustrated in FIG. 2 is a task management table for managing tasks including task A, task B, and task C. The task management table 108 includes a task name of each task, a program counter (PC) indicating the progress of each task, a processor state register (PSR) that records a processor state and condition at the time of task execution, and a stack position. A stack pointer (SP) indicating a state of a task, a state indicating a state of the task, a priority (priority), a processing content of a task being executed (register file), an HW accelerator being used when there are a plurality of HW accelerators, or Manage the use and non-use (HW) of the only HW accelerator.

CPU101は、このようなタスク管理テーブル108を用い、複数のタスクの実行順序を設定する。CPU101とタスク管理テーブル108とは、本実施形態の実行順序設定手段として機能する。本実施形態でいう実行順序は、実行可能なタスクのタスク名をより早期に実行されるものから一列に列記して表される。また、この列を、以降レディキューとも記すものとする。   The CPU 101 uses such a task management table 108 to set the execution order of a plurality of tasks. The CPU 101 and the task management table 108 function as an execution order setting unit in the present embodiment. The execution order referred to in the present embodiment is represented by listing the task names of tasks that can be executed in a line from those that are executed earlier. This column is also referred to as a ready queue hereinafter.

一方、HWアクセラレータ103は、タスクの実行にあたって比較的負荷の大きいデータの処理をするためのハードウェアである。このため、データ処理に使用される演算部106、CPU101の指示にしたがって演算部106を制御する制御部104を備えている。
制御部104は、カウンタあるいはステートマシンから成る。本実施形態のカウンタは、処理のサイクルをカウントする。ステートマシンは、処理のパラメータや設定等によって演算部106での処理を制御する。制御部104によれば、現在演算部106が実行している処理のサイクル数や状態を示すことができる。
On the other hand, the HW accelerator 103 is hardware for processing data with a relatively large load when executing a task. For this reason, the control part 104 which controls the calculating part 106 according to the instruction | indication of the calculating part 106 and CPU101 used for data processing is provided.
The control unit 104 includes a counter or a state machine. The counter of the present embodiment counts processing cycles. The state machine controls processing in the arithmetic unit 106 according to processing parameters and settings. The control unit 104 can indicate the number of cycles and the state of the process currently being executed by the calculation unit 106.

また、HWアクセラレータ103は、ステータス信号生成部105及びステータスレジスタ107を備えている。ステータス信号生成部105は、HWアクセラレータ103によって得られる処理の残りサイクル数を示すステータス信号を生成する。ステータス信号は、HWステータス(progress_val)として残りのサイクル数を含む情報をステータスレジスタ107に書き込む信号である。図1に示した例では、HWアクセラレータ103によって実行されている処理の残りのサイクル数が30であることを示している。   The HW accelerator 103 also includes a status signal generation unit 105 and a status register 107. The status signal generation unit 105 generates a status signal indicating the number of remaining cycles of processing obtained by the HW accelerator 103. The status signal is a signal for writing information including the remaining number of cycles to the status register 107 as the HW status (progress_val). In the example illustrated in FIG. 1, the remaining number of cycles of the process executed by the HW accelerator 103 is 30.

このような制御部104、ステータス信号生成部105、ステータスレジスタ107は、実行される電子データの処理の進捗状況を示すHWステータス(進捗情報)を記録する進捗情報記録手段として機能する。
CPU101は、ステータスレジスタ107に書き込まれたHWステータスを認識し、認識されたHWステータスを含む情報に基づいてタスクを切替え、順次実行する。本実施形態のデータ処理装置は、HWステータスによってタスク管理テーブル108で設定された実行順序を変更することによってタスク切替えを実行する。なお、実行順序を変更する具体的な動作については後述する。また、本実施形態でいうHWステータスを含む情報とは、HWステータス及び各タスクの優先順位の情報である。
The control unit 104, the status signal generation unit 105, and the status register 107 function as a progress information recording unit that records an HW status (progress information) indicating a progress status of processing of electronic data to be executed.
The CPU 101 recognizes the HW status written in the status register 107, switches tasks based on information including the recognized HW status, and executes them sequentially. The data processing apparatus according to this embodiment executes task switching by changing the execution order set in the task management table 108 according to the HW status. A specific operation for changing the execution order will be described later. The information including the HW status referred to in the present embodiment is information on the HW status and the priority order of each task.

以上述べた構成において、CPU101は、HWアクセラレータ103をキックしてタスクに含まれる一の処理(HW依頼処理)の実行を指示する。HWアクセラレータ103は、指示されたHW依頼処理を実行する。この際、本実施形態では、制御部104がHW依頼処理の内容に基づいて処理の開始から終了までに必要なサイクル数を算出する。ステータス信号生成部105は、設定されたサイクル数をステータス信号によってステータスレジスタ107に書き込む。また、CPU101は、HWアクセラレータ103は、書き込まれたサイクル数を演算部106の処理の進捗に応じて更新する。   In the configuration described above, the CPU 101 kicks the HW accelerator 103 and instructs execution of one process (HW request process) included in the task. The HW accelerator 103 executes the instructed HW request process. At this time, in the present embodiment, the control unit 104 calculates the number of cycles required from the start to the end of the process based on the contents of the HW request process. The status signal generation unit 105 writes the set number of cycles in the status register 107 using the status signal. Further, the CPU 101 updates the number of cycles written by the HW accelerator 103 in accordance with the progress of the processing of the calculation unit 106.

また、CPU101は、ステータスレジスタ107に記録されたHWステータスを認識することができる(矢線Aで示す)。本実施形態では、ステータスレジスタ107にHWステータスを書き込み、CPU101がメモリマップに割り当てられているステータスレジスタ107を参照することによってHWステータスの認識を可能にしている。
図3は、CPU101によって参照されるメモリマップの一例を示した図である。本実施形態では、メモリマップのうちHWステータスが書き込まれるアドレスの範囲を予め設定しておく。そして、CPU101が、タスクを終了するごとにメモリマップの設定された範囲のアドレスに書き込まれたデータを参照することによって処理の残りサイクル数を認識する。
Further, the CPU 101 can recognize the HW status recorded in the status register 107 (indicated by an arrow A). In this embodiment, the HW status is written in the status register 107, and the CPU 101 can recognize the HW status by referring to the status register 107 assigned to the memory map.
FIG. 3 is a diagram illustrating an example of a memory map referred to by the CPU 101. In the present embodiment, an address range in which the HW status is written in the memory map is set in advance. Then, every time the CPU 101 finishes the task, the CPU 101 recognizes the number of remaining cycles of processing by referring to the data written to the address within the set range of the memory map.

このような構成により、CPU101は、比較的簡易にHWステータスを参照し、HWアクセラレータ103によって実行されている処理の状況を随時判定することができる。
一方、HWアクセラレータ103は、矢線Bで示すアクセスラインを有し、指示された処理の完了をCPU101に割込みとして通知することが可能である。
次に、以上述べた本実施形態のデータ処理装置の動作を説明する。この説明では、データ処理装置がタスクA、タスクB、タスクCの3つのタスクを実行するものとする。タスクA、タスクB、タスクCの優先順位は、タスクA>タスクB>タスクCである。
With such a configuration, the CPU 101 can relatively easily refer to the HW status and determine the status of the process being executed by the HW accelerator 103 at any time.
On the other hand, the HW accelerator 103 has an access line indicated by an arrow B, and can notify the CPU 101 of the completion of the instructed processing as an interrupt.
Next, the operation of the data processing apparatus of this embodiment described above will be described. In this description, it is assumed that the data processing apparatus executes three tasks, task A, task B, and task C. The priority order of task A, task B, and task C is task A> task B> task C.

図4は、本実施形態のデータ処理装置の動作を説明するための図であって、実線は本実施形態のデータ処理装置の動作を、破線は比較のため記した従来技術の動作を示している。図4において、タスクA、タスクB、タスクCの文字の下に記した縦方向の矢線は、各タスクが実行されているタイミングを示している。また、OSの文字の下に記した縦方向の矢線は、CPU101においてOSが動作しているタイミングを、INTの文字の下に記した縦方向の矢線は、割込み及び割込みにかかる処理のタイミング示している。また、横方向の矢線は、各処理の遷移を示すものである。   FIG. 4 is a diagram for explaining the operation of the data processing apparatus according to the present embodiment. The solid line indicates the operation of the data processing apparatus according to the present embodiment, and the broken line indicates the operation of the prior art described for comparison. Yes. In FIG. 4, vertical arrows indicated below the characters of task A, task B, and task C indicate the timing at which each task is executed. The vertical arrow line below the OS character indicates the timing at which the OS is operating in the CPU 101, and the vertical arrow line below the INT character indicates interrupts and interrupt-related processing. Timing is shown. Moreover, the horizontal arrow line shows the transition of each process.

なお、図4に示した縦方向の矢線の実線と破線とのずれは、両者を識別して認識しやすくするためのものであって、特に記載する箇所以外に両者に実質的な相違はない。
以下、本実施形態のデータ処理装置の動作と、従来の構成の動作とを対比して説明する。
Note that the deviation between the solid line and the broken line in the vertical direction of the arrow shown in FIG. 4 is for identifying and recognizing both, and there is no substantial difference between the two except for the parts described in particular. Absent.
Hereinafter, the operation of the data processing apparatus of the present embodiment will be described in comparison with the operation of the conventional configuration.

(本実施形態のデータ処理装置)
本実施形態のデータ処理装置は、先ず、CPU101が、最も優先順位の高いタスクAの実行を開始する。タスクAの実行中、CPU101は、HW依頼処理の実行をHWアクセラレータ103に指示する(S401)。このため、CPU101においては、実行されているタスクがOS(Operating System)に切替えられてディスパッチャが起動する。
(Data processing apparatus of this embodiment)
In the data processing apparatus of the present embodiment, first, the CPU 101 starts execution of task A having the highest priority. During the execution of task A, the CPU 101 instructs the HW accelerator 103 to execute the HW request process (S401). For this reason, in the CPU 101, the task being executed is switched to the OS (Operating System) and the dispatcher is activated.

図5は、上記したタスクAの実行中にHW依頼処理をするタスクプログラムを示した図である。HW依頼処理は、タスクAの実行中にCPU101がHWアクセラレータ103をコールする。そして、HW依頼処理に必要なパラメータを渡して処理の実行を指示するものである。
CPU101は、図2に示したタスク管理テーブルを参照し、HWアクセラレータ103の使用状況を確認する(S402)。そして、HWアクセラレータ103が使用可能な状態であった場合、CPU101上で動作するOSは、HWアクセラレータ103にHW依頼処理の実行を指示する(S403)。タスクAは、HW依頼処理の完了まで実行できない状態になる。このため、CPU101は、タスクAをレディキューから外す(S404)。
FIG. 5 is a diagram showing a task program that performs HW request processing during the execution of task A described above. In the HW request process, the CPU 101 calls the HW accelerator 103 during execution of task A. Then, a parameter necessary for the HW request process is passed to instruct execution of the process.
The CPU 101 refers to the task management table shown in FIG. 2 and confirms the usage status of the HW accelerator 103 (S402). If the HW accelerator 103 is usable, the OS operating on the CPU 101 instructs the HW accelerator 103 to execute the HW request process (S403). Task A is in a state where it cannot be executed until the HW request process is completed. Therefore, the CPU 101 removes task A from the ready queue (S404).

タスクAが実行できなくなったことにより、CPU101では、次のタスクを実行するためにディスパッチャが起動する(S405)。ここで、本実施形態のデータ処理装置は、OSがステータスレジスタ107に書き込まれているHWステータスを確認する(S406)。
本実施形態のHWステータスは、HW依頼処理に必要な残りのサイクル数で表されている。CPU101は、HWステータスを確認した結果、HWステータスが所定の数以上のサイクル数を示している場合、レディキューにおける次のタスクBを実行する(S407)。
Since the task A cannot be executed, the CPU 101 starts the dispatcher to execute the next task (S405). Here, the data processing apparatus according to the present embodiment checks the HW status written in the status register 107 by the OS (S406).
The HW status of this embodiment is represented by the number of remaining cycles necessary for the HW request process. As a result of checking the HW status, the CPU 101 executes the next task B in the ready queue when the HW status indicates a predetermined number of cycles or more (S407).

CPU101においてタスクBの実行が終了すると、ディスパッチャが起動し(S408)、CPU101上でOSが動作する。OSは、ステータスレジスタ107に書き込まれているHWステータスを確認する(S409)。確認の結果、HWステータスが示すサイクル数が所定の数に満たない場合、タスクAが所定の時間以下の時間内に終了する。
HWステータスが示すサイクル数が所定の数に満たない場合、CPU101は、レディキューにおいてタスクBの次に実行すべきタスクCの優先度とタスクAの優先度とを比較する。タスクAの優先度は、タスクCの優先度よりも高い。このため、CPU101は、レディキューので設定された実行順序を変更し、タスクCを実行することなくタスクAをレディキューの先頭に追加する(S410)。
When the execution of task B is completed in the CPU 101, the dispatcher is activated (S408), and the OS operates on the CPU 101. The OS confirms the HW status written in the status register 107 (S409). As a result of the confirmation, when the number of cycles indicated by the HW status is less than the predetermined number, the task A ends within a predetermined time or less.
When the number of cycles indicated by the HW status is less than the predetermined number, the CPU 101 compares the priority of the task C to be executed next to the task B in the ready queue with the priority of the task A. The priority of task A is higher than the priority of task C. Therefore, the CPU 101 changes the execution order set in the ready queue and adds task A to the head of the ready queue without executing task C (S410).

HW依頼処理が終了すると、HWアクセラレータ103は、割込みによってCPU101に処理の終了を通知する(S411)。本実施形態のデータ処理装置では、割込みがあったときタスクがすでにレディキューに追加されていて、しかもCPU101が他のタスクを実行していない。このため、速やかに割込みに伴う処理をしてタスクAの実行を開始することができる。
割込みに伴う処理が終了すると、CPU101上でOSが動作してディスパッチャが起動する(S412)。次に、CPU101は、レディキューにおいて先頭にあるタスクAを実行する(S413:図中に実行開始のタイミングをt1として記す)。
When the HW request process ends, the HW accelerator 103 notifies the CPU 101 of the end of the process by interruption (S411). In the data processing apparatus of this embodiment, when an interrupt occurs, a task has already been added to the ready queue, and the CPU 101 is not executing another task. For this reason, it is possible to immediately start the execution of the task A by performing a process associated with the interruption.
When the process associated with the interrupt is completed, the OS operates on the CPU 101 and the dispatcher is activated (S412). Next, the CPU 101 executes task A at the head of the ready queue (S413: the execution start timing is indicated as t1 in the figure).

(従来の構成)
従来のデータ処理装置は、タスクAの処理の一部の実行をHWアクセラレータ103に依頼したことによってタスクAをレディキューから外した後にディスパッチャを起動する。そして、HWアクセラレータ103の処理状況によらず、レディキューにそってタスクB、タスクCを順次実行する。
(Conventional configuration)
The conventional data processing apparatus starts the dispatcher after removing the task A from the ready queue by requesting the HW accelerator 103 to execute part of the processing of the task A. Then, regardless of the processing status of the HW accelerator 103, task B and task C are sequentially executed along the ready queue.

HWアクセラレータ103は、HW依頼処理を終了すると、割込みによってCPU101に処理の終了を通知する。このとき、CPU101は、タスクCの実行中であって、タスクCよりも優先度が高いタスクA実行することを決定する。このため、タスクAをレディキューの先頭に追加してディスパッチャを起動する。ディスパッチャにより、CPU101は、タスクCに替えてタスクAを実行する(図中に実行開始のタイミングをt2として記す)。   When completing the HW request process, the HW accelerator 103 notifies the CPU 101 of the end of the process by an interrupt. At this time, the CPU 101 determines that the task A is being executed and the task A having a higher priority than the task C is being executed. Therefore, task A is added to the head of the ready queue to start the dispatcher. The CPU 101 executes the task A instead of the task C by the dispatcher (execution start timing is indicated as t2 in the figure).

このように、本実施形態のデータ処理装置は、タスクが終了した時点でHWアクセラレータ103におけるHW依頼処理の残りサイクル数を確認する点で従来の構成と相違する。また、HW依頼処理を含むタスクAの優先度がタスクCよりも高いことから、タスクCを実行することなくタスクAをレディキューに追加する。
このような処理によれば、本実施形態のデータ処理装置は、タスクの実行順序を変更し、HWアクセラレータ103による割込みに先んじてタスクAをレディキューに追加しておくことができる。また、割込みがなされた後にも、タスクCの実行を中断するためタスクCの処理中のデータをレジスタファイルに退避させる等の処理をすることなく、速やかにタスクAの実行の準備をすることができる。
As described above, the data processing apparatus according to the present embodiment is different from the conventional configuration in that the number of remaining cycles of the HW request processing in the HW accelerator 103 is confirmed when the task is completed. Further, since the priority of task A including the HW request process is higher than that of task C, task A is added to the ready queue without executing task C.
According to such processing, the data processing apparatus of the present embodiment can change the task execution order and add task A to the ready queue prior to the interruption by the HW accelerator 103. In addition, even after an interrupt is made, the execution of task A can be quickly prepared without processing such as saving the data being processed in task C to a register file in order to interrupt the execution of task C. it can.

このため、本実施形態は、処理の一部の実行をHWアクセラレータ103に依頼したことによって中断されたタスクAの実行を、従来の構成よりも図中に示す差分d(タイミングt1とタイミングt2との差分)の時間だけ早く開始することができる。
なお、本実施形態のデータ処理装置は、以上述べた構成に限定されるものではない。すなわち、以上述べた実施形態では、HWアクセラレータ103によって実行されている処理の残りサイクル数を進捗情報として書き込んでいる。しかしながら、進捗情報は、残りサイクル数に限定されるものでなく、例えば、残りサイクル数に基づいてフラグ等を立てるものであってもよい。
For this reason, in the present embodiment, the execution of the task A interrupted by requesting the HW accelerator 103 to execute a part of the processing is different from the conventional configuration in the difference d (timing t1 and timing t2 shown in the figure). Can be started earlier by the time of (difference).
Note that the data processing apparatus of the present embodiment is not limited to the configuration described above. That is, in the embodiment described above, the remaining number of cycles of the process executed by the HW accelerator 103 is written as progress information. However, the progress information is not limited to the number of remaining cycles, and for example, a flag or the like may be set based on the number of remaining cycles.

図6は、フラグを進捗情報としてHWステータスに使用したデータ処理装置の例を説明するための図であって、図6中に示した構成のうち、図1に示した構成と同一のものには同一の符号を付し、説明を一部省くものとする。
図示したデータ処理装置は、処理の残りサイクル数が記録されるステータスレジスタ107に代えて、フラグを立てる際のしきい値となるサイクル数(しきい値サイクル数:pre_done_cfg)が設定されるパラメータレジスタ608、残り処理数がしきい値サイクル数以下になった場合に立てられるフラグが書き込まれるステータスレジスタ607を備えている。
FIG. 6 is a diagram for explaining an example of a data processing apparatus that uses a flag as progress information for the HW status. Of the configurations shown in FIG. 6, the same configurations as those shown in FIG. Are given the same reference numerals, and a part of the explanation is omitted.
In the illustrated data processing apparatus, a parameter register in which a cycle number (threshold cycle number: pre_done_cfg) serving as a threshold for setting a flag is set instead of the status register 107 in which the remaining cycle number of processing is recorded. 608 is provided with a status register 607 into which a flag that is set when the number of remaining processes is equal to or less than the threshold cycle number is written.

図6に示したデータ処理装置は、制御部104が、現在実行中のHW依頼処理のサイクル数をカウントすると共に残りサイクル数を算出する。さらに、制御部104は、算出された残りサイクル数をパラメータレジスタ608に書き込まれたしきい値サイクル数と比較する。そして、残りサイクル数がしきい値サイクル数以下になった場合ステータス信号生成部105に指示してステータスレジスタ607に「1」のフラグ(pre_done_flag)を書き込ませる。   In the data processing apparatus shown in FIG. 6, the control unit 104 counts the number of cycles of the currently executing HW request process and calculates the number of remaining cycles. Further, the control unit 104 compares the calculated remaining cycle number with the threshold cycle number written in the parameter register 608. When the remaining number of cycles is equal to or less than the threshold number of cycles, the status signal generation unit 105 is instructed to cause the status register 607 to write a flag (pre_done_flag).

CPU101は、タスクが終了するとステータスレジスタ607を参照し、「1」のフラグが立ったことによってHWアクセラレータ103におけるHW依頼処理の終了が近いことを検出する。そして、HW依頼処理を含むタスクと、レディキューに設定されたタスクとの優先順位に応じてタスクの実行順序を変更する。
また、図6に示したデータ処理装置にあっても、CPU101は、メモリマップを参照することによってしきい値サイクル数やフラグといったHWステータスを認識する。
When the task is completed, the CPU 101 refers to the status register 607 and detects that the HW request process in the HW accelerator 103 is almost completed by setting the flag “1”. Then, the task execution order is changed according to the priority order of the task including the HW request process and the task set in the ready queue.
Also in the data processing apparatus shown in FIG. 6, the CPU 101 recognizes the HW status such as the threshold cycle number and flag by referring to the memory map.

図7は、CPU101によって参照されるメモリマップの一例である。本実施形態では、メモリマップのうちHWステータスが書き込まれるアドレスの範囲を予め設定しておく。そして、CPU101が、タスクが終了するごとにメモリマップの設定された範囲のアドレスに書き込まれたデータを参照することによって処理の残りサイクル数を認識する。
また、本実施形態のデータ処理装置は、しきい値サイクル数を任意に設定可能に構成することも可能である。このような構成は、例えば、ユーザの要望やデータ処理装置が扱うデータの種別、HWアクセラレータの処理内容に応じてデータ処理装置が含まれる機器の出荷時に所望の設定値をパラメータレジスタ608に書き込むことによって実現できる。
FIG. 7 is an example of a memory map referred to by the CPU 101. In the present embodiment, an address range in which the HW status is written in the memory map is set in advance. Then, the CPU 101 recognizes the number of remaining cycles of processing by referring to data written to addresses in a set range of the memory map every time a task is completed.
Further, the data processing apparatus of the present embodiment can be configured such that the number of threshold cycles can be arbitrarily set. In such a configuration, for example, a desired setting value is written in the parameter register 608 at the time of shipment of a device including the data processing device according to the user's request, the type of data handled by the data processing device, and the processing content of the HW accelerator. Can be realized.

また、予め所定のしきい値を複数設定しておき、タスクのパラメータ等に応じてCPU101が設定を変更するものであってもよい。
なお、以上の構成では、しきい値サイクルの値を書き替え可能なパラメータレジスタ608がしきい値記録手段となる。
Alternatively, a plurality of predetermined threshold values may be set in advance, and the CPU 101 may change the setting according to a task parameter or the like.
In the above configuration, the parameter register 608 that can rewrite the value of the threshold cycle serves as the threshold recording means.

本発明の一実施形態のデータ処理装置の構成を説明するための図である。It is a figure for demonstrating the structure of the data processor of one Embodiment of this invention. 図1に示したタスク管理テーブルの一例を示した図である。It is the figure which showed an example of the task management table shown in FIG. 図1に示したCPUによって参照されるメモリマップの一例を示した図である。It is the figure which showed an example of the memory map referred by CPU shown in FIG. 本発明の一実施形態のデータ処理装置の動作を説明するための図である。It is a figure for demonstrating operation | movement of the data processor of one Embodiment of this invention. 図4に示したタスクAの実行中にHW依頼処理をするタスクプログラムを示した図である。FIG. 5 is a diagram showing a task program that performs HW request processing during execution of task A shown in FIG. 4. 本発明の一実施形態のデータ処理装置の他の構成を説明するための図である。It is a figure for demonstrating the other structure of the data processor of one Embodiment of this invention. 図6に示したCPUによって参照されるメモリマップの一例を示した図である。It is the figure which showed an example of the memory map referred by CPU shown in FIG.

符号の説明Explanation of symbols

101 CPU、102 メモリ、103 HWアクセラレータ、104 制御部
105 ステータス信号生成部、106 演算部、107 ステータスレジスタ、108 タスク管理テーブル、607 ステータスレジスタ、608 パラメータレジスタ
101 CPU, 102 memory, 103 HW accelerator, 104 control unit 105 status signal generation unit, 106 operation unit, 107 status register, 108 task management table, 607 status register, 608 parameter register

Claims (6)

複数のタスクを、当該タスクの優先順位にしたがって順次実行する制御手段と、
前記制御手段の指示によって電子データを処理するデータ処理実行手段と、を備えるデータ処理装置であって、
前記データ処理実行手段は、
実行される電子データの処理の進捗状況を示す進捗情報を記録する進捗情報記録手段を備え、
前記制御手段は、
前記進捗情報記録手段によって記録された進捗情報を認識する進捗状況認識手段を備え、
前記進捗状況認識手段によって認識された進捗情報を含む情報に基づいてタスクを切替え、順次実行することを特徴とするデータ処理装置。
Control means for sequentially executing a plurality of tasks according to the priority order of the tasks;
A data processing device comprising: data processing execution means for processing electronic data according to an instruction from the control means;
The data processing execution means includes
A progress information recording means for recording progress information indicating a progress status of processing of electronic data to be executed;
The control means includes
Progress status recognition means for recognizing progress information recorded by the progress information recording means,
A data processing apparatus, wherein tasks are switched and executed sequentially based on information including progress information recognized by the progress status recognition means.
前記制御手段は、タスクの実行順序を設定する実行順序設定手段を備え、
前記実行順序設定手段は、前記進捗状況認識手段によって認識された進捗状況によって前記実行順序設定手段によって設定された実行順序を変更することを特徴とする請求項1に記載のデータ処理装置。
The control means includes an execution order setting means for setting an execution order of tasks,
The data processing apparatus according to claim 1, wherein the execution order setting unit changes the execution order set by the execution order setting unit according to a progress situation recognized by the progress situation recognition unit.
前記進捗情報記録手段が前記データ処理実行手段内のレジスタに進捗情報を記録すると共に、前記進捗状況認識手段は、前記進捗情報記録手段に割り当てられたメモリマップ上の対応するアドレスを参照して進捗情報を認識することを特徴とする請求項1または2に記載のデータ処理装置。   The progress information recording means records progress information in a register in the data processing execution means, and the progress status recognition means refers to a corresponding address on the memory map assigned to the progress information recording means. The data processing apparatus according to claim 1 or 2, wherein information is recognized. 前記進捗情報記録手段は、前記データ処理実行手段におけるデータ処理のうち残りのデータ処理にかかるサイクル数を進捗情報として記録することを特徴とする請求項1から3のいずれか1項に記載のデータ処理装置。   The data according to any one of claims 1 to 3, wherein the progress information recording means records the number of cycles for the remaining data processing among the data processing in the data processing execution means as progress information. Processing equipment. 前記進捗情報記録手段は、前記データ処理実行手段におけるデータ処理の残りが所定のデータ処理量であるしきい値以下であるか否かを判定し、しきい値以下であった場合、データ処理の残りがしきい値以下であることを示すフラグを進捗情報として記録することを特徴とする請求項1から3のいずれか1項に記載のデータ処理装置。   The progress information recording means determines whether or not the remainder of the data processing in the data processing execution means is equal to or less than a threshold value that is a predetermined data processing amount. The data processing apparatus according to any one of claims 1 to 3, wherein a flag indicating that the remainder is equal to or less than a threshold is recorded as progress information. 前記しきい値を記録すると共に、記録されたしきい値を変更することが可能なしきい値記録手段を備えることを特徴とする請求項5に記載のデータ処理装置。   6. The data processing apparatus according to claim 5, further comprising a threshold value recording unit capable of recording the threshold value and changing the recorded threshold value.
JP2005289679A 2005-10-03 2005-10-03 Data processor Withdrawn JP2007102399A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005289679A JP2007102399A (en) 2005-10-03 2005-10-03 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005289679A JP2007102399A (en) 2005-10-03 2005-10-03 Data processor

Publications (1)

Publication Number Publication Date
JP2007102399A true JP2007102399A (en) 2007-04-19

Family

ID=38029298

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005289679A Withdrawn JP2007102399A (en) 2005-10-03 2005-10-03 Data processor

Country Status (1)

Country Link
JP (1) JP2007102399A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010205046A (en) * 2009-03-04 2010-09-16 Toyota Motor Corp Information processing apparatus
JP2014178801A (en) * 2013-03-14 2014-09-25 Juki Corp Image processing apparatus and image processing method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010205046A (en) * 2009-03-04 2010-09-16 Toyota Motor Corp Information processing apparatus
JP2014178801A (en) * 2013-03-14 2014-09-25 Juki Corp Image processing apparatus and image processing method

Similar Documents

Publication Publication Date Title
US9727343B2 (en) Apparatus and method for handling exception events
US7992042B2 (en) Debug support device, and program for directing computer to perform debugging method
US6553487B1 (en) Device and method for performing high-speed low overhead context switch
EP3754492A1 (en) Interrupt system for risc-v architecture
US10824467B2 (en) Data processing system with protected mode of operation for processing protected content
US9092255B2 (en) Multi-core processor system, computer product, and control method for interrupt execution
JPH02267634A (en) Interrupt system
JP2005276097A (en) Interruption request program and microcomputer
JP4965638B2 (en) System and method for controlling task switching
JP2007102399A (en) Data processor
JP2006146758A (en) Computer system
JP2004078683A (en) Computer system and shared memory controlling method
JPH0916409A (en) Microcomputer
JP2011108140A (en) Data processor
JP2005258509A (en) Storage device
JP2007109038A (en) Data processor
JP2007109037A (en) Data processor
JP2008140124A (en) Data processor
JP2007241629A (en) Information processor and program for making computer execute information processing method
JPH05313916A (en) Electronic computer and its interruption processing method
JPH05233525A (en) Input/otuput processor
JPH0486923A (en) Task management controlling system
JPS61184644A (en) Control system of virtual computer system
JP2003223334A (en) Interruption processing method, os supporting system, information processor, and recording medium
JP2006146641A (en) Multi-thread processor and multi-thread processor interruption method

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070405

A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090106