JP2009064112A - Code transfer method to memory - Google Patents

Code transfer method to memory Download PDF

Info

Publication number
JP2009064112A
JP2009064112A JP2007229472A JP2007229472A JP2009064112A JP 2009064112 A JP2009064112 A JP 2009064112A JP 2007229472 A JP2007229472 A JP 2007229472A JP 2007229472 A JP2007229472 A JP 2007229472A JP 2009064112 A JP2009064112 A JP 2009064112A
Authority
JP
Japan
Prior art keywords
code
memory
speed
detected
statistical information
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
JP2007229472A
Other languages
Japanese (ja)
Inventor
Atsushi Shibuya
淳 渋谷
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.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2007229472A priority Critical patent/JP2009064112A/en
Publication of JP2009064112A publication Critical patent/JP2009064112A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a dynamic code transfer method to a high-speed memory, improving execution operation speed by dynamically detecting a function having high access frequency or a function having a very long execution time, arranging a memory resource to the memory capable of dynamically operating at high speed, and performing transfer. <P>SOLUTION: This code transfer method to the memory in a system having memories each having different access speed has steps: for totaling use frequency of a previously designated code during operation of the system to generate statistical information; for detecting the high-use-frequency code from the statistical information; and for transferring the detected code to the memory having the higher access speed than the memory recording the detected code, and performing the arrangement. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、アクセス速度の異なる複数のメモリ領域にメモリ資源を割り付ける技術に関する。   The present invention relates to a technique for allocating memory resources to a plurality of memory areas having different access speeds.

従来、限られたメモリ領域に効果的にメモリ資源(ソースコード)を割り付けて動作させるために、予め利用者がベクタファイルなどを作成し、そのベクタファイルに基づいてコンパイラやリンカがメモリ領域にメモリ資源を配置している。   Conventionally, in order to effectively allocate memory resources (source code) to a limited memory area and operate it, a user creates a vector file in advance, and a compiler or linker stores memory in the memory area based on the vector file. Resources are allocated.

例えば、高速に動作させたいメモリ資源が複数あるが、高速動作可能なメモリ領域のメモリ容量がメモリ資源のプログラム容量より少ない場合、利用者が比較的アクセス頻度の高いメモリ資源を選んで高速動作可能なメモリ領域に割り付けられるようにベクタファイルを作成している。   For example, if there are multiple memory resources that you want to operate at high speed, but the memory capacity of the memory area that can be operated at high speed is less than the program capacity of the memory resource, the user can select a memory resource with relatively high access frequency and operate at high speed A vector file is created so that it can be allocated to the appropriate memory area.

また、ベクタファイルにより一度割り付けられたメモリ資源は、プログラム実行中にメモリ領域の変更をすることが難しいため、CPUのキャッシュ機能を利用してアクセス頻度の高いデータや命令をキャッシュ領域へ保持し高速化を実施している。   In addition, memory resources once allocated by a vector file are difficult to change the memory area during program execution. Therefore, frequently accessed data and instructions are held in the cache area using the CPU's cache function to achieve high speed. Is being implemented.

特許文献1によれば、シミュレータ部は、アクセス速度の異なる少なくとも2つのメモリ領域を持つプロセッサシステムをモデル化してプログラムをシミュレーションする。資源割付部は、シミュレーション結果に基づいて、高速メモリ領域には可能な限りデータを配置せずにプログラムの目標実行速度を維持できるように、プログラム実行で使用するデータ領域を、高速メモリ領域と低速メモリ領域とに分配配置する最適なメモリ配置を決定する。上記のようなシステムにおけるメモリ配置の最適解を、システムモデルのシミュレーションを通じて自動的に生成してメモリ資源最適化を支援する方法が提案されている。   According to Patent Document 1, the simulator unit models a processor system having at least two memory areas with different access speeds and simulates a program. Based on the simulation results, the resource allocation unit assigns the data area used for program execution to the high-speed memory area and the low-speed memory area so that the target execution speed of the program can be maintained without placing data in the high-speed memory area as much as possible. The optimum memory allocation to be distributed to the memory area is determined. There has been proposed a method for automatically optimizing memory allocation in the system as described above through simulation of a system model to support memory resource optimization.

特許文献2によれば、関数テーブルをプログラム可能とすることによって関数演算を高速に行い、かつ関数テーブルの内容を書き換えることによって複数の関数演算に対応することができる演算装置が提案されている。   Patent Document 2 proposes an arithmetic device capable of performing a function operation at high speed by making the function table programmable, and supporting a plurality of function operations by rewriting the contents of the function table.

特許文献3によれば、アプリケーションコード(プログラム)内にライブラリアドレス一覧テーブルを設け、このテーブルにライブラリのアドレスを登録する手順を設けることにより、ライブラリとダイナミックにリンクする提案がされている。   According to Patent Document 3, a library address list table is provided in an application code (program), and a procedure for registering a library address in this table is provided to dynamically link the library.

特許文献4によれば、高速メモリ領域への割り当てが可能な変数が存在する場合に、変数を高速メモリに割り当てることのできる言語処理装置が提案されている。
特許文献5によれば、キャッシュメモリ内のデータが充分に利用されないままリプレースする場合、元のデータについてキャッシュメモリへの登録を以降禁止することができるので、キャッシュメモリの利用効率を高め、ミス率を低減する提案がされている。
According to Patent Document 4, there is proposed a language processing apparatus capable of assigning a variable to a high-speed memory when there is a variable that can be assigned to a high-speed memory area.
According to Patent Document 5, when data in a cache memory is replaced without being fully used, the original data can be prohibited from being registered in the cache memory thereafter, so that the use efficiency of the cache memory is improved and the miss rate is increased. There are proposals to reduce this.

しかしながら、特許文献1のような装置において、プログラムを高速動作可能なメモリへ静的に配置した場合、実際の動作がこのメモリへの配置で最適であることが保障されない。同様に、シュミュレーションにより頻度の高いプログラムを検出した場合でも実際の動作条件の変化により、シュミュレーション結果が最適であることを保障することが困難になるという問題がある。   However, when the program is statically arranged in a memory capable of high-speed operation in an apparatus such as Patent Document 1, it is not guaranteed that the actual operation is optimal in this memory arrangement. Similarly, even when a highly frequent program is detected by simulation, there is a problem that it is difficult to ensure that the simulation result is optimal due to changes in actual operating conditions.

また、CPUキャッシュ機能では、データアクセス、命令アクセスが対象であるため、
プログラムコードそのものの配置先が遅いメモリの場合、制御時間の大半が遅いメモリに配置されたプログラムコードのメモリリードに占められてしまう。
The CPU cache function is for data access and instruction access.
In the case of a memory in which the program code itself is placed at a slow location, most of the control time is occupied by the memory read of the program code placed in the slow memory.

また、特許文献1〜5には使用頻度の高いメモリ資源を、使用頻度に応じて動的に高速動作可能なメモリに格納するものではない。
特開2004−70862号公報 特開平09−022343号公報 特開平10−254711号公報 特開2000−339173号公報 特開平05−274225号公報
In Patent Documents 1 to 5, memory resources that are frequently used are not stored in a memory that can dynamically operate at high speed according to the frequency of use.
JP 2004-70862 A Japanese Patent Laid-Open No. 09-022343 Japanese Patent Laid-Open No. 10-254711 JP 2000-339173 A JP 05-274225 A

本発明は上記のような実情に鑑みてなされたものであり、アクセス頻度の高い関数や実行時間が多大な関数を動的に検出して、動的に高速動作可能なメモリへメモリ資源を配置、転送することにより実行動作速度を向上させる高速メモリへの動的コード転送方法を提供することを目的とする。   The present invention has been made in view of the above circumstances, and dynamically detects a function having a high access frequency or a function having a long execution time, and dynamically allocates a memory resource to a memory capable of operating at high speed. An object of the present invention is to provide a dynamic code transfer method to a high-speed memory which improves the execution operation speed by transferring.

本発明の態様のひとつであるアクセス速度が異なるメモリを備えるシステムにおけるメモリへのコード転送方法であって、前記システムの動作中に、予め指定したコードの使用頻度を集計して統計情報を生成し、前記統計情報から使用頻度が多い前記コードを検出し、検出したコードが記録されているメモリよりアクセス速度が速いメモリに、前記検出したコードを転送して配置する。   A method of transferring code to a memory in a system including memories with different access speeds, which is one aspect of the present invention, and generates statistical information by aggregating the frequency of use of predetermined codes during operation of the system. The code that is frequently used is detected from the statistical information, and the detected code is transferred to a memory having a higher access speed than the memory in which the detected code is recorded.

上記構成により、アクセス頻度の高い関数や実行時間が多大な関数を動的に検出して、動的に高速動作可能なメモリへメモリ資源を配置、転送することにより実行動作速度を向上させることができる。   With the above configuration, it is possible to improve the execution operation speed by dynamically detecting a function with high access frequency or a function with a long execution time, and allocating and transferring memory resources to a memory capable of dynamic operation at high speed. it can.

好ましくは、前記統計情報は、起動回数または走行数を有し、起動回数には予め指定されたコードが起動するごとに起動した回数が記録され、走行数には前記コードを実行するたびに走行した回数を記録してもよい。   Preferably, the statistical information includes the number of activations or the number of runnings, and the number of times of activation is recorded every time a predetermined code is activated, and the number of travelings is recorded each time the code is executed. May be recorded.

好ましくは、前記起動回数と予め設定された起動回数閾値を比較して前記起動回数閾値以上であるか否かを検出するか、または前記走行数と予め設定された走行数閾値を比較して前記走行数閾値以上であるか否かを検出する、ことにより使用頻度が高い前記コードを検出してもよい。   Preferably, the number of times of activation and a preset number of times of activation threshold are compared to detect whether or not the number of times of activation is equal to or greater than the threshold value of the number of times of activation, or the number of runnings is compared with a preset number of times of running threshold The code having a high use frequency may be detected by detecting whether or not it is equal to or greater than a running number threshold.

好ましくは、前記検出したコードをアクセス速度が速いメモリに転送するとき、前記高速メモリに前記検出したコードがなく、前記高速メモリの空き領域に前記検出したコードを記録できるかを判定し、前記高速メモリに前記検出したコードが転送可能であるときに転送を行ってもよい。   Preferably, when transferring the detected code to a memory having a high access speed, it is determined whether the detected code is stored in a free area of the high speed memory without the detected code in the high speed memory, and the high speed The transfer may be performed when the detected code can be transferred to the memory.

好ましくは、前記高速メモリに空き領域がなければ、前記高速メモリに既に登録されているコードを削除して空き領域を確保し、前記検出したコードを転送してもよい。   Preferably, if there is no free area in the high-speed memory, a code already registered in the high-speed memory may be deleted to secure a free area, and the detected code may be transferred.

本発明は、アクセス頻度の高い関数や実行時間が多大な関数を動的に検出して、動的に高速動作可能なメモリへメモリ資源を配置、転送することによりシステムの動作速度を向上させることができる。   The present invention dynamically detects a function with a high access frequency or a function with a long execution time, and dynamically allocates and transfers memory resources to a memory capable of high-speed operation, thereby improving the operation speed of the system. Can do.

(原理説明)
複数のアクセス速度が異なるメモリを備えるシステムにおいて、動作頻度の高いコードを検出し、システムが運用中であっても動作頻度の高いコードを高速動作可能なメモリへ動的に配置する。
(Principle explanation)
In a system including a plurality of memories having different access speeds, a code having a high operation frequency is detected, and a code having a high operation frequency is dynamically arranged in a memory capable of high-speed operation even when the system is in operation.

ここで、コードとは、利用者によりプログラミングされたソースコードに対してコンパイルおよびリンクを実施することにより作成された実行形式のコードであり、ライブラリに登録されている関数や利用者が指定したコードである。   Here, the code is an executable code created by compiling and linking the source code programmed by the user, such as a function registered in the library or a code specified by the user. It is.

コードの検出は、エントリテーブルにあるコードであるかを判別して検出する。
エントリテーブルは、実際に動的にメモリ配置を変更したいコードの一部または全てのコードが格納されているアドレスとメモリサイズなどを示すエントリキー情報と、そのコードの起動頻度である起動回数とスタックの走行数を示す統計情報により構成される。
The code is detected by determining whether the code is in the entry table.
The entry table includes entry key information indicating the address and memory size where a part or all of the code that actually wants to dynamically change the memory allocation is stored, the number of times the code is activated, and the stack It is comprised by the statistical information which shows the driving | running number of.

動的にコードを高速動作可能なメモリへ配置する場合、アプリケーションプログラムなどに利用者が予め任意の契機で開始、終了、期間を設定することにより、統計情報の収集と集計を周期的に実行する。   When dynamically allocating code to a memory capable of high-speed operation, statistical information is collected and aggregated periodically by the user setting the start, end, and period in advance at an arbitrary timing. .

統計情報は、エントリテーブルに登録されているコードが起動された場合に、エントリテーブルに登録されたコードに対応する起動回数、走行数を収集して記録する。
その後、予め設定した起動回数閾値を統計情報の起動回数が越えたこと、または予め設定した統計情報の走行数閾値を走行数が越えたことを検出する。
When the code registered in the entry table is activated, the statistical information collects and records the number of activations and the number of runnings corresponding to the code registered in the entry table.
Thereafter, it is detected that the number of times of activation of the statistical information has exceeded a preset number of activations threshold, or that the number of travelings has exceeded a preset number of runnings of statistical information.

高速動作可能なメモリへの配置は、高速動作可能なメモリに空き容量があり、統計情報集計テーブルなどに記録したコードが配置できるかを判定し、高速動作可能なメモリへ配置できる場合には、該当するコードを高速動作可能なメモリへ転送する。   If the memory that can be operated at high speed has free space in the memory that can be operated at high speed and the code recorded in the statistical information aggregation table etc. can be arranged, Transfer the corresponding code to a memory capable of high-speed operation.

高速動作可能なメモリに配置したコードは、次回の起動から、高速動作可能メモリ内のコードを動作させるために、エントリテーブルのエントリキー情報のアドレスを書き換える。また、高速動作可能なメモリにどのコードが配置されているのかを管理するための情報も更新する。   The code arranged in the memory capable of high-speed operation rewrites the address of the entry key information in the entry table in order to operate the code in the memory capable of high-speed operation from the next activation. In addition, information for managing which code is arranged in the memory capable of high-speed operation is also updated.

なお、高速動作可能なメモリへ配置する起動回数閾値、走行数閾値を越えたコードが新たに発生しても、配置先の高速動作可能なメモリに十分な容量が確保できない場合には、一度、高速動作可能なメモリへ配置したコードのエントリテーブルを初期値に戻す。そして、高速動作可能なメモリに十分な空き容量を確保したのち、新たにコードの配置を実施する。   In addition, even if a code exceeding the threshold for the number of activations and the number of runnings to be placed in the memory capable of high-speed operation is newly generated, if sufficient capacity cannot be secured in the memory capable of high-speed operation at the placement destination, Returns the entry table of the code placed in the memory capable of high-speed operation to the initial value. Then, after securing a sufficient free space in a memory capable of high-speed operation, a new code is arranged.

以下図面に基づいて、本発明の実施形態について詳細を説明する。
(実施例1)
(構成)
図1は、アクセス速度が異なるメモリが混在するシステムの構成を示す図である。図1に示すシステムは、CPU101、高速動作可能なメモリ102、フラッシュメモリ103から構成される回路を備えている。CPU101、高速動作可能なメモリ102、フラッシュメモリ103は、バスライン104を介して接続されている。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
Example 1
(Constitution)
FIG. 1 is a diagram showing a configuration of a system in which memories having different access speeds are mixed. The system shown in FIG. 1 includes a circuit including a CPU 101, a memory 102 capable of high-speed operation, and a flash memory 103. The CPU 101, the memory 102 that can operate at high speed, and the flash memory 103 are connected via a bus line 104.

CPU101は、コンパイラおよびリンカにより生成された複数のコードが記録されているメモリ領域からコードを読み出し、そのコードの内容に基づいて動作する。
また、CPU101は、エントリテーブルの先頭アドレスを格納するメモリ(レジスタなど)を設けエントリテーブルのエントリキー情報にて、コード(関数コードなど)を起動する。
The CPU 101 reads a code from a memory area in which a plurality of codes generated by a compiler and a linker are recorded, and operates based on the contents of the code.
The CPU 101 also provides a memory (register or the like) for storing the start address of the entry table, and activates a code (function code or the like) using the entry key information in the entry table.

統計情報の解析を行うソフトウェアは、OS(Operating System)により管理され、高速メモリ102を制御するデータとして、高速メモリ管理情報を使用する。
高速メモリ管理情報には、起動回数閾値、走行数閾値、統計項目の優先度により構成される。これらの情報は、利用者が変更することができる。
Software for analyzing statistical information is managed by an OS (Operating System), and uses high-speed memory management information as data for controlling the high-speed memory 102.
The high-speed memory management information is composed of the activation count threshold, the running count threshold, and the priority of statistical items. These pieces of information can be changed by the user.

CPU101には、統計情報を収集するか否かのメモリ(レジスタなど)を設け、統計情報収集の場合、動的に配置するコード起動の際に統計情報の収集を実施する。
高速動作可能なメモリ102には、電源投入時やリセット時にはベクタファイルにより指定されたコードが静的に記録される。運用時は、アクセス頻度の高いコードが検出され、検出されたコードを動的に高速動作可能なメモリ102に転送する。以後、高速動作可能なメモリ102を単に高速メモリと呼ぶこととする。
The CPU 101 is provided with a memory (register or the like) that determines whether or not to collect statistical information. In the case of collecting statistical information, the statistical information is collected when a dynamically allocated code is activated.
In the memory 102 capable of high-speed operation, a code designated by the vector file is statically recorded when the power is turned on or reset. During operation, a code with high access frequency is detected, and the detected code is dynamically transferred to the memory 102 capable of high-speed operation. Hereinafter, the memory 102 capable of high-speed operation is simply referred to as a high-speed memory.

フラッシュメモリ103は高速メモリ102よりアクセス速度の遅いメモリである。フラッシュメモリ103は、電源投入時やリセット時にはベクタファイルにより指定されたコードが静的に記録される。   The flash memory 103 is a memory having a slower access speed than the high-speed memory 102. In the flash memory 103, the code specified by the vector file is statically recorded when the power is turned on or reset.

なお、図1では高速メモリ102よりアクセス速度が遅いメモリとしてフラッシュメモリ103を示したが、フラッシュメモリに限定するものではない。
統計情報集計処理は、OSの周期タスクによって動作する。CPU101にて収集した統計情報をサーチし、高速メモリ管理情報を使用し、閾値を越えたかの判定を行う。閾値を超えた関数を検出した場合、統計情報集計テーブルに格納する。また、エントリテーブル上の統計情報のクリアを実施する。
In FIG. 1, the flash memory 103 is shown as a memory having a slower access speed than the high-speed memory 102, but the present invention is not limited to the flash memory.
The statistical information totaling process operates according to the periodic task of the OS. The statistical information collected by the CPU 101 is searched, and the high-speed memory management information is used to determine whether the threshold value is exceeded. When a function exceeding the threshold is detected, it is stored in the statistical information aggregation table. Also, the statistical information on the entry table is cleared.

作成された統計情報集計テーブルは、高速メモリ更新処理によって実行される高速メモリ102への転送の制御に使用する。
高速メモリ更新処理は、高速メモリ管理情報によって高速メモリ102に配置できるか判定を行う。例えば、同周期に複数のコードが転送対象となった場合には、統計項目優先度を判定し、優先順に制御を実施する。
The created statistical information aggregation table is used to control transfer to the high-speed memory 102 executed by the high-speed memory update process.
In the high-speed memory update process, it is determined whether or not the high-speed memory management information can be arranged in the high-speed memory 102. For example, when a plurality of codes are to be transferred in the same cycle, the statistical item priority is determined, and control is performed in order of priority.

また、この時、高速メモリの空き容量が無く、最も頻度情報が少ない配置済みコードを元に戻すことにより新規に検出した関数が配置可能であれば、頻度情報が少ないコードのアドレスを元に戻す制御を実施する。   At this time, if the newly detected function can be placed by returning the placed code with the least amount of frequency information and no free space in the high-speed memory, the address of the code with less frequency information is restored. Implement control.

検出したコードが配置可能なメモリ容量を確保可能な場合、高速メモリ102へ検出したコードの転送(コピー)を実施する。
頻度の少ない配置コードを戻す場合や新規に検出したコードを配置した場合には、エントリテーブルと高速メモリ管理情報テーブルの更新を行い、高速メモリ102内の配置を有効に活用できるように、メモリの再配置を実施する。
When the memory capacity in which the detected code can be arranged can be secured, the detected code is transferred (copied) to the high-speed memory 102.
When returning an infrequent placement code or placing a newly detected code, the entry table and the high-speed memory management information table are updated so that the placement in the high-speed memory 102 can be used effectively. Perform relocation.

(コンパイラとリンカ)
図1に示したシステムにおいて、利用者がプログラミングしたコードをコンパイルする際に、フラッシュメモリ103のような低速動作のメモリにあるコードを、運用中に高速メモリ102へ配置するために必要なコードを付加してコンパイルする。
(Compiler and linker)
In the system shown in FIG. 1, when compiling the code programmed by the user, the code necessary for allocating the code in the low-speed memory such as the flash memory 103 to the high-speed memory 102 during operation is provided. Add and compile.

つまり、コンパイラへ動的にメモリ配置を変更したいコードのアドレスとメモリサイズを示すエントリキー情報と転送用コードを、利用者がプログラミングしたコードに組み込
みコンパイルを行う。例えば、拡張言語などを用いてエントリキー情報や転送用コードを組み込んでもよい。
In other words, the entry key information indicating the address and memory size of the code whose memory allocation is to be dynamically changed and the transfer code are embedded in the code programmed by the user and compiled. For example, entry key information and a transfer code may be incorporated using an extended language.

また、コンパイラは、動的に配置する利用者により指定された複数のコードに対して、図2に示すエントリテーブルを生成する。
図2に示したエントリテーブルは、エントリインデックス値領域、コード先頭アドレス/サイズ領域、起動回数保存領域、走行回数保存領域からなるエントリ領域を、複数有している。
In addition, the compiler generates an entry table shown in FIG. 2 for a plurality of codes designated by a user that is dynamically arranged.
The entry table shown in FIG. 2 has a plurality of entry areas including an entry index value area, a code head address / size area, a startup count storage area, and a travel count storage area.

エントリインデックス値領域は、高速に動作させたいコードのコード名称に対応する番号が格納されている。例えば、プログラミングされたコード名、関数名など(エントリキー情報)が記録されている。   The entry index value area stores a number corresponding to a code name of a code that is desired to be operated at high speed. For example, a programmed code name, function name, etc. (entry key information) are recorded.

先頭アドレス/サイズ領域は、エントリインデックス値に対応するコードの先頭アドレスとサイズなど(エントリキー情報)が記録される領域である。
起動回数保存領域は、エントリインデックス値に対応するコードが起動した回数(統計情報)を記録する。
The start address / size area is an area in which the start address and size (entry key information) of the code corresponding to the entry index value are recorded.
The activation count storage area records the number of times (statistical information) the code corresponding to the entry index value is activated.

走行回数保存領域は、エントリインデックス値に対応するコードが起動した際に、スタックへ移行した回数(統計情報)を記録する。
例えば、コンパイラは静的に配置したコードに対しては従来のアセンブラ展開を実施するが、動的に配置するコードに対しては、起動先をエントリキー情報から取得し、起動するコードに対してアセンブラ展開を実施する。
The number-of-runs storage area records the number of times (statistical information) transferred to the stack when the code corresponding to the entry index value is activated.
For example, the compiler performs conventional assembler expansion for statically placed code, but for dynamically placed code, the activation destination is obtained from the entry key information, and the activated code is Implement assembler deployment.

リンカは、メモリ領域にエントリテーブルの領域を確保する。また、高速動作を必要としないコードについては従来どおりのリンクを行う。
(動作説明)
図3に本発明の処理シーケンスを示し動作を説明する。図3に示す処理シーケンスは、アプリケーション31、OS32、CPU101(ハードウェア)の動作を示している。
The linker secures an entry table area in the memory area. Also, code that does not require high-speed operation is linked as before.
(Description of operation)
FIG. 3 shows the processing sequence of the present invention and the operation will be described. The processing sequence illustrated in FIG. 3 illustrates operations of the application 31, the OS 32, and the CPU 101 (hardware).

アプリケーション31は、統計情報開始、停止、収集期間をOS32へ通知し、任意の契機でCPU101へ統計情報を収集するか否かを、収集レジスタを操作することにより統計情報の収集を行えるようにする。収集開始を受け付けたOS32は、CPU101へ収集レジスタにより指示し、統計情報収集処理を開始する(統計情報収集処理開始35)。   The application 31 notifies the OS 32 of the statistical information start, stop, and collection period, and enables the collection of statistical information by manipulating the collection register to determine whether or not to collect the statistical information to the CPU 101 at an arbitrary timing. . The OS 32 that has received the start of collection instructs the CPU 101 using the collection register and starts the statistical information collection process (statistical information collection process start 35).

アプリケーションの実行中にエントリテーブルに登録されているコードを検出すると、図3の動作開始指示33に示すようにOS32に対して通知をする。
OS32が通知を受けるとCPU101に設けられた収集レジスタの設定をする通知を、図3の収集レジスタ設定34に示すようにCPU101に対して通知をする。
When a code registered in the entry table is detected during execution of the application, the OS 32 is notified as indicated by an operation start instruction 33 in FIG.
When the OS 32 receives the notification, it notifies the CPU 101 of a notification for setting the collection register provided in the CPU 101 as shown in the collection register setting 34 of FIG.

CPU101は通知を受けると起動回数と走行数をカウントしてエントリテーブルの起動回数保存領域、走行回数保存領域に記録する。
次に、エントリテーブルの内容を周期的に集計するため、図3の周期タスク生成36により制御される集計周期処理開始37を実行する。
Upon receiving the notification, the CPU 101 counts the number of activations and the number of travels and records them in the activation number storage area and the travel number storage area of the entry table.
Next, in order to periodically total the contents of the entry table, a totaling period process start 37 controlled by the periodic task generation 36 in FIG. 3 is executed.

図4は、統計情報を収集する処理フローを示す図である。
コード起動時に、そのコード走行中の走行数をスタック領域にカウントしていき、そのコード終了時に、スタック内の走行数と、起動回数をエントリテーブルに保存する。
FIG. 4 is a diagram showing a processing flow for collecting statistical information.
When the code is activated, the number of runs during the code run is counted in the stack area, and when the code ends, the number of runs in the stack and the number of activations are stored in the entry table.

ステップS41では統計情報を収集するか判定する。エントリテーブルのエントリインデックス値領域に記録されているエントリインデックス値と実行するコードが同じであるかを判定する。エントリインデックス値に記録されているコードと一致した場合にはステップS42に移行する。一致していない場合には高速メモリに102に配置する必要がないコードであるためステップS47に移行する。   In step S41, it is determined whether to collect statistical information. It is determined whether or not the code to be executed is the same as the entry index value recorded in the entry index value area of the entry table. If the code matches the code recorded in the entry index value, the process proceeds to step S42. If they do not match, the code does not need to be placed in the high-speed memory 102, and the process proceeds to step S47.

ステップS42ではコードが起動され実行される。
ステップS43では実行中のコードの走行数をカウントしてスタック領域に格納する。
ステップS44では該コードの実行が終了する。
In step S42, the code is activated and executed.
In step S43, the number of running codes being executed is counted and stored in the stack area.
In step S44, the execution of the code ends.

ステップS45では該コードの起動回数が記録されている起動回数保存領域に対応するコードが起動するたびに1を加算(インクリメント)して記録する。
ステップS46ではスタック領域に記録した走行数を収集して走行回数保存領域に登録する。
In step S45, 1 is added (incremented) and recorded each time the code corresponding to the activation count storage area in which the activation count of the code is recorded is activated.
In step S46, the number of travels recorded in the stack area is collected and registered in the travel number storage area.

ステップS47ではエントリテーブルに記録されていないコードを起動させ、ステップS48ではコードの実行が完了する。
図5に、走行数をスタック領域に記録する場合の例について示す。
In step S47, a code not recorded in the entry table is activated, and in step S48, the execution of the code is completed.
FIG. 5 shows an example in which the running number is recorded in the stack area.

図5(A)はコードに含まれる関数コードA、関数コードB、関数コードCがネスト構造である場合について示されている。関数コードAの走行数は、関数コードBの両側にある前半処理と後半処理の走行数の合計である。関数コードBの走行数は、関数コードCの両側にある前半処理と後半処理の走行数の合計である。そして、関数コードCの走行数は関数コードC内の走行数である。   FIG. 5A shows a case where the function code A, function code B, and function code C included in the code have a nested structure. The traveling number of the function code A is the sum of the traveling numbers of the first half process and the second half process on both sides of the function code B. The traveling number of the function code B is the sum of the traveling numbers of the first half process and the second half process on both sides of the function code C. The traveling number of the function code C is the traveling number in the function code C.

図5(B)は、図5(A)に示した構造において走行数をどのようにスタック領域に記録しておくかを示した図である。
図5(B)に示したメモリ領域には、関数コードA〜Cが利用する領域があり、各領域はユーザスタック領域51、スタック走行回数保存領域52、旧フレームポインタ保存領域53、戻りプログラムカウンタ保存領域54から構成される。
FIG. 5B is a diagram showing how the traveling number is recorded in the stack area in the structure shown in FIG.
The memory area shown in FIG. 5B includes areas used by the function codes A to C. Each area includes a user stack area 51, a stack running count storage area 52, an old frame pointer storage area 53, and a return program counter. The storage area 54 is configured.

ユーザスタック領域51は、各関数コードに移行する際に必要なデータを退避させる領域である。現在、実行している関数コードを完了するとユーザスタック領域51に退避したデータは再び元に戻される。   The user stack area 51 is an area for saving data necessary for shifting to each function code. When the currently executing function code is completed, the data saved in the user stack area 51 is restored again.

スタック走行回数保存領域52は走行数を収集する領域である。例えば、図5(A)のような関数コードAの前半処理→関数Bの前半処理→関数Cの処理→関数Bの後半処理→関数Aの後半処理の順に各々の関数コードの走行数をカウントして保存する。なお、スタック走行回数保存領域52はユーザスタック領域51の一部を利用してもよい。   The stack travel count storage area 52 is an area for collecting the travel count. For example, the number of running of each function code is counted in the order of the first half processing of the function code A as shown in FIG. 5A, the first half processing of the function B, the processing of the function C, the second half processing of the function B, and the second half processing of the function A. And save. Note that the stack travel count storage area 52 may use a part of the user stack area 51.

旧フレームポインタ保存領域53は、各関数コードのフレームポインタの示す内容が保存されている。
戻りプログラムカウンタ保存領域54は、プログラムカウンタの戻り値を記録する領域である。
The old frame pointer storage area 53 stores the contents indicated by the frame pointer of each function code.
The return program counter storage area 54 is an area for recording the return value of the program counter.

関数コードA前半処理が起動されると関数コードA用のスタック走行回数保存領域52に走行数が記録される。次に、関数コードAの実行中関数コードBが呼ばれると関数コードBが起動する。関数コードB用のスタック走行回数保存領域52に関数コードB前半処理の走行数が記録される。   When the first half of the function code A processing is started, the number of travels is recorded in the stack travel number storage area 52 for the function code A. Next, when the function code B during execution of the function code A is called, the function code B is activated. The number of travels of the first half of the function code B is recorded in the stack travel number storage area 52 for the function code B.

関数コードBの実行中関数コードCが呼ばれると関数コードCが起動する。関数コードC用のスタック走行回数保存領域52に関数コードC処理の走行数が記録される。
次に、関数コードCの処理が完了すると関数コードBの処理に戻り、関数コードB関数コードB用のスタック走行回数保存領域52に関数コードB後半処理の走行数が関数コードB前半処理の走行数に加算され記録される。
When the function code C is called while the function code B is being executed, the function code C is activated. The travel number of the function code C process is recorded in the stack travel count storage area 52 for the function code C.
Next, when the processing of the function code C is completed, the processing returns to the processing of the function code B, and the number of runnings of the function code B latter half processing is stored in the stack running number storage area 52 for the function code B function code B. It is added to the number and recorded.

関数コードBの処理が完了すると関数コードAの処理に戻り、関数コードA後半処理が起動されると関数コードA用のスタック走行回数保存領域52に関数コードA後半処理の走行数が関数コードA前半処理の走行数に加算され記録される。   When the processing of the function code B is completed, the processing returns to the processing of the function code A. When the second half processing of the function code A is started, the running number of the second processing of the function code A is stored in the function code A It is added to the number of travels in the first half process and recorded.

そして、ステップS46で説明したように、各関数コードのスタック走行回数保存領域52に記録した走行数を加算し、関数コードごとにエントリテーブルの走行回数保存領域に登録する。   Then, as described in step S46, the number of travels recorded in the stack travel count storage area 52 of each function code is added and registered for each function code in the travel count storage area of the entry table.

図6は、OSにより制御される周期タスク生成により実行開始指示される集計周期処理の処理フローを示す図である。
ステップS61では、コード(例えば関数コードなど)に対応したエントリテーブルの起動回数保存領域、走行回数保存領域に記録されている起動回数と走行数を検出する。また、走行回数が1回であるとはアセンブラレベルでは1ステップであることから、各コードの走行数がわかれば実行時間が算出できるため、各コードの走行時間を用いて検出してもよい。
FIG. 6 is a diagram showing a processing flow of a totaling periodic process instructed to start execution by generating a periodic task controlled by the OS.
In step S61, the number of activations and the number of travelings recorded in the activation number storage area and the traveling number storage area of the entry table corresponding to the code (for example, function code) are detected. In addition, since the number of times of running is one step at the assembler level, the execution time can be calculated if the number of running of each code is known. Therefore, the running time of each code may be used for detection.

ステップS62では、図7に示した高速メモリ管理情報に予め設定した起動回数閾値を統計情報の起動回数が越えたか、または予め設定した統計情報の走行数閾値を統計情報の起動回数が越えたかを判定する。起動回数閾値または走行数閾値の範囲を越えたときステップS63に移行する。越えていない場合には次のコードのサーチをするためにステップS61に移行する。   In step S62, whether the statistical information activation count exceeds the preset activation count threshold in the high-speed memory management information shown in FIG. 7 or whether the statistical information activation count exceeds the preset statistical information running count threshold. judge. When it exceeds the range of the activation number threshold or the running number threshold, the process proceeds to step S63. If not, the process proceeds to step S61 to search for the next code.

ステップS63では、上記起動回数閾値または走行数閾値の範囲を越えたコードのエントリキー情報と統計情報を統計情報集計テーブルに格納する。統計情報集計テーブルはエントリキー情報と統計情報を格納するための領域を有している。   In step S63, the entry key information and statistical information of the code exceeding the range of the activation number threshold or the running number threshold are stored in the statistical information aggregation table. The statistical information aggregation table has an area for storing entry key information and statistical information.

ステップS64では、対応するコードのエントリテーブルの統計情報をクリアする。
ステップS65ではエントリキテーブルに登録されているコード全てのサーチが完了したかを判定し、完了していればステップS66に移行する。全てのコードのサーチが完了していない場合にはステップS61に移行する。
In step S64, the statistical information in the entry table of the corresponding code is cleared.
In step S65, it is determined whether or not all codes registered in the entry key table have been searched. If completed, the process proceeds to step S66. If not all codes have been searched, the process proceeds to step S61.

ステップS66では、統計情報集計テーブルにデータがあるかを判定する。格納されたコードのエントリキー情報と統計情報からなるデータがある場合にはステップS67に移行する。   In step S66, it is determined whether there is data in the statistical information tabulation table. If there is data including entry key information and statistical information of the stored code, the process proceeds to step S67.

ステップS67では図8に示す高速メモリ更新処理を行う。
図7(A)は、高速メモリ管理情報を格納するメモリ領域の構造を示す図である。高速メモリ管理情報は、高速メモリ102の使用状態を管理する領域とエントリテーブルに登録されているコードを制御する設定値が記録されている。
In step S67, the high-speed memory update process shown in FIG. 8 is performed.
FIG. 7A is a diagram showing the structure of a memory area that stores high-speed memory management information. In the high-speed memory management information, an area for managing the usage state of the high-speed memory 102 and a setting value for controlling a code registered in the entry table are recorded.

高速メモリ管理情報は、高速メモリ最大サイズ、高速メモリ残サイズ、周期時間、周期回数、起動回数閾値、起動回数優先度、走行数閾値、走行数優先度、高速メモリ格納情報から構成されている。   The high-speed memory management information includes a high-speed memory maximum size, a high-speed memory remaining size, a cycle time, a cycle count, a startup count threshold, a startup count priority, a running count threshold, a running count priority, and high-speed memory storage information.

高速メモリ最大サイズには高速メモリ102を使用できる最大サイズが記録されている。
高速メモリ残サイズは、高速メモリ102の現在使用しているメモリの残りのメモリ容量が記録されている。
The maximum size that can use the high-speed memory 102 is recorded in the high-speed memory maximum size.
As the high-speed memory remaining size, the remaining memory capacity of the memory currently used in the high-speed memory 102 is recorded.

周期時間は集計周期処理の起動時間が記録されている。周期回数には、集計処理が何回実行されたかが記録されている。
起動回数閾値にはエントリテーブルに記録されている起動回数と比較するために、予め利用者が設定した値である。また、エントリテーブルに登録したコードごとに起動回数閾値を設けてもよい。
As the cycle time, the start-up time of the counting cycle process is recorded. The number of cycles records how many times the aggregation process has been executed.
The activation count threshold is a value set in advance by the user in order to compare with the activation count recorded in the entry table. In addition, an activation frequency threshold may be provided for each code registered in the entry table.

走行数閾値にはエントリテーブルに記録されている走行数と比較するために、予め利用者が設定した値である。また、エントリテーブルに登録したコードごとに走行数閾値を設けてもよい。   The travel number threshold is a value set in advance by the user in order to compare with the travel number recorded in the entry table. Moreover, you may provide a driving | running | working number threshold value for every code registered into the entry table.

起動回数優先度と走行数優先度は、高速メモリ102へのコード配置の実行開始を起動回数に基づいて実行するか、走行回数に基づいて実行するかを選択する。例えば、フラグを用いて優先度を決める。起動回数を優先する場合にはフラグを立て、走行数を優先する場合にはフラグを立てない。また、起動回数と走行数が上記起動回数閾値と走行数閾値を越えた場合に高速メモリ102へのコード配置を実行するときは、起動回数と走行数用にフラグを設けて、2つのフラグを有効にすることが考えられる。   The activation number priority and the traveling number priority select whether to start executing the code arrangement in the high-speed memory 102 based on the number of activations or based on the number of travelings. For example, the priority is determined using a flag. A flag is set when priority is given to the number of activations, and no flag is set when priority is given to the number of runs. In addition, when code placement in the high-speed memory 102 is executed when the number of activations and the number of runnings exceed the above-mentioned number of activations threshold and the number of runnings threshold, a flag is provided for the number of activations and the number of runnings, and two flags are set. It can be considered to be effective.

高速メモリ格納情報は、各コードに対応する高速メモリ格納コードキー情報、初期コードアドレス値、高速メモリアドレス値、高速メモリ格納統計情報から構成されている。
高速メモリ格納コードキー情報は、高速メモリ102に登録されているコードのエントリキー情報が格納されている。
The high-speed memory storage information includes high-speed memory storage code key information corresponding to each code, an initial code address value, a high-speed memory address value, and high-speed memory storage statistical information.
In the high-speed memory storage code key information, entry key information of a code registered in the high-speed memory 102 is stored.

初期コードアドレス値は、高速メモリ102に配置される前の低速メモリ(フラッシュメモリ103)に配置されていたときの先頭アドレスが記録されている。
高速メモリアドレス値は、高速メモリ102に配置されたコードの先頭アドレスが記録されている。
As the initial code address value, a head address when it is arranged in the low-speed memory (flash memory 103) before being arranged in the high-speed memory 102 is recorded.
As the high-speed memory address value, the head address of the code arranged in the high-speed memory 102 is recorded.

高速メモリ格納統計情報は起動回数と走行回数が記録されている。
図7(B)は、上記統計情報集計テーブルを示し、検出された使用頻度の高いコードのエントリキー情報と統計情報を記録する。
In the high-speed memory storage statistical information, the number of activations and the number of runnings are recorded.
FIG. 7B shows the statistical information tabulation table, which records entry key information and statistical information of the detected frequently used codes.

例えば、記録する順番は古い順にメモリ領域のアドレス番地の番号の小さい方に記録していくことにより古いコードを簡単にサーチすることができる。また、エントリキー情報に登録した順番を記録しておいてもよい。   For example, it is possible to easily search for an old code by recording in the order of recording in ascending order of address number in the memory area. Further, the order of registration in the entry key information may be recorded.

図8は、高速メモリ102へコードを配置する制御フロー示した図である。図9は、フラッシュメモリ103にある関数コードA〜Cのうち関数コードBを高速メモリ102に転送することを示す図である。   FIG. 8 is a diagram showing a control flow for arranging codes in the high-speed memory 102. FIG. 9 is a diagram showing that the function code B among the function codes A to C in the flash memory 103 is transferred to the high-speed memory 102.

ステップS81では高速メモリ102に既にそのコードが配置済みであるかを判定する。
例えば、統計情報集計テーブルに記録されたエントリキー情報に基づいて判定する。
In step S81, it is determined whether the code has already been arranged in the high-speed memory 102.
For example, the determination is made based on the entry key information recorded in the statistical information aggregation table.

エントリテーブルに記録されているコードであり、起動回数または走行数が、設定された起動回数閾値または走行数閾値を越えたコードが、既に高速メモリ102に配置されて
いる場合にはステップS82に移行する。まだ配置されていない場合にはステップS83に移行する。図9では関数コードBが検出される。
If the code recorded in the entry table and the number of activations or the number of runnings exceeds the set number of activations threshold or the running number threshold has already been placed in the high-speed memory 102, the process proceeds to step S82. To do. If not yet arranged, the process proceeds to step S83. In FIG. 9, the function code B is detected.

ステップS82では高速メモリ102に配置するコードの容量以上の空き領域があるかを判定する。空き領域がある場合にはステップS86に移行する。空き領域がない場合にはステップS83に移行する。図9の場合は関数コードBのメモリ容量と空き領域を比較する。   In step S82, it is determined whether or not there is a free area larger than the capacity of the code to be arranged in the high speed memory 102. If there is an empty area, the process proceeds to step S86. If there is no free area, the process proceeds to step S83. In the case of FIG. 9, the memory capacity of the function code B is compared with the free area.

ステップS83では、高速メモリ102に配置されている最も古いコードを削除すると高速メモリ102に空き領域が確保できるかを判定する。削除しても空き領域が確保できない場合にはこのフローを抜ける。メモリ領域を確保できる場合ステップS84に移行する。ここで、最も古いコードの検出は、統計情報集計テーブルに記録されたエントリキー情報の順番などをサーチすることにより判定する。   In step S <b> 83, it is determined whether an empty area can be secured in the high speed memory 102 by deleting the oldest code arranged in the high speed memory 102. If a free area cannot be secured even after deletion, the process exits this flow. If the memory area can be secured, the process proceeds to step S84. Here, the detection of the oldest code is determined by searching the order of entry key information recorded in the statistical information aggregation table.

ステップS84では、最も古いコードに対応するエントリテーブルの統計情報の起動回数と走行数をクリアする。また、最も古いコードに対応するエントリテーブルのエントリキー情報を高速メモリ管理情報の初期コードアドレスを参照して更新する。   In step S84, the number of activations and the number of runnings in the statistical information of the entry table corresponding to the oldest code are cleared. Further, the entry key information in the entry table corresponding to the oldest code is updated with reference to the initial code address of the high-speed memory management information.

ステップS85では、ステップS84において更新したコードに対応する高速メモリ管理情報の高速メモリ格納情報を更新する。つまり、更新したコードに対応する高速メモリアドレスをクリアする。また、高速メモリ残りサイズも更新する。   In step S85, the high-speed memory storage information of the high-speed memory management information corresponding to the code updated in step S84 is updated. That is, the high-speed memory address corresponding to the updated code is cleared. Also, the remaining high-speed memory size is updated.

また、統計情報集計テーブルに記録されている最も古いコードに対応するエントリキー情報と統計情報を削除する。
ステップS86では高速メモリ102に配置するコードを高速メモリ102の空き領域に転送する。図9では関数コードBを転送する。
Also, the entry key information and statistical information corresponding to the oldest code recorded in the statistical information totaling table are deleted.
In step S <b> 86, the code placed in the high speed memory 102 is transferred to an empty area of the high speed memory 102. In FIG. 9, the function code B is transferred.

ステップS87では、起動回数または走行数が設定された起動回数閾値または走行数閾値を越えたことを検出されたコードを配置した高速メモリ102の先頭アドレスを、エントリテーブルのエントリキー情報に反映する。   In step S87, the start address of the high-speed memory 102 in which the code that has been detected that the number of times of starting or the number of runnings exceeds the set number of times of starting threshold or the number of runnings is set is reflected in the entry key information of the entry table.

ステップS88では、検出されたコードを配置した高速メモリ102の先頭アドレスを、高速メモリ管理情報の高速メモリアドレスに反映させる。また、高速メモリ残りサイズも更新する。   In step S88, the start address of the high-speed memory 102 in which the detected code is arranged is reflected in the high-speed memory address of the high-speed memory management information. Also, the remaining high-speed memory size is updated.

なお、上記実施例のフローに示した制御処理は、その制御処理を遂行させる命令が記述されたプログラムをコンピュータに実行させることにより実現することができる。
このプログラムをCD−ROMなどの記憶媒体に記憶しておけば、コンピュータに、そのプログラムをインストールすることにより、制御処理を実現することができる。また、このプログラムを通信ネットワークを介してコンピュータにダウンロードしてもよい。
また、本発明は、上記実施の形態に限定されるものでなく、本発明の要旨を逸脱しない範囲内で種々の改良、変更が可能である。
Note that the control processing shown in the flow of the above embodiment can be realized by causing a computer to execute a program in which an instruction for performing the control processing is described.
If this program is stored in a storage medium such as a CD-ROM, the control process can be realized by installing the program in a computer. Further, this program may be downloaded to a computer via a communication network.
The present invention is not limited to the above-described embodiment, and various improvements and modifications can be made without departing from the gist of the present invention.

(付記1)
アクセス速度が異なるメモリを備えるシステムにおけるメモリへのコード転送方法であって、
前記システムの動作中に、予め指定したコードの使用頻度を集計して統計情報を生成し、
前記統計情報から使用頻度が多い前記コードを検出し、
検出したコードが記録されているメモリよりアクセス速度が速いメモリに、前記検出し
たコードを転送して配置する、
ことを特徴とするメモリへのコード転送方法。
(付記2)
前記統計情報は、起動回数または走行数を有し、
起動回数には予め指定されたコードが起動するごとに起動した回数を記録し、
走行数には前記コードを実行するたびに走行した回数を記録する、
ことを特徴とする付記1に記載のメモリへのコード転送方法。
(付記3)
使用頻度が高い前記コードの検出は、
前記起動回数と予め設定された起動回数閾値を比較して前記起動回数閾値以上であるか否かを検出するか、または前記走行数と予め設定された走行数閾値を比較して前記走行数閾値以上であるか否かを検出する、ことにより使用頻度が高い前記コードを検出することを特徴とする付記2に記載のメモリへのコード転送方法。
(付記4)
前記検出したコードをアクセス速度が速いメモリに転送するとき、
既に前記高速メモリに前記検出したコードがなく、前記高速メモリの空き領域に前記検出したコードを記録できるかを判定し、前記高速メモリに前記検出したコードが転送可能であるときに転送を行うことを特徴とする付記1に記載のメモリへのコード転送方法。
(付記5)
前記高速メモリに空き領域がなければ、前記高速メモリに既に登録されているコードを削除して空き領域を確保し、前記検出したコードを転送することを特徴とする付記5に記載のメモリへのコード転送方法。
(請求項6)
コンピュータに、
アクセス速度が異なるメモリを備えるシステムの動作中に、予め指定したコードの使用頻度を集計して統計情報を生成する処理と、
前記統計情報から使用頻度が多い前記コードを検出する処理と、
検出したコードが記録されているメモリよりアクセス速度が速いメモリに、前記検出したコードを転送して配置する処理と、
を実行させるためのコード転送プログラム。
(付記7)
前記起動回数または前記走行数に優先順をつけることを特徴とする付記2に記載のメモリへのコード転送方法。
(Appendix 1)
A code transfer method to a memory in a system including memories having different access speeds,
During the operation of the system, the usage frequency of the code specified in advance is aggregated to generate statistical information,
Detect the code that is frequently used from the statistical information,
Transferring and arranging the detected code in a memory having a higher access speed than the memory in which the detected code is recorded;
A code transfer method to a memory.
(Appendix 2)
The statistical information includes the number of activations or the number of runs,
Record the number of activations every time a pre-specified code is activated,
Record the number of runs each time the code is executed in the number of runs.
The method for transferring a code to a memory according to appendix 1, wherein:
(Appendix 3)
Detection of the code that is used frequently is
The number of activations is compared with a preset number of activations threshold to detect whether the number of activations is equal to or greater than the number of activations threshold, or the number of travelings is compared with a preset number of runnings threshold The code transfer method to the memory according to appendix 2, wherein the code that is frequently used is detected by detecting whether or not the above is true.
(Appendix 4)
When transferring the detected code to a memory having a high access speed,
Determining whether or not the detected code is already present in the high-speed memory and the detected code can be recorded in an empty area of the high-speed memory, and transferring when the detected code can be transferred to the high-speed memory The method for transferring a code to a memory according to appendix 1, wherein:
(Appendix 5)
6. If there is no free area in the high-speed memory, the code already registered in the high-speed memory is deleted, a free area is secured, and the detected code is transferred. Code transfer method.
(Claim 6)
On the computer,
During the operation of a system having memories with different access speeds, a process of generating statistical information by summing up the frequency of use of codes specified in advance;
A process of detecting the code frequently used from the statistical information;
A process of transferring and arranging the detected code in a memory having a faster access speed than the memory in which the detected code is recorded;
Code transfer program to execute.
(Appendix 7)
The code transfer method to the memory according to appendix 2, wherein priority is given to the number of activations or the number of runnings.

本発明の実施形態によるシステム構成例を示す図である。It is a figure which shows the system configuration example by embodiment of this invention. エントリテーブルの構成を示す図である。It is a figure which shows the structure of an entry table. アプリケーションによって実行される処理を示すフロー図である。It is a flowchart which shows the process performed by an application. 統計情報の収集制御の処理を示すフロー図である。It is a flowchart which shows the process of collection control of statistical information. 統計情報の走行数のカウント制御を示すフロー図である。It is a flowchart which shows count control of the number of driving | running | working of statistical information. 統計情報の集計周期処理の処理制御を示すフロー図である。It is a flowchart which shows the process control of the totaling period process of statistical information. 高速メモリ管理情報の構成を示す図である。It is a figure which shows the structure of high-speed memory management information. 高速メモリへコードを格納する処理を示すフロー図である。It is a flowchart which shows the process which stores a code in a high-speed memory. 低速メモリから高速メモリにコードを転送する図である。It is a figure which transfers a code from low speed memory to high speed memory.

符号の説明Explanation of symbols

101 CPU
102 高速メモリ(高速動作可能なメモリ)
103 フラッシュメモリ
31 アプリケーション
32 OS
33 開始指示
34 収集レジスタ設定
35 統計情報収集処理開始
36 周期タスク生成
37 集計周期処理開始
101 CPU
102 High-speed memory (memory capable of high-speed operation)
103 Flash memory 31 Application 32 OS
33 Start instruction 34 Collection register setting 35 Statistics information collection process start 36 Periodic task generation 37 Aggregation period process start

Claims (6)

アクセス速度が異なるメモリを備えるシステムにおけるメモリへのコード転送方法であって、
前記システムの動作中に、予め指定したコードの使用頻度を集計して統計情報を生成し、
前記統計情報から使用頻度が多い前記コードを検出し、
検出したコードが記録されているメモリよりアクセス速度が速いメモリに、前記検出したコードを転送して配置する、
ことを特徴とするメモリへのコード転送方法。
A code transfer method to a memory in a system including memories having different access speeds,
During the operation of the system, the usage frequency of the code specified in advance is aggregated to generate statistical information,
Detect the code that is frequently used from the statistical information,
Transferring and arranging the detected code in a memory having a higher access speed than the memory in which the detected code is recorded;
A code transfer method to a memory.
前記統計情報は、起動回数または走行数を有し、
起動回数には予め指定されたコードが起動するごとに起動した回数が記録され、
走行数には前記コードを実行するたびに走行した回数が記録される、
ことを特徴とする請求項1に記載のメモリへのコード転送方法。
The statistical information includes the number of activations or the number of runs,
The number of activations is recorded each time a pre-specified code is activated,
The number of runs is recorded every time the code is executed,
The method for transferring code to a memory according to claim 1.
使用頻度が高い前記コードの検出は、
前記起動回数と予め設定された起動回数閾値を比較して前記起動回数閾値以上であるか否かを検出するか、または前記走行数と予め設定された走行数閾値を比較して前記走行数閾値以上であるか否かを検出する、ことにより使用頻度が高い前記コードを検出することを特徴とする請求項2に記載のメモリへのコード転送方法。
Detection of the code that is used frequently is
The number of activations is compared with a preset number of activations threshold to detect whether the number of activations is equal to or greater than the number of activations threshold, or the number of travelings is compared with a preset number of runnings threshold 3. The code transfer method to the memory according to claim 2, wherein the code that is used frequently is detected by detecting whether or not the above is true.
前記検出したコードをアクセス速度が速い高速メモリに転送するとき、
前記高速メモリに前記検出したコードがなく、前記高速メモリの空き領域に前記検出したコードを記録できるかを判定し、前記高速メモリに前記検出したコードが転送可能であるときに転送を行うことを特徴とする請求項1に記載のメモリへのコード転送方法。
When transferring the detected code to a high-speed memory having a high access speed,
Determining whether there is no detected code in the high-speed memory and the detected code can be recorded in an empty area of the high-speed memory, and performing transfer when the detected code can be transferred to the high-speed memory. The method of transferring code to a memory according to claim 1.
前記高速メモリに空き領域がなければ、前記高速メモリに既に登録されているコードを削除して空き領域を確保し、前記検出したコードを転送することを特徴とする請求項5に記載のメモリへのコード転送方法。   6. The memory according to claim 5, wherein if there is no free area in the high-speed memory, a code already registered in the high-speed memory is deleted to secure a free area, and the detected code is transferred. Code transfer method. コンピュータに、
アクセス速度が異なるメモリを備えるシステムの動作中に、予め指定したコードの使用頻度を集計して統計情報を生成する処理と、
前記統計情報から使用頻度が多い前記コードを検出する処理と、
検出したコードが記録されているメモリよりアクセス速度が速いメモリに、前記検出したコードを転送して配置する処理と、
を実行させるためのコード転送プログラム。
On the computer,
During the operation of a system having memories with different access speeds, a process of generating statistical information by summing up the frequency of use of codes specified in advance;
A process of detecting the code frequently used from the statistical information;
A process of transferring and arranging the detected code in a memory having a faster access speed than the memory in which the detected code is recorded;
Code transfer program to execute.
JP2007229472A 2007-09-04 2007-09-04 Code transfer method to memory Withdrawn JP2009064112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007229472A JP2009064112A (en) 2007-09-04 2007-09-04 Code transfer method to memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007229472A JP2009064112A (en) 2007-09-04 2007-09-04 Code transfer method to memory

Publications (1)

Publication Number Publication Date
JP2009064112A true JP2009064112A (en) 2009-03-26

Family

ID=40558666

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007229472A Withdrawn JP2009064112A (en) 2007-09-04 2007-09-04 Code transfer method to memory

Country Status (1)

Country Link
JP (1) JP2009064112A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012248166A (en) * 2011-05-31 2012-12-13 Fuji Electric Co Ltd Program development support device and program thereof
JP2015060589A (en) * 2013-09-18 2015-03-30 インテル・コーポレーション Heterogenous memory access
KR102630168B1 (en) * 2023-06-01 2024-01-29 쿠팡 주식회사 Electronic device and method for managing codes

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012248166A (en) * 2011-05-31 2012-12-13 Fuji Electric Co Ltd Program development support device and program thereof
JP2015060589A (en) * 2013-09-18 2015-03-30 インテル・コーポレーション Heterogenous memory access
US9513692B2 (en) 2013-09-18 2016-12-06 Intel Corporation Heterogenous memory access
KR102630168B1 (en) * 2023-06-01 2024-01-29 쿠팡 주식회사 Electronic device and method for managing codes

Similar Documents

Publication Publication Date Title
Gidra et al. NumaGiC: A garbage collector for big data on big NUMA machines
Nguyen et al. A lightweight infrastructure for graph analytics
US7779054B1 (en) Heuristic-based resumption of fully-young garbage collection intervals
US11016743B2 (en) Runtime state based code re-optimization
EP1668500B1 (en) Methods and apparatuses for thread management of multi-threading
KR100722710B1 (en) A method of scheduling garbage collection
Clifford et al. Memento mori: Dynamic allocation-site-based optimizations
TWI574202B (en) Memory management model and interface for new applications
JP2006092532A (en) Increasing data locality of recently accessed resource
US20050071438A1 (en) Methods and apparatuses for compiler-creating helper threads for multi-threading
US10572181B2 (en) Multiple stage garbage collector
KR20140035416A (en) Memory manager with enhanced application metadata
JP4265610B2 (en) Program control apparatus, program control method, and program recording medium
Yu et al. Performance analysis and optimization of full garbage collection in memory-hungry environments
US8510529B2 (en) Method for generating program and method for operating system
JP2009064112A (en) Code transfer method to memory
JP2006172495A (en) Program control apparatus and method, and program recording medium
JP6135392B2 (en) Cache memory control program, processor incorporating cache memory, and cache memory control method
Moore et al. Automatic generation of program affinity policies using machine learning
Hartmann et al. Efficient code management for dynamic multi-tiered compilation systems
Chakraborty et al. Integrating software caches with scratch pad memory
Mann et al. Study of Energy-Efficient Optimization Techniques for High-Level Homogeneous Resource Management
Patrou NUMA awareness: improving thread and memory management in the JVM
JP5577518B2 (en) Memory management method, computer and memory management program
JP7225900B2 (en) Compiler device, program, and information processing method

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