JP6218645B2 - Program analysis apparatus, program analysis method, and program - Google Patents

Program analysis apparatus, program analysis method, and program Download PDF

Info

Publication number
JP6218645B2
JP6218645B2 JP2014042575A JP2014042575A JP6218645B2 JP 6218645 B2 JP6218645 B2 JP 6218645B2 JP 2014042575 A JP2014042575 A JP 2014042575A JP 2014042575 A JP2014042575 A JP 2014042575A JP 6218645 B2 JP6218645 B2 JP 6218645B2
Authority
JP
Japan
Prior art keywords
execution
time
task
path
execution path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2014042575A
Other languages
Japanese (ja)
Other versions
JP2015169997A (en
Inventor
亜希子 米田
亜希子 米田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2014042575A priority Critical patent/JP6218645B2/en
Publication of JP2015169997A publication Critical patent/JP2015169997A/en
Application granted granted Critical
Publication of JP6218645B2 publication Critical patent/JP6218645B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

本発明は、タスクの実行時間の算出に関する。   The present invention relates to calculation of task execution time.

多くの組込システムでは予め定められた時間(デッドライン)内で処理を完了する必要のあるリアルタイムタスクと、そうでない非リアルタイムタスクが存在する。
システム開発ではタスクの実行時間がデッドラインを超えないよう、タスクの最悪実行時間を算出してデッドラインを超えないことを確認している。
In many embedded systems, there are real-time tasks that need to be completed within a predetermined time (deadline) and non-real-time tasks that are not.
In system development, the worst execution time of a task is calculated and it is confirmed that it does not exceed the deadline so that the execution time of the task does not exceed the deadline.

従来の実行時間を算出する方法として、(1)プログラムコードを静的解析してプログラムの実行経路を解析し、各実行経路の実行時間から最長の実行時間を見積もる方法と、(2)プログラムを実機またはシミュレーションによって動的に実行させて実行時間を計測する方法がある。   As a conventional method of calculating the execution time, (1) a method of statically analyzing the program code to analyze the execution path of the program and estimating the longest execution time from the execution time of each execution path; There is a method of measuring the execution time by dynamically executing it with an actual machine or a simulation.

上記(1)の方法ではプログラムの全ての実行経路を計算しているため算出漏れがない。
しかし、プログラムの正確な実行時間を見積もるためには命令の実行数だけでなく、キャッシュヒット率やメモリ、I/O(Input/Output)アクセス時間等、H/W(Hardware)の挙動を考慮する必要がある。
上記(2)の方法ではH/Wの挙動も考慮することで、より正確な実行時間を算出することができるが、実行時間が最悪となる実行経路を実行しているかわからない。
In the method (1), since all execution paths of the program are calculated, there is no omission of calculation.
However, in order to estimate the exact execution time of a program, not only the number of instructions executed but also the behavior of H / W (Hardware) such as cache hit rate, memory, I / O (Input / Output) access time, etc. There is a need.
In the method (2), it is possible to calculate a more accurate execution time by considering the behavior of H / W, but it is not known whether the execution path having the worst execution time is being executed.

特許文献1では、プログラムを解析して実行経路を出力し、各実行経路の実行時間をH/Wの挙動を考慮して算出し、限界実行時間(最悪実行時間あるいは最良実行時間)を算出している。   In Patent Document 1, the program is analyzed and the execution path is output, the execution time of each execution path is calculated in consideration of the H / W behavior, and the limit execution time (worst execution time or best execution time) is calculated. ing.

国際公開WO2013−128519号公報International Publication WO2013-128519

しかし近年、組込システムでもキャッシュメモリが搭載されるようになり、メモリアクセス性能が向上するようになった一方で、実行時間がキャッシュミス率により変動するため、最悪実行時間の見積もりが困難となっている。
キャッシュミス率は自身のタスクの実行だけでなく、他のタスクの実行によっても影響される(正確には自身あるいは他の実行されるタスクの命令あるいはデータの配置(アドレス)によってキャッシュミス率が変わる)。
また、異なる実行優先度のリアルタイムタスクが複数存在し、優先度の高いリアルタイムタスク(A)が優先度の低いリアルタイム(B)の実行を中断させて実行するようなシステムも存在する。
この場合、優先度の低いリアルタイムタスク(B)の実行中断中に、キャッシュメモリに優先度の高いリアルタイムタスク(A)の命令またはデータが格納されることで、優先度の低いリアルタイムタスク(B)の命令またはデータが追い出されることがある。
リアルタイムタスク(B)が処理再開後にキャッシュメモリから追い出された命令またはデータを参照しようとした場合、キャッシュミスが発生するためメモリアクセス時間が増加する。
そのため、リアルタイムタスク(B)の実行時間は処理が途中で中断されなかった場合に比べて実行時間が増加する場合がある。
However, in recent years, embedded memory has become equipped with cache memory, and while memory access performance has improved, the execution time varies depending on the cache miss rate, making it difficult to estimate the worst execution time. ing.
The cache miss rate is influenced not only by the execution of its own task, but also by the execution of other tasks (exactly, the cache miss rate changes depending on the instruction or data arrangement (address) of itself or another executed task) ).
There are also systems in which a plurality of real-time tasks having different execution priorities exist, and a real-time task (A) having a higher priority interrupts execution of the real-time (B) having a lower priority and executes it.
In this case, the instruction or data of the real-time task (A) with high priority is stored in the cache memory while the execution of the real-time task (B) with low priority is interrupted, so that the real-time task (B) with low priority is stored. Instructions or data may be evicted.
When the real-time task (B) tries to refer to an instruction or data evicted from the cache memory after resuming processing, a memory miss occurs because a cache miss occurs.
Therefore, the execution time of the real-time task (B) may increase as compared with the case where the process is not interrupted in the middle.

特許文献1では上記のようにタスクの実行優先度を考慮した実行時間を算出を行っていないため、優先度の低いリアルタイムタスクが他の優先度の高いリアルタイムタスクによって処理が割り込まれたことを考慮した、正確なタスクの実行時間を見積もることができないという課題がある。   In Patent Document 1, since the execution time considering the task execution priority is not calculated as described above, it is considered that the processing is interrupted by a real-time task having a lower priority than another real-time task having a higher priority. However, there is a problem that an accurate task execution time cannot be estimated.

この発明は、上記のような課題を解決することを主な目的とし、タスクの実行時間を正確に算出することを主な目的とする。   The main object of the present invention is to solve the above problems, and to calculate the task execution time accurately.

本発明に係るプログラム解析装置は、
複数のタスクが生成される、複数のブロックで構成されたプログラムを解析し、タスクごとに、タスクにおいて実行されるブロック群を実行順に実行パスとして抽出する実行パス抽出部と、
前記プログラム実行時のタスクの生成順序に従って、各タスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて複数の配列パターンを生成する配列パターン生成部と、
配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出する実行時間算出部とを有することを特徴とする。
The program analysis apparatus according to the present invention includes:
An execution path extraction unit that analyzes a program composed of a plurality of blocks in which a plurality of tasks are generated and extracts a group of blocks executed in the task as an execution path for each task;
In accordance with the task generation order at the time of executing the program, an array pattern generating unit for arraying execution paths corresponding to each task and generating a plurality of array patterns by changing a combination of execution paths;
An execution time calculation unit that calculates an execution time of an execution path for each execution path when the execution paths included in the array pattern are sequentially executed for each arrangement pattern.

本発明によれば、プログラム実行時のタスクの生成順序に従って実行パスを配列した配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出するため、タスクの実行時間を正確に算出することができる。   According to the present invention, the execution time of the execution path when the execution paths included in the array pattern are sequentially executed is calculated for each execution path for each array pattern in which the execution paths are arranged in accordance with the task generation order during program execution. Therefore, the task execution time can be accurately calculated.

実施の形態1に係る最悪実行時間判定システムの構成例を示す図。1 is a diagram illustrating a configuration example of a worst execution time determination system according to a first embodiment. 実施の形態1に係る実行対象S/Wのリアルタイムタスクの処理例を示す図。The figure which shows the process example of the real-time task of execution object S / W which concerns on Embodiment 1. FIG. 実施の形態1に係る実行パスリストの例を示す図。FIG. 4 is a diagram showing an example of an execution path list according to the first embodiment. 実施の形態1に係るタスクスケジュールの例を示す図。FIG. 4 shows an example of a task schedule according to the first embodiment. 実施の形態1に係る配列パターンの例を示す図。FIG. 4 shows an example of an arrangement pattern according to the first embodiment. 実施の形態1に係るタスクスケジュールの例を示す図。FIG. 4 shows an example of a task schedule according to the first embodiment. 実施の形態2に係る最悪実行時間判定システムの構成例を示す図。The figure which shows the structural example of the worst execution time determination system which concerns on Embodiment 2. FIG. 実施の形態2に係る実行パスリストの例を示す図。FIG. 10 is a diagram showing an example of an execution path list according to the second embodiment. 実施の形態2に係るシミュレーション対象の配列パターンを決定する方法を示す図。FIG. 10 is a diagram illustrating a method for determining an array pattern to be simulated according to the second embodiment. 実施の形態1及び2に係る最悪実行時間判定システムのハードウェア構成例を示す図。The figure which shows the hardware structural example of the worst execution time determination system which concerns on Embodiment 1 and 2. FIG.

実施の形態1.
本実施の形態では、異なる優先度のリアルタイムタスクが存在するシステムにおいて、優先度の低いタスクが優先度の高いタスクの影響も考慮した最悪実行時間をより高精度に算出し、デッドラインを超えるかどうかをより正確に判定する構成を説明する。
Embodiment 1 FIG.
In this embodiment, in a system in which real-time tasks with different priorities exist, a task with a lower priority calculates the worst execution time considering the influence of a task with a higher priority more accurately, and exceeds the deadline. A configuration for more accurately determining whether will be described.

図1は、本実施の形態に係る最悪実行時間判定システム1000の構成例を示す。
図1において、実行対象S/W記憶部10は、リアルタイムタスクがデッドラインを超えるかどうかを判定する実行対象S/W(Software)を記憶する。
実行対象S/Wでは、2つ以上のリアルタイムタスクが存在し、各タスクに優先度が設定されている。
FIG. 1 shows a configuration example of a worst execution time determination system 1000 according to the present embodiment.
In FIG. 1, an execution target S / W storage unit 10 stores an execution target S / W (Software) for determining whether or not a real-time task exceeds a deadline.
In the execution target S / W, there are two or more real-time tasks, and a priority is set for each task.

実行パス解析部20は、実行対象S/Wを解析し、実行対象S/Wから各リアルタイムタスクの実行パスを算出する。
実行対象S/Wは、複数のブロックから構成されるプログラムであり、実行パスは、実行対象S/Wにおけるタスクごとの実行経路であり、タスクにおいて実行されるブロック群を実行順に連結したシークエンスである。
実行パス解析部20は、実行パス抽出部の例に相当する。
The execution path analysis unit 20 analyzes the execution target S / W and calculates the execution path of each real-time task from the execution target S / W.
The execution target S / W is a program composed of a plurality of blocks, the execution path is an execution path for each task in the execution target S / W, and is a sequence in which blocks executed in the task are connected in the execution order. is there.
The execution path analysis unit 20 corresponds to an example of an execution path extraction unit.

実行パスリスト記憶部30は、実行パスリストを記憶する。
実行パスリストは、実行パス解析部20によって算出されたタスクごとの実行パスのリストと、各パスを実行するための条件を表す情報である。
The execution path list storage unit 30 stores an execution path list.
The execution path list is information representing a list of execution paths for each task calculated by the execution path analysis unit 20 and conditions for executing each path.

タスクスケジュール記憶部60は、タスクスケジュールを記憶する。
タスクスケジュールは、対象のシステムのタスクの実行スケジュール情報である。
タスクスケジュールには、タスクの生成順序が記述されるとともに、タスクごとに上限の実行時間であるデッドライン(上限時間)が記述されている。
タスクスケジュールは上限時間情報の例に相当する。
また、タスクスケジュール記憶部60は、上限時間情報記憶部の例に相当する。
The task schedule storage unit 60 stores a task schedule.
The task schedule is task execution schedule information of the target system.
In the task schedule, the generation order of tasks is described, and a deadline (upper limit time) that is an upper limit execution time is described for each task.
The task schedule corresponds to an example of upper limit time information.
The task schedule storage unit 60 corresponds to an example of an upper limit time information storage unit.

実行パス組み合わせ決定部40は、実行パスリストとタスクスケジュールからシミュレーションする実行パスの組み合わせを決定する。
より具体的には、実行パス組み合わせ決定部40は、タスクスケジュールに示されるタスクの生成順序に従って、各タスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて複数の配列パターンを生成する。
実行パス組み合わせ決定部40は、配列パターン生成部の例に相当する。
The execution path combination determination unit 40 determines a combination of execution paths to be simulated from the execution path list and the task schedule.
More specifically, the execution path combination determination unit 40 arranges execution paths corresponding to each task according to the task generation order indicated in the task schedule, and changes the combination of execution paths to generate a plurality of arrangement patterns. Generate.
The execution path combination determination unit 40 corresponds to an example of an array pattern generation unit.

実行時間算出部100は、実行パスの組合せである配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出する。
実行時間算出部100は、シミュレーション部50、変数操作部70及びキャッシュ無効化部80で構成される。
The execution time calculation unit 100 calculates, for each execution path, the execution time of the execution path when the execution paths included in the array pattern are sequentially executed for each array pattern that is a combination of execution paths.
The execution time calculation unit 100 includes a simulation unit 50, a variable operation unit 70, and a cache invalidation unit 80.

シミュレーション部50は、実行対象S/Wのプログラムをシミュレーション実行するシミュレータである。
シミュレーション部50は、実行対象S/Wの実行環境を模擬して、実行対象S/Wの実行時間を算出する。
シミュレーション部50にはキャッシュメモリの動作をシミュレーションするキャッシュシミュレータも備えている。
The simulation unit 50 is a simulator that executes a simulation of the program of the execution target S / W.
The simulation unit 50 simulates the execution environment of the execution target S / W and calculates the execution time of the execution target S / W.
The simulation unit 50 also includes a cache simulator that simulates the operation of the cache memory.

変数操作部70は、シミュレーション部50にて実行パス組み合わせ決定部40で組み合わせた実行パス通りにシミュレーションを行うために、シミュレーション中の変数値を操作する。   The variable operation unit 70 operates variable values during simulation in order to perform a simulation according to the execution paths combined by the execution path combination determination unit 40 in the simulation unit 50.

キャッシュ無効化部80は、シミュレーション部50の実行中の任意のタイミングにてシミュレーション部50に備えるキャッシュシミュレータ内のデータを無効化する。   The cache invalidation unit 80 invalidates data in the cache simulator provided in the simulation unit 50 at an arbitrary timing during the execution of the simulation unit 50.

最悪実行時間判定部90は、シミュレーション部50にて実行対象S/Wを実行した結果、リアルタイムタスクがデッドラインを超えるかどうかを判定する。   The worst execution time determination unit 90 determines whether or not the real-time task exceeds the deadline as a result of executing the execution target S / W by the simulation unit 50.

各機能ブロックは1つあるいは複数のプログラムとして実装されていてもよいし、複数の機能ブロックが1つのプログラムとして実装されていてもよい。
実行対象S/Wは1つまたは複数のプログラムの実行ファイルとして存在してもよいし、メモリ上に展開されたプログラムでもよい。
実行パスリスト、タスクスケジュールはファイルとして存在してもよいし、メモリ上にのみ配置されるデータであってもよい。
Each functional block may be implemented as one or a plurality of programs, or a plurality of functional blocks may be implemented as one program.
The execution target S / W may exist as an execution file of one or a plurality of programs, or may be a program expanded on a memory.
The execution path list and the task schedule may exist as files, or may be data arranged only on the memory.

次に動作について説明する。   Next, the operation will be described.

まず、実行パス解析部20にて実行対象S/Wの各タスクの実行パスのリストを算出する。
実行パスの算出例について図2のフローチャートを用いて説明する。
First, the execution path analysis unit 20 calculates a list of execution paths for each task of the execution target S / W.
An execution path calculation example will be described with reference to the flowchart of FIG.

図2は、あるリアルタイムタスクの処理を示すフローチャートである。
図2の各ブロックは1つ以上の命令を表し、ブロック2、ブロック4は分岐命令を表し、本例ではそれぞれの成立条件をX<0、Y=1とする。
このとき、タスクの実行パスは以下の3通りが考えられ、それぞれの実行パスが実行される条件は()に記載したものとなる。
・ブロック1→ブロック2(X<0)
・ブロック1→ブロック2→ブロック3→ブロック4→ブロック5(X>=0かつY≠1)
・ブロック1→ブロック2→ブロック3→ブロック4→ブロック6→ブロック5(X>=0かつY=1)
従って、図2に示したタスクから得られる実行パスリストは図3のようになる。
図3では分岐条件をX<0のように値の範囲で示したが、X=−1のように条件が成立する任意の値を条件として記述してもよい。
全てのリアルタイムタスクについて上記手順を行い、各リアルタイムタスクの実行パスを算出する。
FIG. 2 is a flowchart showing processing of a certain real-time task.
Each block in FIG. 2 represents one or more instructions, and block 2 and block 4 represent branch instructions. In this example, the establishment conditions are X <0 and Y = 1.
At this time, the following three types of task execution paths are conceivable, and the conditions for executing each execution path are those described in ().
Block 1 → Block 2 (X <0)
Block 1 → Block 2 → Block 3 → Block 4 → Block 5 (X> = 0 and Y ≠ 1)
-Block 1-> Block 2-> Block 3-> Block 4-> Block 6-> Block 5 (X> = 0 and Y = 1)
Therefore, the execution path list obtained from the task shown in FIG. 2 is as shown in FIG.
In FIG. 3, the branch condition is shown as a range of values such that X <0. However, any value that satisfies the condition such as X = −1 may be described as the condition.
The above procedure is performed for all real-time tasks, and the execution path of each real-time task is calculated.

次に、実行パス組み合わせ決定部40の動作について説明する。
実行パス組み合わせ決定部40は、実行パス解析部20で算出した実行パスリストをタスクスケジュールに基づいてシミュレーション実行する実行パスの組み合わせ(配列パターン)を決定する。
タスクスケジュールは、タスクの実行スケジュールを示す情報であり、リアルタイムタスクの各タスクの実行周期とデッドライン、実行優先度が格納されている。
Next, the operation of the execution path combination determination unit 40 will be described.
The execution path combination determination unit 40 determines an execution path combination (array pattern) for executing a simulation of the execution path list calculated by the execution path analysis unit 20 based on the task schedule.
The task schedule is information indicating a task execution schedule, and stores the execution cycle, deadline, and execution priority of each task of the real-time task.

本実施の形態の実行対象S/Wが動作するシステムのタスクの実行スケジュール例を図4に示す。
タスクA、タスクBは、いずれもリアルタイムタスクであり、デッドラインは次のタスク実行の開始までとする。
タスクA、タスクBは、いずれも予め決められた実行周期のタイミング(タスクAはT1、T3、T6、タスクBはT1、T6)で実行される。
図4の例では、タスクAの実行周期はタスクBの実行周期の半分であり、かつ、実行優先度はタスクAのほうが高い。
そのため、タスクBの実行中にタスクAの実行開始タイミングとなると、プロセッサはタスクBの実行を一時中断し、タスクAの処理を行う(T3〜T4のタイミングが該当)。
その後、タスクAの処理が完了するとタスクBの処理を再開する(T4のタイミング)。
FIG. 4 shows an example of the task execution schedule of the system in which the execution target S / W of the present embodiment operates.
Task A and task B are both real-time tasks, and the deadline is until the start of the next task execution.
Both task A and task B are executed at the timing of a predetermined execution cycle (task A is T1, T3, T6, task B is T1, T6).
In the example of FIG. 4, the execution cycle of task A is half of the execution cycle of task B, and the execution priority of task A is higher.
Therefore, when the execution start timing of task A is reached during the execution of task B, the processor suspends the execution of task B and performs the processing of task A (the timing from T3 to T4 is applicable).
Thereafter, when the processing of task A is completed, the processing of task B is resumed (timing T4).

実行パスの組み合わせでは、全てのリアルタイムタスクの実行周期の最小公倍数となる期間のタスクのスケジュールを行う。
本例ではタスクAとタスクBの実行周期が1:2のため、タスクAが2回、タスクBが1回実行される場合のタスクの組み合わせを行う。
In the combination of execution paths, tasks are scheduled for a period that is the least common multiple of the execution cycle of all real-time tasks.
In this example, since the execution cycle of task A and task B is 1: 2, task combination is performed when task A is executed twice and task B is executed once.

実行パス解析部20は、算出した実行パスリストから、タスクAの実行パスがA1、A2、A3の3通り、タスクBの実行パスがB1、B2の2通りあったとすると、実行パスの組み合わせは、図5に示す18通りが考えられる。
つまり、図4のタスクAとタスクBの生成順序に沿って、各タスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて18通りの配列パターンを生成する。
そして、シミュレーション部50が、この18通りの配列パターンのそれぞれの実行パスの組み合わせについてシミュレーションを実行し、実行時間を算出する。
If the execution path analysis unit 20 assumes that there are three execution paths A1, A2, and A3 and two execution paths B1 and B2 from the calculated execution path list, the combination of execution paths is as follows. There are 18 ways shown in FIG.
That is, the execution paths corresponding to each task are arranged in accordance with the generation order of task A and task B in FIG. 4, and the combinations of the execution paths are changed to generate 18 arrangement patterns.
And the simulation part 50 performs a simulation about the combination of each execution path of these 18 kinds of arrangement patterns, and calculates execution time.

次に、シミュレーション部50にて実行時間を算出する動作を説明する。
シミュレーション部50は、図5に示した18通りの実行パスの組み合わせを1つずつ実行し、実行時間を算出する。
シミュレーション部50は、実行対象S/Wを実行するためのシミュレータであり、実行対象S/Wが動作するシステム(ターゲットシステム)のハードウェア構成(特にキャッシュメモリのエントリの競合)を模擬し、ターゲットシステムのハードウェア仕様に基づいた命令実行時間や、キャッシュミスによるミスペナルティを考慮した実行時間を考慮して実行対象S/Wを実行するものとする。
このようなシミュレータは参考文献1などによって既に考えられている。
図4のようにシミュレーション部50がタスクA、タスクBをそれぞれの実行周期(タイミング)と優先度に基づいて実行する方法としては、シミュレーション部50に備わっているターゲットシステムによるハードウェアタイマに基づいた割り込みや、実行対象S/Wを実行する、あるいは実行対象S/Wに含まれるOS(Operating System)によって実現する方法があり、いずれもシミュレーション部50によるシミュレーション環境構築時に容易に実装することができる。
参考文献1:特開2013−222392号公報
Next, the operation for calculating the execution time in the simulation unit 50 will be described.
The simulation unit 50 executes the 18 execution path combinations shown in FIG. 5 one by one and calculates the execution time.
The simulation unit 50 is a simulator for executing the execution target S / W. The simulation unit 50 simulates the hardware configuration of the system (target system) on which the execution target S / W operates (particularly, contention for cache memory entries), and the target It is assumed that the execution target S / W is executed in consideration of an instruction execution time based on the hardware specifications of the system and an execution time considering a miss penalty due to a cache miss.
Such a simulator has already been considered by Reference 1 and the like.
As shown in FIG. 4, the simulation unit 50 executes the tasks A and B based on the respective execution periods (timing) and priorities based on the hardware timer by the target system provided in the simulation unit 50. There are methods that can be implemented by an interrupt, an execution target S / W, or an OS (Operating System) included in the execution target S / W, which can be easily implemented when the simulation unit 50 builds a simulation environment. .
Reference 1: JP 2013-222392 A

シミュレーション部50が指定した実行パスの組み合わせを実行するようにするために、変数操作部70は各タスクの実行開始時(図4のようなタスクスケジューリングの場合はT1、T2、T3のタイミング)に各パスの実行条件が成立するようにシミュレータ内の変数値を変更する。
例えばタスクAの実行パスA1〜3が図3のNo.1〜3にそれぞれ対応し、図5のNo.3の実行パスの組み合わせ(すなわちA1→B1→A3)を実行する場合、変数操作部70は図4のT1のタイミングでX=−1を設定し、T3のタイミングでX=0、Y=1を設定する。
また、タスクBの実行パスの実行条件がタスクAの実行パスの実行条件と同じ変数を使用する場合(例えばタスクBがB1を実行する条件がX=2の場合)は、タスクBが再開するタイミング(図4の場合はT4のタイミング)において、再度変数の値を設定する。
In order to execute the combination of execution paths designated by the simulation unit 50, the variable operation unit 70 starts the execution of each task (in the case of task scheduling as shown in FIG. 4, timings T1, T2, and T3). The variable value in the simulator is changed so that the execution condition for each pass is satisfied.
For example, the execution paths A1 to A3 of task A are shown in No. No. 1 in FIG. 3 is executed, the variable operation unit 70 sets X = -1 at the timing T1 in FIG. 4, and X = 0 and Y = 1 at the timing T3. Set.
In addition, when the execution condition of the execution path of task B uses the same variable as the execution condition of the execution path of task A (for example, when the condition under which task B executes B1 is X = 2), task B resumes. At the timing (T4 timing in the case of FIG. 4), the value of the variable is set again.

キャッシュ無効化部80は、シミュレーション部50が実行を開始する時にシミュレーション部50の内部に存在するキャッシュメモリ(の動作を模擬するモデル)の全てのエントリを無効化し、キャッシュにデータが何も存在していない状態にする。
これにより、シミュレーション開始時はキャッシュメモリにタスクAの命令およびデータが存在しないため、その実行パスにおける最悪実行時間を算出することができる。
The cache invalidation unit 80 invalidates all entries in the cache memory (a model for simulating the operation) existing in the simulation unit 50 when the simulation unit 50 starts execution, and there is no data in the cache. Not in a state.
Thereby, since the instruction and data of task A do not exist in the cache memory at the start of simulation, the worst execution time in the execution path can be calculated.

また、キャッシュ無効化部80はシミュレーション開始時だけでなく、非リアルタイムタスクが動作する可能性のあるタイミングでもキャッシュメモリの全てのエントリを無効化する。
例えば図6のようにタスクBがタスクAの2回目の実行開始タイミングであるT13よりも前のT12のタイミングで処理を完了した場合、キャッシュ無効化部80は2回目のタスクAの実行開始タイミングであるT13でもシミュレーション部50の内部に存在するキャッシュメモリの全てのエントリを無効化する。
これはT12からT13の間に非リアルタイムタスクが動作する可能性があるためであり、非リアルタイムタスクの実行により、タスクAのどのキャッシュデータが追い出されるか(あるいは全く追い出されないか)は実行される非リアルタイムタスクのプログラムによって変わってくるため、全てのキャッシュデータが追い出される、最悪の実行時間を算出するためである(シミュレーション部50はT12からT13のときに非リアルタイムタスクのシミュレーションすることはしない)。
これにより、T12からT13の間に非リアルタイムタスクが動作し、リアルタイムタスクAのデータが追い出されることを考慮した最悪実行時間を算出することができる。
The cache invalidation unit 80 invalidates all entries in the cache memory not only at the start of simulation but also at a timing at which a non-real-time task may operate.
For example, as shown in FIG. 6, when task B completes processing at timing T12 before T13, which is the second execution start timing of task A, the cache invalidation unit 80 starts execution timing of the second task A. Even at T13, all entries in the cache memory existing in the simulation unit 50 are invalidated.
This is because a non-real-time task may operate between T12 and T13, and which cache data of task A is evicted (or not evicted at all) by execution of the non-real-time task is executed. This is to calculate the worst execution time in which all cache data is evicted because it varies depending on the non-real-time task program (the simulation unit 50 does not simulate the non-real-time task from T12 to T13). ).
As a result, it is possible to calculate the worst execution time in consideration of the fact that the non-real-time task operates between T12 and T13 and the data of the real-time task A is evicted.

以上のように、キャッシュ無効化部80は、シミュレーション実行開始時またはリアルタイムタスクの実行の合間すなわち、非リアルタイムタスクが実行される可能性のあるタイミングでキャッシュメモリの全てのエントリを無効化する。   As described above, the cache invalidation unit 80 invalidates all entries in the cache memory at the start of simulation execution or between executions of a real-time task, that is, at a timing at which a non-real-time task may be executed.

シミュレーション部50は組み合わせを実行したときの各タスクの実行完了時刻を算出する。
例えば、図4の場合、タスクA(1回目)の実行完了時刻はT2、タスクBの実行完了時刻はT5、タスクA(2回目)の時刻完了時刻はT4となる。
The simulation unit 50 calculates the execution completion time of each task when the combination is executed.
For example, in the case of FIG. 4, the execution completion time of task A (first time) is T2, the execution completion time of task B is T5, and the time completion time of task A (second time) is T4.

最悪実行時間判定部90は、シミュレーション部50が出力した実行完了時刻とタスクスケジュールから、タスクの実行パスの組み合わせによる各リアルタイムタスクの実行時間がデッドラインを超えないかを確認する。
具体的には、図4の場合であれば、タスクA(1回目)の実行完了時刻が2回目のタスクAの実行完了時刻であるT3を超えていないこと、タスクB、タスクA(2回目)の実行完了時刻が次のタスクB、タスクAの実行開始時刻であるT6を超えていないことを確認し、いずれかのタスクの実行完了時刻がデッドラインを超えていた場合は、実行対象S/Wはデッドラインを超えると判定する。
The worst execution time determination unit 90 confirms whether the execution time of each real-time task by a combination of task execution paths does not exceed the deadline from the execution completion time and task schedule output by the simulation unit 50.
Specifically, in the case of FIG. 4, the task A (first time) execution completion time does not exceed the second task A execution completion time T3, task B, task A (second time). ) Execution completion time does not exceed T6 which is the execution start time of the next task B and task A. If the execution completion time of any task exceeds the deadline, the execution target S It is determined that / W exceeds the deadline.

実行パス組み合わせ決定部40にて算出した全ての実行パスの組み合わせについて最悪実行時間判定部90がデッドラインを超えないと判定した場合は、実行対象S/Wはターゲットのシステムの上でデッドラインを超えないということができる。   When the worst execution time determination unit 90 determines that the execution path combination determination unit 40 does not exceed the deadline for all execution path combinations calculated, the execution target S / W sets the deadline on the target system. It can be said that it does not exceed.

以上が実施の形態1の動作である。   The above is the operation of the first embodiment.

<実施の形態1の効果>
以上のように、本実施の形態では、実行パス解析部20にて実行対象S/Wの全ての実行パスを解析した後、タスクスケジュールに記しているタスクの実行スケジュールに合わせてシミュレーションを行って実行時間を算出する。
このため、優先度の低いタスクBの実行時間は優先度の高いタスクAによる処理の中断による影響を考慮した実行時間を算出されることから、優先度の低いタスクBがデッドラインをミスするかをより正確に判定することができる。
<Effect of Embodiment 1>
As described above, in the present embodiment, after the execution path analysis unit 20 analyzes all the execution paths of the execution target S / W, the simulation is performed according to the task execution schedule described in the task schedule. Calculate the execution time.
For this reason, the execution time of task B with a low priority is calculated in consideration of the influence of processing interruption by task A with a high priority, so whether task B with a low priority misses a deadline. Can be determined more accurately.

<実施の形態1の変形例>
本実施の形態では、全ての実行パスの組み合わせをシミュレーションし、各実行パスの組み合わせの実行時間がデッドラインを超えないことを判定するようにしたが、最悪実行時間判定部90がデッドラインを超えると判断した場合は、実行対象S/Wがデッドラインを超えることが既に確認できているため、以降の実行パスの組み合わせのシミュレーションを実行せずに終了してもよい。
これにより、判定時間を短縮することができる。
<Modification of Embodiment 1>
In this embodiment, all execution path combinations are simulated and it is determined that the execution time of each execution path combination does not exceed the deadline. However, the worst execution time determination unit 90 exceeds the deadline. If it is determined that the execution target S / W has already exceeded the deadline, it may be terminated without executing the simulation of the combination of subsequent execution paths.
Thereby, the determination time can be shortened.

また、本実施の形態では、シミュレーション部50にて実行する実行パスの組み合わせの順番について記載していないが、実行パス解析部20にて解析した実行パスの長いものを組み合わせたものから実行してもよい。
この場合、デッドラインを超える可能性の高いパスからシミュレーション実行していくので、早期にデッドラインを超えると判定される可能性がある。
このとき、先ほど説明したように、デッドラインを超えると判定されると以降のシミュレーション実行を行わずに終了すれば、判定時間をさらに短縮することができる。
In this embodiment, the order of combinations of execution paths executed by the simulation unit 50 is not described. However, the execution path analysis unit 20 executes a combination of long execution paths. Also good.
In this case, since the simulation is executed from a path that is highly likely to exceed the deadline, it may be determined that the deadline is exceeded early.
At this time, as described above, if it is determined that the deadline is exceeded, the determination time can be further shortened if the simulation is terminated without performing the subsequent simulation.

ここでいう実行パスの長いものとしては、命令数の多いもの、メモリやI/Oのアクセス回数の多いもの(あるいはアクセス時間が長いもの)、命令数とメモリ、I/Oのアクセス時間の両方を考慮したものなどが挙げられる。
また、これらのほかにシミュレーション部50を用いて各実行パス単体を実行したときの実行時間を算出し、その時間が長いものを実行パスの長いものとしてもよい(実施の形態2に記載)。
Long execution paths here include those with a large number of instructions, those with a large number of memory and I / O accesses (or those with a long access time), both the number of instructions and the memory and I / O access times. Can be considered.
In addition to these, the execution time when each execution path alone is executed using the simulation unit 50 may be calculated, and a long execution path may be a long execution path (described in the second embodiment).

実施の形態2.
以上の実施の形態1では、実行パス解析部20で算出したタスクごとの実行パスについて、タスクスケジュールに記載されているタスクの実行スケジュールに合わせた総組み合わせを実施する。
しかし、一般的にタスクごとの実行パスは多数(数十〜数百以上)存在し、そのパスをタスクの実行スケジューリングに合わせて組み合わせたときの総組み合わせ数は膨大となり、全てをシミュレーションして実行時間を算出するのは現実的ではない。
そこで、実行パスの組み合わせを決定する数を削減する実施の形態を示す。
Embodiment 2. FIG.
In the first embodiment described above, a total combination according to the task execution schedule described in the task schedule is performed for the execution paths for each task calculated by the execution path analysis unit 20.
However, there are generally many execution paths (several tens to several hundreds or more) for each task, and the total number of combinations when the paths are combined in accordance with the task execution scheduling is enormous. It is not realistic to calculate time.
Therefore, an embodiment in which the number of determining execution path combinations is reduced will be described.

図7は本実施の形態に係る最悪実行時間判定システム1000の構成例を表す。
図1と同じ構成、動作を行うものについては同じ番号を振り、説明は省略する。
FIG. 7 shows a configuration example of the worst execution time determination system 1000 according to the present embodiment.
Components that perform the same configuration and operation as those in FIG.

実施の形態2では実行パスリスト記憶部31で記憶する実行パスリストに格納する情報が一部追加され、実行パス組み合わせ決定部41の動作内容が異なる。
本実施の形態に係る実行パスリストを、以下では、実行パスリスト310と表記する。
図7では流れの説明上、2つの実行時間算出部100が存在しているが、同一のものを想定している。
In the second embodiment, part of information stored in the execution path list stored in the execution path list storage unit 31 is added, and the operation content of the execution path combination determination unit 41 is different.
Hereinafter, the execution path list according to the present embodiment is referred to as an execution path list 310.
In FIG. 7, there are two execution time calculation units 100 for explanation of the flow, but the same one is assumed.

実施の形態2で実施の形態1と異なる点について説明する。   A difference between the second embodiment and the first embodiment will be described.

実行の形態2では、まず実行パス解析部20にて実施の形態1と同様に実行パスのリストを算出したのち、実行時間算出部100が、各実行パスを単体で実行したときの実行時間を算出する。
このとき、実行時間算出部100にあるキャッシュ無効化部80がシミュレーション部50の内部にあるキャッシュメモリを無効状態にして実行し、常にキャッシュメモリの先にあるメインメモリからデータを取得したときの各実行パスの実行時間を算出する。
これにより、最悪の実行時間を算出することができる(実際はキャッシュメモリが有効になっているので、この時間ほど悪くなることはない)。
In the execution mode 2, first, the execution path analysis unit 20 calculates a list of execution paths in the same manner as in the first embodiment, and then the execution time calculation unit 100 calculates the execution time when each execution path is executed alone. calculate.
At this time, each cache invalidation unit 80 in the execution time calculation unit 100 executes the cache memory in the simulation unit 50 in an invalid state, and always obtains data from the main memory ahead of the cache memory. Calculate the execution time of the execution path.
As a result, the worst execution time can be calculated (in fact, since the cache memory is enabled, it is not as bad as this time).

実行パスリスト310には、図8のようにキャッシュの実行パスとその実行パスを実行するための実行条件に加え、実行時間算出部100で算出した各パスの実行時間が格納される。   The execution path list 310 stores the execution time of each path calculated by the execution time calculation unit 100 in addition to the cache execution path and the execution condition for executing the execution path as shown in FIG.

実行パス組み合わせ決定部41は実施の形態1同様、実行パスリスト310に格納されている実行パスとタスクスケジュールに基づいて、実行パスの組み合わせを行う。
その上で、組み合わせの中から、デッドラインを超える可能性のある実行パスの組み合わせを抽出してシミュレーション部50で実行時間の算出を行う。
As in the first embodiment, the execution path combination determination unit 41 performs execution path combinations based on the execution paths and task schedules stored in the execution path list 310.
Then, from the combinations, combinations of execution paths that may exceed the deadline are extracted, and the simulation unit 50 calculates the execution time.

デッドラインを超える可能性のある実行パスの組み合わせの抽出方法を図9の例を用いて説明する。
例ではタスクAとタスクBのリアルタイムタスクが図4と同じ実行スケジュールで実行される。
タスクAの実行周期は50ms、タスクBの実行周期が100msとする。
また、タスクAはA1、A2、A3の3種類、タスクBはB1、B2の2種類の実行パスが存在し、それぞれの単体の実行時間はA1、A2、A3が5ms、20ms、60ms、B1、B2は30ms、70msであったとしている。
このとき、タスクAとタスクBの実行スケジュールに応じた実行パスの組み合わせは図9の18通りになる。
ここで、実行パス組み合わせ決定部41は、組み合わせた18通りに対するそれぞれの単体の実行時間の合計を算出し、実行時間の合計がタスクの実行パスの組み合わせを行ったスケジューリング期間(ここでは100ms)を超えるものに対してシミュレーション部50にて実行時間を算出する。
図9ではNo.6、9、11、12、14、15、16、17、18の9個の組み合わせが該当する。
A method for extracting a combination of execution paths that may exceed the deadline will be described with reference to the example of FIG.
In the example, the real-time tasks of task A and task B are executed with the same execution schedule as in FIG.
The execution cycle of task A is 50 ms, and the execution cycle of task B is 100 ms.
Task A has three types of execution paths A1, A2 and A3, and task B has two types of execution paths B1 and B2. The individual execution times of A1, A2, and A3 are 5 ms, 20 ms, 60 ms, and B1. , B2 is 30 ms and 70 ms.
At this time, there are 18 combinations of execution paths according to the execution schedules of task A and task B in FIG.
Here, the execution path combination determination unit 41 calculates the total execution time of each single unit for the 18 combinations, and the execution time is a scheduling period (here, 100 ms) in which the execution path combinations of the tasks are performed. The simulation unit 50 calculates the execution time for those that exceed.
In FIG. Nine combinations of 6, 9, 11, 12, 14, 15, 16, 17, 18 are applicable.

また、タスク単体の実行時間がデッドライン(実行周期)を超えているものに対してもシミュレーション部50にて実行時間を算出する。
図9ではNo.3、6、9、12、13〜18の10通りが該当する。
The simulation unit 50 also calculates an execution time for a task whose execution time exceeds a deadline (execution cycle).
In FIG. Ten types of 3, 6, 9, 12, 13 to 18 are applicable.

これらの中から重複を除いた11通りが、シミュレーション部50で実行時間を測定する実行パスの組み合わせとなる。   Among these, 11 combinations excluding duplication are combinations of execution paths for which the simulation unit 50 measures the execution time.

以上が実行パス組み合わせ決定部41による実行パスの組み合わせ数を減らす動作の説明である。   The above is description of the operation | movement which reduces the number of execution path combinations by the execution path combination determination part 41. FIG.

<実施の形態2の効果>
以上のように、本実施の形態では実行パス組み合わせ決定部41にて、デッドラインを超える可能性のある実行パスの組み合わせに限定してシミュレーションを行うことで、デッドラインを越えるかどうかの判定を行う時間を削減することができる。
<Effect of Embodiment 2>
As described above, in the present embodiment, the execution path combination determination unit 41 determines whether or not the deadline is exceeded by performing simulation only for combinations of execution paths that may exceed the deadline. Time to do can be reduced.

<実施の形態2の変形例>
本実施の形態ではキャッシュメモリがない状態の各実行パスの実行時間をもとに組み合わせを減らすようにしたが、キャッシュメモリによる処理時間短縮の効果が大きい場合、実行時間が実際よりもはるかに大きくなり、ほぼ全ての組み合わせを実行する可能性がある。
そこで、キャッシュメモリを有効(使用可能な状態)にし、実行開始時にキャッシュメモリに何もない状態からシミュレーション実行したときの実行時間をもとに組み合わせを減らしてもよい。
ただし、この場合は優先度の高いタスクが途中で割り込まれたときにキャッシュから追い出されることによるキャッシュミス数増加による遅延を考慮するため、実際に算出した実行時間にマージンとなる時間を足した時間を各実行パスの実行時間とする。
マージンとなる時間は実行パスごとに一律の時間でもよいし、キャッシュヒット数、キャッシュ使用量などのキャッシュの使用特性に応じて設定してもよい。
<Modification of Embodiment 2>
In this embodiment, the number of combinations is reduced based on the execution time of each execution path when there is no cache memory. However, when the effect of reducing the processing time by the cache memory is large, the execution time is much longer than the actual time. There is a possibility of executing almost all combinations.
Therefore, the cache memory may be enabled (a usable state), and the number of combinations may be reduced based on the execution time when the simulation is executed from a state where there is nothing in the cache memory at the start of execution.
However, in this case, in order to take into account the delay due to the increase in the number of cache misses due to being expelled from the cache when a high priority task is interrupted halfway, the time calculated by adding the margin time to the actual execution time Is the execution time of each execution path.
The margin time may be uniform for each execution path, or may be set according to cache usage characteristics such as the number of cache hits and cache usage.

本実施の形態の変形例としては、実施の形態1と同様、最悪実行時間判定部90がデッドラインを超えると判断すると以降の実行パスの組み合わせのシミュレーションを実行せずに終了してもよい。これによる効果は実施の形態1と同じく、判定時間を短縮できる。   As a modification of the present embodiment, similar to the first embodiment, if the worst execution time determination unit 90 determines that the deadline is exceeded, the simulation may be terminated without executing a simulation of the combination of subsequent execution paths. As a result, the determination time can be shortened as in the first embodiment.

また、シミュレーション部50にて実行する実行パスの組み合わせの順番についても、実行パス組み合わせ決定部41が算出した実行時間の合計が最も大きいものを組み合わせたものから実行してもよい。
この場合、デッドラインを超える可能性の高いパスからシミュレーション実行していくので、早期にデッドラインを超えると判定される可能性がある。
このとき、デッドラインを超えると判定されると以降のシミュレーション実行を行わずに終了すれば、判定時間をさらに短縮することができる。
Also, the order of combinations of execution paths executed by the simulation unit 50 may be executed from the combination of the execution times calculated by the execution path combination determination unit 41 having the largest total.
In this case, since the simulation is executed from a path that is highly likely to exceed the deadline, it may be determined that the deadline is exceeded early.
At this time, if it is determined that the deadline is exceeded, the determination time can be further shortened by ending without executing the subsequent simulation.

最後に、実施の形態1及び2に示した最悪実行時間判定システム1000のハードウェア構成例を図10を参照して説明する。
最悪実行時間判定システム1000はコンピュータであり、最悪実行時間判定システム1000の各要素をプログラムで実現することができる。
最悪実行時間判定システム1000のハードウェア構成としては、バスに、演算装置901、外部記憶装置902、主記憶装置903、通信装置904、入出力装置905が接続されている。
Finally, a hardware configuration example of the worst execution time determination system 1000 shown in the first and second embodiments will be described with reference to FIG.
The worst execution time determination system 1000 is a computer, and each element of the worst execution time determination system 1000 can be realized by a program.
As a hardware configuration of the worst execution time determination system 1000, an arithmetic device 901, an external storage device 902, a main storage device 903, a communication device 904, and an input / output device 905 are connected to a bus.

演算装置901は、プログラムを実行するCPU(Central Processing Unit)である。
外部記憶装置902は、例えばROM(Read Only Memory)やフラッシュメモリ、ハードディスク装置である。
主記憶装置903は、RAM(Random Access Memory)である。
通信装置904は、例えばNIC(Network Interface Card)である。
入出力装置905は、例えばマウス、キーボード、ディスプレイ装置等である。
The arithmetic device 901 is a CPU (Central Processing Unit) that executes a program.
The external storage device 902 is, for example, a ROM (Read Only Memory), a flash memory, or a hard disk device.
The main storage device 903 is a RAM (Random Access Memory).
The communication device 904 is, for example, a NIC (Network Interface Card).
The input / output device 905 is, for example, a mouse, a keyboard, a display device, or the like.

プログラムは、通常は外部記憶装置902に記憶されており、主記憶装置903にロードされた状態で、順次演算装置901に読み込まれ、実行される。
プログラムは、図1に示す「〜部」(「〜記憶部」は除く、以下も同様)として説明している機能を実現するプログラムである。
更に、外部記憶装置902にはオペレーティングシステム(OS)も記憶されており、OSの少なくとも一部が主記憶装置903にロードされ、演算装置901はOSを実行しながら、図1に示す「〜部」の機能を実現するプログラムを実行する。
また、実施の形態1及び2の説明において、「〜の判断」、「〜の判定」、「〜の抽出」、「〜の算出」、「〜の検知」、「〜の設定」、「〜の登録」、「〜の選択」、「〜の生成」等として説明している処理の結果を示す情報やデータや信号値や変数値が主記憶装置903にファイルとして記憶されている。
The program is normally stored in the external storage device 902, and is loaded into the main storage device 903 and sequentially read into the arithmetic device 901 and executed.
The program is a program that realizes a function described as “˜unit” (excluding “˜storage unit”, the same applies hereinafter) shown in FIG.
Further, an operating system (OS) is also stored in the external storage device 902. At least a part of the OS is loaded into the main storage device 903. ”Is executed.
In the description of the first and second embodiments, “determination of”, “determination of”, “extraction of”, “calculation of”, “detection of”, “setting of”, “ Information, data, signal values, and variable values indicating the results of the processing described as “Registration of”, “Selection of”, “Generation of”, and the like are stored in the main storage device 903 as files.

なお、図10の構成は、あくまでも最悪実行時間判定システム1000のハードウェア構成の一例を示すものであり、最悪実行時間判定システム1000のハードウェア構成は図10に記載の構成に限らず、他の構成であってもよい。   The configuration of FIG. 10 is merely an example of the hardware configuration of the worst execution time determination system 1000, and the hardware configuration of the worst execution time determination system 1000 is not limited to the configuration illustrated in FIG. It may be a configuration.

また、実施の形態1及び2に示す手順により、本発明に係るプログラム解析方法を実現可能である。   Further, the program analysis method according to the present invention can be realized by the procedure shown in the first and second embodiments.

10 実行対象S/W記憶部、20 実行パス解析部、30 実行パスリスト記憶部、31 実行パスリスト記憶部、40 実行パス組み合わせ決定部、41 実行パス組み合わせ決定部、50 シミュレーション部、60 タスクスケジュール記憶部、70 変数操作部、80 キャッシュ無効化部、90 最悪実行時間判定部、100 実行時間算出部、1000 最悪実行時間判定システム。   10 execution target S / W storage unit, 20 execution path analysis unit, 30 execution path list storage unit, 31 execution path list storage unit, 40 execution path combination determination unit, 41 execution path combination determination unit, 50 simulation unit, 60 task schedule Storage unit, 70 variable operation unit, 80 cache invalidation unit, 90 worst execution time determination unit, 100 execution time calculation unit, 1000 worst execution time determination system.

Claims (14)

複数のタスクが生成される、複数のブロックで構成されたプログラムを解析し、タスクごとに、タスクにおいて実行されるブロック群を実行順に実行パスとして抽出する実行パス抽出部と、
前記プログラム実行時のタスクの生成順序に従って、各タスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて複数の配列パターンを生成する配列パターン生成部と、
配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出する実行時間算出部とを有することを特徴とするプログラム解析装置。
An execution path extraction unit that analyzes a program composed of a plurality of blocks in which a plurality of tasks are generated and extracts a group of blocks executed in the task as an execution path for each task;
In accordance with the task generation order at the time of executing the program, an array pattern generating unit for arraying execution paths corresponding to each task and generating a plurality of array patterns by changing a combination of execution paths;
A program analysis apparatus comprising: an execution time calculation unit that calculates an execution time of an execution path for each execution path when execution paths included in the array pattern are sequentially executed for each arrangement pattern.
前記実行時間算出部は、
キャッシュメモリが実装されているプログラム実行環境で配列パターンに含まれる実行パスが順に実行された場合の実行時間を実行パスごとに算出することを特徴とする請求項1に記載のプログラム解析装置。
The execution time calculation unit
2. The program analysis apparatus according to claim 1, wherein an execution time when execution paths included in the array pattern are sequentially executed in a program execution environment in which a cache memory is mounted is calculated for each execution path.
前記プログラム解析装置は、更に、
タスクごとに、上限の実行時間が上限時間として記述される上限時間情報を記憶する上限時間情報記憶部と、
前記実行時間算出部により算出された各実行パスの実行時間が、各実行パスのタスクの上限時間を超えていないかを判定する判定部を有することを特徴とする請求項1又は2に記載のプログラム解析装置。
The program analysis device further includes:
For each task, an upper limit time information storage unit that stores upper limit time information described as an upper limit execution time as an upper limit time;
The determination unit according to claim 1, further comprising: a determination unit that determines whether the execution time of each execution path calculated by the execution time calculation unit exceeds an upper limit time of a task of each execution path. Program analysis device.
前記判定部は、
前記実行時間算出部が全ての配列パターンに対して実行パスの実行時間の算出を終える前に、前記実行時間算出部により算出された各実行パスの実行時間が、各実行パスのタスクの上限時間を超えていないかを判定し、
前記実行時間算出部は、
前記判定部により、いずれかの配列パターンにおいて、いずれかの実行パスの実行時間が上限時間を超えていると判定された場合に、以降の実行時間の算出を取りやめることを特徴とする請求項3に記載のプログラム解析装置。
The determination unit
The execution time of each execution path calculated by the execution time calculation unit before the execution time calculation unit finishes calculating the execution time of the execution path for all the array patterns is the upper limit time of the task of each execution path. Determine whether or not
The execution time calculation unit
4. The subsequent execution time calculation is canceled when the determination unit determines that the execution time of any execution path exceeds the upper limit time in any array pattern. The program analysis device described in 1.
前記実行時間算出部は、
包含しているブロックの個数が多い配列パターンから順に、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出することを特徴とする請求項1又は4に記載のプログラム解析装置。
The execution time calculation unit
The execution time of the execution path when the execution paths included in the array pattern are sequentially executed in order from the array pattern having the largest number of blocks is included for each execution path. The program analysis device described in 1.
前記プログラム解析装置は、更に、
タスクごとに、上限の実行時間が上限時間として記述される上限時間情報を記憶する上限時間情報記憶部を有し、
前記実行時間算出部は、
単体で実行された場合の各実行パスの実行時間を算出し、
配列パターンごとに、配列パターンに含まれる各実行パスの単体の実行時間が、各実行パスのタスクの上限時間を超えるか否かを判定し、
配列パターンごとに、配列パターンに含まれる各実行パスの単体の実行時間を合計した合計値が、各実行パスのタスクの上限時間を合計した合計値を超えるか否かを判定し、
いずれかの実行パスの単体の実行時間が上限値を超える配列パターン及び実行時間の合計値が上限時間の合計値を超える配列パターンの少なくともいずれかを選択し、
選択した配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出することを特徴とする請求項1に記載のプログラム解析装置。
The program analysis device further includes:
Each task has an upper limit time information storage unit that stores upper limit time information described as an upper limit execution time as an upper limit time,
The execution time calculation unit
Calculate the execution time of each execution path when executed alone,
For each array pattern, determine whether the execution time of each execution path included in the array pattern exceeds the upper limit time of each execution path task,
For each array pattern, determine whether the total value of the total execution time of each execution path included in the array pattern exceeds the total value of the total upper limit time of tasks of each execution path,
Select at least one of an array pattern in which the execution time of a single execution path exceeds the upper limit and an array pattern in which the total execution time exceeds the total upper limit,
The program analysis apparatus according to claim 1, wherein the execution time of execution paths when execution paths included in the selected array pattern are sequentially executed is calculated for each execution path.
前記実行時間算出部は、
キャッシュメモリが実装されていないプログラム実行環境で各実行パスが単体で実行された場合の実行時間を算出することを特徴とする請求項6に記載のプログラム解析装置。
The execution time calculation unit
The program analysis apparatus according to claim 6, wherein an execution time when each execution path is executed alone in a program execution environment in which no cache memory is mounted is calculated.
前記実行時間算出部は、
キャッシュメモリが実装されているプログラム実行環境で、各実行パスの実行開始時に前記キャッシュメモリにデータが存在しない状態で各実行パスが単体で実行された場合の実行時間を算出することを特徴とする請求項6に記載のプログラム解析装置。
The execution time calculation unit
In a program execution environment in which a cache memory is mounted, the execution time is calculated when each execution path is executed alone with no data in the cache memory at the start of execution of each execution path. The program analysis apparatus according to claim 6.
前記実行時間算出部は、
選択した配列パターンのうち、配列パターンに含まれる各実行パスの単体の実行時間を合計した合計値が大きい配列パターンから順に、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出することを特徴とする請求項6に記載のプログラム解析装置。
The execution time calculation unit
Execution of execution paths when the execution paths included in the array pattern are executed in order from the array pattern with the largest total value of the total execution time of the individual execution paths included in the array pattern among the selected array patterns The program analysis apparatus according to claim 6, wherein the time is calculated for each execution path.
前記実行パス抽出部は、
複数のリアルタイムタスクが生成される、複数のブロックで構成されたプログラムを解析し、リアルタイムタスクごとに、リアルタイムタスクにおいて実行されるブロック群を実行順に実行パスとして抽出し、
前記配列パターン生成部は、
前記プログラム実行時のリアルタイムタスクの生成順序に従って、各リアルタイムタスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて複数の配列パターンを生成し、
前記実行時間算出部は、
配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出することを特徴とする請求項1に記載のプログラム解析装置。
The execution path extraction unit
Analyzing a program composed of multiple blocks that generate multiple real-time tasks, and for each real-time task, extract a group of blocks to be executed in the real-time task as an execution path in the order of execution,
The array pattern generation unit includes:
According to the generation order of the real-time task at the time of program execution, the execution path corresponding to each real-time task is arranged, and a plurality of arrangement patterns are generated by changing the combination of the execution paths,
The execution time calculation unit
The program analysis apparatus according to claim 1, wherein an execution time of an execution path when execution paths included in the array pattern are sequentially executed is calculated for each execution pattern.
前記実行時間算出部は、
キャッシュメモリが実装されているプログラム実行環境で、配列パターンごとに、特定の実行順序の実行パスの実行開始時に前記キャッシュメモリにデータが存在しない状態で当該実行パスが実行された場合の実行パスの実行時間を実行パスごとに算出することを特徴とする請求項10に記載のプログラム解析装置。
The execution time calculation unit
In the program execution environment where the cache memory is implemented, the execution path when the execution path is executed in a state where no data exists in the cache memory at the start of execution of the execution path in a specific execution order for each array pattern The program analysis apparatus according to claim 10, wherein the execution time is calculated for each execution path.
前記プログラム解析装置は、更に、
タスクごとに、上限の実行時間が上限時間として記述される上限時間情報を記憶する上限時間情報記憶部と、
前記実行時間算出部が全ての配列パターンに対して実行パスの実行時間の算出を終える前に、前記実行時間算出部により算出された各実行パスの実行時間が、各実行パスのタスクの上限時間を超えていないかを判定する判定部とを有し、
前記実行時間算出部は、
前記判定部により、いずれかの配列パターンにおいて、いずれかの実行パスの実行時間が上限時間を超えていると判定された場合に、以降の実行時間の算出を取りやめることを特徴とする請求項6に記載のプログラム解析装置。
The program analysis device further includes:
For each task, an upper limit time information storage unit that stores upper limit time information described as an upper limit execution time as an upper limit time;
The execution time of each execution path calculated by the execution time calculation unit before the execution time calculation unit finishes calculating the execution time of the execution path for all the array patterns is the upper limit time of the task of each execution path. And a determination unit for determining whether or not
The execution time calculation unit
The subsequent execution time calculation is canceled when the determination unit determines that the execution time of any execution path exceeds the upper limit time in any array pattern. The program analysis device described in 1.
コンピュータが、複数のタスクが生成される、複数のブロックで構成されたプログラムを解析し、タスクごとに、タスクにおいて実行されるブロック群を実行順に実行パスとして抽出する実行パス抽出ステップと、
前記コンピュータが、前記プログラム実行時のタスクの生成順序に従って、各タスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて複数の配列パターンを生成する配列パターン生成ステップと、
前記コンピュータが、配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出する実行時間算出ステップとを有することを特徴とするプログラム解析方法。
An execution path extraction step in which a computer analyzes a program composed of a plurality of blocks in which a plurality of tasks are generated, and extracts a group of blocks executed in the task as an execution path for each task;
The computer arranges execution paths corresponding to each task according to the generation order of the tasks at the time of executing the program, and generates a plurality of array patterns by changing the combination of the execution paths; and
An execution time calculating step for calculating, for each execution path, an execution time of an execution path when the execution path included in the array pattern is sequentially executed for each array pattern. .
複数のタスクが生成される、複数のブロックで構成されたプログラムを解析し、タスクごとに、タスクにおいて実行されるブロック群を実行順に実行パスとして抽出する実行パス抽出処理と、
前記プログラム実行時のタスクの生成順序に従って、各タスクに対応する実行パスを配列させるとともに、実行パスの組合せを変化させて複数の配列パターンを生成する配列パターン生成処理と、
配列パターンごとに、配列パターンに含まれる実行パスが順に実行された場合の実行パスの実行時間を実行パスごとに算出する実行時間算出処理とをコンピュータに実行させることを特徴とするプログラム。
Analyzing a program composed of a plurality of blocks in which a plurality of tasks are generated, and for each task, an execution path extraction process for extracting a block group executed in the task as an execution path in the execution order;
Arranging execution paths corresponding to each task according to the generation order of the tasks at the time of program execution, and an array pattern generation process for generating a plurality of array patterns by changing the combination of execution paths;
A program that causes a computer to execute an execution time calculation process that calculates an execution time of an execution path for each execution path when execution paths included in the array pattern are sequentially executed for each arrangement pattern.
JP2014042575A 2014-03-05 2014-03-05 Program analysis apparatus, program analysis method, and program Active JP6218645B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014042575A JP6218645B2 (en) 2014-03-05 2014-03-05 Program analysis apparatus, program analysis method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014042575A JP6218645B2 (en) 2014-03-05 2014-03-05 Program analysis apparatus, program analysis method, and program

Publications (2)

Publication Number Publication Date
JP2015169997A JP2015169997A (en) 2015-09-28
JP6218645B2 true JP6218645B2 (en) 2017-10-25

Family

ID=54202717

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014042575A Active JP6218645B2 (en) 2014-03-05 2014-03-05 Program analysis apparatus, program analysis method, and program

Country Status (1)

Country Link
JP (1) JP6218645B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291767B (en) * 2016-04-11 2020-07-17 西门子工厂自动化工程有限公司 Optimization processing method and device for task execution time
JP6611963B2 (en) 2016-12-29 2019-11-27 三菱電機株式会社 Program analysis apparatus, program analysis system, program analysis method, and analysis program
JP7457589B2 (en) * 2020-07-01 2024-03-28 日立Astemo株式会社 Information processing device, information processing method, and information processing system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10061001B4 (en) * 2000-12-08 2005-05-04 Robert Bosch Gmbh Method and control unit for controlling technical processes in a motor vehicle, and storage element and control program therefor
JP2003288237A (en) * 2002-03-27 2003-10-10 Hitachi Ltd Device and method for measuring execution time in controller
JP4905597B1 (en) * 2011-03-15 2012-03-28 オムロン株式会社 Controller support device, controller support program to be executed in the device, and recording medium storing the program
WO2013128519A1 (en) * 2012-03-02 2013-09-06 日本電気株式会社 Device for analyzing critical execution time and method for analyzing critical execution time, as well as non-temporary computer-readable medium for storing program

Also Published As

Publication number Publication date
JP2015169997A (en) 2015-09-28

Similar Documents

Publication Publication Date Title
US9229838B2 (en) Modeling and evaluating application performance in a new environment
JP2014513373A5 (en)
Sunwoo et al. A structured approach to the simulation, analysis and characterization of smartphone applications
CN108885579B (en) Method and apparatus for data mining from kernel tracing
US10101796B2 (en) Processor power estimation
JP6218645B2 (en) Program analysis apparatus, program analysis method, and program
Hassani et al. LiveSim: Going live with microarchitecture simulation
US10402510B2 (en) Calculating device, calculation method, and calculation program
US8340952B2 (en) Power estimation method and device therefor
US7089406B2 (en) Method and apparatus for controlling program instruction completion timing for processor verification
JP2012509546A (en) Method and data processing system for simulating embedded systems
EP3077910B1 (en) Methods and apparatus to optimize platform simulation resource consumption
Wang et al. Towards improving mapreduce task scheduling using online simulation based predictions
JP6249827B2 (en) Simulation apparatus and simulation program
WO2018032897A1 (en) Method and device for evaluating packet forwarding performance and computer storage medium
CN114286984A (en) Workload performance prediction
Neves et al. Mremu: An emulation-based framework for datacenter network experimentation using realistic mapreduce traffic
JP5454349B2 (en) Performance estimation device
KR102007881B1 (en) Method and system for fast and accurate cycle estimation through hybrid instruction set simulation
Cornelis et al. The pipeline performance model: a generic executable performance model for GPUs
JP5390464B2 (en) Simulation apparatus, simulation apparatus control method, and program
JP6020775B1 (en) Simulation device
CN103955357A (en) Timing method for dynamic binary translation instruction set simulator
JP6223637B2 (en) Simulation apparatus, simulation method, and simulation program
KR101918051B1 (en) Simulation method based on epoch

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161128

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170807

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170926

R150 Certificate of patent or registration of utility model

Ref document number: 6218645

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250