JP2013080386A - Information processing device and address management method - Google Patents

Information processing device and address management method Download PDF

Info

Publication number
JP2013080386A
JP2013080386A JP2011220174A JP2011220174A JP2013080386A JP 2013080386 A JP2013080386 A JP 2013080386A JP 2011220174 A JP2011220174 A JP 2011220174A JP 2011220174 A JP2011220174 A JP 2011220174A JP 2013080386 A JP2013080386 A JP 2013080386A
Authority
JP
Japan
Prior art keywords
address
change
program
instruction
unit
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
JP2011220174A
Other languages
Japanese (ja)
Inventor
Toshiro Isomura
俊郎 磯村
Takumi Nakagawa
匠 中川
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 JP2011220174A priority Critical patent/JP2013080386A/en
Publication of JP2013080386A publication Critical patent/JP2013080386A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Executing Machine-Instructions (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an information processing device capable of reducing reinspection when a program is changed.SOLUTION: An information processing device 100 comprises: program storage means 103 which stores a program before a change and a program after the change; changed part extraction means 141 which extracts a changed part of the programs before and after the change; address determination means 142 which determines virtual addresses of the changed part from the beginning of instructions, determines physical addresses of the changed part when the program before the change and the changed part are allocated in the storage means, while holding addresses of the program before the change, and generates an intermediate table in which the physical addresses are associated with the virtual addresses; and address translation table generation means 143 which compares each instruction of the program after the change with each instruction of the program before the change for each address from the beginning, and generates an address translation table in which the physical addresses and the virtual addresses obtained from the intermediate table are registered, when different instructions are described.

Description

本発明は、実行ファイルを作成する情報処理装置に関する。   The present invention relates to an information processing apparatus that creates an executable file.

C言語などの高級言語は、コンピュータがプログラムを実行するために、開発者がコーディングしたソースコードを、コンピュータが処理可能なオブジェクトコードに変換する翻訳処理を必要とする。   A high-level language such as C language requires a translation process for converting a source code coded by a developer into an object code that can be processed by the computer in order for the computer to execute the program.

図1は、一般的な翻訳処理の手順の一例を示す。コンパイラはソースコードに対し、字句解析(キーワードや変数の抽出)、構文解析(文法に従っているかの解析)、意味解析(実行可能の解析)、コード生成(オブジェクトコードの生成)等の処理を施す。リンカは、オブジェクトコードが参照する他のファイルやライブラリを特定して結合する。これによりコンピュータが実行可能な実行ファイルが生成される。組み込みソフトの場合、実行ファイルはROMに記憶され、一般にプログラムを呼ばれる。   FIG. 1 shows an example of a general translation processing procedure. The compiler performs processing such as lexical analysis (keyword and variable extraction), syntax analysis (analysis according to grammar), semantic analysis (executable analysis), and code generation (object code generation) on the source code. The linker identifies and combines other files and libraries referenced by the object code. As a result, an executable file executable by the computer is generated. In the case of embedded software, the executable file is stored in the ROM and is generally called a program.

ところで、ソフトウェア開発では、一度は製品開発が完了しROMに記憶されたプログラムに対し、処理内容を修正したり追加したりすることがよく行われる。開発者がソースコードを変更した場合、その変更が一部(例えば、一命令でも)でも上記の翻訳処理の全てをソースコードの全体に行う必要がある。   By the way, in software development, it is often performed to correct or add processing contents to a program that has been once developed and stored in a ROM. When the developer changes the source code, it is necessary to perform all of the above translation processing on the entire source code even if the change is partly (for example, even with one instruction).

図2は、ソースコードの変更が実行ファイルに与える影響を説明する図の一例である。変更前のプログラムは3つの関数A〜Cを有し、ROMの図示するアドレスに記憶される。開発者が関数Aに3つの命令を追加する変更を加えた場合、翻訳処理により生成される実行ファイルにも関数Aの変更が反映されるので、関数Aが記憶されるROMのアドレスの一部だけでなく、変更箇所以降の全ての命令のアドレスが変更になる。図では3つのPOP命令を含め、ソースコードの変更がない関数B,Cの命令のアドレスが全て変更になっている。   FIG. 2 is an example of a diagram for explaining the influence of the change of the source code on the execution file. The program before the change has three functions A to C and is stored at the address shown in the ROM. When the developer makes a change to add three instructions to the function A, the change in the function A is reflected in the executable file generated by the translation process, so a part of the ROM address where the function A is stored Not only the address of all instructions after the changed part is changed. In the figure, the addresses of the instructions of functions B and C that do not change the source code, including three POP instructions, are all changed.

命令とアドレスの関係が変更になると、CPUが命令Aを実行する際にメモリにアクセスするタイミングが、同じ命令Aを実行する場合でも変わってくるおそれがある。メモリアクセスのタイミングが変わると、それまでは生じていなかった不具合が生じる可能性を否定できない。このため、ソフトウェア開発では、ソースコードに対する一部の変更でも、プログラム全体の再検査が行われている。車載ソフトではプログラムの開発コストのうち、検査工程のコストが3〜7割を占めると言われており、プログラムの変更に伴う再検査の工程が大きなコスト増となっている。   When the relationship between the instruction and the address is changed, the timing of accessing the memory when the CPU executes the instruction A may change even when the same instruction A is executed. If the memory access timing changes, there is no denying the possibility of problems that did not occur until then. For this reason, in software development, the entire program is re-inspected even with some changes to the source code. In-vehicle software is said to account for 30 to 70% of the cost of development of the program, and the cost of the re-inspection accompanying the program change is greatly increased.

ソースコードの変更に伴う命令の再配置を抑制する技術も提案されている(例えば、特許文献1参照。)。特許文献1には、変更のない関数については元のアドレスに配置する言語処理装置が開示されている。   A technique for suppressing the rearrangement of instructions accompanying the change of the source code has also been proposed (see, for example, Patent Document 1). Patent Document 1 discloses a language processing device in which functions that are not changed are arranged at original addresses.

図3は、特許文献1のプログラムの再配置を説明する図の一例である。ソースコードの変更により、実行ファイルに例えば以下のコードが追加されたものとする。
POP edi
POP exi
追加によりこれらの命令以降の命令はアドレスが変更される。しかし、特許文献1の言語処理装置は、変更のない関数B,Cの命令はアドレスを変更しない。このため、アドレスが変更になる命令は、関数Aの“POP edi”から関数Aの最後の命令に留めることができる。変更により関数Aのサイズが大きくなったため、関数Bの直前のアドレスまでに配置困難になった命令は、関数Cよりも後のアドレスに配置される。このように、引用文献1では、関数単位でプログラムを記憶することで、アドレスの変更を最小限にすることができる。
FIG. 3 is an example of a diagram illustrating the rearrangement of the program of Patent Document 1. It is assumed that, for example, the following code is added to the executable file by changing the source code.
POP edi
POP exi
As a result, the addresses of these and subsequent instructions are changed. However, the language processing apparatus of Patent Document 1 does not change the address of the instructions of functions B and C that are not changed. For this reason, the instruction whose address is changed can be limited to the last instruction of the function A from “POP edi” of the function A. Since the size of the function A is increased due to the change, an instruction that is difficult to be arranged up to the address immediately before the function B is arranged at an address after the function C. As described above, in the cited document 1, the address change can be minimized by storing the program in units of functions.

特開2002−108625号公報JP 2002-108625 A

しかしながら、特許文献1では、変更された関数Aのいくつかの命令についてアドレスの変更があるため、アドレスに変更が生じた命令については再検査が必要になるという問題がある。つまり図3の関数Aの“POP edi”から関数Aの最後の命令までは再検査が必要であるため、コスト低減効果が十分ではない。   However, in Patent Document 1, since there are address changes for some instructions of the changed function A, there is a problem that an instruction whose address has changed needs to be rechecked. That is, since the re-inspection is necessary from “POP edi” of the function A in FIG. 3 to the last instruction of the function A, the cost reduction effect is not sufficient.

本発明は、上記課題に鑑み、プログラム変更時の再検査をさらに低減できる情報処理装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide an information processing apparatus that can further reduce re-examination when changing a program.

本発明は、変更前のプログラムと変更後のプログラムを記憶するプログラム記憶手段と、変更前のプログラムと変更後のプログラムの変更部を抽出する変更部抽出手段と、前記変更部を含め変更後のプログラムの各命令を外部の記憶手段に配置した際の仮想アドレスを決定すると共に、変更前のプログラムのアドレスを固定したまま、変更前のプログラム及び前記変更部を記憶手段に配置した際の該変更部の物理アドレスを決定し、前記物理アドレスと前記相対アドレスとを対応づけた中間テーブルを作成するアドレス決定手段と、変更後のプログラムの各命令と、変更後のプログラムの各命令を先頭からアドレス毎に比較し、同じ命令が記述されている場合は、それらのアドレスを対応付けて登録し、異なる命令が記述されている場合は、前記中間テーブルの前記物理アドレスと前記相対アドレスとを取り出して登録したアドレス変換テーブルを作成するアドレス変換テーブル作成手段と、を有する情報処理装置を提供する。   The present invention includes a program storage means for storing a program before change and a program after change, a change part extraction means for extracting a change part of the program before change and the program after change, and the changed part including the change part. The virtual address when each instruction of the program is arranged in the external storage means is determined, and the change when the program before change and the change unit are arranged in the storage means while fixing the address of the program before change Address determining means for determining the physical address of each part and creating an intermediate table in which the physical address and the relative address are associated with each other, each instruction of the changed program, and each instruction of the changed program from the head Compared every time, if the same instruction is described, register and associate those addresses, and if different instructions are described, Serial to provide an intermediate table of the physical address and the relative address and the address conversion table creating means for creating an address conversion table registering taken out, the information processing apparatus having a.

プログラム変更時の再検査をさらに低減できる情報処理装置を提供することができる。   It is possible to provide an information processing apparatus that can further reduce re-examination at the time of program change.

一般的な翻訳処理の手順の一例を示す図である。It is a figure which shows an example of the procedure of a general translation process. ソースコードの変更が実行ファイルに与える影響を説明する図の一例である。It is an example of the figure explaining the influence which the change of a source code has on an executable file. 特許文献1のプログラムの再配置を説明する図の一例である。FIG. 11 is an example of a diagram for explaining rearrangement of a program in Patent Literature 1; 変更前後のプログラムの配置を説明する図の一例である。It is an example of the figure explaining arrangement | positioning of the program before and behind a change. 開発用情報処理装置、及び、開発されたプログラムを実行する車両を有するプログラム配信システムを模式的に示す図の一例である。It is an example of the figure which shows typically the information processing apparatus for development, and the program delivery system which has the vehicle which runs the developed program. 開発用情報処理装置及びマイコンのハードウェア構成図の一例である。FIG. 2 is an example of a hardware configuration diagram of a development information processing apparatus and a microcomputer. 開発用プログラムの機能ブロック図の一例である。It is an example of a functional block diagram of a development program. リンカがアドレス変換テーブルを生成する手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the procedure in which a linker produces | generates an address conversion table. 変更前プログラムと変更後プログラムの比較を説明する図の一例である。It is an example of the figure explaining the comparison of the program before a change, and a program after a change. アドレス変換テーブルの作成を説明する図の一例である。It is an example of the figure explaining preparation of an address translation table. マイコンの機能ブロックの一例を示す図である。It is a figure which shows an example of the functional block of a microcomputer. マイコンがアドレスを変換してプログラムを読み出す手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the procedure in which a microcomputer converts an address and reads a program. リンカがアドレス変換テーブルを生成する手順を示すフローチャート図の一例である(実施例2)。(Example 2) which is an example of the flowchart figure which shows the procedure in which a linker produces | generates an address conversion table. 変更前プログラムと変更後プログラムの比較を説明する図の一例である(実施例2)。It is an example of the figure explaining the comparison of the program before a change, and a program after a change (Example 2). アドレス変換テーブルの作成を説明する図の一例である(実施例2)。FIG. 10 is an example of a diagram illustrating creation of an address conversion table (second embodiment). 変更前プログラムと変更後プログラムの比較を説明する図の一例である(実施例3)。FIG. 10 is an example of a diagram illustrating comparison between a pre-change program and a post-change program (Example 3); アドレス変換テーブルの作成を説明する図の一例である(実施例3)。FIG. 10 is an example of a diagram illustrating creation of an address conversion table (Example 3);

以下、本発明を実施するための形態について図面を参照しながら実施例を挙げて説明する。 DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.

図4は、変更前後のプログラムの配置を説明する図の一例である。関数Aにだけ、以下のようなコードの追加が生じる変更があったとする。
POP edi
POP esi
POP ebx
(i) 本実施形態のリンカは、実行ファイルに何らかの変更が生じても、変更前の実行ファイルにおける命令とアドレスの関係を一切変更しない。図示するように、変更が生じない関数B,Cだけでなく、変更が加えられた関数Aも、変更前と同じROMの同じアドレスに配置される。
FIG. 4 is an example of a diagram for explaining the arrangement of programs before and after the change. Suppose that only the function A has a change that causes the following code to be added.
POP edi
POP esi
POP ebx
(i) Even if any change occurs in the execution file, the linker of the present embodiment does not change the relationship between the instruction and the address in the execution file before the change. As shown in the figure, not only the functions B and C that do not change, but also the function A that has been changed is arranged at the same address in the same ROM as before the change.

そして、元の実行ファイルに存在しない命令は、同じROMの関数A〜Cとは別の領域に配置される(記憶される)。
(ii) 一方、このままでは、上記3つの命令を、関数Aのどの命令の次に実行すればよいか不明となる。このため、リンカは変更前の実行ファイルの各命令のアドレスと、変更後の実行ファイルの各命令のアドレスを対応づけるアドレス変換テーブルを生成する。
Instructions that do not exist in the original executable file are arranged (stored) in a different area from the functions A to C in the same ROM.
(ii) On the other hand, as it is, it becomes unclear which instruction of the function A should execute the above three instructions. For this reason, the linker generates an address conversion table that associates the addresses of the instructions in the execution file before the change with the addresses of the instructions in the execution file after the change.

リンカは、オブジェクトコードを生成する際に、追加命令を他の命令と区別することなく1つの実行ファイルに結合する。よって、実行ファイルの先頭アドレスを基準とした、追加命令の相対的なアドレスは判明している(以下、リンカが生成した変更後の実行ファイルの、ROMに書き込まれと仮定した場合の配置を仮想メモリ配置という。また、仮想メモリ配置のアドレスを仮想配置アドレスという)。変更後のプログラムは仮想メモリ配置の順に実行される。したがって、仮想メモリ配置の命令と、変更前の同じアドレスに記憶されている命令を比較して一致しない命令は、仮想メモリ配置の命令と領域外の命令の物理アドレスとを対応づけることでアドレス変換テーブルを生成できる。   When the linker generates object code, it combines additional instructions into one executable file without distinguishing them from other instructions. Therefore, the relative address of the additional instruction is known based on the start address of the executable file (hereinafter, the arrangement of the modified executable file generated by the linker is assumed to be written in the ROM. This is called memory allocation, and the address of virtual memory allocation is called virtual allocation address). The changed program is executed in the order of virtual memory allocation. Therefore, the virtual memory allocation instruction and the instruction stored at the same address before the change are compared, and the instruction that does not match is converted by associating the virtual memory allocation instruction with the physical address of the instruction outside the area. A table can be generated.

(iii) CPUが、ROMに記憶された変更後の実行ファイル(変更なしの実行ファイル+領域外の追加分の命令)を実行する場合、プログラムカウンタには、ROMのアドレス順に、CPUが次に読み出す命令のアドレスが順次、格納される。しかし、CPUが単に順番に命令を実行しても追加された3つの命令を実行できない。このため、プログラムカウンタは、アドレス変換部に次に読み出す命令のアドレスを出力する。   (iii) When the CPU executes an execution file after change stored in the ROM (execution file without change + additional instructions outside the area), the program counter displays the next in the ROM address order. The addresses of instructions to be read are sequentially stored. However, even if the CPU simply executes the instructions in order, the added three instructions cannot be executed. Therefore, the program counter outputs the address of the next instruction to be read to the address conversion unit.

アドレス変換部はアドレス変換テーブルを参照して、読み出す命令のアドレスを仮想メモリ配置のアドレスとして、仮想メモリ配置アドレスに対応づけられた物理アドレスをアドレスコントローラに出力する(読み出す命令のアドレスの物理アドレスに変換する)。したがって、CPUが追加された命令を実行する際は、必要に応じて関数A〜Cの領域外にアクセスする。   The address conversion unit refers to the address conversion table and outputs the physical address associated with the virtual memory allocation address to the address controller using the address of the instruction to be read as the address of the virtual memory allocation (to the physical address of the address of the instruction to be read) Convert). Therefore, when the CPU executes the added instruction, it accesses the area outside the functions A to C as necessary.

以上のようにして、関数A〜Cのアドレスを変えずに、追加命令だけを領域外に記憶しても、CPUは変更後の実行ファイルを不都合なく実行できる。ソフトウェアの検査工程においては、開発者は、関数A〜Cのアドレスに変更がないので、領域外の命令にアクセスするテストのみを実行すればよい。したがって、プログラム変更時の再検査の工程を大幅に削減でき、ソフトウェアの開発コストを大幅に低減できる。   As described above, even if only the additional instruction is stored outside the area without changing the addresses of the functions A to C, the CPU can execute the changed execution file without any inconvenience. In the software inspection process, since the address of the functions A to C is not changed, the developer only needs to execute a test for accessing an instruction outside the area. Therefore, the re-inspection process when changing the program can be greatly reduced, and the software development cost can be greatly reduced.

〔構成例〕
図5は、本実施形態の開発用情報処理装置、及び、開発されたプログラムを実行するマイコン200が搭載された車両を有するプログラム配信システム500を模式的に示す図の一例である。開発用情報処理装置100は、一般的なソフトウェア開発の各工程を実行するPC(Personal Computer)やワークステーションなどのコンピュータである。検査工程が完了したプログラムは、車両300の出荷時にマイコン200のROMに記憶される。また、車両300の出荷後にプログラムに変更があった場合は、ディーラなどのサービスエンジニアがツールを使用して車両300のマイコン200のROMに変更後のプログラムを書き込む。また、車両300の出荷後に、プログラムに変更があった場合、開発者等がプログラムをサーバ400に記憶しておけば、通信装置(DCM:Data Communication Module)がサーバ400からダウンロードすることができる。車載されたマイコン200は、ダウンロードしたプログラムを車両300のROMに書き込む。開発用情報処理装置100で開発されたプログラムはいずれの態様でROMに記憶されてもよく、記憶された後の実行方法は同じである。
[Configuration example]
FIG. 5 is an example of a diagram schematically illustrating a development information processing apparatus according to the present embodiment and a program distribution system 500 having a vehicle on which a microcomputer 200 that executes the developed program is mounted. The development information processing apparatus 100 is a computer such as a PC (Personal Computer) or a workstation that executes each process of general software development. The program for which the inspection process has been completed is stored in the ROM of the microcomputer 200 when the vehicle 300 is shipped. When the program is changed after the vehicle 300 is shipped, a service engineer such as a dealer writes the changed program in the ROM of the microcomputer 200 of the vehicle 300 using a tool. Further, when the program is changed after the vehicle 300 is shipped, if a developer or the like stores the program in the server 400, a communication device (DCM: Data Communication Module) can be downloaded from the server 400. The microcomputer 200 mounted on the vehicle writes the downloaded program into the ROM of the vehicle 300. The program developed by the development information processing apparatus 100 may be stored in the ROM in any manner, and the execution method after being stored is the same.

図6(a)は開発用情報処理装置100のハードウェア構成図の一例を示す。開発用情報処理装置100は、CPU101、ROM102、RAM103、HDD104、ネットワークI/F105、グラフィックボード106、キーボード107、マウス108、メディアドライブ109、及び、DVD−ROMドライブ110を有する。CPU101は、HDD104に記憶された開発用プログラム130を実行して開発用情報処理装置100の全体の動作を制御する。ROM102は、IPL(Initial Program Loader)や静的なデータを記憶しており、車載されたROMとは異なるものである。RAM103は、CPU101が開発用プログラム130を実行する際のワークエリアとして使用される。   FIG. 6A shows an example of a hardware configuration diagram of the development information processing apparatus 100. The development information processing apparatus 100 includes a CPU 101, ROM 102, RAM 103, HDD 104, network I / F 105, graphic board 106, keyboard 107, mouse 108, media drive 109, and DVD-ROM drive 110. The CPU 101 executes the development program 130 stored in the HDD 104 to control the overall operation of the development information processing apparatus 100. The ROM 102 stores IPL (Initial Program Loader) and static data, and is different from the in-vehicle ROM. The RAM 103 is used as a work area when the CPU 101 executes the development program 130.

HDD104にはCPU101が実行する開発用プログラム130やOSが記憶される。ネットワークI/F105はネットワークに接続するための例えばイーサネット(登録商標)カードであり、主にレイヤ1、2の処理を提供する。レイヤ3以上の処理は、OSに含まれるTCP/IPのプロトコルスタックや不図示の通信プログラムが提供する。   The HDD 104 stores a development program 130 and an OS executed by the CPU 101. The network I / F 105 is, for example, an Ethernet (registered trademark) card for connecting to a network, and mainly provides layer 1 and 2 processing. Layer 3 and higher processing is provided by a TCP / IP protocol stack and a communication program (not shown) included in the OS.

グラフィックボード106は、CPU101がビデオRAMに書き込んだ描画コマンドを解釈してディスプレイ120にウィンドウ、メニュー、カーソル、文字又は画像などの各種情報を表示する。キーボード107は、文字、数値、各種指示などのための複数のキーを備え、ユーザの操作を受け付けCPU101に通知する。同様に、マウス108はカーソルの移動、メニューなどの処理対象の選択、処理内容などのユーザの操作を受け付ける。メディアドライブ109は、フラッシュメモリ等の記録メディア111に対するデータの読み出し又は書き込み(記憶)を制御する。DVD−ROMドライブ110は、着脱可能な記録媒体の一例としてのCD−RW、DVD−RW等の光メディア112に対する各種データの読み出し又は書き込みを制御する。また、上記各構成要素を電気的に接続するためのアドレスバスやデータバス等のバスライン113を備えている。   The graphic board 106 interprets a drawing command written in the video RAM by the CPU 101 and displays various information such as a window, a menu, a cursor, a character, or an image on the display 120. The keyboard 107 includes a plurality of keys for characters, numerical values, various instructions, etc., and accepts user operations and notifies the CPU 101 of them. Similarly, the mouse 108 accepts user operations such as movement of a cursor, selection of a processing target such as a menu, and processing content. The media drive 109 controls reading or writing (storage) of data with respect to a recording medium 111 such as a flash memory. The DVD-ROM drive 110 controls reading or writing of various data with respect to an optical medium 112 such as a CD-RW or DVD-RW as an example of a removable recording medium. In addition, a bus line 113 such as an address bus or a data bus for electrically connecting the above-described components is provided.

開発用プログラム130は、インストール可能な形式又は実行可能な形式のファイルで、コンピュータで読み取り可能な記録メディア111や光メディア112に記録して流通される。また、開発用プログラム130は、不図示のサーバからインストール可能な形式又は実行可能な形式のファイルで開発用情報処理装置100に配布されてもよい。   The development program 130 is a file in an installable or executable format, and is recorded and distributed on a computer-readable recording medium 111 or optical medium 112. Further, the development program 130 may be distributed to the development information processing apparatus 100 in a file that can be installed or executed from a server (not shown).

図6(b)は、車両300に搭載されるマイコン200のハードウェア構成図の一例である。マイコン200は、ECU(Electronic Control Unit)に搭載されることが想定されているがその用途は車両に限定されない。車載されるECUには、その主要な機能により、エンジンECU、ブレーキECU、ボディECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等の種類がある。本実施例のマイコン200はECUの機能の違いに影響されず搭載されることが可能である。また、複数の機能が1つに統合されたECUにマイコン200を搭載してもよい。   FIG. 6B is an example of a hardware configuration diagram of the microcomputer 200 mounted on the vehicle 300. The microcomputer 200 is assumed to be mounted on an ECU (Electronic Control Unit), but its application is not limited to a vehicle. There are various types of ECUs mounted on the vehicle, such as an engine ECU, a brake ECU, a body ECU, a navigation ECU (AV / information processing ECU), and a gateway ECU, depending on main functions. The microcomputer 200 of the present embodiment can be mounted without being affected by the difference in ECU functions. Further, the microcomputer 200 may be mounted on an ECU in which a plurality of functions are integrated into one.

マイコン200は、バスに接続されたCPU11、ROM12、INTC13、RAM14、DMAC15、並びに、I/Oブリッジ16を有し、I/Oブリッジ16にはADC17及びCANコントローラ18が接続されている。   The microcomputer 200 includes a CPU 11, a ROM 12, an INTC 13, a RAM 14, a DMAC 15, and an I / O bridge 16 connected to a bus, and an ADC 17 and a CAN controller 18 are connected to the I / O bridge 16.

CPU11は1つ以上のコアを有し、プログラムカウンタ201及びアドレス変換部202を含む、一般的な構成(例えば、ALU等の演算装置、命令バッファ、命令デコーダ、レジスタセット等)を有している。アドレス変換部202はCPU11の外部に配置されていてもよい。   The CPU 11 has a general configuration (for example, an arithmetic unit such as an ALU, an instruction buffer, an instruction decoder, a register set, etc.) including one or more cores and including a program counter 201 and an address conversion unit 202. . The address conversion unit 202 may be disposed outside the CPU 11.

ROM12はフラッシュメモリなどの不揮発メモリであり、CPU11が実行するプログラム210や静的なパラメータを記憶している。ROM12にはアドレスコントローラ203が配置されている。アドレスコントローラ203は、アドレス変換部202が出力した命令のアドレスを解釈してROM12に出力する。指定されたアドレスの命令はROM12から読み出されCPU11の命令バッファに記憶される。   The ROM 12 is a non-volatile memory such as a flash memory, and stores a program 210 executed by the CPU 11 and static parameters. An address controller 203 is disposed in the ROM 12. The address controller 203 interprets the address of the instruction output from the address conversion unit 202 and outputs it to the ROM 12. The instruction at the designated address is read from the ROM 12 and stored in the instruction buffer of the CPU 11.

INTC13はIRQやその他の割り込み端子を介して周辺機器から入力された割り込み要求を、周辺機器の優先順位に基づき調停してCPU11に通知する。これによりCPU11は、割り込みした周辺機器に応じて決まったアドレスの命令をROM12から読み出して処理を実行する。   The INTC 13 arbitrates based on the priority of the peripheral device and notifies the CPU 11 of the interrupt request input from the peripheral device via the IRQ or other interrupt terminal. As a result, the CPU 11 reads an instruction at an address determined according to the interrupted peripheral device from the ROM 12 and executes the process.

RAM14は、CPU11がプログラム210を実行するための作業領域である。CPU11はROM12からプログラム210を読み込み、また、必要であればデータバスを介してRAM14からデータを読み出しプログラム210を実行する。DMAC15は、CPU11からの指示によりRAM14からI/Oブリッジ16を介して周辺機器にデータを送信する。また、周辺機器から割り込みされたCPU11から指示を受けて、I/Oブリッジ16を介して周辺機器からデータを受け取り、RAM14に書き込む。   The RAM 14 is a work area for the CPU 11 to execute the program 210. The CPU 11 reads the program 210 from the ROM 12, and reads the data from the RAM 14 via the data bus if necessary and executes the program 210. The DMAC 15 transmits data from the RAM 14 to the peripheral device via the I / O bridge 16 according to an instruction from the CPU 11. In response to an instruction from the CPU 11 interrupted by the peripheral device, data is received from the peripheral device via the I / O bridge 16 and written to the RAM 14.

I/Oブリッジ16は、マルチプレクサ又はブリッジ回路であり、チャネル毎にADC、及び、CANコントローラとそれぞれ接続されており、これらの周辺機器とデータを送受信する。ADC(analog to digital converter)17は、センサが検出したアナログ信号をデジタル信号に変換する。なお、ADC17もINTC13を介して変換の終了をCPU11に通知する。CANコントローラ18は、車載ネットワークを介して接続された他のECUと通信するための通信装置である。CANコントローラ18は、CPU11から通信データの送信要求を受け付けるとフレームの各フィールドにIDやデータを格納しCANバスに出力する。また、CANコントローラ18は、受信すべきIDの通信データを検出するとそれを取り込みCPU11に割り込んで通知する。   The I / O bridge 16 is a multiplexer or a bridge circuit, and is connected to an ADC and a CAN controller for each channel, and transmits / receives data to / from these peripheral devices. An ADC (analog to digital converter) 17 converts an analog signal detected by the sensor into a digital signal. The ADC 17 also notifies the CPU 11 of the end of conversion via the INTC 13. The CAN controller 18 is a communication device for communicating with other ECUs connected via an in-vehicle network. When receiving a communication data transmission request from the CPU 11, the CAN controller 18 stores the ID and data in each field of the frame and outputs them to the CAN bus. Further, when the CAN controller 18 detects the communication data of the ID to be received, it captures it and interrupts it to notify the CPU 11.

<開発用情報処理装置の機能ブロック>
図7は、開発用プログラム130の機能ブロック図の一例を示す。本実施形態では開発用プログラム130のリンカ140がいくつかの新たな機能を有するが、これらの機能はリンカ140とは別の機能として開発用プログラム130に実装してもよい。
<Functional blocks of information processing device for development>
FIG. 7 shows an example of a functional block diagram of the development program 130. In the present embodiment, the linker 140 of the development program 130 has some new functions, but these functions may be implemented in the development program 130 as functions different from the linker 140.

リンカ140は、変更部特定部141、変更部アドレス決定部142、及び、アドレス変換テーブル作成部143を有する。リンカ140にこれらの機能を起動させるため、開発者はリンク時にリンカオプションを指定する。リンカオプションは、例えば、次のように指定し、XXXをリンカ140の仕様に応じて設定することで、デバッグ情報の作成、プログラムデータベースファイルの作成等、種々のオプションを指定できる。
LINK /XXX
リンカ140は、開発者が変更したソースコードから生成されたオブジェクトコードを結合して実行ファイル(プログラム210)を生成する。図ではこれを変更後プログラムとしている。開発用情報処理装置100のHDD104には変更後プログラムと変更前プログラムが記憶されている。
The linker 140 includes a changing unit specifying unit 141, a changing unit address determining unit 142, and an address conversion table creating unit 143. In order to cause the linker 140 to activate these functions, the developer specifies linker options at the time of linking. For example, by specifying the linker option as follows and setting XXX in accordance with the specifications of the linker 140, various options such as creation of debug information and creation of a program database file can be designated.
LINK / XXX
The linker 140 generates an execution file (program 210) by combining the object code generated from the source code changed by the developer. In the figure, this is the changed program. The HDD 104 of the development information processing apparatus 100 stores a post-change program and a pre-change program.

本実施形態のリンカ140は、変更部特定のリンカオプションが指定されると、変更部特定部141が、変更前プログラムと変更後プログラムの変更部を特定する。なお、リンカ140には、変更部特定のリンカオプションと共に、プログラム210のROM12における先頭アドレスが指定される。よって、ROM12におけるプログラム210の各命令のアドレスはリンカ140にとって既知となる。   In the linker 140 according to the present embodiment, when a changer specific linker option is designated, the changer specifying unit 141 specifies the change part of the pre-change program and the post-change program. The linker 140 is designated with the start address in the ROM 12 of the program 210 along with the linker option specific to the change section. Therefore, the address of each instruction of the program 210 in the ROM 12 is known to the linker 140.

変更部特定部141は、変更前プログラムと変更後プログラムの変更部を特定する。変更部アドレス決定部142は、変更部のROM12における物理アドレスを決定する。アドレス変換テーブル作成部143は、アドレス変換テーブルを生成する。これらの処理については後に詳述する。   The change part specifying part 141 specifies the change part of the pre-change program and the post-change program. The changing unit address determining unit 142 determines a physical address in the ROM 12 of the changing unit. The address conversion table creation unit 143 generates an address conversion table. These processes will be described in detail later.

〔アドレス変換テーブルの作成〕
図8は、リンカ140がアドレス変換テーブルを生成する手順を示すフローチャート図の一例である。以下、S10〜S30まで順に説明する。
<S10 変更部の抽出>
図9(a)は、変更前プログラムと変更後プログラムの比較を説明する図の一例である。図9(a)では「POP edi」「POP esi」「POP ebx」の3つの命令が追加されている。
a1.まず、変更部特定部141はROM12における先頭アドレスに変更後プログラムの先頭を配置した場合の仮想配置アドレスを求める。変更前プログラムについても同様である。
a2.次に、変更部特定部141は、変更前プログラムの命令をアドレス順に読み出し、変更後プログラムに同じ命令が登録されているか否かを判定する。すなわち、変更部特定部141は、変更前プログラムの1つの命令について、変更後プログラムの全ての命令をアドレス順に比較する。
a3.変更部特定部141は、変更前プログラムと変更後プログラムの両方にある命令を、変更後プログラムから除いた残りを変更部として抽出する。変更部特定部141は、追加された命令の仮想配置アドレス、及び、変更後プログラムの命令を1組として、変更された全ての命令を取り出す。
[Create address translation table]
FIG. 8 is an example of a flowchart illustrating a procedure for the linker 140 to generate an address conversion table. Hereinafter, S10 to S30 will be described in order.
<Extraction of S10 change part>
FIG. 9A is an example of a diagram illustrating a comparison between the pre-change program and the post-change program. In FIG. 9A, three instructions “POP edi”, “POP esi”, and “POP ebx” are added.
a1. First, the changing unit specifying unit 141 obtains a virtual placement address when the top of the changed program is placed at the top address in the ROM 12. The same applies to the pre-change program.
a2. Next, the change part specifying part 141 reads the instructions of the program before change in the order of addresses, and determines whether or not the same instruction is registered in the program after change. That is, the changing unit specifying unit 141 compares all instructions of the post-change program in the order of addresses for one instruction of the pre-change program.
a3. The changing unit specifying unit 141 extracts the remainder obtained by removing the instructions in both the pre-change program and the post-change program from the post-change program as the changing unit. The change unit specifying unit 141 takes out all changed instructions, with the virtual placement address of the added instruction and the instruction of the changed program as one set.

<S20 変更部の物理アドレスの決定>
図9(b)は、実行ファイルの変更部の物理アドレスの決定について説明する図の一例である。
b1.変更後プログラムの非変更部は、変更前プログラムと同じROM12のアドレスに記憶される。このため、ROM12における非変更部のアドレスは固定であると共に既知である。変更部アドレス決定部142は、非変更部の最終アドレスの次のアドレス、又は、最終アドレスから若干離れたアドレスを先頭に、変更部を配置した時の物理アドレスを決定する。図9(b)では、0xFF00から変更部の命令が配置されることになる。
b2.変更部アドレス決定部142は、変更部の命令の仮想配置アドレスと、物理アドレスを対応づけて記憶する。
<S20 Determination of Physical Address of Change Unit>
FIG. 9B is an example of a diagram illustrating the determination of the physical address of the execution file changing unit.
b1. The non-change portion of the post-change program is stored at the same address of the ROM 12 as that of the pre-change program. For this reason, the address of the non-change part in the ROM 12 is fixed and known. The changing unit address determining unit 142 determines a physical address when the changing unit is arranged with the address next to the final address of the non-changed unit or an address slightly apart from the final address as the head. In FIG. 9B, the instruction of the changing unit is arranged from 0xFF00.
b2. The changing unit address determining unit 142 stores the virtual arrangement address of the instruction of the changing unit and the physical address in association with each other.

<S30 アドレス変換テーブルの作成>
図10はアドレス変換テーブルの作成を説明する図の一例である。
アドレス変換テーブル作成部143は、変更部特定部141が特定した変更された命令の仮想配置アドレス、及び、物理アドレスを用いて、アドレス変換テーブルを作成する。
c1.ROM12に記憶されるのは変更前プログラム(変更後プログラムの非変更部)と追加分である。このため、アドレス変換テーブル作成部143は、仮想メモリ配置のアドレスの命令と変更前プログラムの物理アドレスの命令とを順番に比較し、同じアドレスに異なる命令がある場合に、アドレスを変更する。図では、仮想配置アドレスの0xF0A3〜0xF0BF(関数Aの最後)までのアドレスに、同じアドレスに異なる命令がある。また、変更後プログラムに追加された命令のため、仮想配置アドレスの0xF0BFから0xF0C2までの命令も変換の対象となる。
c2.アドレス変換テーブル作成部143は、仮想配置アドレスと同じ物理アドレスに同じ命令がある場合、変更前プログラムの仮想配置アドレスと変更後プログラムの物理アドレスを対応づけて、アドレス変換テーブルを作成する。つまり同じアドレス同士を対応づける。
c3.仮想配置アドレスと同じ物理アドレスの異なる命令のうち、領域外に配置される命令は、領域外の物理アドレスを対応づける。このため、アドレス変換テーブル作成部143は、上記b.2で抽出された仮想配置アドレスと物理アドレスを取り出してアドレス変換テーブルに書き出す。
c4.仮想配置アドレスと同じ物理アドレスの異なる命令のうち、残りの命令は、関数A〜Cの領域内に同じ命令が存在するはずなので、仮想配置アドレスの1命令ずつ、変更前プログラムの命令を検索し、変更前プログラムの命令のアドレスを仮想配置アドレスに対応づける。以上のようにして、アドレス変換テーブルが作成される。
<S30 Address conversion table creation>
FIG. 10 is an example for explaining the creation of the address conversion table.
The address translation table creation unit 143 creates an address translation table using the virtual placement address and physical address of the changed instruction identified by the modification unit identification unit 141.
c1. The ROM 12 stores the pre-change program (non-change part of the post-change program) and the added part. For this reason, the address conversion table creating unit 143 sequentially compares the instruction at the address of the virtual memory arrangement and the instruction at the physical address of the program before change, and changes the address when there are different instructions at the same address. In the figure, there are different instructions at the same address in the addresses from 0xF0A3 to 0xF0BF (the end of the function A) of the virtual arrangement addresses. Further, since the instructions are added to the post-change program, instructions from 0xF0BF to 0xF0C2 of the virtual allocation address are also converted.
c2. When there is the same instruction at the same physical address as the virtual placement address, the address translation table creation unit 143 creates an address translation table by associating the virtual placement address of the pre-change program with the physical address of the post-change program. That is, the same addresses are associated with each other.
c3. Of the instructions having the same physical address as the virtual arrangement address, the instruction arranged outside the area associates the physical address outside the area. Therefore, the address conversion table creating unit 143 takes out the virtual arrangement address and physical address extracted in b.2 and writes them in the address conversion table.
c4. Of the instructions with the same physical address as the virtual allocation address, the remaining instructions should be in the area of functions A to C. Therefore, the instructions of the program before the change are searched one by one at the virtual allocation address. The address of the instruction of the program before change is associated with the virtual arrangement address. The address conversion table is created as described above.

<車両のマイコンの機能ブロック>
図11は、マイコン200の機能ブロックの一例を示す図である。プログラム210の非変更部は、変更前プログラムと同じROM12の物理アドレスに、変更部は、変更部アドレス決定部142が決定したROM12の物理アドレスに記憶される。
<Functional block of vehicle microcomputer>
FIG. 11 is a diagram illustrating an example of functional blocks of the microcomputer 200. The non-change part of the program 210 is stored in the same physical address of the ROM 12 as the pre-change program, and the change part is stored in the physical address of the ROM 12 determined by the change part address determination part 142.

プログラムカウンタ201は、原則的にROM12の先頭アドレスから順番に命令のアドレスを指定し、CPU11がROM12から命令を読み出す。しかし、ROM12には変更前の実行ファイルが記憶されているので、CPU11が変更部にアクセスするタイミングで、CPU11は変更後の命令が記憶されている領域外のアドレスから命令を読み出さなければならない。   In principle, the program counter 201 designates the address of an instruction in order from the top address of the ROM 12, and the CPU 11 reads the instruction from the ROM 12. However, since the execution file before the change is stored in the ROM 12, the CPU 11 must read the instruction from an address outside the area where the instruction after the change is stored when the CPU 11 accesses the change unit.

そこで、アドレス変換部202は、プログラムカウンタ201が決定したアドレスを、アドレス変換テーブルの仮想配置アドレスとして、仮想配置アドレスに対応づけられた物理アドレスを読み出す。例えば、プログラムカウンタ201が決定したアドレスが0xF000の場合、アドレス変換テーブルから0xF000が読み出される。プログラムカウンタ201が決定したアドレスが0xF0A0〜0xF0A2の場合も、アドレス変換テーブルから0xF0A0〜0xF0A2が読み出される。   Therefore, the address conversion unit 202 reads the physical address associated with the virtual arrangement address using the address determined by the program counter 201 as the virtual arrangement address of the address conversion table. For example, when the address determined by the program counter 201 is 0xF000, 0xF000 is read from the address conversion table. Even when the addresses determined by the program counter 201 are 0xF0A0 to 0xF0A2, 0xF0A0 to 0xF0A2 are read from the address conversion table.

これに対し、プログラムカウンタ201が決定したアドレスが0xF0A3の場合、アドレス変換テーブルから0xFF00が読み出され、同様に0xF0A4に対してはアドレス変換テーブルから0xFF01が読み出され、0xF0A5に対してはアドレス変換テーブルから0xFF02が読み出される。アドレス変換テーブルにより、CPU11が読み出す命令のアドレスを変更することができる。   On the other hand, when the address determined by the program counter 201 is 0xF0A3, 0xFF00 is read from the address conversion table. Similarly, 0xFF01 is read from the address conversion table for 0xF0A4, and address conversion is performed for 0xF0A5. 0xFF02 is read from the table. The address of the instruction read by the CPU 11 can be changed by the address conversion table.

なお、アドレス変換テーブルは、アドレス変換部202に記憶されていてもよいし、ROM12に記憶しておき、マイコン200の起動時にプログラム210がROM12から読み出しアドレス変換部202のレジスタ等に読み出してもよい。   The address conversion table may be stored in the address conversion unit 202, or may be stored in the ROM 12, and the program 210 may be read from the ROM 12 and read into the register of the address conversion unit 202 when the microcomputer 200 is activated. .

アドレスコントローラ203は、アドレス変換部202が命令バスのアドレス線(Address)に出力した物理アドレスのうちRowアドレスをRowコントローラに出力する。Rowコントローラは、Rowアドレスをデコードして、Row線をアクティブ状態にする。
また、アドレスコントローラ203は、アドレス変換部202が命令バスのアドレス線(Address)に出力した物理アドレスのうちColumnアドレスをColumnコントローラに出力する。Columnコントローラは、Columnアドレスをデコードして、Column線をアクティブ状態にする。Row線/Column線の両方がアクティブになったROM12の領域のデータが、データ線に出力されCPU11に取り込まれる。
The address controller 203 outputs the Row address among the physical addresses output by the address conversion unit 202 to the address line (Address) of the instruction bus to the Row controller. The Row controller decodes the Row address and activates the Row line.
Further, the address controller 203 outputs the Column address to the Column controller among the physical addresses output by the address conversion unit 202 to the address line (Address) of the instruction bus. The Column controller decodes the Column address and activates the Column line. Data in the area of the ROM 12 in which both the Row line / Column line are active is output to the data line and taken into the CPU 11.

〔テスト工程〕
ROM12には、図9(b)に示した非変更部の命令と追加分の命令が記憶される。開発者は、変更部の命令が記憶された0xFF00〜0xFF02にCPU11がアクセスするテストパターンを作成してテストを行うか、又は、例えばSMVコードでCPU11が0xFF00〜0xFF02にアクセスするモデルを作成しモデル検査を行うなどの、検査工程を行う。したがって、本実施例では、プログラム210の全体をテストする場合と比べ、検査工程を大幅に削減できる。
[Test process]
The ROM 12 stores an instruction for the non-change unit and an additional instruction shown in FIG. The developer creates a test pattern in which the CPU 11 accesses the 0xFF00 to 0xFF02 in which the instruction of the change unit is stored, or performs a test, or creates a model in which the CPU 11 accesses the 0xFF00 to 0xFF02 using, for example, SMV code An inspection process such as an inspection is performed. Therefore, in this embodiment, the inspection process can be greatly reduced as compared with the case where the entire program 210 is tested.

〔マイコンの動作手順〕
図12は、マイコン200がアドレスを変換してプログラム210を読み出す手順を示すフローチャート図の一例である。図12のフローチャート図は、マイコン200の起動中、繰り返し実行される。
[Operation procedure of microcomputer]
FIG. 12 is an example of a flowchart illustrating a procedure in which the microcomputer 200 converts the address and reads the program 210. The flowchart of FIG. 12 is repeatedly executed while the microcomputer 200 is activated.

アドレス変換部202は、プログラムカウンタ201から読み出し先の命令のアドレスを取得する(S110)。   The address conversion unit 202 acquires the address of the instruction to be read from the program counter 201 (S110).

アドレス変換部202は、アドレス変換テーブルを参照し、プログラムカウンタ201から取得したアドレスに対応づけられた物理アドレスを読み出す(S120)。   The address conversion unit 202 reads the physical address associated with the address acquired from the program counter 201 with reference to the address conversion table (S120).

アドレス変換部202は、プログラムカウンタ201から取得したアドレスと、アドレス変換テーブルから読み出した物理アドレスを比較する(S130)。   The address conversion unit 202 compares the address acquired from the program counter 201 with the physical address read from the address conversion table (S130).

両者が一致しない場合(S130No)、アドレス変換部202はアドレス変換テーブルから読み出した物理アドレスをアドレスコントローラに出力する(S170)。   If the two do not match (S130 No), the address conversion unit 202 outputs the physical address read from the address conversion table to the address controller (S170).

両者が一致する場合(S130Yes)、アドレス変換部202はプログラムカウンタ201から取得したアドレスをアドレスコントローラに出力する(S140)。   If the two match (S130 Yes), the address conversion unit 202 outputs the address acquired from the program counter 201 to the address controller (S140).

アドレスコントローラ203は指定されたアドレスの命令をCPU11に供給する(S150)。   The address controller 203 supplies the instruction at the designated address to the CPU 11 (S150).

CPU11が命令を実行すると、プログラムカウンタ201はアドレスを1つインクリメントする(S160)。このような処理を繰り返すことで、変更部を含め変更後のプログラム210が実行される。   When the CPU 11 executes the instruction, the program counter 201 increments the address by one (S160). By repeating such processing, the changed program 210 including the changing unit is executed.

本実施例の開発用情報処理装置100又は車載されるマイコン200によれば、プログラムが変更されても変更前と同じアドレスに記憶することで、プログラム変更時の再検査の工程を大幅に削減でき、ソフトウェアの開発コストを大幅に低減できる。   According to the development information processing apparatus 100 or the on-board microcomputer 200 according to the present embodiment, even if the program is changed, the re-inspection process when the program is changed can be greatly reduced by storing the program at the same address as before the change. Software development costs can be greatly reduced.

実施例1では、変更により命令が追加された場合について説明したが、変更により一部の命令が消去される場合もあり得る。本実施例では変更により命令が消去された場合の開発用情報処理装置100について説明する。   In the first embodiment, the case where an instruction is added by a change has been described. However, a part of the instruction may be deleted by the change. In the present embodiment, the development information processing apparatus 100 when an instruction is deleted due to a change will be described.

図13は、リンカ140がアドレス変換テーブルを生成する手順を示すフローチャート図の一例である。図13では、実施例1と比較してS20が不要になる。   FIG. 13 is an example of a flowchart illustrating a procedure for the linker 140 to generate an address conversion table. In FIG. 13, S20 is unnecessary compared with the first embodiment.

<S10 変更部を抽出>
図14は、変更前プログラムと変更後プログラムの比較を説明する図の一例である。図14では、変更前プログラムから「xor esp eax」が削除されている。
a1.まず、変更部特定部141はROM12における先頭アドレスに変更後プログラムの先頭を配置した場合の仮想配置アドレスを求める。変更前プログラムについても同様である。
a2.次に、変更部特定部141は、変更前プログラムの命令をアドレス順に読み出し、変更後プログラムに同じ命令が登録されているか否かを判定する。すなわち、変更部特定部141は、変更前プログラムの1つの命令について、変更後プログラムの全ての命令をアドレス順に比較する。
a3.実施例1では、変更前プログラムになく変更後プログラムにある命令を抽出したが、本実施例では変更前プログラムにあり変更後プログラムにない命令を抽出する。変更部特定部141は、変更された(削除された)命令の仮想配置アドレス、及び、命令がないという情報「命令なし」を1組として、変更された全ての命令を取り出す。
<Extract S10 change part>
FIG. 14 is an example of a diagram illustrating a comparison between a pre-change program and a post-change program. In FIG. 14, “xor esp eax” is deleted from the pre-change program.
a1. First, the changing unit specifying unit 141 obtains a virtual placement address when the top of the changed program is placed at the top address in the ROM 12. The same applies to the pre-change program.
a2. Next, the change part specifying part 141 reads the instructions of the program before change in the order of addresses, and determines whether or not the same instruction is registered in the program after change. That is, the changing unit specifying unit 141 compares all instructions of the post-change program in the order of addresses for one instruction of the pre-change program.
a3. In the first embodiment, instructions in the post-change program but not in the pre-change program are extracted, but in this embodiment, instructions that are in the pre-change program but not in the post-change program are extracted. The changing unit specifying unit 141 takes out all changed instructions with a set of the virtual arrangement address of the changed (deleted) instruction and the information “no instruction” indicating that there is no instruction.

本実施例では、追加されたことによる命令の変更部はない。よって、変更部アドレス決定部142は物理アドレスを決定する必要はない。   In the present embodiment, there is no instruction change part due to the addition. Therefore, the changing unit address determining unit 142 does not need to determine a physical address.

<S30 アドレス変換テーブルの作成>
次に、アドレス変換テーブル作成部143がアドレス変換テーブルを生成する。
図15は、アドレス変換テーブルの作成を説明する図の一例である。
<S30 Address conversion table creation>
Next, the address conversion table creation unit 143 generates an address conversion table.
FIG. 15 is an example of a diagram illustrating creation of an address conversion table.

追加された命令がない場合、ROM12に記憶されるプログラム210は変更の前と後で全く変わらない。しかし、ソースコードの変更を反映するため、CPU11が変更により削除された命令を実行することを回避する必要がある。
c1.アドレス変換テーブル作成部143は、仮想メモリ配置のアドレスの命令と変更前プログラムの物理アドレスの命令とを順番に比較し、同じアドレスに異なる命令がある場合に、アドレスを変更する。図では、仮想配置アドレスの0xF0A2〜0xF0BE(関数Aの最後)まで、同じアドレスに異なる命令がある。
c2.アドレス変換テーブル作成部143は、仮想配置アドレスと同じ物理アドレスに同じ命令がある場合、変更前プログラムのアドレスと変更後プログラムのアドレスを対応づけて、アドレス変換テーブルを作成する。
c3.仮想配置アドレスと同じ物理アドレスの異なる命令のうち、「命令なし」の命令は、仮想配置アドレスに対応づける必要がない。しかし、仮想配置アドレスに、ROM12の別のアドレスを対応づける必要がある。このため、アドレス変換テーブル作成部143は、「命令なし」の命令と同じ命令を変更前プログラムから検索し、「命令なし」の命令の仮想配置アドレスに変更前プログラムの命令の対応づける。
c4.仮想配置アドレスと同じ物理アドレスの異なる命令のうち、残りの命令は、関数A〜Cの領域内に同じ命令が存在するはずなので、仮想配置アドレスの1命令ずつ、変更前プログラムの命令を検索し、変更前プログラムの命令のアドレスを仮想配置アドレスに対応づける。以上のようにして、アドレス変換テーブルが作成される。
If there are no added instructions, the program 210 stored in the ROM 12 will not change at all before and after the change. However, in order to reflect the change of the source code, it is necessary to avoid that the CPU 11 executes the instruction deleted by the change.
c1. The address conversion table creation unit 143 compares the instruction at the address in the virtual memory arrangement with the instruction at the physical address in the program before change, and changes the address when there are different instructions at the same address. In the figure, there are different instructions at the same address from 0xF0A2 to 0xF0BE (end of function A) of the virtual arrangement addresses.
c2. When there is the same instruction at the same physical address as the virtual placement address, the address conversion table creation unit 143 creates an address conversion table by associating the address of the program before change with the address of the program after change.
c3. Of the instructions having the same physical address as the virtual arrangement address, the instruction “no instruction” does not need to be associated with the virtual arrangement address. However, it is necessary to associate another address in the ROM 12 with the virtual arrangement address. Therefore, the address conversion table creating unit 143 searches the pre-change program for the same instruction as the “no instruction” instruction, and associates the instruction of the pre-change program with the virtual arrangement address of the “no instruction” instruction.
c4. Of the instructions with the same physical address as the virtual allocation address, the remaining instructions should be in the area of functions A to C. Therefore, the instructions of the program before the change are searched one by one at the virtual allocation address. The address of the instruction of the program before change is associated with the virtual arrangement address. The address conversion table is created as described above.

変更により一部の命令が消去された場合、消去後の命令のアドレスは1つずつ詰まっているので、命令とアドレスの関係がずれてしまう。このため、本来であれば、プログラム210の大部分で検査工程をやり直す必要が生じる。これに対し本実施例では、ROM12に記憶される実行ファイルに全く変更がないので、検査工程を大幅に削減できる。   When some instructions are erased due to the change, the addresses of the instructions after erasure are blocked one by one, and the relationship between the instructions and the addresses is deviated. For this reason, it is necessary to redo the inspection process in most of the program 210. On the other hand, in this embodiment, since the execution file stored in the ROM 12 is not changed at all, the inspection process can be greatly reduced.

本実施例では、実施例1と実施例2を組み合わせた開発用情報処理装置100について説明する。実施例1と2の2つの態様で変更部を抽出し、アドレス変換テーブルを生成すればよい。
本実施例の手順は実施例1と同様なのでフローチャート図は省略する。
In the present embodiment, a development information processing apparatus 100 combining the first embodiment and the second embodiment will be described. What is necessary is just to extract a change part by the two aspects of Example 1 and 2, and produce | generate an address conversion table.
Since the procedure of this embodiment is the same as that of the first embodiment, the flowchart is omitted.

<S10 変更部の抽出>
図16は、変更前プログラムと変更後プログラムの比較を説明する図の一例である。図16では、「POP edi」「POP esi」「POP ebx」の3つの命令が追加され、かつ、変更前プログラムから「xor esp eax」が削除されている。
a1.まず、変更部特定部141はROM12における先頭アドレスに変更後プログラムの先頭を配置した場合の仮想配置アドレスを求める。変更前プログラムについても同様である。
a2.次に、変更部特定部141は、変更前プログラムの命令をアドレス順に読み出し、変更後プログラムに同じ命令が登録されているか否かを判定する。すなわち、変更部特定部141は、変更前プログラムの1つの命令について、変更後プログラムの全ての命令をアドレス順に比較する。
<Extraction of S10 change part>
FIG. 16 is an example of a diagram illustrating a comparison between a pre-change program and a post-change program. In FIG. 16, three instructions “POP edi”, “POP esi”, and “POP ebx” are added, and “xor esp eax” is deleted from the pre-change program.
a1. First, the changing unit specifying unit 141 obtains a virtual placement address when the top of the changed program is placed at the top address in the ROM 12. The same applies to the pre-change program.
a2. Next, the change part specifying part 141 reads the instructions of the program before change in the order of addresses, and determines whether or not the same instruction is registered in the program after change. That is, the changing unit specifying unit 141 compares all instructions of the post-change program in the order of addresses for one instruction of the pre-change program.

a3‐1.図16(a)に示すように、変更部特定部141は、変更前プログラムになく変更後プログラムにある命令を抽出する。変更部特定部141は、変更部の命令の仮想配置アドレス、及び、変更後プログラムの命令を1組として、変更された全ての命令を取り出す。   a3-1. As shown in FIG. 16A, the change unit identification unit 141 extracts instructions in the post-change program rather than the pre-change program. The changing unit specifying unit 141 takes out all changed instructions with the virtual placement address of the instruction of the changing unit and the instruction of the changed program as one set.

a3‐2.図16(a)に示すように、変更部特定部141は、変更前プログラムにあり変更後プログラムにない命令を抽出する。変更部特定部141は、変更部の命令の仮想配置アドレス、及び、命令がないという情報「命令なし」を1組として、変更された全ての命令を取り出す。   a3-2. As shown in FIG. 16A, the change unit identification unit 141 extracts instructions that are in the pre-change program but not in the post-change program. The changing unit specifying unit 141 takes out all changed instructions with the virtual arrangement address of the instruction of the changing unit and the information “no instruction” indicating that there is no instruction as one set.

<S20 物理アドレスの決定>
変更部アドレス決定部142は、図16(b)に示すように、S3‐1の処理により得られた変更部についてのみ、物理アドレスを決定する。処理手順は実施例1と同様である。
b1.変更部アドレス決定部142は、非変更部の最終アドレスの次のアドレス、又は、最終アドレスから若干離れたアドレスを先頭に、変更部を配置した時の物理アドレスを決定する。図16では、0xFF00から変更部の命令が配置されることになる。
b2.変更部アドレス決定部142は、変更部の命令の仮想配置アドレスと、物理アドレスを対応づけて記憶する。
<S20 Determination of physical address>
As shown in FIG. 16B, the changing unit address determining unit 142 determines a physical address only for the changing unit obtained by the process of S3-1. The processing procedure is the same as in the first embodiment.
b1. The changing unit address determining unit 142 determines a physical address when the changing unit is arranged with the address next to the final address of the non-changed unit or an address slightly apart from the final address as the head. In FIG. 16, the instruction of the changing unit is arranged from 0xFF00.
b2. The changing unit address determining unit 142 stores the virtual arrangement address of the instruction of the changing unit and the physical address in association with each other.

<S30 アドレス変換テーブルの作成>
図17はアドレス変換テーブルの作成を説明する図の一例である。
アドレス変換テーブル作成部143は、変更部特定部141が特定した変更部、仮想配置アドレス、及び、物理アドレスを用いて、アドレス変換テーブル生成する。
c1.アドレス変換テーブル作成部143は、仮想メモリ配置のアドレスの命令と変更前プログラムの物理アドレスの命令とを順番に比較し、同じアドレスに異なる命令がある場合に、アドレスを変更する。図では、仮想配置アドレスの0xF0A2〜0xF0BF(関数Aの最後)まで、同じアドレスに異なる命令がある。また、変更後プログラムに追加された命令のため仮想配置アドレスの0xF0BF〜0xF0Cの命令も対象となる。
c2.アドレス変換テーブル作成部143は、仮想配置アドレスと同じ物理アドレスに同じ命令がある場合、変更前プログラムのアドレスと変更後プログラムのアドレスを対応づけて、アドレス変換テーブルを作成する。
c3.仮想配置アドレスと同じ物理アドレスの異なる命令のうち、領域外に配置される命令は、領域外の物理アドレスを対応づける。このため、アドレス変換テーブル作成部143は、上記b.2で抽出された仮想配置アドレスと物理アドレスを取り出してアドレス変換テーブルに書き出す。
<S30 Address conversion table creation>
FIG. 17 is an example of a diagram illustrating the creation of an address conversion table.
The address conversion table creating unit 143 generates an address conversion table using the changing unit, the virtual arrangement address, and the physical address specified by the changing unit specifying unit 141.
c1. The address conversion table creation unit 143 compares the instruction at the address in the virtual memory arrangement with the instruction at the physical address in the program before change, and changes the address when there are different instructions at the same address. In the figure, there are different instructions at the same address from 0xF0A2 to 0xF0BF (the end of the function A) of the virtual arrangement addresses. In addition, since the instructions are added to the post-change program, the virtual addresses 0xF0BF to 0xF0C are also targeted.
c2. When there is the same instruction at the same physical address as the virtual placement address, the address conversion table creation unit 143 creates an address conversion table by associating the address of the program before change with the address of the program after change.
c3. Of the instructions having the same physical address as the virtual arrangement address, the instruction arranged outside the area associates the physical address outside the area. Therefore, the address conversion table creating unit 143 takes out the virtual arrangement address and physical address extracted in b.2 and writes them in the address conversion table.

「命令なし」の命令については、実施例2と同様に仮想配置アドレスの命令と同じ命令を検索すればよい。しかし、図示する例では、追加された命令が、「命令なし」の命令のアドレスに記述されるので、追加された命令の仮想配置アドレスと物理アドレスの対応付けを優先する。
c4.仮想配置アドレスと同じ物理アドレスとで異なる命令のうち、残りの命令は、領域内に同じ命令が存在するはずなので、仮想配置アドレスの1命令ずつ、変更前の命令を検索し、変更前の命令を仮想配置アドレスに対応づける。
For the “no instruction” instruction, the same instruction as the instruction at the virtual placement address may be searched as in the second embodiment. However, in the illustrated example, the added instruction is described in the address of the instruction “no instruction”, and therefore, the correspondence between the virtual placement address and the physical address of the added instruction is prioritized.
c4. Of the instructions that differ between the virtual address and the same physical address, the remaining instructions should have the same instruction in the area. Therefore, the instruction before the change is searched for each instruction of the virtual address, and the instruction before the change. Is associated with the virtual arrangement address.

以上説明したように、本実施例の開発用情報処理装置100は、命令が追加されても、削除されても、アドレス変換テーブルを作成することで、ROM12に記憶される変更前後のプログラム210のアドレスを変える必要がない。このため検査工程を大幅に削減できる。   As described above, the development information processing apparatus 100 according to the present embodiment creates the address conversion table regardless of whether an instruction is added or deleted, so that the program 210 before and after the change stored in the ROM 12 can be stored. There is no need to change the address. Therefore, the inspection process can be greatly reduced.

11 CPU
12 ROM
100 開発用情報処理装置
130 開発用プログラム
140 リンカ
141 変更部特定部
142 変更部アドレス決定部
143 アドレス変換テーブル作成部
200 マイコン
201 プログラムカウンタ
202 アドレス変換部
203 アドレスコントローラ
210 プログラム
300 車両
400 サーバ
11 CPU
12 ROM
DESCRIPTION OF SYMBOLS 100 Information processing apparatus 130 Development program 140 Linker 141 Change part specific | specification part 142 Change part Address determination part 143 Address conversion table preparation part 200 Microcomputer 201 Program counter 202 Address conversion part 203 Address controller 210 Program 300 Vehicle 400 Server

Claims (5)

変更前のプログラムと変更後のプログラムを記憶するプログラム記憶手段と、
変更前のプログラムと変更後のプログラムの変更部を抽出する変更部抽出手段と、
前記変更部を含め変更後のプログラムの各命令を外部の記憶手段に配置した際の仮想アドレスを決定すると共に、
変更前のプログラムの物理アドレスを固定したまま、変更前のプログラム及び前記変更部を前記外部の記憶手段に配置した際の該変更部の物理アドレスを決定し、前記変更部の前記仮想アドレスと前記物理アドレスとを対応づけた中間テーブルを作成するアドレス決定手段と、
変更後のプログラムの各命令と、変更前のプログラムの各命令を先頭からアドレス毎に比較し、同じ命令が記述されている場合は、それらのアドレスを対応付けて登録し、異なる命令が記述されている場合は、前記中間テーブルの前記仮想アドレスと前記物理アドレスとを対応づけて登録したアドレス変換テーブル、を作成するアドレス変換テーブル作成手段と、
を有する情報処理装置。
Program storage means for storing the program before the change and the program after the change;
Change part extraction means for extracting the change part of the program before the change and the program after the change,
While determining the virtual address when each instruction of the changed program including the changing unit is arranged in an external storage means,
While fixing the physical address of the program before the change, the physical address of the change unit when the program before the change and the change unit are arranged in the external storage unit is determined, and the virtual address of the change unit and the virtual address Address determining means for creating an intermediate table in which physical addresses are associated with each other;
Compare each instruction of the program after the change with each instruction of the program before the change for each address from the beginning, and if the same instruction is described, register those addresses in association with each other and describe a different instruction. An address translation table creating means for creating an address translation table in which the virtual address and the physical address of the intermediate table are registered in association with each other;
An information processing apparatus.
前記変更部抽出手段が、変更前のプログラムにあり変更後のプログラムにない命令を前記変更部として抽出した場合、
前記アドレス変換テーブル作成手段は、変更後のプログラムにない命令の前記仮想アドレスの命令を、変更前のプログラムから検索し、該仮想アドレスと検索した命令の物理アドレスを対応づけてアドレス変換テーブルに登録する、
ことを特徴とする請求項1記載の情報処理装置。
When the change unit extraction means extracts an instruction that is in the program before the change and is not in the program after the change as the change unit,
The address conversion table creating means searches the program before the change for the instruction of the virtual address that is not in the program after the change, and registers the virtual address and the physical address of the searched instruction in association with each other in the address conversion table To
The information processing apparatus according to claim 1.
前記アドレス変換テーブル作成手段は、前記仮想アドレスと物理アドレスの同じアドレスに異なる命令が記述されているが、前記中間テーブルに登録されていない前記仮想アドレスについて、該仮想アドレスの命令を変更前のプログラムから検索し、該仮想アドレスと検索した命令の物理アドレスを対応づけてアドレス変換テーブルに登録する、
ことを特徴とする請求項1又は2記載の情報処理装置。
The address conversion table creating means includes a program in which different instructions are described in the same address of the virtual address and the physical address, but the instruction of the virtual address is not changed for the virtual address that is not registered in the intermediate table. And register the virtual address and the physical address of the searched instruction in the address conversion table in association with each other.
The information processing apparatus according to claim 1 or 2.
請求項1又は2に記載された情報処理装置により生成されたアドレス変換テーブルと、
変更前のプログラム及び前記変更部が記憶された前記外部の記憶手段と、
命令実行手段が読み出す命令のアドレスを生成するアドレス生成手段と、
前記アドレス生成手段が生成したアドレスと、該アドレスと同じ前記アドレス変換テーブルの前記仮想アドレスに対応づけられた前記物理アドレスとが異なる場合、該アドレスを前記物理アドレスに変換するアドレス変換手段と、
前記アドレス変換手段が変換した前記物理アドレスの命令を前記記憶手段から読み出し、前記命令実行手段に供給する命令読み出し手段と、
を有する情報処理装置。
An address conversion table generated by the information processing apparatus according to claim 1;
The external storage means storing the program before the change and the change unit;
An address generation means for generating an address of an instruction read by the instruction execution means;
If the address generated by the address generation unit is different from the physical address associated with the virtual address of the same address conversion table as the address, the address conversion unit converts the address to the physical address;
An instruction reading unit that reads the instruction of the physical address converted by the address conversion unit from the storage unit and supplies the instruction to the instruction execution unit;
An information processing apparatus.
情報処理装置が作成するプログラムのアドレスを管理するアドレス管理方法であって、
変更前のプログラムと変更後のプログラムを記憶するプログラム記憶手段から、変更部抽出手段が、変更前のプログラムと変更後のプログラムを読み出し、両者の変更部を抽出するステップと、
アドレス決定手段が、前記変更部を含め変更後のプログラムの各命令を外部の記憶手段に配置した際の仮想アドレスを決定するステップと、
変更前のプログラムの物理アドレスを固定したまま、変更前のプログラム及び前記変更部を外部の記憶手段に配置した際の該変更部の物理アドレスを決定するステップと、
前記変更部の前記仮想アドレスと前記物理アドレスとを対応づけた中間テーブルを作成するステップと、
アドレス変換テーブル作成手段が、変更後のプログラムの各命令と、変更前のプログラムの各命令を先頭からアドレス毎に比較するステップと、
同じ命令が記述されている場合は、それらのアドレスを対応付けて登録し、異なる命令が記述されている場合は、前記中間テーブルの前記仮想アドレスと前記物理アドレスとを対応づけて登録したアドレス変換テーブルを作成するステップと、
を有するアドレス管理方法。
An address management method for managing an address of a program created by an information processing apparatus,
From the program storage means for storing the program before the change and the program after the change, the change part extraction means reads the program before the change and the program after the change, and extracts both of the change parts;
An address determining unit determining a virtual address when each instruction of the changed program including the changing unit is arranged in an external storage unit;
Determining the physical address of the change unit when the program and the change unit before the change are arranged in an external storage unit while fixing the physical address of the program before the change;
Creating an intermediate table associating the virtual address and the physical address of the changing unit;
The address conversion table creating means compares each instruction of the program after the change and each instruction of the program before the change for each address from the head,
When the same instruction is described, the addresses are registered in association with each other. When different instructions are described, the address conversion is performed by associating and registering the virtual address and the physical address in the intermediate table. Creating a table;
Address management method.
JP2011220174A 2011-10-04 2011-10-04 Information processing device and address management method Pending JP2013080386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011220174A JP2013080386A (en) 2011-10-04 2011-10-04 Information processing device and address management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011220174A JP2013080386A (en) 2011-10-04 2011-10-04 Information processing device and address management method

Publications (1)

Publication Number Publication Date
JP2013080386A true JP2013080386A (en) 2013-05-02

Family

ID=48526705

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011220174A Pending JP2013080386A (en) 2011-10-04 2011-10-04 Information processing device and address management method

Country Status (1)

Country Link
JP (1) JP2013080386A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460172A (en) * 2022-08-22 2022-12-09 曙光信息产业股份有限公司 Device address allocation method, device, computer device, medium, and program product
JP2023510122A (en) * 2019-12-20 2023-03-13 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Device with interface and method of operating device with interface

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2023510122A (en) * 2019-12-20 2023-03-13 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Device with interface and method of operating device with interface
JP7375201B2 (en) 2019-12-20 2023-11-07 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Device with an interface and method of operating the device with an interface
CN115460172A (en) * 2022-08-22 2022-12-09 曙光信息产业股份有限公司 Device address allocation method, device, computer device, medium, and program product
CN115460172B (en) * 2022-08-22 2023-12-05 曙光信息产业股份有限公司 Device address allocation method, device, computer device, medium and program product

Similar Documents

Publication Publication Date Title
US9336001B2 (en) Dynamic instrumentation
US8381194B2 (en) Methods and apparatuses for selective code coverage
WO2020019490A1 (en) Interface testing method, electronic device and storage medium
CN112905472B (en) Kernel debugging system and method
CN112395843B (en) PHP code-based service processing method, device and medium
JP2009187223A (en) Processor, electronic equipment, interrupt control method, and interrupt control program
CN111104269A (en) UART interface-based processor debugging method and system
US20110276950A1 (en) Name binding extensibility for typed programming language
US9691123B2 (en) Instrumentation of graphics instructions
CN105027089B (en) Core functions detector
US7139857B2 (en) Method and apparatus for handling interrupts
US8434072B2 (en) Automatic retrieval of translated messages for interacting with legacy systems
JP2013080386A (en) Information processing device and address management method
US20120089386A1 (en) Simulation apparatus, computer-readable recording medium, and method
JP4594889B2 (en) Method for tracing program executed on a system including a plurality of processing devices, and system including a plurality of processing devices
US9317454B2 (en) Information processing apparatus, information processing method, and recording medium
US7318221B2 (en) Windows™ F-language interpreter
CA2878558C (en) Lock free streaming of executable code data
JP2008140124A (en) Data processor
US9779012B1 (en) Dynamic and global in-system debugger
JP2008204023A (en) Programmable controller system and debug method for programmable controller
US7281166B1 (en) User-customizable input error handling
Lin et al. Automated development tools for Linux USB drivers
JP2008305093A (en) Memory controller, control method for memory controller, program, and storage medium
JP2001290674A (en) Device and method for setting program breakpoint