JP2000194585A - Execution time calculating device for program - Google Patents

Execution time calculating device for program

Info

Publication number
JP2000194585A
JP2000194585A JP10367820A JP36782098A JP2000194585A JP 2000194585 A JP2000194585 A JP 2000194585A JP 10367820 A JP10367820 A JP 10367820A JP 36782098 A JP36782098 A JP 36782098A JP 2000194585 A JP2000194585 A JP 2000194585A
Authority
JP
Japan
Prior art keywords
program
execution
database
condition
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
JP10367820A
Other languages
Japanese (ja)
Inventor
Toshiyuki Sasaki
俊之 佐々木
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP10367820A priority Critical patent/JP2000194585A/en
Publication of JP2000194585A publication Critical patent/JP2000194585A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To eliminated the need for modifying a program by easily measuring the execution time of the program. SOLUTION: The execution time calculating device for program uses a program analysis part 2 so as to take a conditional statement out of a program source file 1, gives a condition code of '1' for truth or '0' for falsehood, and finds an execution path for the condition code value to generate a condition- code-VS-instruction-word data base 3. Then a condition-code-VS-execution-cycle- number data base 5 is generated from the generated data base and an instruction-word-VS-execution-cycle-number data base 4 and the number of execution cycles is totalized to find the execution time of the program.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、例えばシーケン
スソフトウエアで使用されるIL(インストラクション
−ランゲージ)言語等で記述されたプログラムの実行時
間計算装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an execution time calculation device for a program described in, for example, an IL (Instruction Language) language used in sequence software.

【0002】[0002]

【従来の技術】従来、プログラムの実行時間は、PLC
(プログラマブルコントローラ)等の処理装置に転送し
実際に運転している状態で計測し、表示するようにして
いるのが一般的である。
2. Description of the Related Art Conventionally, the execution time of a program is controlled by a PLC.
In general, the data is transferred to a processing device such as a (programmable controller) and measured and displayed in the state of actual operation.

【0003】[0003]

【発明が解決しようとする課題】つまり、PLCや処理
装置に転送し実際に運転しなければ実行時間を測定でき
ず、測定結果が仕様を満足しない場合は、従来はシステ
ム設計工程からやり直すようにしているため、非常に大
きな工程ロスが発生する、という問題を有している。し
たがって、この発明の課題は、プログラムの実行時間を
簡単に測定し得るようにすることにある。
That is, the execution time cannot be measured unless the data is transferred to a PLC or a processing unit and actually operated, and if the measurement result does not satisfy the specifications, the conventional system design process is started again. Therefore, there is a problem that a very large process loss occurs. Therefore, an object of the present invention is to make it possible to easily measure the execution time of a program.

【0004】[0004]

【課題を解決するための手段】このような課題を解決す
べく、請求項1の発明では、所定の言語で記述されたプ
ログラムを解析して条件文を抽出し、その条件文で真を
“1”,偽を“0”とする条件コードを付与し、この条
件コードの値に対するプログラムの実行パスを求めて、
各条件コードに対するプログラム命令語のデータベース
を作成するプログラム解析部と、命令語に対応する実行
サイクル数を格納しておくデータベースと、前記リレー
ションデータベースと実行サイクル数データベースとか
ら条件コード対実行サイクル数のデータベースを作成
し、その実行サイクル数を合計する実行時間計算部と、
から構成している。
In order to solve such a problem, according to the first aspect of the present invention, a conditional statement is extracted by analyzing a program described in a predetermined language, and true is defined by the conditional statement. A condition code for setting "1" and false to "0" is given, and a program execution path for the value of the condition code is obtained.
A program analysis unit that creates a database of program instruction words for each condition code, a database that stores the number of execution cycles corresponding to the instruction words, and a condition code versus execution cycle number from the relation database and the execution cycle number database. An execution time calculation unit that creates a database and totals the number of execution cycles;
It consists of.

【0005】上記請求項1の発明においては、前記条件
文を抽出するために、命令語対応のコメント行に制御記
号と飛び先行を付加しておき、前記制御記号を検出して
条件コードが“1”ならば飛び先行から命令語を抽出す
ることができ(請求項2の発明)、または、前記条件文
を抽出するために、予め条件語を定義しておくことがで
きる(請求項3の発明)。
According to the first aspect of the present invention, in order to extract the conditional sentence, a control symbol and a jump precedence are added to a comment line corresponding to the instruction word, and the control symbol is detected and the condition code is changed to "1". If it is 1 ", a command word can be extracted from the skip ahead (the invention of claim 2), or a condition word can be defined in advance to extract the conditional statement (claim 3) invention).

【0006】[0006]

【発明の実施の形態】図1はこの発明の実施の形態を示
すブロック図である。図1において、1はプログラムソ
ースファイル、2はプログラム解析部、3は条件コード
に対する命令語データベース(条件コードVS命令語デ
ータベース)、4は命令語に対する実行サイクルデータ
ベース(命令語VS実行サイクルデータベース)、5は
条件コードに対する実行サイクル数データベース(条件
コードVS実行サイクル数データベース)、6は出力
(結果)としての実行サイクル数の合計を示す。
FIG. 1 is a block diagram showing an embodiment of the present invention. In FIG. 1, 1 is a program source file, 2 is a program analysis unit, 3 is a command database (condition code VS command database) for condition codes, 4 is an execution cycle database (command VS execution cycle database) for commands, Reference numeral 5 denotes an execution cycle number database for the condition code (condition code VS execution cycle number database), and reference numeral 6 denotes the total number of execution cycles as an output (result).

【0007】すなわち、プログラム解析部2は、図2に
示すようなプログラムソースファイル1を解析して、ジ
ャンプ(JMP)などの条件文を抽出する。なお、プロ
グラムソースファイル1は、ここでは記述言語としてイ
ンストラクション・ランゲージ(IL)を使用した例が
示されている。そして、この条件文で真を“1”,偽を
“0”とする条件コードを付与し、この条件コードの値
に対するプログラム命令語の実行パスを求めて、図3に
示すような各条件コードに対するプログラム命令語のリ
レーションデータベース(条件コードVS命令語データ
ベース)3を作成する。
That is, the program analysis unit 2 analyzes the program source file 1 as shown in FIG. 2 and extracts a conditional statement such as a jump (JMP). Here, the program source file 1 shows an example in which instruction language (IL) is used as a description language. Then, a condition code that sets true to "1" and false to "0" is given in this condition statement, and the execution path of the program instruction word for the value of the condition code is obtained. A relation database (condition code VS instruction database) 3 of the program command corresponding to is created.

【0008】一方、図4の如き命令語に対応する実行サ
イクル数(命令語VS実行サイクル数)のデータベース
4を予め用意しておけば、上記データベース3の各命令
語について条件コードごとの実行サイクル数を求めるこ
とができ、さらに、この求められた実行サイクル数を合
計することにより、実行時間を算出することが可能とな
る。条件コードVS実行サイクル数のデータベース5
と、合計サイクル数の例を図5に示す。図5から、条件
コードが“0”の場合の合計サイクル数は「11」であ
り、条件コードが“1”の場合の合計サイクル数は
「6」であることが分かる。
On the other hand, if a database 4 of the number of execution cycles (number of instruction word VS execution cycles) corresponding to an instruction word as shown in FIG. The execution time can be calculated by summing up the obtained execution cycle numbers. Condition code VS execution cycle number database 5
FIG. 5 shows an example of the total number of cycles. FIG. 5 shows that the total number of cycles when the condition code is “0” is “11”, and the total number of cycles when the condition code is “1” is “6”.

【0009】なお、条件文を抽出する手法としては例え
ば図2の第3行または第7行に示すように、命令語(J
MP)対応のコメント行に制御記号$J,$Bと飛び先
行(飛び先ラベル)を付加しておき、前記制御記号を検
出して条件コードが“1”ならば飛び先行から命令語を
抽出するか、または、予め条件語を定義しておき、これ
を検出して同様の処理をするなどの方法が考えられる。
As a method of extracting a conditional sentence, for example, as shown in the third or seventh line of FIG.
MP) A control symbol $ J, $ B and a jump precedence (jump destination label) are added to the corresponding comment line, and if the control symbol is detected and the condition code is "1", an instruction word is extracted from the jump precedence. Alternatively, a method is conceivable in which a conditional word is defined in advance, and this is detected and the same processing is performed.

【0010】[0010]

【発明の効果】この発明によれば、 (1)プログラムの設計段階で実行時間が計算できるた
め、手直しが回避できる。 (2)各機能ブロック毎に実行時間が計算できるため、
実行時間短縮のための方針を立てることができる。 (3)実行時間が最大となる条件が分かるので、機能検
証時の条件設定が容易となる。
According to the present invention, (1) the execution time can be calculated at the stage of designing a program, so that rework can be avoided. (2) Since the execution time can be calculated for each functional block,
Policies can be set to reduce execution time. (3) Since the condition for maximizing the execution time is known, the condition setting at the time of function verification becomes easy.

【図面の簡単な説明】[Brief description of the drawings]

【図1】この発明の実施の形態を示すブロック図であ
る。
FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】IL言語で記述されたソースファイル例説明図
である。
FIG. 2 is an explanatory diagram of an example of a source file described in an IL language.

【図3】条件コード対命令語のデータベース例説明図で
ある。
FIG. 3 is an explanatory diagram of an example of a database of condition codes versus instruction words.

【図4】命令語対実行サイクル数のデータベース例説明
図である。
FIG. 4 is an explanatory diagram of an example of a database of instruction words versus the number of execution cycles.

【図5】条件コード対実行サイクル数のデータベース例
と計算結果の説明図である。
FIG. 5 is an explanatory diagram of a database example of a condition code versus the number of execution cycles and a calculation result.

【符号の説明】[Explanation of symbols]

1…プログラムソースファイル、2…プログラム解析
部、3…条件コード対命令語データベース、4…命令語
対実行サイクルデータベース、5…条件コード対実行サ
イクル数データベース、6…出力(結果)。
DESCRIPTION OF SYMBOLS 1 ... program source file, 2 ... program analysis part, 3 ... condition code vs. instruction database, 4 ... instruction word vs. execution cycle database, 5 ... condition code vs. execution cycle number database, 6 ... output (result).

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 所定の言語で記述されたプログラムを解
析して条件文を抽出し、その条件文で真を“1”,偽を
“0”とする条件コードを付与し、この条件コードの値
に対するプログラムの実行パスを求めて、各条件コード
に対するプログラム命令語のデータベースを作成するプ
ログラム解析部と、命令語に対応する実行サイクル数を
格納しておくデータベースと、前記リレーションデータ
ベースと実行サイクル数データベースとから条件コード
対実行サイクル数のデータベースを作成し、その実行サ
イクル数を合計する実行時間計算部と、からなるプログ
ラムの実行時間計算装置。
1. A program described in a predetermined language is analyzed to extract a conditional statement, and a conditional code that sets true to “1” and false to “0” is added to the conditional statement. A program analysis unit for creating a database of program instructions for each condition code by finding a program execution path for each value, a database for storing the number of execution cycles corresponding to the instructions, the relation database and the number of execution cycles A program execution time calculation device comprising: a database of condition codes versus execution cycles from a database; and an execution time calculation unit for summing up the number of execution cycles.
【請求項2】 前記条件文を抽出するために、命令語対
応のコメント行に制御記号と飛び先行を付加しておき、
前記制御記号を検出して条件コードが“1”ならば飛び
先行から命令語を抽出することを特徴とする請求項1に
記載のプログラムの実行時間計算装置。
2. A control symbol and a jump precedence are added to a comment line corresponding to a command word in order to extract the conditional statement.
2. The program execution time calculation device according to claim 1, wherein the control symbol is detected, and if the condition code is "1", the instruction word is extracted from the skip ahead.
【請求項3】 前記条件文を抽出するために、予め条件
語を定義しておくことを特徴とする請求項1に記載のプ
ログラムの実行時間計算装置。
3. The program execution time calculation device according to claim 1, wherein a condition word is defined in advance to extract the condition sentence.
JP10367820A 1998-12-24 1998-12-24 Execution time calculating device for program Pending JP2000194585A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10367820A JP2000194585A (en) 1998-12-24 1998-12-24 Execution time calculating device for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10367820A JP2000194585A (en) 1998-12-24 1998-12-24 Execution time calculating device for program

Publications (1)

Publication Number Publication Date
JP2000194585A true JP2000194585A (en) 2000-07-14

Family

ID=18490280

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10367820A Pending JP2000194585A (en) 1998-12-24 1998-12-24 Execution time calculating device for program

Country Status (1)

Country Link
JP (1) JP2000194585A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015210574A (en) * 2014-04-24 2015-11-24 富士通株式会社 Information processor, processing method and processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015210574A (en) * 2014-04-24 2015-11-24 富士通株式会社 Information processor, processing method and processing program

Similar Documents

Publication Publication Date Title
JP2004164554A (en) Device and method for executing and monitoring program
US11656592B2 (en) Analysis device, analysis method, and recording medium
JP2000194585A (en) Execution time calculating device for program
US20230129280A1 (en) Computer readable storage medium, program creation support apparatus, and program creation support method
CN109597638B (en) Method and device for solving data processing and equipment linkage based on real-time computing engine
JPH06231081A (en) Numerical formula display system
KR100290623B1 (en) A method of controlling data of database
JP2003005809A (en) Interface device for programmable controller
JP4371000B2 (en) IDL compiling device, IDL compiling method, and IDL compiler
JP2653880B2 (en) Program content analyzer
JPH02220145A (en) Program tracing system
JPH05100719A (en) Programmable controller
JP3638505B2 (en) Simulation apparatus and software simulation method for microprocessor
JP2003067195A (en) Optimization compile method and optimization compile device
JPH04273330A (en) Calculation processor for column position of layout item
JP2001060151A (en) Program analyzing device, and storage medium stored with program for program analysis or data for program analysis
JPH11195011A (en) Language translation processor, language translation processing method and record medium recording language translation processing program
JPH05313870A (en) Preparation system for program structure diagram
JPH1011276A (en) Program transferring method
JPH11224185A (en) Device and method for analyzing variable influence
JPH0193826A (en) System for counting dynamic step of high grade language
JPH05204700A (en) Language processor
JP2012068946A (en) Batch processing program analyzing method and device
JP2003150386A (en) Compiler and compiling method
JPH02190935A (en) Compile system for program having syntax analysis rule integrating function