JP2007034650A - Software development system - Google Patents

Software development system Download PDF

Info

Publication number
JP2007034650A
JP2007034650A JP2005216662A JP2005216662A JP2007034650A JP 2007034650 A JP2007034650 A JP 2007034650A JP 2005216662 A JP2005216662 A JP 2005216662A JP 2005216662 A JP2005216662 A JP 2005216662A JP 2007034650 A JP2007034650 A JP 2007034650A
Authority
JP
Japan
Prior art keywords
program
target program
software development
development system
compiler
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2005216662A
Other languages
Japanese (ja)
Inventor
Kazuo Nishikata
和夫 西片
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.)
NEC Electronics Corp
Original Assignee
NEC Electronics 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 NEC Electronics Corp filed Critical NEC Electronics Corp
Priority to JP2005216662A priority Critical patent/JP2007034650A/en
Publication of JP2007034650A publication Critical patent/JP2007034650A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a software development system for improving the development efficiency of software. <P>SOLUTION: This software development system 100 is provided with a compiler for compiling a primitive program 11, and for generating a target program 12 and an execution module 30 for executing the target program 12. The compiler 20 optimizes the target program 12 corresponding to a processor 1 which supports a memory access instruction with an address updating function. In the case of optimizing the target program 12, the compiler 20 gathers address update and memory access to be executed with condition branching interposed into an instruction in one step to be executed before the condition branching. Furthermore, the compiler 20 generates optimized position data 13 showing a position where the target program 12 is optimized. An execution module 30 is provided with a function for issuing warning when access to an uninitialized/undefined memory region is performed. The execution module 30 does not issue warning when executing the code of the position shown by the optimized position data 13. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、ソフトウェアを開発するための技術に関する。   The present invention relates to a technique for developing software.

ソフトウェアの開発において、コンパイラは重要な役割を果たす。コンパイラは、原始プログラム(ソースコード)をコンパイルし、目的プログラム(実行コード)を生成する。また、コンパイラは、目的プログラムのサイズや効率が向上するように、プログラム構成を最適化する。その最適化手法は、目的プログラムを実行するプロセッサの機能によって大きく異なってくる。言い換えれば、あるプロセッサに関して、どのような最適化方法を用いるかによって、目的プログラムの性能に大きな差が生じてしまう。このように、目的プログラムが適用されるシステムの性能を最大限に引き出す上で、コンパイラにおける最適化技術は、非常に重要な役割を果たす。   Compilers play an important role in software development. The compiler compiles a source program (source code) and generates a target program (executable code). The compiler also optimizes the program configuration so that the size and efficiency of the target program are improved. The optimization method varies greatly depending on the function of the processor that executes the target program. In other words, there is a large difference in the performance of the target program depending on what optimization method is used for a certain processor. Thus, the optimization technique in the compiler plays a very important role in maximizing the performance of the system to which the target program is applied.

コンパイルに関連する技術は、例えば特許文献1に開示されている。特許文献1に記載されたコンパイル装置は、分岐履歴情報採取コード生成手段と、分岐パターン解析手段と、ループ最適化手段とを含む。分岐履歴情報採取コード生成手段は、オブジェクトプログラムに含まれる各ループ処理の実行毎の繰り返し数と該ループ処理内の条件分岐命令の分岐履歴の情報とを採取するためのコードを生成する。分岐パターン解析手段は、分岐履歴情報ファイルに記録された情報に基づいて、対象となるループ処理内の分岐パターンの解析を行う。ループ最適化手段は、分岐パターン解析手段による解析結果に基づいて、対象となるループ処理を効率良く実行するのに最適なコードを生成する。   A technique related to compilation is disclosed in Patent Document 1, for example. The compiling device described in Patent Document 1 includes branch history information collection code generation means, branch pattern analysis means, and loop optimization means. The branch history information collection code generation means generates a code for collecting the number of repetitions for each execution of each loop process included in the object program and the branch history information of the conditional branch instruction in the loop process. The branch pattern analysis means analyzes the branch pattern in the target loop process based on the information recorded in the branch history information file. The loop optimization means generates an optimum code for efficiently executing the target loop processing based on the analysis result by the branch pattern analysis means.

あるプロセッサの機能として、「アドレス更新機能付きメモリアクセス機能」が知られている。図1は、その機能を説明するための概念図である。図1には、アドレス更新機能付きメモリアクセス機能を有するプロセッサ1と、そのプロセッサ1がアクセスするメインメモリ2が示されている。プロセッサ1は、レジスタdp0やレジスタr0を含んでいる。レジスタdp0には、メインメモリ2のアドレス(番地)を示す値“0x100”が格納されているとする。このようなプロセッサ1において、例えば、次のような命令が実行される場合を考える。   As a function of a certain processor, a “memory access function with an address update function” is known. FIG. 1 is a conceptual diagram for explaining the function. FIG. 1 shows a processor 1 having a memory access function with an address update function and a main memory 2 accessed by the processor 1. The processor 1 includes a register dp0 and a register r0. It is assumed that a value “0x100” indicating the address (address) of the main memory 2 is stored in the register dp0. In such a processor 1, for example, consider the case where the following instruction is executed.

r0 = *++dp0   r0 = * ++ dp0

この命令は、「レジスタdp0の値を1増加させ、レジスタdp0で示されるアドレスからデータを読み出し、そのデータをレジスタr0にセットする」という命令である。この場合、レジスタdp0の値がインクリメントされ、“0x101”になる。また、メインメモリ2の番地0x101から、値“0xff”が読み出される。その値“0xff”は、レジスタr0に格納される。   This instruction is an instruction that “increments the value of the register dp0 by 1, reads data from the address indicated by the register dp0, and sets the data in the register r0”. In this case, the value of the register dp0 is incremented to “0x101”. Also, the value “0xff” is read from the address 0x101 of the main memory 2. The value “0xff” is stored in the register r0.

上述の例において、レジスタdp0の値を1増加させる動作が「アドレス更新」であり、レジスタdp0で示されるアドレスからデータを読み出す動作が「メモリアクセス」である。上述の命令によれば、アドレス更新とメモリアクセスが1ステップで実行される。このような命令が、「アドレス更新機能付きメモリアクセス命令」と呼ばれる。図1におけるプロセッサ1は、このアドレス更新機能付きメモリアクセス命令をサポートしており、アドレス更新機能付きメモリアクセス機能を有している。   In the above example, the operation of incrementing the value of the register dp0 by 1 is “address update”, and the operation of reading data from the address indicated by the register dp0 is “memory access”. According to the above instruction, the address update and the memory access are executed in one step. Such an instruction is called a “memory access instruction with an address update function”. The processor 1 in FIG. 1 supports this memory access instruction with an address update function and has a memory access function with an address update function.

このような機能を有するプロセッサ1に対応するコンパイラの最適化手法として、図2に示された手法が知られている。図2には、あるプログラムの流れの一部が示されている。最適化が行われない場合、まずアドレス更新が行われる(ステップS1)。次に、ある条件が満たされているか否かの判定が行われる(ステップS2)。その条件が満たされている場合(ステップS2;Yes)、続けて第1処理(ステップS3)、メモリアクセス(ステップS4)、及び第2処理(ステップS5)が実行される。その条件が満たされない場合(ステップS2;No)、ステップS3〜S5は実行されない。   As a compiler optimization method corresponding to the processor 1 having such a function, the method shown in FIG. 2 is known. FIG. 2 shows a part of a program flow. If optimization is not performed, address updating is performed first (step S1). Next, it is determined whether or not a certain condition is satisfied (step S2). When the condition is satisfied (step S2; Yes), the first process (step S3), the memory access (step S4), and the second process (step S5) are subsequently executed. When that condition is not satisfied (step S2; No), steps S3 to S5 are not executed.

プロセッサ1がアドレス更新機能付きメモリアクセス機能を有する場合、コンパイラは、上記処理を次のように最適化することができる。すなわち、まず「アドレス更新機能付きメモリアクセス命令」が実行される(ステップS11)。次に、上記条件が満たされているか否かの判定が行われる(ステップS12)。その条件が満たされている場合(ステップS12;Yes)、続けて第1処理(ステップS13)及び第2処理(ステップS14)が実行される。その条件が満たされない場合(ステップS12;No)、ステップS13〜S14は実行されない。   When the processor 1 has a memory access function with an address update function, the compiler can optimize the above process as follows. That is, first, a “memory access instruction with an address update function” is executed (step S11). Next, it is determined whether or not the above condition is satisfied (step S12). When the condition is satisfied (step S12; Yes), the first process (step S13) and the second process (step S14) are subsequently performed. When the condition is not satisfied (step S12; No), steps S13 to S14 are not executed.

このように、条件分岐を挟んで実行される2つの「アドレス更新」と「メモリアクセス」を、条件分岐の前に実行される1つの「アドレス更新機能付きメモリアクセス」にまとめることが可能である。これにより、コードのサイズが削減される。また、条件分岐において条件が満たされる場合(ステップS2、S12;Yes)、続けて行われる処理ステップの数が1つだけ減少する。その結果、プログラムの実行速度が向上する。すなわち、図2に示される最適化を行うことにより、目的プログラムの効率や性能を向上させることが可能となる。メモリアクセスが条件分岐前に実行され、アドレス更新が条件分岐後に実行される場合であっても、同様の最適化が可能である。   In this way, it is possible to combine two “address update” and “memory access” executed across a conditional branch into one “memory access with address update function” executed before the conditional branch. . This reduces the code size. Further, when the condition is satisfied in the conditional branch (steps S2, S12; Yes), the number of subsequent processing steps is decreased by one. As a result, the execution speed of the program is improved. That is, by performing the optimization shown in FIG. 2, the efficiency and performance of the target program can be improved. Similar optimization is possible even when the memory access is executed before the conditional branch and the address update is executed after the conditional branch.

図3は、一般的なソフトウェア開発環境を説明するための図である。コンパイラ80は、原始プログラム11をコンパイルすることにより、目的プログラム12を生成する。開発される目的プログラム12(ソフトウェア)は、マイコンなどの製品3に搭載される。この製品3は、「アドレス更新機能付きメモリアクセス機能」を有する上記プロセッサ1を備えており、目的プログラム12はそのプロセッサ1により実行される。そのため、コンパイラ80は、図2に示された手法に基づいて、目的プログラム12の最適化を行う。   FIG. 3 is a diagram for explaining a general software development environment. The compiler 80 generates the target program 12 by compiling the source program 11. The target program 12 (software) to be developed is installed in a product 3 such as a microcomputer. The product 3 includes the processor 1 having a “memory access function with an address update function”, and the target program 12 is executed by the processor 1. Therefore, the compiler 80 optimizes the target program 12 based on the method shown in FIG.

尚、上述の最適化が行われる場合、条件分岐の前に、プログラム開発者の意図しないメモリアクセスが発生するという副作用も発生する。つまり、原始プログラム11が意図通りに作成されたとしても、コンパイラ80によるコンパイルの結果、目的プログラム12は、プログラム開発者の意図しないメモリアクセスを含んでしまう。但し、この副作用は、プログラムの正常な実行を妨げるわけでは無いので、通常は無視される。意図しないメモリアクセスを含む目的プログラム12がそのまま製品3に搭載されても、特に問題は生じない。   When the above-described optimization is performed, a side effect that a memory access unintended by the program developer occurs before the conditional branch occurs. That is, even if the source program 11 is created as intended, the target program 12 includes memory access not intended by the program developer as a result of compilation by the compiler 80. However, this side effect is usually ignored because it does not prevent normal execution of the program. Even if the target program 12 including an unintended memory access is installed in the product 3 as it is, no particular problem occurs.

特開平10−240573号公報JP-A-10-240573

ソフトウェアの開発において、生成される目的プログラム12のデバッグや動作検証も必要である。例えば図3に示されるように、シミュレーションモジュール90が用いられる。このシミュレーションモジュール90は、プロセッサ1と目的プログラム12を搭載した製品3をシミュレートするように構成されたハードウェアあるいはソフトウェアである。シミュレーションモジュール90は、目的プログラム12を実行する実行部91を備えている。この実行部91は、目的プログラム12の実行中に未初期化・未定義のメモリ領域へのアクセスが行われた場合、開発者に対して警告を発する「警告機能」を備えている。この警告機能は、開発者が目的プログラム12中の不具合を発見する助けとなる。   In software development, it is necessary to debug and verify the operation of the generated target program 12. For example, as shown in FIG. 3, a simulation module 90 is used. The simulation module 90 is hardware or software configured to simulate the product 3 in which the processor 1 and the target program 12 are installed. The simulation module 90 includes an execution unit 91 that executes the target program 12. The execution unit 91 has a “warning function” that issues a warning to the developer when an uninitialized / undefined memory area is accessed during the execution of the target program 12. This warning function helps the developer to find a defect in the target program 12.

上述の通り、コンパイラ80により最適化された目的プログラム12は、プログラム開発者の意図しないメモリアクセスを含んでいる。そのようなメモリアクセスは、プログラムの正常動作を妨げるわけではないが、シミュレーションモジュール90は、そのようなメモリアクセスに対しても警告を発する可能性がある。しかしながら、開発者は、そのようなメモリアクセスによる警告と、本当の不具合による警告とを区別することはできない。従って、警告が発せられた場合、開発者は、問題点やプログラムの解析を無駄に行ってしまう可能性がある。これは、時間の無駄であり、開発効率の低下を招く。   As described above, the target program 12 optimized by the compiler 80 includes memory access not intended by the program developer. Such memory access does not interfere with the normal operation of the program, but the simulation module 90 may issue a warning for such memory access. However, developers cannot distinguish between such memory access warnings and real fault warnings. Therefore, when a warning is issued, the developer may wastefully analyze problems and programs. This is a waste of time and causes a reduction in development efficiency.

以下に、[発明を実施するための最良の形態]で使用される番号・符号を用いて、[課題を解決するための手段]を説明する。これらの番号・符号は、[特許請求の範囲]の記載と[発明を実施するための最良の形態]との対応関係を明らかにするために括弧付きで付加されたものである。ただし、それらの番号・符号を、[特許請求の範囲]に記載されている発明の技術的範囲の解釈に用いてはならない。   [Means for Solving the Problems] will be described below using the numbers and symbols used in [Best Mode for Carrying Out the Invention]. These numbers and symbols are added in parentheses in order to clarify the correspondence between the description of [Claims] and [Best Mode for Carrying Out the Invention]. However, these numbers and symbols should not be used for the interpretation of the technical scope of the invention described in [Claims].

本発明に係るソフトウェア開発システム(100)は、原始プログラム(11)をコンパイルし目的プログラム(12)を生成するコンパイラと、その目的プログラム(12)を実行する実行モジュール(30)とを備える。その実行モジュール(30)は、例えば、目的プログラム(12)が搭載される製品(3)をシミュレートするためのシミュレーションモジュール(30)である。   A software development system (100) according to the present invention includes a compiler that compiles a source program (11) and generates a target program (12), and an execution module (30) that executes the target program (12). The execution module (30) is, for example, a simulation module (30) for simulating a product (3) on which the target program (12) is mounted.

コンパイラ(20)は、アドレス更新とメモリアクセスを1ステップで実行する「第1命令(アドレス更新機能付きメモリアクセス命令)」をサポートするプロセッサ(1)に対応するように、目的プログラム(12)の最適化を行う。その最適化において、コンパイラ(20)は、条件分岐を挟んで実行されるアドレス更新とメモリアクセスを、条件分岐の前に実行される1ステップの上記第1命令にまとめる。更に、コンパイラ(20)は、目的プログラム(12)中の最適化が行われた位置を示す最適化位置データ(13)を生成する。   The compiler (20) executes the update of the target program (12) so as to correspond to the processor (1) that supports the "first instruction (memory access instruction with an address update function)" that executes address update and memory access in one step. Perform optimization. In the optimization, the compiler (20) combines the address update and the memory access that are executed with the conditional branch between them into one step of the first instruction that is executed before the conditional branch. Further, the compiler (20) generates optimized position data (13) indicating the position where the optimization is performed in the target program (12).

実行モジュール(30)は、未初期化・未定義のメモリ領域へのアクセスが行われる場合に警告を発する機能を有する。この実行モジュール(30)は、上記最適化位置データ(13)に示された位置を参照しながら、目的プログラム(12)を実行する。具体的には、実行モジュール(30)は、目的プログラム(12)中の上記位置のコードを実行する際は、警告を発しない。つまり、実行モジュール(30)は、無視可能な未初期化・未定義のメモリ領域へのアクセスに対して警告を行わず、本当の不具合に起因する警告のみを発する。   The execution module (30) has a function of issuing a warning when an uninitialized / undefined memory area is accessed. The execution module (30) executes the object program (12) while referring to the position indicated in the optimized position data (13). Specifically, the execution module (30) does not issue a warning when executing the code at the position in the target program (12). That is, the execution module (30) does not issue a warning for access to an uninitialized / undefined memory area that can be ignored, and only issues a warning due to a real failure.

従って、開発者は無駄なプログラム解析を行う必要がなくなり、開発時間の浪費が抑制される。また、開発者は、本来の警告機能を有効に活用することが可能となる。その結果、ソフトウェアの開発効率が向上する。   Therefore, the developer does not need to perform useless program analysis, and waste of development time is suppressed. In addition, the developer can effectively use the original warning function. As a result, software development efficiency is improved.

本発明に係るソフトウェア開発システムによれば、開発効率が向上する。   The software development system according to the present invention improves the development efficiency.

添付図面を参照して、本発明によるソフトウェア開発システムを説明する。   A software development system according to the present invention will be described with reference to the accompanying drawings.

図4は、本発明の実施の形態に係るソフトウェア開発環境を説明するための図である。コンパイラ20は、原始プログラム11をコンパイルすることにより、目的プログラム12を生成する。その目的プログラム12(ソフトウェア)は、マイコンなどの製品に搭載される。その製品は、「アドレス更新機能付きメモリアクセス機能」を有するプロセッサ1を備えており、目的プログラム12はそのプロセッサ1により実行される。そのため、コンパイラ20は、図2に示された手法に基づいて、プロセッサ1に対応するように目的プログラム12の最適化を行う。すなわち、コンパイラ20は、条件分岐を挟んで実行される「アドレス更新」と「メモリアクセス」を、条件分岐の前に実行される1ステップの「アドレス更新機能付きメモリアクセス命令」にまとめる。   FIG. 4 is a diagram for explaining a software development environment according to the embodiment of the present invention. The compiler 20 generates the target program 12 by compiling the source program 11. The target program 12 (software) is installed in a product such as a microcomputer. The product includes a processor 1 having a “memory access function with an address update function”, and the target program 12 is executed by the processor 1. Therefore, the compiler 20 optimizes the target program 12 so as to correspond to the processor 1 based on the method shown in FIG. That is, the compiler 20 combines “address update” and “memory access” executed across the conditional branch into one step “memory access instruction with address update function” executed before the conditional branch.

また、本実施の形態に係るコンパイラ20は、目的プログラム12中の最適化が行われた位置を示す最適化位置データ13を生成する。つまり、最適化位置データ13は、条件分岐前後の「アドレス更新」と「メモリアクセス」がまとめられた「アドレス更新機能付きメモリアクセス命令」の位置を示す。更に言い換えれば、最適化位置データ13は、図2に示されたステップS11の位置を示す。目的プログラム12中の位置とは、ステップS11の目的プログラム12内でのアドレス(オフセット位置)を意味する。例えば、最適化位置データ13には、“0x010”といったアドレスを示す値が格納される。   In addition, the compiler 20 according to the present embodiment generates optimized position data 13 indicating the position in the target program 12 where the optimization has been performed. That is, the optimized position data 13 indicates the position of the “memory access instruction with an address update function” in which “address update” and “memory access” before and after the conditional branch are collected. In other words, the optimized position data 13 indicates the position of step S11 shown in FIG. The position in the target program 12 means an address (offset position) in the target program 12 in step S11. For example, the optimization position data 13 stores a value indicating an address such as “0x010”.

コンパイラ20によって生成された目的プログラム12は、実行モジュールにより実行される。図4において、その実行モジュールの例として、生成された目的プログラム12のデバッグや動作検証を行うためのシミュレーションモジュール30が示されている。このシミュレーションモジュール30は、プロセッサ1と目的プログラム12を搭載した製品をシミュレートするように構成される。後述されるように、このシミュレーションモジュール30は、ハードウェアで構成されてもよいし、ソフトウェアで構成されてもよい。   The target program 12 generated by the compiler 20 is executed by the execution module. In FIG. 4, a simulation module 30 for performing debugging and operation verification of the generated target program 12 is shown as an example of the execution module. The simulation module 30 is configured to simulate a product on which the processor 1 and the target program 12 are installed. As will be described later, the simulation module 30 may be configured by hardware or software.

目的プログラム12のデバッグや動作検証を行うためには、プログラムの異常動作を検知し開発者に通知する機能が必要である。そのため、本実施の形態に係るシミュレーションモジュール30は、目的プログラム12の実行中に未初期化・未定義のメモリ領域へのアクセスが行われた場合、開発者に対して警告を発する機能を備えている。この機能は、以下「警告機能」と参照される。シミュレーションモジュール30の警告機能は、開発者が目的プログラム12中の不具合を発見する助けとなる。   In order to debug and verify the operation of the target program 12, a function for detecting an abnormal operation of the program and notifying the developer is necessary. Therefore, the simulation module 30 according to the present embodiment has a function of issuing a warning to the developer when an uninitialized / undefined memory area is accessed during the execution of the target program 12. Yes. This function is hereinafter referred to as “warning function”. The warning function of the simulation module 30 helps the developer to find a defect in the target program 12.

図4に示されるように、シミュレーションモジュール30は、実行部31と判定部32を有している。実行部31は、目的プログラム12を実行する。実行中の目的プログラム12の不具合を検出するため、この実行部31は、上述の警告機能を有する。判定部32は、最適化位置データ13を読み込む。そして、判定部32は、現在実行中の目的プログラム12の位置が、最適化位置データ13に示されている位置と一致するかどうか判定する。一致する場合、判定部32は、実行部31にマスク信号を出力する。実行部31は、マスク信号を受け取った場合、未初期化・未定義のメモリ領域へのアクセスが行われたとしても、警告を発しない。   As illustrated in FIG. 4, the simulation module 30 includes an execution unit 31 and a determination unit 32. The execution unit 31 executes the target program 12. In order to detect a malfunction of the target program 12 being executed, the execution unit 31 has the warning function described above. The determination unit 32 reads the optimized position data 13. Then, the determination unit 32 determines whether or not the position of the target program 12 currently being executed matches the position indicated in the optimized position data 13. If they match, the determination unit 32 outputs a mask signal to the execution unit 31. When the execution unit 31 receives a mask signal, it does not issue a warning even if an uninitialized / undefined memory area is accessed.

図5は、シミュレーションモジュール30による処理を示すフローチャートである。シミュレーションモジュール30は、目的プログラム12の実行を開始する(ステップS100)。目的プログラム12中のある位置で、メインメモリに対するアクセスが行われる(ステップS110)。そのメモリアクセスが未初期化・未定義のメモリ領域へのアクセスではない場合(ステップS111;No)、処理が引き続き実行される(ステップS120)。   FIG. 5 is a flowchart showing processing by the simulation module 30. The simulation module 30 starts execution of the target program 12 (step S100). The main memory is accessed at a certain position in the target program 12 (step S110). If the memory access is not an access to an uninitialized / undefined memory area (step S111; No), the processing is continued (step S120).

未初期化・未定義のメモリ領域へのアクセスが行われた時は(ステップS111;Yes)、警告が発せられる場合と、警告が発せられない場合がある。ステップS111におけるメモリアクセスが、最適化位置データ13に示された位置のメモリアクセスである場合(ステップS112;Yes)、判定部32は、実行部31にマスク信号を出力している。従って、シミュレーションモジュール30は、警告を出さずに処理を続行する(ステップS120)。つまり、シミュレーションモジュール30は、未初期化・未定義のメモリ領域へのアクセスが行われていないように振る舞う。   When an uninitialized / undefined memory area is accessed (step S111; Yes), a warning may be issued or a warning may not be issued. When the memory access in step S111 is a memory access at the position indicated in the optimized position data 13 (step S112; Yes), the determination unit 32 outputs a mask signal to the execution unit 31. Therefore, the simulation module 30 continues the process without issuing a warning (step S120). That is, the simulation module 30 behaves as if an uninitialized / undefined memory area is not accessed.

一方、ステップS111におけるメモリアクセスが、最適化位置データ13に示された位置のメモリアクセスではない場合(ステップS112;No)、シミュレーションモジュール30は、開発者に警告を与える(ステップS200)。この場合の警告は無視できない本当の不具合に起因する可能性が高い。未初期化・未定義のメモリ領域へのアクセスの原因は、原始プログラム11に存在する可能性が高い。従って、開発者は、プログラムの解析を行い、問題点を検討する(ステップS210)。   On the other hand, when the memory access in step S111 is not the memory access at the position indicated in the optimized position data 13 (step S112; No), the simulation module 30 gives a warning to the developer (step S200). The warning in this case is likely due to a real fault that cannot be ignored. The cause of access to the uninitialized / undefined memory area is likely to exist in the source program 11. Therefore, the developer analyzes the program and examines the problem (step S210).

目的プログラム12が最後まで実行されると(ステップS130;Yes)、シミュレーションモジュール30の処理は終了する。   When the objective program 12 is executed to the end (step S130; Yes), the processing of the simulation module 30 is finished.

このように、本実施の形態に係るシミュレーションモジュール30は、最適化位置データ13に示された位置情報を参照しながら目的プログラム12を実行し、不必要な場合は警告を発しない。具体的には、最適化位置データ13に示された位置の「アドレス更新機能付きメモリアクセス命令」を実行する際、シミュレーションモジュール30は、警告を発しない。すなわち、シミュレーションモジュール30は、無視可能な未初期化・未定義のメモリ領域へのアクセスに対して警告を行わず、本当の不具合に起因する警告のみを発する。従って、開発者は無駄なプログラム解析を行う必要がなくなり、開発時間の浪費が抑制される。また、開発者は、本来の警告機能を有効に活用することが可能となる。その結果、ソフトウェアの開発効率が向上する。   As described above, the simulation module 30 according to the present embodiment executes the object program 12 while referring to the position information indicated in the optimized position data 13, and does not issue a warning when unnecessary. Specifically, when executing the “memory access instruction with an address update function” at the position indicated in the optimized position data 13, the simulation module 30 does not issue a warning. That is, the simulation module 30 does not issue a warning for access to an ignorable uninitialized / undefined memory area, and issues only a warning due to a real defect. Therefore, the developer does not need to perform useless program analysis, and waste of development time is suppressed. In addition, the developer can effectively use the original warning function. As a result, software development efficiency is improved.

以上に説明されたソフトウェア開発を実現するための具体的なシステム構成が、以下に例示される。   A specific system configuration for realizing the software development described above is exemplified below.

図6は、ソフトウェア開発システム100の一例を示している。このソフトウェア開発システム100は、目的プログラム開発装置200と目的プログラム実行装置300を含んでいる。目的プログラム開発装置200は、目的プログラム12を開発するための装置であり、例えばパーソナルコンピュータにより実現される。目的プログラム実行装置300は、目的プログラム12を実行するための装置であり、上記シミュレーションモジュール(実行モジュール)30に対応している。   FIG. 6 shows an example of the software development system 100. The software development system 100 includes a target program development device 200 and a target program execution device 300. The target program development device 200 is a device for developing the target program 12, and is realized by, for example, a personal computer. The target program execution device 300 is a device for executing the target program 12, and corresponds to the simulation module (execution module) 30.

目的プログラム開発装置200は、演算処理装置210、メインメモリ220、記憶装置230、入力装置240、表示装置250、及びインタフェース260を備えており、それらはバスを介して互いに通信可能に接続されている。記憶装置230としては、ハードディスクドライブが例示される。この記憶装置230には、原始プログラム11、目的プログラム12、最適化位置データ13、コンパイラ20、及びデバッガ40が格納されている。入力装置240としては、マウスやキーボードが例示される。表示装置250としては、液晶ディスプレイが例示される。   The target program development device 200 includes an arithmetic processing device 210, a main memory 220, a storage device 230, an input device 240, a display device 250, and an interface 260, which are connected to each other via a bus so as to communicate with each other. . An example of the storage device 230 is a hard disk drive. The storage device 230 stores a source program 11, a target program 12, optimized position data 13, a compiler 20, and a debugger 40. Examples of the input device 240 include a mouse and a keyboard. An example of the display device 250 is a liquid crystal display.

目的プログラム実行装置300は、ハードウェアであり、製品と同じように目的プログラム12を実行できるように構成される。具体的には、目的プログラム実行装置300は、プロセッサ310、メインメモリ320、格納部330、及びインタフェース360を備えており、それらはバスを介して互いに通信可能に接続されている。格納部330は、最適化位置データ13を格納するための記憶領域であり、その格納部330として、不揮発性メモリが例示される。   The target program execution device 300 is hardware, and is configured to execute the target program 12 in the same manner as a product. Specifically, the target program execution device 300 includes a processor 310, a main memory 320, a storage unit 330, and an interface 360, which are connected to each other via a bus so as to communicate with each other. The storage unit 330 is a storage area for storing the optimized position data 13, and a non-volatile memory is exemplified as the storage unit 330.

プロセッサ310は、上述の実行部31に対応している。目的プログラム12を実行するため、プロセッサ310は、「アドレス更新機能付きメモリアクセス機能」を有している。つまり、プロセッサ310は、アドレス更新機能付きメモリアクセス命令をサポートしている。また、プロセッサ310は、目的プログラム12の実行中に未初期化・未定義のメモリ領域へのアクセスが行われた場合に警告を発する「警告機能」も有している。更に、プロセッサ310は、最適化位置データ13を参照する上述の判定部32も有している。 The processor 310 corresponds to the execution unit 31 described above. In order to execute the target program 12, the processor 310 has a “memory access function with an address update function”. That is, the processor 310 supports a memory access instruction with an address update function. The processor 310 also has a “warning function” that issues a warning when an uninitialized / undefined memory area is accessed during execution of the target program 12. Furthermore, the processor 310 also includes the above-described determination unit 32 that refers to the optimized position data 13.

目的プログラム開発装置200と目的プログラム実行装置300は、インタフェース260及び360を介して、互いに通信可能に接続される。これにより、目的プログラム開発装置200と目的プログラム実行装置300との間で、データのやりとりを行うことが可能である。   The target program development device 200 and the target program execution device 300 are connected to each other via interfaces 260 and 360 so as to communicate with each other. As a result, data can be exchanged between the target program development device 200 and the target program execution device 300.

このようなソフトウェア開発システム100を用いて、ソフトウェアは次のように開発される。開発者は、表示装置250に表示される情報を参照し、入力装置240を用いることによって原始プログラム11を編集する。次に、開発者は、コンパイラ20を起動する。このコンパイラ20は、演算処理装置210によって、メインメモリ220にロードされ実行される。コンパイラ20の命令に従って、演算処理装置210は、次のような処理を行う。すなわち、演算処理装置210は、記憶装置230から原始プログラム11を読み込み、その原始プログラム11をコンパイルする。ここで、図2に示された最適化が行われる。このコンパイルの結果、最適化された目的プログラム12と、最適化された位置を示す最適化位置データ13が生成される。演算処理装置210は、これら目的プログラム12及び最適化位置データ13を、記憶装置230に格納する。   Using such a software development system 100, software is developed as follows. The developer refers to the information displayed on the display device 250 and edits the source program 11 by using the input device 240. Next, the developer activates the compiler 20. The compiler 20 is loaded into the main memory 220 and executed by the arithmetic processing unit 210. In accordance with the instruction from the compiler 20, the arithmetic processing unit 210 performs the following processing. That is, the arithmetic processing unit 210 reads the source program 11 from the storage device 230 and compiles the source program 11. Here, the optimization shown in FIG. 2 is performed. As a result of this compilation, an optimized target program 12 and optimized position data 13 indicating the optimized position are generated. The arithmetic processing unit 210 stores the objective program 12 and the optimized position data 13 in the storage device 230.

次に、開発者は、デバッガ40を起動する。このデバッガ40は、演算処理装置210によって、メインメモリ220にロードされ実行される。デバッガ40の命令に従って、演算処理装置210は、目的プログラム12と最適化位置データ13を、記憶装置230から目的プログラム実行装置300に送信する。目的プログラム12は、メインメモリ320に格納され、プロセッサ310により実行される。最適化位置データ13は、格納部330に格納される。開発者による指示に応答して、デバッガ40は、目的プログラム実行装置300に目的プログラム12の実行を開始させる。   Next, the developer activates the debugger 40. The debugger 40 is loaded into the main memory 220 and executed by the arithmetic processing unit 210. In accordance with the instruction of the debugger 40, the arithmetic processing unit 210 transmits the target program 12 and the optimized position data 13 from the storage device 230 to the target program execution device 300. The target program 12 is stored in the main memory 320 and executed by the processor 310. The optimized position data 13 is stored in the storage unit 330. In response to the instruction from the developer, the debugger 40 causes the target program execution device 300 to start executing the target program 12.

目的プログラム実行装置300において、プロセッサ310は、図5に示された処理を実行する。つまり、プロセッサ310は、最適化位置データ13を参照しながら、目的プログラム12を実行する。最適化位置データ13に示された位置のコードを実行する際、プロセッサ310は警告を出力しない。一方、未初期化・未定義のメモリ領域へのアクセスが行われ、そのコードの位置が最適化位置データ13に示された位置と一致しない場合、プロセッサ310は警告を出力する。その警告を示す信号は、目的プログラム開発装置200に送られ、表示装置250には警告メッセージが表示される。不具合を通知された開発者は、原始プログラム11や目的プログラム12の解析を行う。   In the target program execution device 300, the processor 310 executes the processing shown in FIG. That is, the processor 310 executes the target program 12 while referring to the optimized position data 13. When executing the code at the position indicated in the optimized position data 13, the processor 310 does not output a warning. On the other hand, if an uninitialized / undefined memory area is accessed and the position of the code does not match the position indicated in the optimized position data 13, the processor 310 outputs a warning. A signal indicating the warning is sent to the target program development device 200, and a warning message is displayed on the display device 250. The developer who has been notified of the problem analyzes the source program 11 and the target program 12.

また、シミュレーションモジュール30は、ソフトウェア的に構成されてもよい。図7は、シミュレーションモジュール30がソフトウェアで構成された場合のソフトウェア開発システム100’を示している。図7において、図6と同様の構成には同一の符号が付され、その説明は適宜省略される。   The simulation module 30 may be configured as software. FIG. 7 shows a software development system 100 ′ when the simulation module 30 is configured by software. In FIG. 7, the same components as those in FIG.

図7において、記憶装置230には、ソフトウェアとしてのシミュレータ300’が格納されている。このシミュレータ300’が、上記シミュレーションモジュール(実行モジュール)30に対応している。このシミュレータ300’は、演算処理装置210によって実行されるソフトウェアであり、図6に示された目的プログラム実行装置300の機能をソフトウェア的に実現している。つまり、上述のプロセッサ310やメインメモリ320は、仮想的にコンピュータ上に構築される。   In FIG. 7, the storage device 230 stores a simulator 300 ′ as software. This simulator 300 ′ corresponds to the simulation module (execution module) 30. The simulator 300 'is software executed by the arithmetic processing unit 210, and realizes the function of the target program execution device 300 shown in FIG. 6 in software. That is, the processor 310 and the main memory 320 described above are virtually constructed on a computer.

目的プログラム12と最適化位置データ13が生成された後、開発者は、シミュレータ300’を起動する。このシミュレータ300’は、演算処理装置210によって、メインメモリ220にロードされ実行される。シミュレータ300’の命令に従って、演算処理装置210は、記憶装置230に格納された目的プログラム12と最適化位置データ13を読み込む。目的プログラム12は、このシミュレータ300’上において実行される、すなわち、仮想的なプロセッサ310により実行される。シミュレータ300’の処理内容は、目的プログラム実行装置300の処理内容と同一である。   After the target program 12 and the optimized position data 13 are generated, the developer activates the simulator 300 '. The simulator 300 ′ is loaded into the main memory 220 and executed by the arithmetic processing unit 210. In accordance with the instruction of the simulator 300 ′, the arithmetic processing unit 210 reads the target program 12 and the optimized position data 13 stored in the storage device 230. The target program 12 is executed on the simulator 300 ′, that is, executed by the virtual processor 310. The processing content of the simulator 300 ′ is the same as the processing content of the target program execution device 300.

本発明に係るソフトウェア開発システム100、100’によれば、開発者は無駄なプログラム解析を行う必要がなくなる。よって、開発時間の浪費が抑制される。また、開発者は、シミュレーションモジュールの本来の警告機能を有効に活用することが可能となる。その結果、ソフトウェアの開発効率が向上する。   According to the software development systems 100 and 100 ′ according to the present invention, the developer need not perform useless program analysis. Therefore, waste of development time is suppressed. Further, the developer can effectively use the original warning function of the simulation module. As a result, software development efficiency is improved.

図1は、アドレス更新機能付きメモリアクセス機能を説明するための概念図である。FIG. 1 is a conceptual diagram for explaining a memory access function with an address update function. 図2は、コンパイラによる最適化の例を示す図である。FIG. 2 is a diagram illustrating an example of optimization by the compiler. 図3は、従来のソフトウェア開発環境を示すブロック図である。FIG. 3 is a block diagram showing a conventional software development environment. 図4は、本発明に係るソフトウェア開発環境を示すブロック図である。FIG. 4 is a block diagram showing a software development environment according to the present invention. 図5は、本発明に係るシミュレーションモジュールによる目的プログラムの実行処理を示すフローチャートである。FIG. 5 is a flowchart showing the execution processing of the object program by the simulation module according to the present invention. 図6は、本発明に係るソフトウェア開発システムの構成の一例を示すブロック図である。FIG. 6 is a block diagram showing an example of the configuration of the software development system according to the present invention. 図7は、本発明に係るソフトウェア開発システムの構成の他の例を示すブロック図である。FIG. 7 is a block diagram showing another example of the configuration of the software development system according to the present invention.

符号の説明Explanation of symbols

1 プロセッサ
11 原始プログラム
12 目的プログラム
13 最適化位置データ
20 コンパイラ
30 シミュレーションモジュール
31 実行部
32 判定部
40 デバッガ
100 ソフトウェア開発システム
200 目的プログラム開発装置
210 演算処理装置
220 メインメモリ
230 記憶装置
240 入力装置
250 表示装置
260 インタフェース
300 目的プログラム実行装置
300’ シミュレータ
310 プロセッサ
320 メインメモリ
330 格納部
360 インタフェース
DESCRIPTION OF SYMBOLS 1 Processor 11 Primitive program 12 Target program 13 Optimization position data 20 Compiler 30 Simulation module 31 Execution part 32 Judgment part 40 Debugger 100 Software development system 200 Objective program development apparatus 210 Arithmetic processing apparatus 220 Main memory 230 Storage apparatus 240 Input apparatus 250 Display Device 260 Interface 300 Objective program execution device 300 'Simulator 310 Processor 320 Main memory 330 Storage unit 360 Interface

Claims (10)

原始プログラムをコンパイルし目的プログラムを生成するコンパイラと、
前記目的プログラムを実行する実行モジュールと
を備え、
前記コンパイラは、アドレス更新とメモリアクセスを1ステップで実行する第1命令をサポートするプロセッサに対応するように前記目的プログラムの最適化を行い、また、前記目的プログラム中の前記最適化が行われた位置を示す最適化位置データを生成し、
前記実行モジュールは、前記最適化位置データに示された前記位置を参照しながら、前記目的プログラムを実行する
ソフトウェア開発システム。
A compiler that compiles the source program and generates the target program;
An execution module for executing the target program,
The compiler optimizes the target program so as to correspond to a processor that supports a first instruction that executes address update and memory access in one step, and the optimization is performed in the target program. Generate optimized location data to indicate location,
The execution module executes the object program while referring to the position indicated in the optimized position data.
請求項1に記載のソフトウェア開発システムであって、
前記実行モジュールは、未初期化・未定義のメモリ領域へのアクセスが行われる場合に警告を発する機能を有し、前記目的プログラム中の前記位置のコードを実行する際は、前記警告を発しない
ソフトウェア開発システム。
A software development system according to claim 1,
The execution module has a function of issuing a warning when an uninitialized / undefined memory area is accessed, and does not issue the warning when executing the code at the location in the target program. Software development system.
請求項1又は2に記載のソフトウェア開発システムであって、
前記最適化において、前記コンパイラは、条件分岐を挟んで実行されるアドレス更新とメモリアクセスを、前記条件分岐の前に実行される1ステップの前記第1命令にまとめる
ソフトウェア開発システム。
The software development system according to claim 1 or 2,
In the optimization, the compiler integrates the address update and memory access executed across the conditional branch into one step of the first instruction executed before the conditional branch.
請求項3に記載のソフトウェア開発システムであって、
前記最適化位置データは、前記目的プログラム中の前記まとめられた前記第1命令の位置を示す
ソフトウェア開発システム。
A software development system according to claim 3,
The software development system, wherein the optimized position data indicates a position of the collected first instruction in the target program.
請求項1乃至4のいずれかに記載のソフトウェア開発システムであって、
前記コンパイラを実行する演算処理装置と、
前記原始プログラムが格納される記憶装置と
を更に備え、
前記演算処理装置は、前記記憶装置から前記原始プログラムを読み込み、前記コンパイラの命令に従って前記原始プログラムをコンパイルし、生成される前記目的プログラム及び前記最適化位置データを前記記憶装置に格納する
ソフトウェア開発システム。
A software development system according to any one of claims 1 to 4,
An arithmetic processing unit for executing the compiler;
A storage device for storing the primitive program;
A software development system that reads the source program from the storage device, compiles the source program according to instructions of the compiler, and stores the generated target program and the optimized position data in the storage device .
請求項5に記載のソフトウェア開発システムであって、
前記実行モジュールは、前記演算処理装置により実行されるソフトウェアであり、
前記演算処理装置は、前記実行モジュールの命令に従い、前記記憶装置に格納された前記目的プログラム及び前記最適化位置データを読み込み、
前記ソフトウェア上において前記目的プログラムが実行される
ソフトウェア開発システム。
The software development system according to claim 5,
The execution module is software executed by the arithmetic processing device,
The arithmetic processing unit reads the target program and the optimized position data stored in the storage device according to the instruction of the execution module,
A software development system in which the target program is executed on the software.
請求項5に記載のソフトウェア開発システムであって、
前記実行モジュールは、前記記憶装置と通信可能なハードウェアであり、前記第1命令をサポートする第1プロセッサを備え、
前記第1プロセッサは、前記記憶装置から送信される前記目的プログラムを実行する
ソフトウェア開発システム。
The software development system according to claim 5,
The execution module is hardware capable of communicating with the storage device, and includes a first processor that supports the first instruction,
The first processor is a software development system for executing the object program transmitted from the storage device.
目的プログラムを開発するためのプログラム開発装置と、
前記プログラム開発装置と通信可能に接続されたプログラム実行装置と
を具備し、
前記プログラム実行装置は、アドレス更新とメインメモリへのアクセスを1ステップで実行する第1命令をサポートするプロセッサを備え、
前記プロセッサは、未初期化・未定義のメモリ領域へのアクセスが行われる場合に警告を発する機能を有し、
前記プログラム開発装置は、原始プログラムをコンパイルすることによって前記目的プログラムを生成するコンパイラを備え、
前記コンパイラは、前記プロセッサに対応するように前記目的プログラムの最適化を行い、また、前記目的プログラム中の前記最適化が行われた位置を示す最適化位置データを生成し、
前記プログラム実行装置は、前記目的プログラムと前記最適化位置データを前記プログラム開発装置から受け取り、
前記プロセッサは、前記最適化位置データを参照しながら前記目的プログラムを実行し、前記目的プログラム中の前記位置のコードを実行する際は、前記警告を発しない
ソフトウェア開発システム。
A program development device for developing a target program;
A program execution device communicably connected to the program development device,
The program execution device includes a processor that supports a first instruction that executes address update and access to a main memory in one step,
The processor has a function of issuing a warning when an uninitialized / undefined memory area is accessed,
The program development apparatus includes a compiler that generates the target program by compiling a source program,
The compiler optimizes the target program so as to correspond to the processor, and generates optimized position data indicating a position where the optimization is performed in the target program,
The program execution device receives the target program and the optimized position data from the program development device,
The software development system, wherein the processor executes the target program while referring to the optimized position data, and does not issue the warning when executing the code at the position in the target program.
請求項8に記載のソフトウェア開発システムであって、
前記最適化において、前記コンパイラは、条件分岐を挟んで実行されるアドレス更新とメモリアクセスを、前記条件分岐の前に実行される1ステップの前記第1命令にまとめる
ソフトウェア開発システム。
The software development system according to claim 8,
In the optimization, the compiler integrates the address update and memory access executed across the conditional branch into one step of the first instruction executed before the conditional branch.
請求項9に記載のソフトウェア開発システムであって、
前記最適化位置データは、前記目的プログラム中の前記まとめられた前記第1命令の位置を示す
ソフトウェア開発システム。
The software development system according to claim 9,
The software development system, wherein the optimized position data indicates a position of the collected first instruction in the target program.
JP2005216662A 2005-07-27 2005-07-27 Software development system Withdrawn JP2007034650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005216662A JP2007034650A (en) 2005-07-27 2005-07-27 Software development system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005216662A JP2007034650A (en) 2005-07-27 2005-07-27 Software development system

Publications (1)

Publication Number Publication Date
JP2007034650A true JP2007034650A (en) 2007-02-08

Family

ID=37793838

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005216662A Withdrawn JP2007034650A (en) 2005-07-27 2005-07-27 Software development system

Country Status (1)

Country Link
JP (1) JP2007034650A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944037A (en) * 2009-07-06 2011-01-12 北京中电华大电子设计有限责任公司 Method for simulating randomicity of smart card chip RAM in development system
US8930905B2 (en) 2012-03-05 2015-01-06 Samsung Electronics Co., Ltd. System and method for providing a guideline for optimizing platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944037A (en) * 2009-07-06 2011-01-12 北京中电华大电子设计有限责任公司 Method for simulating randomicity of smart card chip RAM in development system
US8930905B2 (en) 2012-03-05 2015-01-06 Samsung Electronics Co., Ltd. System and method for providing a guideline for optimizing platform

Similar Documents

Publication Publication Date Title
US8170859B1 (en) Methods, apparatuses and computer program products for simulating arbitrary unmodified code
US6587995B1 (en) Enhanced programmable core model with integrated graphical debugging functionality
US20090144705A1 (en) Debugging device and debugging method
JPH11232138A (en) Emulation method
US9292265B2 (en) Method for convergence analysis based on thread variance analysis
US8359561B2 (en) Equivalence verification between transaction level models and RTL at the example to processors
EP2223213B1 (en) Multi language software code analysis
US20110307688A1 (en) Synthesis system for pipelined digital circuits
JPH11194957A (en) Debug supporting device, parallel execution information generation device and recording medium for recording program applied to the same
Bouchhima et al. Automatic instrumentation of embedded software for high level hardware/software co-simulation
JP6342129B2 (en) Source code error position detection apparatus and method for mixed mode program
US20100275185A1 (en) System and Method for High Performance Coverage Analysis
US7240334B1 (en) Methods, systems, and computer program products for deferred computer program tracing
US20130024675A1 (en) Return address optimisation for a dynamic code translator
US10380313B1 (en) Implementation and evaluation of designs for heterogeneous computing platforms with hardware acceleration
US20080127118A1 (en) Method and system for dynamic patching of software
JPH0748182B2 (en) Program error detection method
JP2007034650A (en) Software development system
Chen et al. CARE: Compiler-assisted recovery from soft failures
JPH06309193A (en) Method and device for verifying operation of machine language program
US20030070117A1 (en) Simulation apparatus and simulation method
Hexsel cMIPS–a synthesizable VHDL model for the classical five stage pipeline
JP2011145880A (en) Generation method for test task used in logic verification of semiconductor integrated circuit
JP4594704B2 (en) Program development support system, program and recording medium
JP2004013190A (en) Environment for software development, simulator, and recording medium

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20081007