JP2010160716A - Verification device - Google Patents

Verification device Download PDF

Info

Publication number
JP2010160716A
JP2010160716A JP2009003184A JP2009003184A JP2010160716A JP 2010160716 A JP2010160716 A JP 2010160716A JP 2009003184 A JP2009003184 A JP 2009003184A JP 2009003184 A JP2009003184 A JP 2009003184A JP 2010160716 A JP2010160716 A JP 2010160716A
Authority
JP
Japan
Prior art keywords
timer
task
instruction
code
execution time
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.)
Pending
Application number
JP2009003184A
Other languages
Japanese (ja)
Inventor
Masahide Sakano
将秀 坂野
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.)
Toyota Motor Corp
Original Assignee
Toyota Motor 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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2009003184A priority Critical patent/JP2010160716A/en
Publication of JP2010160716A publication Critical patent/JP2010160716A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a verification device of a program, wherein influence of presence/absence of a verification code on temporal behavior of a code amount or a control system is reduced. <P>SOLUTION: This verification device verifying an execution time of a task by a CPU 50 includes: a storage means 10 storing a program described with a task code of the task executed by the CPU 50, a first instruction for starting a timer 15 described immediately before the task code; a second instruction for stopping the timer 15 described after the task code; a means 12 starting the timer 15 by only once executing only the first instruction, and means 17, 15, 18, 19, 14 stopping the timer 15 by only once executing only the second instruction, measuring the execution time, and applying statistical processing to a plurality of the execution times obtained by a plurality of pieces of the execution of the task. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、タスクが設計通りに実行されるかを検証する検証装置に関し、特に、タスクの実行時間を測定する検証装置に関する。   The present invention relates to a verification apparatus that verifies whether a task is executed as designed, and more particularly to a verification apparatus that measures the execution time of a task.

制御系システムは、タスクの実行タイミングに非常に厳しい制約が課される。例えば、制御系システムがプログラムのフローチャートどおりに動いても、タスクの実行タイミングが許容範囲を超えてずれると期待通りに作動しない。このため、タスクが設計通りに実行されるかどうかを検証しながら開発が進められることが多い(例えば、特許文献1参照。)。特許文献1には、割込みの発生のタイミングが制御系システムの動作時間に与える影響を検証する検証プログラムを、CPUの命令実行時間を消費することなく実行することで、検証プログラムがタスクの実行時間に与える影響を排除して制御系システムを検証する検証装置が記載されている。   In the control system, very severe restrictions are imposed on the task execution timing. For example, even if the control system moves according to the program flowchart, it does not operate as expected if the task execution timing deviates beyond an allowable range. For this reason, development often proceeds while verifying whether a task is executed as designed (see, for example, Patent Document 1). Patent Document 1 discloses that a verification program for verifying the influence of interrupt generation timing on the operation time of a control system is executed without consuming CPU instruction execution time. The verification apparatus which verifies the control system by eliminating the influence on the system is described.

しかしながら、特許文献1記載の検証装置では、割込み試験装置をCPUとは別に実装する必要があるためコスト増となるという問題がある。また、割込みが制御系システムの動作時間に与える影響しか検証できない。   However, the verification device described in Patent Document 1 has a problem that the cost is increased because the interrupt test device needs to be mounted separately from the CPU. In addition, only the influence of the interrupt on the operation time of the control system can be verified.

ところで、タスクの実行タイミングが設計上の仕様を満たすかどうかをタイマを利用して検証する方法が知られている。この方法は、制御系システムに、タスクの実行時間を測定する検証用の検証コードを記述しておき、制御系システムの実行と共にタスクの実行時間を厳密に測定するものである。実行時間の測定結果を記録しておくことで、設計上の仕様を満たすかどうか、満たすのであれば仕様に対しどのくらい余裕があるかを検証することができる。   By the way, there is known a method for verifying whether a task execution timing satisfies a design specification using a timer. In this method, a verification code for verification for measuring the task execution time is described in the control system, and the task execution time is strictly measured together with the execution of the control system. By recording the measurement result of the execution time, it is possible to verify whether or not the design specification is satisfied, and if so, how much room is available for the specification.

図1は、従来の検証コードの一例を示す図である。この検証コードには、例えば割込み要因の発生による割り込みに対応した「Timing Critical job」タスクの実行時間を測定する手順が記述されている。   FIG. 1 is a diagram illustrating an example of a conventional verification code. This verification code describes a procedure for measuring the execution time of a “Timing Critical Job” task corresponding to an interrupt caused by the occurrence of an interrupt factor, for example.

「Timing Critical job」タスクの実行に先立ち、「Timer_inst()」で新しくタイマのインスタンスを作成し、「Timer_start()」でタイマをスタートする。タイマをスタートすると「Timing Critical job」タスクが実行される。   Before executing the “Timing Critical job” task, create a new timer instance with “Timer_inst ()” and start the timer with “Timer_start ()”. When the timer is started, the "Timing Critical job" task is executed.

「Timing Critical job」タスクが終了すると、「Timer_stop()」によりタイマがストップされる。実行時間はメモリに記憶しておく。ここで、制御系システムでは同じタスクが繰り返し実行されることがあるが、同じタスクであってもI/O待ちや他のタスクの実行状況等に応じて実行時間は完全に同じにはならない。このため、検証コードにより「Timing Critical job」タスクの実行の度に実行時間を上書きすることなく記憶しておく。   When the “Timing Critical job” task ends, the timer is stopped by “Timer_stop ()”. The execution time is stored in the memory. Here, the same task may be repeatedly executed in the control system, but even if it is the same task, the execution time is not completely the same depending on I / O waiting, execution status of other tasks, and the like. For this reason, the verification code is stored without overwriting the execution time each time the “Timing Critical job” task is executed.

そして、検証コードの実行により実行時間の統計データが算出される。すなわち「Calc_min()」により、複数ある実行時間のうち最小の実行時間が決定され、「Calc_max()」により、複数ある実行時間のうち最大の実行時間が決定され、「Calc_average()」により、複数ある実行時間の平均値が算出される。また、実行時間が仕様を満たしているか否かを判定するため、「Check_dedline()」により、例えば最大の実行時間と最大許容時間との差を算出する。   Then, the execution time statistical data is calculated by executing the verification code. That is, the minimum execution time of a plurality of execution times is determined by “Calc_min ()”, the maximum execution time of a plurality of execution times is determined by “Calc_max ()”, and “Calc_average ()” An average value of a plurality of execution times is calculated. Further, in order to determine whether or not the execution time satisfies the specification, for example, a difference between the maximum execution time and the maximum allowable time is calculated by “Check_dedline ()”.

このように、検証コードをタスクのプログラムに一体に記述することで、制御系システムのプログラムを別のハードウェア上に実装した際にも、タスクの実行時間が仕様を満たしているか否かを容易に検証できる。
特開平06−019752号公報
By writing verification code in the task program in this way, it is easy to check whether the task execution time meets the specifications even when the control system program is installed on different hardware. Can be verified.
Japanese Patent Laid-Open No. 06-019752

しかしながら、検証コードは実際の製品に搭載された際には不要となる。このため、検証コードをプログラムと一体に記述したまま製品を出荷することは、プログラムの肥大化やパフォーマンスの劣化をもたらすことになっている。   However, the verification code is not necessary when it is installed in an actual product. For this reason, shipping a product while the verification code is described together with the program leads to enlargement of the program and deterioration of performance.

したがって、プログラムから検証コードを削除して製品を出荷することが望ましいが、検証コードを削除すると制御系システム全体の時間的なふるまいも変わってしまう。例えば、図1に示すようにコンパイル型のプログラムはオブジェクトコードにコンパイルされてからCPUで実行される。「Timer_inst()」は「Timer_inst0x2123」と「Timer_inst0x2124」のオブジェクトコードに、「Timer_start()」は「Timer_start0x1234」と「Timer_start0x1235」のオブジェクトコードにコンパイルされている。同様に、「Timer_stop()」は「Timer_stop0x5892」と「Timer_stop0x5893」に、「Calc_min()」は「Calc_min0x7278」と「Calc_min0x7279」に、「Calc_max()」は「Calc_max0x5290」と「Calc_max0x5291」に、「Calc_average()」は「Calc_average0x0821」と「Calc_average0x822」に、「Check_dedline()」は「Check_dedline0x2122」と「Check_dedline0x2123」に、それぞれコンパイルされている。なお、数値「0x・・・・」はそのオブジェクトコードが記憶されているメモリのアドレスを示す。   Therefore, it is desirable to delete the verification code from the program and ship the product. However, if the verification code is deleted, the temporal behavior of the entire control system changes. For example, as shown in FIG. 1, a compiled program is compiled into object code and then executed by the CPU. “Timer_inst ()” is compiled into object codes “Timer_inst0x2123” and “Timer_inst0x2124”, and “Timer_start ()” is compiled into object codes “Timer_start0x1234” and “Timer_start0x1235”. Similarly, "Timer_stop ()" is "Timer_stop0x5892" and "Timer_stop0x5893", "Calc_min ()" is "Calc_min0x7278" and "Calc_min0x7279", "Calc_max ()" is "Calc_max0x5290" and "Calc_max0x5291", "Calc_average () "Is compiled into" Calc_average0x0821 "and" Calc_average0x822 ", and" Check_dedline () "is compiled into" Check_dedline0x2122 "and" Check_dedline0x2123 ", respectively. The numerical value “0x...” Indicates the address of the memory where the object code is stored.

このように、検証コードが1命令でもオブジェクトコードは複数命令に渡ったり、1命令のオブジェクトコードの実行にも命令によっては複数クロックを消費するなど、実行時間を測定するためのオブジェクトコードの実行には比較的長い時間がかかっている。実行時間の測定のため、制御系システムの時間的な振るふるまいが変わると「Timing Critical job」タスクの実行時間にも影響を与えるので、仕様を満たしていることを保証できない。このため、従来は、検証コードをプログラムに記述したまま製品を出荷していた。   In this way, even if the verification code is one instruction, the object code can be executed over a plurality of instructions, or the execution of the object code for measuring the execution time such as the execution of the object code of one instruction may consume a plurality of clocks depending on the instruction. Takes a relatively long time. Because the execution time is measured, if the behavior of the control system changes over time, the execution time of the “Timing Critical Job” task will also be affected, so it cannot be guaranteed that the specification is satisfied. For this reason, conventionally, products are shipped with the verification code written in the program.

すなわち、従来は、検証コードの有無がコード量や制御系システムの時間的ふるまいに与える影響が大きいため、そのままでは削除することも実装したままとすることも適当でないという問題があった。   That is, conventionally, since the presence or absence of the verification code has a large influence on the code amount and the temporal behavior of the control system, there is a problem that it is not appropriate to delete the code as it is or to leave it mounted.

本発明は、上記課題に鑑み、検証コードの有無がコード量や制御系システムの時間的なふるまいに与える影響を小さくすることができるプログラムの検証装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide a program verification apparatus that can reduce the influence of the presence or absence of a verification code on the code amount and the temporal behavior of a control system.

上記課題に鑑み、本発明は、CPUによるタスクの実行時間を検証する検証装置において、CPUが実行するタスクのタスクコードと、タスクコードの直前に記述されたタイマをスタートさせる第1の命令と、タスクコードの後に記述されたタイマをストップさせる第2の命令と、が記述されたプログラムを記憶する記憶手段と、第1の命令を1つ実行しただけでタイマをスタートさせる手段と、第2の命令を1つ実行しただけでタイマをストップさせ実行時間を測定すると共に、複数回の前記タスクの実行により得られた複数の実行時間に統計処理を施す手段と、を有することを特徴とする。   In view of the above problem, the present invention provides a verification device for verifying the execution time of a task by a CPU, a task code of a task executed by the CPU, a first instruction for starting a timer described immediately before the task code, A second instruction for stopping the timer described after the task code; a storage means for storing the program described therein; a means for starting the timer by executing only one first instruction; Means for stopping the timer and measuring the execution time by executing only one instruction and performing statistical processing on a plurality of execution times obtained by executing the task a plurality of times.

検証コードの有無がコード量や制御系システムの時間的なふるまいに与える影響を小さくすることができるプログラムの検証装置を提供することができる。   It is possible to provide a program verification apparatus capable of reducing the influence of the presence or absence of a verification code on the code amount and the temporal behavior of a control system.

以下、本発明を実施するための最良の形態について図面を参照しながら説明する。
図2は、本実施形態の検証装置100による「Timing Critical job」タスクの実行時間の測定を模式的に説明する図の一例である。本実施形態の検証装置100は、次のような特徴を備える。
(1)ソフトウェアで測定していた実行時間の測定と統計処理をCPU50が実行する。
(2)検証コードには、タイマのスタートを1命令で、統計処理を1命令で、それぞれ記述する。
The best mode for carrying out the present invention will be described below with reference to the drawings.
FIG. 2 is an example of a diagram schematically illustrating the measurement of the execution time of the “Timing Critical job” task by the verification apparatus 100 of the present embodiment. The verification apparatus 100 of this embodiment has the following features.
(1) The CPU 50 executes measurement of execution time and statistical processing measured by software.
(2) In the verification code, describe the start of the timer with one instruction and the statistical processing with one instruction.

例えば、「Timer_inst_start()」がタイマのスタートをCPU50に実行させる命令で、「Timer_stop_calc()」がタイマをストップさせ統計処理をCPU50に実行させる命令である。すなわち、CPU50は「Timer_inst_start()」を実行するとタイマをスタートさせ、「Timer_stop_calc()」を実行すると一連の統計処理を行う。それぞれ1命令なので、コード量や制御系システムの時間的ふるまいに与える影響は誤差として無視できる範囲である。このため、検証コードを含むプログラムをそのまま実際の製品に搭載しても、プログラムの肥大化やパフォーマンスの劣化をもたらすことがない。   For example, “Timer_inst_start ()” is an instruction for causing the CPU 50 to start a timer, and “Timer_stop_calc ()” is an instruction for causing the CPU 50 to execute a statistical process by stopping the timer. That is, the CPU 50 starts a timer when executing “Timer_inst_start ()”, and performs a series of statistical processing when executing “Timer_stop_calc ()”. Since each instruction is one instruction, the influence on the code amount and the temporal behavior of the control system is in a range that can be ignored as an error. For this reason, even if the program including the verification code is directly installed in an actual product, the program will not be enlarged and the performance will not be deteriorated.

なお、実行時間や統計処理の結果はCPU50のメモリに記憶しておく。実行時間や統計処理の結果は、JTAG(Joint Test Action Group)ツール30等を利用してCPU50のメモリから読み出すことができるので、実行時間や統計処理の結果を読み出すためのコードを記述しておく必要はない。   The execution time and the result of statistical processing are stored in the memory of the CPU 50. Since the execution time and the result of statistical processing can be read from the memory of the CPU 50 using a JTAG (Joint Test Action Group) tool 30 or the like, a code for reading the execution time or the result of statistical processing is described. There is no need.

また、「1命令」とはオブジェクトコードにコンパイルされた際に、例えば1回の命令フェッチで読み出される1つの命令である。「オペコード、オペランド0,オペランド1…」のオブジェクトコードの場合,1つのオペコードが本実施形態の「1命令」に相当する。オペランドを有しているか否かは問わない。   In addition, “1 instruction” is one instruction that is read by one instruction fetch, for example, when compiled into an object code. In the case of the object code “opcode, operand 0, operand 1...”, One opcode corresponds to “1 instruction” in the present embodiment. It does not matter whether or not it has an operand.

図3は検証コードを含むプログラムの記述例とオブジェクトコードの一例を示す。図3(a)に示すように、実行タイミングに厳しい制約が課されるタスクのプログラムの冒頭に「Timer_inst_start()」の1命令が、タスクの末尾に「Timer_stop_calc()」の一命令が記述されている。コンパイラがプログラムをコンパイルすることで、図3(b)に示すオブジェクトコードが得られる。このオブジェクトコードはCPU50に接続されたEEPROM(Electrically Erasable and Programmable Read Only Memory)10に記憶される。   FIG. 3 shows a description example of a program including a verification code and an example of an object code. As shown in Fig. 3 (a), one instruction of "Timer_inst_start ()" is described at the beginning of a program of a task in which strict restrictions are imposed on the execution timing, and one instruction of "Timer_stop_calc ()" is described at the end of the task. ing. The object code shown in FIG. 3B is obtained by compiling the program by the compiler. This object code is stored in an EEPROM (Electrically Erasable and Programmable Read Only Memory) 10 connected to the CPU 50.

プログラムの1命令「Timer_inst_start()」が、1命令のまま「Timer_inst_start()0x1111」というオブジェクトコードにコンパイルされており、プログラムの1命令「Timer_stop_calc()」が、1命令のまま「Timer_stop_calc()0x2222」というオブジェクトコードにコンパイルされている。このようなオブジェクトコードは、CPU50の命令セットに対応したものであり、コンパイラ及びCPU50が1命令による実行時間の検証に対応していることになる。なお、数値「0x・・・・」はそのオブジェクトコードが記憶されているメモリのアドレスを示す。   One instruction “Timer_inst_start ()” of the program is compiled into an object code “Timer_inst_start () 0x1111” with one instruction, and one instruction “Timer_stop_calc ()” of the program remains with one instruction “Timer_stop_calc () 0x2222” Is compiled into object code. Such an object code corresponds to the instruction set of the CPU 50, and the compiler and the CPU 50 correspond to verification of execution time by one instruction. The numerical value “0x...” Indicates the address of the memory where the object code is stored.

図4は、本実施形態の検証装置100の概略構成図の一例を示す。検証装置100はCPU50とEEPROM10に記憶された検証コードを実体としている。このCPU50は検証が完了すると例えば車載されるECU(Electronic Control Unit)に搭載される。本実施形態の検証方法は制御系システムに好適であるため、例えばエンジンECU、パワートレイン系ECU又はブレーキECU等に適用される。なお、CPU50やEEPROM10の他、RAM、ROM、ASIC(Application Specific Integrated Circuit)及び入出力端子等を備える。   FIG. 4 shows an example of a schematic configuration diagram of the verification apparatus 100 of the present embodiment. The verification apparatus 100 has a verification code stored in the CPU 50 and the EEPROM 10 as a substance. When the verification is completed, the CPU 50 is mounted on an ECU (Electronic Control Unit) mounted on the vehicle, for example. Since the verification method of the present embodiment is suitable for a control system, it is applied to, for example, an engine ECU, a powertrain ECU, a brake ECU, or the like. In addition to the CPU 50 and the EEPROM 10, a RAM, a ROM, an ASIC (Application Specific Integrated Circuit), an input / output terminal, and the like are provided.

CPU50は命令レジスタに記憶された「Timer_inst_start()0x1111」をフェッチしてデコーダ11で解読して、タイマスタート回路12にタイマ15をスタートさせる信号を出力する。タイマスタート回路12はクロック信号をカウントして時間を測定するタイマ15をスタートさせる。初期化処理は必要に応じて実行される。また、タイマスタート回路12はカウンタ回路13に信号を出力する。カウンタ回路13は信号を受信する毎にカウントアップする回路で、「Timing Critical job」タスクの実行回数をカウントする。この後、CPU50は「Timing Critical job」タスクを実行する。   The CPU 50 fetches “Timer_inst_start () 0x1111” stored in the instruction register, decodes it by the decoder 11, and outputs a signal for starting the timer 15 to the timer start circuit 12. The timer start circuit 12 starts a timer 15 that counts clock signals and measures time. The initialization process is executed as necessary. The timer start circuit 12 outputs a signal to the counter circuit 13. The counter circuit 13 counts up each time a signal is received, and counts the number of times of execution of the “Timing Critical job” task. Thereafter, the CPU 50 executes a “Timing Critical job” task.

「Timing Critical job」タスクが終了すると、CPU50は命令レジスタに記憶された「Timer_stop_calc()0x2222」を読み出しデコーダ11で解読して、タイマストップ回路17にタイマ15をストップさせる信号を出力する。タイマ15がストップした時のタイマ15の値が実行時間である。また、CPU50が「Timer_stop_calc()0x2222」を実行することで、以下の一連の処理が実行される。   When the “Timing Critical job” task ends, the CPU 50 reads “Timer_stop_calc () 0x2222” stored in the instruction register, decodes it by the decoder 11, and outputs a signal for stopping the timer 15 to the timer stop circuit 17. The value of the timer 15 when the timer 15 is stopped is the execution time. Further, the CPU 50 executes “Timer_stop_calc () 0x2222”, whereby the following series of processes is executed.

タイマ15のストップ後、タイマ15が測定した実行時間は比較回路18、比較回路19及び合計加算回路16に出力される。比較回路18はタイマ15が測定した実行時間と記憶しているmin値を比較して、実行時間の方が小さい場合のみ、実行時間を新たにmin値に置き換える。こうすることで、比較回路18には常に最小の実行時間が記憶された状態となる。   After the timer 15 is stopped, the execution time measured by the timer 15 is output to the comparison circuit 18, the comparison circuit 19, and the total addition circuit 16. The comparison circuit 18 compares the execution time measured by the timer 15 with the stored min value, and replaces the execution time with a new min value only when the execution time is smaller. By doing so, the minimum execution time is always stored in the comparison circuit 18.

比較回路19はタイマ15が測定した実行時間と記憶しているmax値を比較して、実行時間の方が小さい場合のみ、実行時間を新たにmax値に置き換える。こうすることで、比較回路19には常に最大の実行時間が記憶された状態となる。   The comparison circuit 19 compares the execution time measured by the timer 15 with the stored max value, and replaces the execution time with the max value only when the execution time is smaller. By doing so, the maximum execution time is always stored in the comparison circuit 19.

また、合計加算回路16は、タイマ15がストップする毎に実行時間を累積する回路である。合計加算回路16には、過去の実行時間が全て累積された累積時間が記憶される。合計加算回路16は、累積時間を算出したタイミングで平均算出回路14に累積時間を出力する。   The total addition circuit 16 is a circuit that accumulates execution time each time the timer 15 stops. The total adding circuit 16 stores an accumulated time in which all past execution times are accumulated. The total adding circuit 16 outputs the accumulated time to the average calculating circuit 14 at the timing at which the accumulated time is calculated.

平均算出回路14は、累積時間が入力されるとカウンタ回路13から実行回数を読み出し、所定の演算(除算)を施して実行時間の平均値を算出する。平均算出回路14は最新の平均値を記憶した状態となる。また、平均算出回路14は平均値を算出したタイミングで平均値を比較回路21に出力する。   When the accumulated time is input, the average calculation circuit 14 reads the number of executions from the counter circuit 13 and performs a predetermined calculation (division) to calculate an average value of the execution times. The average calculation circuit 14 stores the latest average value. The average calculation circuit 14 outputs the average value to the comparison circuit 21 at the timing when the average value is calculated.

比較回路21は、予め定められた最大許容時間を記憶している。比較回路21は最大許容時間と平均値の差を算出して記憶する。なお、最大許容時間はJTAGツール30により検証前に書き込まれている。また、比較回路21は、平均値と最大許容時間との差でなく、min値又はmax値との差を算出してもよい。   The comparison circuit 21 stores a predetermined maximum allowable time. The comparison circuit 21 calculates and stores the difference between the maximum allowable time and the average value. The maximum allowable time is written by the JTAG tool 30 before verification. Further, the comparison circuit 21 may calculate the difference between the min value or the max value instead of the difference between the average value and the maximum allowable time.

そして、プログラムの実行が終了すると、ユーザはJTAGツール30を用いてCPU50から検証結果を読み出す。すなわち、比較回路18からmin値を、比較回路19からmax値を、平均算出回路14から平均値を、比較回路21から最大許容時間と平均値の差を、それぞれ読み出す。   When the execution of the program ends, the user reads the verification result from the CPU 50 using the JTAG tool 30. That is, the min value is read from the comparison circuit 18, the max value is read from the comparison circuit 19, the average value is read from the average calculation circuit 14, and the difference between the maximum allowable time and the average value is read from the comparison circuit 21.

したがって、タイマ15のストップから数クロック程度で最大許容時間と平均値の差までを算出できるので、プログラムが検証コードを含んだまま製品に実装されても制御系システムの時間的なふるまいを変えるおそれがない。また、タイマ15のスタートに1命令、統計処理に1命令のコード量なので、コードを肥大化させることもない。   Accordingly, since the maximum allowable time and the difference between the average values can be calculated within a few clocks from the stop of the timer 15, the temporal behavior of the control system may be changed even if the program is mounted on the product while including the verification code. There is no. Further, since the code amount is one instruction for the start of the timer 15 and one instruction for the statistical processing, the code is not enlarged.

なお、図4では検証コードの実行手段をハードウェアとして実装したが、複数のマイクロ命令から成るマイクロプログラムを実行することで、一連の処理を実行してもよい。この場合、タイマ15が測定した実行時間を「Timer_stop_calc()0x2222」が実行される毎に記憶しておく。そして、マイクロプログラムにより、min値、max値、平均値、及び、平均値と最大許容時間との差を算出する。算出結果はそれぞれレジスタに記憶しておく。   In FIG. 4, the verification code executing means is implemented as hardware, but a series of processing may be executed by executing a microprogram composed of a plurality of microinstructions. In this case, the execution time measured by the timer 15 is stored every time “Timer_stop_calc () 0x2222” is executed. Then, the micro program calculates the min value, the max value, the average value, and the difference between the average value and the maximum allowable time. Each calculation result is stored in a register.

ところで、本実施形態では「Timing Critical job」タスクを1つであるかのように説明したが、実際には1つの制御系システムに「Timing Critical job」タスクは複数あることが多い。この場合、タイマ15をスタートする1命令と、統計処理の1命令にそれぞれオペランドとしてそれぞれIDを記述することで、複数の「Timing Critical job」タスクそれぞれの実行時間の測定と統計処理が可能となる。
「Timer_inst_start() ID」
「Timer_stop_calc() ID」
IDは0〜0xffffの有限個とするが、実際には1〜32個程度で十分である。
また、オペランドとしてのIDとCPU50側の実装部のハードウェアID(以下、HWIDという)をテーブルで対応づけておく。
ID0 → HWID0
ID1 → HWID1
ID2 → HWID2
ID3 → disable
ID4 → disable
ID5 → disable
ID6 → HWID3
こうすることで、CPU50は「Timer_inst_start() ID」や「Timer_stop_calc() ID」を実行する際に、どの実装部を利用すべきか判定できる。このようなテーブルは、例えばEEPROM10に記憶され、JTAGツール30により必要に応じて動的に修正・追加できる。なお、初期状態では全ての対応関係が「disable」である。「Timer_inst_start() ID」又は「Timer_stop_calc() ID」が「disable」IDを指定した場合、CPU50はNOP(No Operation)として処理する(何も実行しない)。
By the way, in this embodiment, although it demonstrated as if there was one "Timing Critical job" task, in fact, there are many "Timing Critical job" tasks in one control system. In this case, by describing IDs as operands in one instruction for starting the timer 15 and one instruction for statistical processing, the execution time of each of the “Timing Critical job” tasks can be measured and statistical processing can be performed. .
"Timer_inst_start () ID"
"Timer_stop_calc () ID"
The ID is a finite number of 0 to 0xffff, but about 1 to 32 is actually sufficient.
Further, an ID as an operand is associated with a hardware ID (hereinafter referred to as HWID) of the mounting unit on the CPU 50 side in a table.
ID0 → HWID0
ID1 → HWID1
ID2 → HWID2
ID3 → disable
ID4 → disable
ID5 → disable
ID6 → HWID3
In this way, the CPU 50 can determine which mounting unit should be used when executing “Timer_inst_start () ID” or “Timer_stop_calc () ID”. Such a table is stored in, for example, the EEPROM 10 and can be dynamically corrected and added as necessary by the JTAG tool 30. In the initial state, all correspondences are “disable”. When “Timer_inst_start () ID” or “Timer_stop_calc () ID” designates “disable” ID, the CPU 50 processes as NOP (No Operation) (does nothing).

従来の検証コードの一例を示す図である。It is a figure which shows an example of the conventional verification code. 検証装置による「Timing Critical job」タスクの実行時間の測定を模式的に説明する図の一例である。It is an example of the figure which illustrates typically the measurement of the execution time of the "Timing Critical job" task by a verification apparatus. 検証コードを含むプログラムの記述例とオブジェクトコードの一例を示す図である。It is a figure which shows the example of a description of the program containing a verification code, and an example of an object code. 検証装置の概略構成図の一例である。It is an example of the schematic block diagram of a verification apparatus.

10 EEPROM
15 タイマ
30 JTAGツール
50 CPU
100 検証装置
10 EEPROM
15 Timer 30 JTAG tool 50 CPU
100 Verification device

Claims (1)

CPUによるタスクの実行時間を検証する検証装置において、
前記CPUが実行する前記タスクのタスクコードと、前記タスクコードの直前に記述されたタイマをスタートさせる第1の命令と、前記タスクコードの後に記述されたタイマをストップさせる第2の命令と、が記述されたプログラムを記憶する記憶手段と、
前記第1の命令を1つ実行しただけでタイマをスタートさせる手段と、
前記第2の命令を1つ実行しただけでタイマをストップさせ前記実行時間を測定すると共に、複数回の前記タスクの実行により得られた複数の前記実行時間に統計処理を施す手段と、
を有することを特徴とする検証装置。
In the verification device that verifies the execution time of the task by the CPU,
A task code of the task to be executed by the CPU; a first instruction for starting a timer described immediately before the task code; and a second instruction for stopping a timer described after the task code. Storage means for storing the described program;
Means for starting a timer by executing only one of the first instructions;
Means for stopping the timer by measuring only the second instruction and measuring the execution time, and performing statistical processing on the plurality of execution times obtained by executing the task a plurality of times;
The verification apparatus characterized by having.
JP2009003184A 2009-01-09 2009-01-09 Verification device Pending JP2010160716A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009003184A JP2010160716A (en) 2009-01-09 2009-01-09 Verification device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009003184A JP2010160716A (en) 2009-01-09 2009-01-09 Verification device

Publications (1)

Publication Number Publication Date
JP2010160716A true JP2010160716A (en) 2010-07-22

Family

ID=42577821

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009003184A Pending JP2010160716A (en) 2009-01-09 2009-01-09 Verification device

Country Status (1)

Country Link
JP (1) JP2010160716A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61262858A (en) * 1985-05-15 1986-11-20 Mitsubishi Electric Corp Program debugging device
JPH02276784A (en) * 1989-04-18 1990-11-13 Mitsubishi Electric Corp Controller of elevator
JPH062453U (en) * 1992-05-29 1994-01-14 安藤電気株式会社 Program test operating time measurement circuit
JPH0991177A (en) * 1995-09-21 1997-04-04 Hitachi Ltd Semiconductor integrated circuit device
JPH11212834A (en) * 1998-01-28 1999-08-06 Nec Corp Measured value display method for performance measurement tool
JP2006293427A (en) * 2005-04-05 2006-10-26 Renesas Technology Corp Software evaluation device and system
JP2007304765A (en) * 2006-05-10 2007-11-22 Nec Electronics Corp Processor system and method for measuring performance of processor system
JP2008305238A (en) * 2007-06-08 2008-12-18 Denso Corp Measuring instrument

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61262858A (en) * 1985-05-15 1986-11-20 Mitsubishi Electric Corp Program debugging device
JPH02276784A (en) * 1989-04-18 1990-11-13 Mitsubishi Electric Corp Controller of elevator
JPH062453U (en) * 1992-05-29 1994-01-14 安藤電気株式会社 Program test operating time measurement circuit
JPH0991177A (en) * 1995-09-21 1997-04-04 Hitachi Ltd Semiconductor integrated circuit device
JPH11212834A (en) * 1998-01-28 1999-08-06 Nec Corp Measured value display method for performance measurement tool
JP2006293427A (en) * 2005-04-05 2006-10-26 Renesas Technology Corp Software evaluation device and system
JP2007304765A (en) * 2006-05-10 2007-11-22 Nec Electronics Corp Processor system and method for measuring performance of processor system
JP2008305238A (en) * 2007-06-08 2008-12-18 Denso Corp Measuring instrument

Similar Documents

Publication Publication Date Title
JP5611756B2 (en) Program flow control
JP5270330B2 (en) Multicore microcomputer system simulation method and simulation apparatus
KR20110070468A (en) Apparatus for executing instrumentation and method thereof
US8347278B2 (en) Instrumenting a compiled software routine for augmentation
KR100983135B1 (en) Processor and method of grouping and executing dependent instructions in a packet
JP6068879B2 (en) MEMORY SYSTEM, MEMORY DEVICE, INFORMATION PROCESSING DEVICE, AND MEMORY SYSTEM OPERATION METHOD
JP2006178646A (en) Information processor, information processing method, semiconductor device, and computer program
US8032794B2 (en) Error processing method and information processing apparatus
JP2010160716A (en) Verification device
JP2009193335A (en) Automatic annotation insertion method of static verification tool
JP6813513B2 (en) Methods and devices for protecting the program counter structure of the processor system and methods and devices for monitoring the processing of interruption requests.
US20100077383A1 (en) Simulation method and storage medium for storing program
JP2013003633A (en) Failure reproduction device and failure reproduction method
US20080133838A1 (en) Data processing device
JP5387521B2 (en) Logic verification scenario generation device and logic verification scenario generation program
JP4725240B2 (en) Data trace method and trace module
JP2005100017A (en) Processor simulator, interruption delay count program and simulation method of processor
US8464100B2 (en) System for checking a program memory of a processing unit
JP6037034B2 (en) Software inspection device, software inspection method, software inspection program
CN112380092B (en) Application program starting time testing method
US8443180B2 (en) Method for operation system startup
JP2009223861A (en) Logic verification system
JP2008071084A (en) Microprocessor and image forming apparatus
KR20170065845A (en) Processor and controlling method thereof
US9342359B2 (en) Information processing system and information processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110702

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120808

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120814

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120913

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121023

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121217

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130115