JP5202472B2 - Instruction placement program, instruction placement apparatus, and instruction placement method - Google Patents

Instruction placement program, instruction placement apparatus, and instruction placement method Download PDF

Info

Publication number
JP5202472B2
JP5202472B2 JP2009182372A JP2009182372A JP5202472B2 JP 5202472 B2 JP5202472 B2 JP 5202472B2 JP 2009182372 A JP2009182372 A JP 2009182372A JP 2009182372 A JP2009182372 A JP 2009182372A JP 5202472 B2 JP5202472 B2 JP 5202472B2
Authority
JP
Japan
Prior art keywords
function
instruction
bank
memory
instructions
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.)
Expired - Fee Related
Application number
JP2009182372A
Other languages
Japanese (ja)
Other versions
JP2010257437A (en
Inventor
俊樹 小原
勝洋 依田
雅彦 都市
信市 石垣
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 Ltd
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Ltd
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 Ltd, Fujitsu Semiconductor Ltd filed Critical Fujitsu Ltd
Priority to JP2009182372A priority Critical patent/JP5202472B2/en
Publication of JP2010257437A publication Critical patent/JP2010257437A/en
Application granted granted Critical
Publication of JP5202472B2 publication Critical patent/JP5202472B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Power Sources (AREA)
  • Stored Programmes (AREA)

Description

この発明は、メモリの省電力を目的とした命令配置プログラム、命令配置装置、および命令配置方法に関する。   The present invention relates to an instruction arrangement program, an instruction arrangement apparatus, and an instruction arrangement method for the purpose of power saving of a memory.

従来より、携帯電話機や小型情報端末など携帯用機器の普及は著しく、これら携帯用機器は、蓄電池からの供給電力によって駆動するという環境上、省電力化技術の開発が積極的に進められている。省電力技術としては、主に携帯用機器のロジック部分の処理負荷の軽減や、処理分散といったロジック部分の効率的な動作を担保する技術が提供されている。ところが、近年では、OSや各種アプリケーションの推奨する動作環境や、処理速度の向上といった観点から携帯用機器に搭載されるメモリの容量も増加傾向にある。したがって、携帯用機器のロジックよりメモリの方が電力、回路規模に与える影響が大きく、メモリに対する省電力化技術に注目が集まっている。   Conventionally, portable devices such as mobile phones and small information terminals have been widely used, and development of power saving technology has been actively promoted in an environment where these portable devices are driven by power supplied from a storage battery. . As a power saving technique, a technique for guaranteeing efficient operation of a logic part such as a reduction in processing load of a logic part of a portable device and processing distribution is mainly provided. However, in recent years, the capacity of the memory mounted on the portable device is also increasing from the viewpoint of the operating environment recommended by the OS and various applications and the improvement of the processing speed. Therefore, the memory has more influence on the power and circuit scale than the logic of the portable device, and attention is focused on the power saving technology for the memory.

すでに提供されている省電力技術としては、メモリを所定の容量ごとのメモリバンクに分割して、使用されていないメモリバンクへの電力供給を動的に制御するという手法が知られている。実際にメモリバンクへの電力供給を制御する場合には、電力が供給される通常モードと電力が供給されないスタンバイモードとの切り替えの間に時間的オーバーヘッドがかかってしまう。そこで、通話状態と待ち受け状態との切り替え状況を解析し、この解析結果を反映させることによってオーバーヘッドをなくしたシステムを構築する技術が開示されている(たとえば、下記特許文献1参照。)。   As a power-saving technique that has already been provided, a technique is known in which a memory is divided into memory banks for each predetermined capacity, and power supply to unused memory banks is dynamically controlled. When the power supply to the memory bank is actually controlled, a time overhead is required between the normal mode in which power is supplied and the standby mode in which power is not supplied. Therefore, a technique for constructing a system that eliminates overhead by analyzing a switching state between a call state and a standby state and reflecting the analysis result is disclosed (for example, see Patent Document 1 below).

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

しかしながら、上述した従来技術の場合、省電力化は図れるものの、適用対象が、通話と待ち受けとが発生する電話機能を備えた携帯型機器に限定されてしまう。一般的に、メモリバンクには、ファームとして提供されている命令を呼び出すためのコードが格納される。したがって、携帯電話端末のように、通話時と待ち受け時と、状況ごとに利用される命令が明確に分類可能であれば、分類した命令を呼び出すための命令コードをそれぞれ異なるメモリバンクへ配置すればよい。   However, in the case of the above-described conventional technology, although power saving can be achieved, the application target is limited to a portable device having a telephone function for generating a call and waiting. Generally, a code for calling an instruction provided as a firmware is stored in a memory bank. Therefore, as in the case of a mobile phone terminal, if the instructions used for each situation can be clearly classified when calling and waiting, if the instruction codes for calling the classified instructions are arranged in different memory banks, Good.

ところが、電話機能をもつ機器以外では、上述したように命令コードを一意的に分類することはできない。結果として、命令コードを分散しても、各メモリバンクに常時電力を供給しなければならなかったり、電力供給先となるメモリバンクの切り替え処理が頻繁に発生してしまい、非効率な電力供給になってしまうという問題があった。   However, the instruction codes cannot be uniquely classified as described above except for devices having a telephone function. As a result, even if the instruction code is distributed, it is necessary to constantly supply power to each memory bank, or the switching process of the memory bank that is the power supply destination frequently occurs, resulting in inefficient power supply. There was a problem of becoming.

本開示技術は、上述した従来技術による問題点を解消するため、装置の機能にかかわらず、メモリバンクへ適切に命令コードを配置して効率的な電力供給を可能にする命令配置プログラム、命令配置装置および命令配置方法と、上述の技術によって命令コードが配置された対象装置によってメモリバンクの省電力化を実現する電力制御システムとを提供することを目的とする。   In order to solve the above-described problems caused by the prior art, the present disclosure provides an instruction placement program and instruction placement that enable efficient power supply by appropriately placing instruction codes in a memory bank regardless of the function of the device. It is an object of the present invention to provide an apparatus, an instruction arrangement method, and a power control system that realizes power saving of a memory bank by a target apparatus in which instruction codes are arranged by the above-described technique.

上述した課題を解決し、目的を達成するため、本開示技術は、コンピュータが、対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する処理と、取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する処理と、前記第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する処理と、作成された配置情報を出力する処理と、を含むことを特徴とする。   In order to solve the above-described problem and achieve the object, the present disclosure provides a process in which a computer acquires a call graph representing a call relationship between instructions in firmware applied to a target device, and the acquired call graph Are classified into the first instruction group located in a predetermined hierarchy or higher from the top and the second instruction group other than the instruction, and the first instruction group. Processing for creating placement information set so that a code for calling an instruction is placed in the first memory bank to which power is always supplied among the memory banks mounted on the target device, and the created placement And a process of outputting information.

本開示技術によれば、コールグラフによって、命令同士の呼び出し関係を特定し、利用頻度の高い命令群とそれ以外の命令群とに分類する。そして、対象装置に搭載されたメモリバンクのうち、常時電力が供給されるメモリバンクへ利用頻度の高い命令群を配置するように設定した配置情報を作成することによって、電力供給先となるメモリバンクを頻繁に切り替えるような事態を避け、効率的な電力制御を図ることができる。   According to the disclosed technique, the call relationship between instructions is specified by a call graph, and is classified into a frequently used instruction group and other instruction groups. Then, among the memory banks installed in the target device, the memory bank that is the power supply destination is created by creating the placement information that is set to place the frequently used instruction group in the memory bank to which power is always supplied Therefore, efficient power control can be achieved by avoiding frequent switching between the two.

本命令配置プログラム、命令配置装置および命令配置方法によれば、装置の機能にかかわらず、メモリバンクへ適切に命令コードを配置して効率的な電力供給を可能にするとともに、本電力制御システムによれば、上述の技術によって命令コードが配置された対象装置によってメモリバンクの省電力化を実現するという効果を奏する。   According to the instruction allocation program, the instruction allocation apparatus, and the instruction allocation method, the instruction code is appropriately allocated to the memory bank regardless of the function of the apparatus to enable efficient power supply and to the power control system. According to this, there is an effect that the power saving of the memory bank is realized by the target device in which the instruction code is arranged by the above technique.

本実施の形態にかかる命令配置処理の概要を示す説明図である。It is explanatory drawing which shows the outline | summary of the instruction arrangement | positioning process concerning this Embodiment. 電力制御システムの構成例を示す説明図である。It is explanatory drawing which shows the structural example of an electric power control system. 再帰的な呼び出しの一例を示す説明図である。It is explanatory drawing which shows an example of a recursive call. MAIN関数が最上位にある構成のファームウェアの一例を示すコールグラフである。6 is a call graph illustrating an example of firmware having a configuration in which a MAIN function is at the highest level. 実際の関数の呼び出し関係を示すコールグラフである。It is a call graph which shows the calling relationship of an actual function. 本実施の形態にかかる命令配置装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the instruction arrangement | positioning apparatus concerning this Embodiment. 本実施の形態にかかる命令配置装置の機能的構成を示すブロック図である。It is a block diagram which shows the functional structure of the instruction arrangement | positioning apparatus concerning this Embodiment. 命令配置処理の手順を示す説明図である。It is explanatory drawing which shows the procedure of a command arrangement | positioning process. 制御装置の構成を示す説明図である。It is explanatory drawing which shows the structure of a control apparatus. 制御信号の構成例を示す説明図である。It is explanatory drawing which shows the structural example of a control signal. 実施例1における配置情報作成手順を示すフローチャート(その1)である。5 is a flowchart (part 1) illustrating a procedure for creating arrangement information according to the first embodiment. 実施例1における配置情報作成手順を示すフローチャート(その2)である。7 is a flowchart (part 2) illustrating a procedure for creating arrangement information according to the first embodiment. 実施例1における配置情報作成手順を示すフローチャート(その3)である。6 is a flowchart (part 3) illustrating the arrangement information creation procedure according to the first embodiment. 実施例1における配置情報作成手順を示すフローチャート(その4)である。10 is a flowchart (part 4) illustrating a procedure for creating arrangement information according to the first embodiment. 実施例1における配置情報作成手順を示すフローチャート(その5)である。10 is a flowchart (part 5) illustrating a procedure for creating arrangement information according to the first embodiment. 分岐数の計数のイメージを示す説明図である。It is explanatory drawing which shows the image of counting of the number of branches. 分岐数2以下と計数された場合の命令配置を示す説明図である。It is explanatory drawing which shows instruction arrangement | positioning when it is counted that the number of branches is 2 or less. 常時ONバンクへの移動例を示す説明図である。It is explanatory drawing which shows the example of a movement to a constantly ON bank. バンク内の容量がオーバーした場合の処理を示す説明図である。It is explanatory drawing which shows a process when the capacity | capacitance in a bank is over. プログラムコードに含まれる関数の静的なコールグラフとメモリマップとの関係を示す説明図である。It is explanatory drawing which shows the relationship between the static call graph of the function contained in a program code, and a memory map. 関数に分岐がない場合の分割位置の算出処理を示す説明図である。It is explanatory drawing which shows the calculation process of the division position when there is no branch in a function. 関数に分岐がある場合の分割位置の算出処理を示す説明図である。It is explanatory drawing which shows the calculation process of the division position when there is a branch in a function. マルチコアによる電力制御システムの構成を示す説明図である。It is explanatory drawing which shows the structure of the electric power control system by a multi-core. マルチコアによる電力制御例を示す説明図である。It is explanatory drawing which shows the example of electric power control by a multi-core. ログの出力手順を示すフローチャートである。It is a flowchart which shows the output procedure of a log. ログのフォーマットを示すデータテーブルである。It is a data table which shows the format of a log. 各関数のデータサイズ例を示す説明図である。It is explanatory drawing which shows the data size example of each function. ログの出力例を示すデータテーブルである。It is a data table which shows the example of a log output. 修正後のログの出力例を示すデータテーブルである。It is a data table which shows the output example of the log after correction. ログを用いたソース修正手順を示すフローチャートである。It is a flowchart which shows the source correction procedure using a log. 実施例4〜9における命令配置装置の機能的構成を示すブロック図である。It is a block diagram which shows the functional structure of the instruction arrangement | positioning apparatus in Examples 4-9. コールグラフの一例を示す説明図である。It is explanatory drawing which shows an example of a call graph. 実施例4における命令配置処理を示す説明図である。FIG. 10 is an explanatory diagram illustrating an instruction arrangement process according to a fourth embodiment. テーブルCのデータ例を示すデータテーブルである。4 is a data table showing a data example of a table C. テーブルSのデータ例を示すデータテーブルである。3 is a data table showing a data example of a table S. テーブルMのデータ例を示すデータテーブルである。4 is a data table showing a data example of a table M. 親関数決定部の詳細な処理を示す説明図である。It is explanatory drawing which shows the detailed process of a parent function determination part. テーブル1の作成例を示すデータテーブルである。It is a data table which shows the example of creation of Table 1. 常時ONメモリ割当部の詳細な処理を示す説明図である。It is explanatory drawing which shows the detailed process of an always ON memory allocation part. 常時ONメモリ割当処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of always ON memory allocation processing. 初期化時のテーブルM_rest・テーブル3のデータ例を示すデータテーブルである。It is a data table which shows the example of data of table M_rest * table 3 at the time of initialization. テーブル2の作成例を示すデータテーブルである。3 is a data table showing an example of creating table 2. テーブル3への割当処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the allocation process to the table 3. テーブルM_restのデータ例を示すデータテーブルである。It is a data table which shows the example of data of table M_rest. テーブル3への割当例を示すデータテーブルである。4 is a data table showing an example of assignment to table 3. 常時ONメモリ割当処理の実行結果を示すデータテーブルである。It is a data table which shows the execution result of always ON memory allocation processing. コード量計算部の詳細な処理を示す説明図である。It is explanatory drawing which shows the detailed process of a code amount calculation part. コード量算出の手順を示すフローチャートである。It is a flowchart which shows the procedure of code amount calculation. テーブル4の作成例を示すデータテーブルである。5 is a data table showing an example of creating table 4. 電力制御メモリ割当部の詳細な処理を示す説明図である。It is explanatory drawing which shows the detailed process of a power control memory allocation part. 電力制御メモリ割当の手順を示すフローチャートである。It is a flowchart which shows the procedure of power control memory allocation. 初期化時のテーブルM_rest・テーブル5のデータ例を示すデータテーブルである。It is a data table which shows the example of data of table M_rest * table 5 at the time of initialization. ソートしたテーブル4を示すデータテーブルである。It is a data table which shows the sorted table 4. テーブル5への割当処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the allocation process to the table 5. 合計コード量に応じたテーブルM_restのデータ例を示すデータテーブルである。It is a data table which shows the example of data of table M_rest according to total code amount. テーブル5に割り当てられたデータ例を示すデータテーブルである。6 is a data table showing an example of data assigned to the table 5. 電力制御メモリの割当処理の実行結果を示すデータテーブルである。It is a data table which shows the execution result of the allocation process of a power control memory. 割当調整・アドレス計算部の詳細な処理を示す説明図である。It is explanatory drawing which shows the detailed process of an allocation adjustment and an address calculation part. 割当調整処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of an allocation adjustment process. 割当調整後のテーブル3のデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table 3 after allocation adjustment. テーブル6−1の出力例を示すデータテーブルである。It is a data table which shows the example of an output of Table 6-1. アドレス計算処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of an address calculation process. 初期化時の配列addrのデータ例を示すデータテーブルである。It is a data table which shows the data example of the array addr at the time of initialization. 常時ONメモリのメモリアドレス設定処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the memory address setting process of always ON memory. 常時ONメモリのアドレス計算開始時のテーブル6・配列addrのデータ例を示すデータテーブルである。It is a data table which shows the data example of the table 6 and the array addr at the time of the start of address calculation of always ON memory. 常時ONメモリのアドレス計算完了時のテーブル6・配列addrのデータ例を示すデータテーブルである。It is a data table which shows the example of a data of the table 6 and array addr at the time of completion of address calculation of always ON memory. 電力制御メモリのメモリアドレス設定処理の手順(その1)を示すフローチャートである。It is a flowchart which shows the procedure (the 1) of the memory address setting process of a power control memory. 電力制御メモリのメモリアドレス設定処理の手順(その2)を示すフローチャートである。It is a flowchart which shows the procedure (the 2) of the memory address setting process of a power control memory. 電力制御メモリのアドレス計算開始時のテーブル6・配列addrのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table 6 and array addr at the time of the address calculation start of a power control memory. 電力制御メモリのアドレス計算実行後のテーブル6・配列addrのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table 6 and array addr after execution of address calculation of a power control memory. 子孫関数についてのアドレス計算時のテーブル6・配列addrのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table 6 and the array addr at the time of address calculation about a descendant function. 子孫関数についてのアドレス計算完了時のテーブル6・配列addrのデータ例を示すデータテーブルである。It is a data table which shows the example of data of Table 6 and array addr at the time of the completion of address calculation about a descendant function. 実施例5における親関数決定部の処理を示す説明図である。It is explanatory drawing which shows the process of the parent function determination part in Example 5. FIG. 重み付け和を利用した親関数決定処理を示す説明図である。It is explanatory drawing which shows the parent function determination process using a weighted sum. 重み付け例を示すデータテーブルである。It is a data table which shows the example of weighting. 実施例6におけるメモリ割当処理を示す説明図である。FIG. 20 is an explanatory diagram illustrating a memory allocation process according to a sixth embodiment. 割当優先度情報付きのメモリ情報のデータ例を示すデータテーブルである。It is a data table which shows the example of data of the memory information with allocation priority information. 常時ONメモリ割当時ソートの手順を示すフローチャートである。It is a flowchart which shows the procedure of the sort at the time of always ON memory allocation. ソート後の割当優先度情報付きのメモリ情報のデータ例を示すデータテーブルである。It is a data table which shows the example of data of the memory information with the allocation priority information after a sort. 電力制御メモリ割当時ソートの手順を示すフローチャートである。It is a flowchart which shows the procedure of the sort at the time of power control memory allocation. 実施例7における電力制御メモリ割当処理を示す説明図である。FIG. 10 is an explanatory diagram illustrating power control memory allocation processing according to a seventh embodiment. 残りメモリ量の評価の手順を示すフローチャートである。It is a flowchart which shows the procedure of evaluation of remaining memory amount. 残りメモリ量の評価時のテーブル5・テーブルM_restのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table 5 and table M_rest at the time of evaluation of remaining memory amount. 実施例8における関数複製処理を示す説明図である。FIG. 20 is an explanatory diagram illustrating function replication processing according to an eighth embodiment. 実施例8における関数複製処理の手順を示すフローチャートである。22 is a flowchart illustrating a procedure of function replication processing according to an eighth embodiment. 関数複製対象となるテーブルCのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table C used as the function replication object. 関数複製済後のテーブルCのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table C after function duplication completed. 実施例9における関数複製処理の手順(その1)を示すフローチャートである。It is a flowchart which shows the procedure (the 1) of the function duplication process in Example 9. 実施例9における関数複製処理の手順(その2)を示すフローチャートである。It is a flowchart which shows the procedure (the 2) of the function duplication process in Example 9. 関数複製済後のテーブルCのデータ例を示すデータテーブルである。It is a data table which shows the example of data of the table C after function duplication completed. 関数複製後のテーブルM_restのデータ例を示すデータテーブルである。It is a data table which shows the example of data of table M_rest after function duplication.

以下に添付図面を参照して、この発明にかかる命令配置プログラム、命令配置装置、および命令配置方法の好適な実施の形態を詳細に説明する。   Exemplary embodiments of an instruction arrangement program, an instruction arrangement apparatus, and an instruction arrangement method according to the present invention will be explained below in detail with reference to the accompanying drawings.

(命令配置処理の概要)
まず、本実施の形態にかかる命令配置処理の概要について説明する。図1は、本実施の形態にかかる命令配置処理の概要を示す説明図である。本実施の形態では、まず、メモリの省電力化を図りたい対象装置に搭載されたメモリバンクの命令コードの配置位置を設定した配置情報105を作成する。
(Outline of instruction placement processing)
First, an overview of the instruction placement process according to the present embodiment will be described. FIG. 1 is an explanatory diagram showing an overview of instruction placement processing according to the present embodiment. In the present embodiment, firstly, the arrangement information 105 in which the instruction code arrangement position of the memory bank mounted on the target device for which power saving of the memory is desired is set is created.

具体的な手順としては、まず対象装置のファームウェアのソース101をコンパイラ110によってコンパイルしてオブジェクト102を抽出する。同時に、コールグラフ作成部120によってソース101から命令同士の呼び出し関係を表すコールグラフ103を作成しておく。その後、命令配置装置100によって、上述のように用意されたオブジェクト102と、コールグラフ103ならびに対象装置に搭載されているメモリバンクの分割状態(総容量いくつのメモリが、それぞれ容量いくつのメモリバンクに分割されているか)を表すメモリ分割情報104が取得されて配置情報105が作成される。作成された配置情報105は、対象装置のメモリバンクへの電力制御システム200における命令コードの配置に利用される。   As a specific procedure, first, the firmware source 101 of the target device is compiled by the compiler 110 to extract the object 102. At the same time, the call graph creation unit 120 creates a call graph 103 representing the call relationship between instructions from the source 101. Thereafter, the instruction allocation device 100 divides the memory 102 mounted in the object 102, the call graph 103, and the target device prepared as described above (the total number of memories into the number of memory banks in each capacity). The memory division information 104 indicating whether the data is divided is acquired, and the arrangement information 105 is created. The created arrangement information 105 is used for instruction code arrangement in the power control system 200 in the memory bank of the target device.

ここで、図2は、電力制御システムの構成例を示す説明図である。図2のように、本実施の形態では、プロセッサ201と、周辺回路202と、電源203と、制御装置204と、メモリバンク(バンク0〜3)205と、バス206とによって構成される対象装置のうち、メモリバンク205への電力制御に関連するハードウェア(電源203、制御装置204およびメモリバンク205)を電力制御システム200として以下説明をおこなう。当然のことながら、図2の構成は対象装置の一例であり、電力制御システム200相当の機能を含んでいれば、プロセッサ201の個数や周辺回路202の内容などは特に限定されない。   Here, FIG. 2 is an explanatory diagram illustrating a configuration example of the power control system. As shown in FIG. 2, in the present embodiment, a target device including a processor 201, a peripheral circuit 202, a power source 203, a control device 204, a memory bank (banks 0 to 3) 205, and a bus 206. Of these, the hardware (power supply 203, control device 204, and memory bank 205) related to power control to the memory bank 205 will be described below as the power control system 200. As a matter of course, the configuration in FIG. 2 is an example of the target device, and the number of processors 201 and the contents of the peripheral circuit 202 are not particularly limited as long as the configuration corresponding to the power control system 200 is included.

また、命令コードを配置するメモリバンクは、大きく2種類に分けられ、常時電力が供給される「常時ONバンク」と、命令コードを読み出す場合にのみ電力が供給される「電力制御バンク」とが用意されているものとする。たとえば、図2のメモリバンク205の場合、バンク0,1が常時ONバンク、バンク2,3が電力制御バンクといったように設定される。   In addition, the memory banks in which the instruction codes are arranged are roughly divided into two types: “always ON banks” to which power is always supplied and “power control banks” to which power is supplied only when reading instruction codes. It shall be prepared. For example, in the case of the memory bank 205 of FIG. 2, the banks 0 and 1 are always set to the ON bank, the banks 2 and 3 are set to the power control bank, and so on.

したがって、メモリバンク205には、それぞれ電力のON/OFFを制御する制御機構として制御装置204が備えられている。なお、対象装置に応じて搭載されているメモリバンク205の総数が異なり、ファームウェア内の命令の構成によっては、常時ONバンクに配置する命令コードの容量も増減し、常時ONバンクの数も変化する。したがって、制御装置204も、メモリバンク205の数に応じた数の用意が必要となる。   Therefore, the memory bank 205 is provided with a control device 204 as a control mechanism for controlling ON / OFF of power. Note that the total number of memory banks 205 mounted differs depending on the target device, and depending on the configuration of instructions in the firmware, the capacity of instruction codes placed in the always-on banks also increases and decreases, and the number of always-on banks also changes. . Accordingly, the control device 204 needs to be prepared in a number corresponding to the number of memory banks 205.

このように、本実施の形態にかかる命令配置処理によって作成された配置情報105を利用するための対象装置のハードウェア構成について説明したが、その他にも、効率的な電力供給を担保した配置情報105を作成するには、ファームウェアの構成として下記のような前提条件を満たす必要がある。   As described above, the hardware configuration of the target device for using the arrangement information 105 created by the instruction arrangement processing according to the present embodiment has been described. In addition, the arrangement information ensures efficient power supply. In order to create 105, the following prerequisites must be satisfied as a firmware configuration.

1)再帰的な呼び出しを含まない
2)ポインタ関数を含まない
3)OSなしでMAIN関数が最上位に位置する構成をもつ
1) Does not include a recursive call 2) Does not include a pointer function 3) Has a configuration in which a MAIN function is positioned at the highest level without an OS

図3は、再帰的な呼び出しの一例を示す説明図である。上記1)の再帰的な呼び出しとは、一旦呼び出された関数がさらに下位の関数によって呼び出される構成を意味する。再帰的な呼び出しが含まれると、後述するコールグラフを作成した場合に、図3のように循環型グラフとなってしまい、適切な命令配置をおこなえない。   FIG. 3 is an explanatory diagram showing an example of a recursive call. The recursive call of the above 1) means a configuration in which a once called function is called by a lower function. When a recursive call is included, when a call graph described later is created, a circular graph is formed as shown in FIG. 3, and appropriate instruction arrangement cannot be performed.

また、上記2)ポインタ関数とは、下記のように命令内に特定のアドレスに格納されている関数を呼び出すような構成の場合、命令の呼び出し対象があちこちに分散してしまう。すなわち、下記func()の中にアドレス0x08000000が入るような構成を指す。   In addition, in the case of the above 2) pointer function, in a configuration in which a function stored at a specific address is called in an instruction as described below, instructions to be called are scattered everywhere. That is, it indicates a configuration in which an address 0x08000000 is placed in the following func ().

Void func()

・・・
IF(FLAG==1)bra 0x08000000
・・・
Voice func ()
{
...
IF (FLAG == 1) bra 0x08000000
...

そして、図4−1は、MAIN関数が最上位にある構成のファームウェアの一例を示すコールグラフである。上記3)のMAIN関数が最上位に位置する構成とは、図4−1のように、MAIN関数が最上位に位置しており、その他の命令を表す関数が階層的に配置されている構成を意味する。なお、図4−2は、実際の関数の呼び出し関係を示すコールグラフである。図4−1に示したコールグラフでは、複数個所で呼び出された関数をそれぞれ別のものとしているため、同一の関数が複数表示されている。実際には、図4−2のように、複数個所で呼び出された関数を1つの点として表しても図4−1と同じ呼び出し関係にて構成されている。   FIG. 4A is a call graph illustrating an example of firmware having a configuration in which the MAIN function is at the highest level. The configuration in which the MAIN function in 3) is positioned at the highest level is a configuration in which the MAIN function is positioned at the highest level and functions representing other instructions are arranged hierarchically as shown in FIG. Means. FIG. 4B is a call graph showing an actual function call relationship. In the call graph shown in FIG. 4A, since the functions called at a plurality of locations are different from each other, a plurality of the same functions are displayed. Actually, as shown in FIG. 4B, even if functions called at a plurality of places are represented as one point, they are configured in the same calling relationship as in FIG.

上述のように、図4−1と図4−2とのいずれのコールグラフも同一の呼び出し関係であり、図4−1のように同じ関数が複数箇所に登場しても、実際には同一の箇所に配置された命令コードによって呼び出される。なお、以下では、視覚的なわかり易さを考慮して、図4−1のように、複数の関数から呼び出される関数をそれぞれ表したコールグラフを用いて、命令配置処理を説明する。   As described above, both call graphs in FIGS. 4-1 and 4-2 have the same call relationship, and even if the same function appears in a plurality of places as in FIG. 4-1, it is actually the same. It is called by the instruction code placed at the location. In the following, in consideration of visual intelligibility, instruction placement processing will be described using a call graph that represents functions called from a plurality of functions as shown in FIG.

(命令配置装置のハードウェア構成)
つぎに、本実施の形態にかかる命令配置装置100のハードウェア構成について説明する。図5は、本実施の形態にかかる命令配置装置のハードウェア構成を示すブロック図である。図5において、命令配置装置100は、CPU(Central Processing Unit)501と、ROM(Read‐Only Memory)502と、RAM(Random Access Memory)503と、磁気ディスクドライブ504と、磁気ディスク505と、通信I/F(Interface)506と、入力デバイス507と、出力デバイス508と、を備えている。また、各構成部はバス510に
よってそれぞれ接続されている。
(Hardware configuration of instruction placement device)
Next, the hardware configuration of the instruction arrangement device 100 according to the present embodiment will be described. FIG. 5 is a block diagram showing a hardware configuration of the instruction arrangement device according to the present exemplary embodiment. In FIG. 5, the instruction placement device 100 includes a CPU (Central Processing Unit) 501, a ROM (Read-Only Memory) 502, a RAM (Random Access Memory) 503, a magnetic disk drive 504, a magnetic disk 505, and a communication. An I / F (Interface) 506, an input device 507, and an output device 508 are provided. Each component is connected by a bus 510.

ここで、CPU501は、命令配置装置100の全体の制御を司る。ROM502は、ブートプログラムや、本実施の形態にかかる命令配置処理を実現するための命令配置プログラムなどの各種プログラムを記憶している。RAM503は、CPU501のワークエリアとして使用される。磁気ディスクドライブ504は、CPU501の制御にしたがって磁気ディスク505に対するデータの更新/参照を制御する。磁気ディスク505は、磁気ディスクドライブ504の制御で書き込まれたデータを記憶する。なお、図5のハードウェア構成では、記録媒体として、磁気ディスク505を用いているが、光ディスクや、フラッシュメモリなど他の記録媒体を利用してもよい。   Here, the CPU 501 governs overall control of the instruction arrangement device 100. The ROM 502 stores various programs such as a boot program and an instruction arrangement program for realizing the instruction arrangement processing according to the present embodiment. The RAM 503 is used as a work area for the CPU 501. The magnetic disk drive 504 controls data update / reference with respect to the magnetic disk 505 according to the control of the CPU 501. The magnetic disk 505 stores data written under the control of the magnetic disk drive 504. In the hardware configuration of FIG. 5, the magnetic disk 505 is used as the recording medium, but other recording media such as an optical disk and a flash memory may be used.

通信I/F506は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク(NET)509に接続され、このネットワーク509を介して他の情報処理装置やその他の外部装置に接続される。そして、通信I/F506は、ネットワーク509と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。通信I/F506の構成例としては、たとえばモデムやLANアダプタなどを採用することができる。   The communication I / F 506 is connected to a network (NET) 509 such as a LAN (Local Area Network), a WAN (Wide Area Network), and the Internet through a communication line, and other information processing apparatuses and other external devices are connected via the network 509. Connected to the device. The communication I / F 506 controls an internal interface with the network 509 and controls input / output of data from an external device. As a configuration example of the communication I / F 506, for example, a modem or a LAN adapter may be employed.

入力デバイス507は、命令配置装置100に対しての外部からの入力を受け付ける。入力デバイス507としては、具体的には、キーボード、マウスなどが挙げられる。キーボードの場合、たとえば、文字、数字、各種指示などの入力のためのキーを備え、データの入力をおこなう。また、タッチパネル式の入力パッドやテンキーなどであってもよい。マウスの場合、たとえば、カーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などをおこなう。また、ポインティングデバイスとして同様に機能を備えるものであれば、トラックボールやジョイスティックなどであってもよい。   The input device 507 accepts an external input to the instruction arrangement device 100. Specific examples of the input device 507 include a keyboard and a mouse. In the case of a keyboard, for example, keys for inputting letters, numbers, and various instructions are provided, and data is input. Moreover, a touch panel type input pad or a numeric keypad may be used. In the case of a mouse, for example, the cursor is moved, a range is selected, or a window is moved or the size is changed. Further, a trackball or a joystick may be used as long as they have the same function as a pointing device.

出力デバイス508は、命令配置処理によって作成された配置情報を出力する。出力デバイス508としては、具体的には、ディスプレイ、プリンタなどが挙げられる。ディスプレイの場合、たとえば、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイとしてさらに、CRT、TFT液晶ディスプレイ、プラズマディスプレイなどを採用することができる。また、プリンタの場合、たとえば、画像データや文書データを印刷する。さらに、レーザプリンタやインクジェットプリンタを採用することができる。   The output device 508 outputs the arrangement information created by the instruction arrangement process. Specific examples of the output device 508 include a display and a printer. In the case of a display, for example, data such as a cursor, an icon or a tool box, a document, an image, and function information is displayed. Further, a CRT, a TFT liquid crystal display, a plasma display, or the like can be employed as this display. In the case of a printer, for example, image data and document data are printed. Further, a laser printer or an ink jet printer can be employed.

(命令配置装置の機能的構成)
つぎに、命令配置装置の機能的構成について説明する。図6は、本実施の形態にかかる命令配置装置の機能的構成を示すブロック図である。図6のように、命令配置装置100は、取得部601と、分類部602と、作成部603と、出力部604と、判断部605と、抽出部606と、算出部607と、を含む構成である。この制御部となる機能(取得部601〜算出部607)は、具体的には、たとえば、図5に示したROM502、RAM503、磁気ディスク505などの記憶領域に記憶された命令配置プログラムをCPU501に実行させることにより、または、通信I/F506により、その機能を実現する。
(Functional configuration of instruction placement device)
Next, a functional configuration of the instruction arrangement device will be described. FIG. 6 is a block diagram showing a functional configuration of the instruction arrangement device according to the present exemplary embodiment. As illustrated in FIG. 6, the instruction arrangement device 100 includes an acquisition unit 601, a classification unit 602, a creation unit 603, an output unit 604, a determination unit 605, an extraction unit 606, and a calculation unit 607. It is. Specifically, the functions (acquisition unit 601 to calculation unit 607) serving as the control unit store, for example, an instruction arrangement program stored in a storage area such as the ROM 502, RAM 503, and magnetic disk 505 shown in FIG. The function is realized by executing or by the communication I / F 506.

取得部601は、対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する機能を有する。コールグラフ103は、図1のように、コールグラフ作成部120などによってあらかじめ作成されている。コールグラフ作成部120は、公知の技術として広く用いられているコールグラフ作成ツール(たとえば、codeviz,gprof,pycallgraphなど)によって実現されるため、詳細な説明は省略する。また、取得されたコールグラフは、RAM503、磁気ディスク505などの記憶領域に記憶される。   The acquisition unit 601 has a function of acquiring a call graph representing a call relationship between instructions in firmware applied to the target device. The call graph 103 is created in advance by the call graph creation unit 120 or the like as shown in FIG. Since the call graph creation unit 120 is realized by a call graph creation tool (for example, codevidz, gprof, pycallgraph, etc.) widely used as a known technique, detailed description thereof is omitted. The acquired call graph is stored in a storage area such as the RAM 503 and the magnetic disk 505.

分類部602は、取得部601によって取得されたコールグラフ103によって表された命令を分類する機能を有する。分類部602は、具体的には、コールグラフ103によって表された命令のうち(たとえば、図4−1のような命令群)、MAIN関数によって表された最上位の命令から所定階層以上に位置する第1の命令群と、第1の命令群以外の第2の命令群とに分類する。たとえば、最上位から2階層以内の命令とそれ以外の命令といったような分類がおこなわれる。なお、分類結果を表すデータは、RAM503、磁気ディスク505などの記憶領域に記憶される。   The classification unit 602 has a function of classifying the instructions represented by the call graph 103 acquired by the acquisition unit 601. Specifically, the classification unit 602 is positioned above a predetermined hierarchy from the highest-level instruction represented by the MAIN function among the instructions represented by the call graph 103 (for example, an instruction group as illustrated in FIG. 4A). And a second instruction group other than the first instruction group. For example, a classification such as an instruction within two layers from the top and other instructions is performed. Data representing the classification result is stored in a storage area such as the RAM 503 and the magnetic disk 505.

このように、分類部602を設けることによって、ファームウェア内の命令を呼び出し頻度の高い命令とそれ以外の命令とに分類することができる。呼び出し頻度の高い命令とそれ以外の命令とに分類するための基本的な手法として、ここでは、コールグラフ103における階層を判断基準としている。なお、分類部602は、呼び出し頻度の高い命令を分類するための手法として他に、後述する判断部605、抽出部606および算出部607による処理結果を利用することもできる(詳しくは、各機能部の説明の際に記述する)。   In this manner, by providing the classification unit 602, it is possible to classify instructions in the firmware into instructions with high call frequency and other instructions. Here, as a basic technique for classifying into instructions with high calling frequency and other instructions, the hierarchy in the call graph 103 is used as a judgment criterion. The classifying unit 602 can also use processing results obtained by a determining unit 605, an extracting unit 606, and a calculating unit 607, which will be described later, as a method for classifying instructions with a high call frequency (for details, refer to each function). In the description of the part).

作成部603は、分類部602による分類結果に応じて命令を呼び出すための命令コードをいずれのメモリバンク205へ配置するかを設定した配置情報105を作成する。具体的には、分類部602によって第1の命令群に分類された命令を呼び出すためのコードを、常時ONバンクへ配置するように設定した配置情報105を作成する。また、作成部603は、第2の命令群(ファームウェア内の命令のうち第1の命令群以外の命令)に分類された命令を呼び出すためのコードを、電力制御バンクへ配置するように設定した配置情報105を作成する。   The creation unit 603 creates the placement information 105 that sets in which memory bank the instruction code for calling up the command according to the classification result by the classification unit 602 is placed. Specifically, the arrangement information 105 set so that the code for calling the instruction classified into the first instruction group by the classification unit 602 is always arranged in the ON bank is created. In addition, the creation unit 603 sets the code for calling the instructions classified into the second instruction group (instructions other than the first instruction group among the instructions in the firmware) to be arranged in the power control bank. The arrangement information 105 is created.

さらに、作成部603は、第2の命令群を呼び出すコードの配置を設定する際に、上位の階層の命令が一致する命令同士を同一の電力制御バンクへ配置するように設定した配置情報を作成する。すなわち、作成部603は、第2の命令群に分類された命令の命令コードをむやみに電力制御バンクのいずれかに配置するような設定を防ぐ。そして、作成部603は、少なくとも、上位の命令が同一の命令同士を、同一の電力制御バンクへ配置するような設定をおこなうことができる。   Furthermore, the creation unit 603 creates placement information that is set so that instructions that match the instructions in the upper hierarchy are placed in the same power control bank when setting the placement of the code that calls the second instruction group. To do. In other words, the creation unit 603 prevents setting such that the instruction codes of the instructions classified into the second instruction group are unnecessarily arranged in any of the power control banks. Then, the creation unit 603 can perform setting so that at least instructions having the same higher order instruction are arranged in the same power control bank.

したがって、図4−1の例では、上位2階層までの命令が第1の命令群に分類された場合、B1から呼び出される下位の命令群(C1,C2,D1〜D3,E1〜E3)を同一の電力制御バンクへ配置し、B2から呼び出される下位の命令群(C3,D2,D4,E2〜E4)を同一の電力制御バンクへ配置するように設定する。なお、作成された配置情報105は、RAM503、磁気ディスク505などの記憶領域に記憶される。   Therefore, in the example of FIG. 4A, when the instructions up to the upper two layers are classified into the first instruction group, the lower instruction groups (C1, C2, D1 to D3, E1 to E3) called from B1 are changed. The lower instruction group (C3, D2, D4, E2 to E4) called from B2 is set to be placed in the same power control bank. The created arrangement information 105 is stored in a storage area such as the RAM 503 and the magnetic disk 505.

このように、作成部603を設けることによって、呼び出し頻度の高い命令(第1の命令群)の命令コードを常時ONバンクへ配置するように設定した配置情報105を作成することができる。呼び出し頻度が高い命令を常時ONバンクに優先的に配置することによって、電力制御バンクに配置されている命令を呼び出す機会が削減される。すなわち、電力が供給されていない可能性のある電力制御バンクに配置された命令を呼び出す頻度を低く抑えることができるため、従来の課題に挙げたようなオーバーヘッドが発生しにくい。   In this way, by providing the creation unit 603, it is possible to create the placement information 105 that is set so that the instruction code of the frequently called instruction (first instruction group) is always placed in the ON bank. By placing instructions with a high calling frequency preferentially in the always-on bank, the opportunity to call instructions placed in the power control bank is reduced. That is, since the frequency of calling instructions arranged in a power control bank that may not be supplied with power can be suppressed to a low level, the overhead described in the conventional problem is unlikely to occur.

出力部604は、作成部603によって作成された配置情報105を出力する機能を有する。出力形式としては、たとえば、出力デバイス508として提供されたディスプレイへの表示、プリンタへの印刷出力、通信I/F506による外部装置への送信がある。また、出力された配置情報105は、RAM503、磁気ディスク505などの記憶領域に記憶される。   The output unit 604 has a function of outputting the arrangement information 105 created by the creation unit 603. The output format includes, for example, display on a display provided as the output device 508, print output to a printer, and transmission to an external apparatus through the communication I / F 506. The output arrangement information 105 is stored in a storage area such as the RAM 503 and the magnetic disk 505.

判断部605は、取得部601によって取得されたコールグラフ103によって表された命令に特定の命令が含まれているか否かを判断する機能を有する。判断部605によって判断される特定の命令は、利用者によって任意に設定可能である。したがって、ファームウェア内の命令の構成に応じて使用頻度の高い命令を特定の命令に設定することができる。また、判断部605による判断結果は、RAM503、磁気ディスク505などの記憶領域に記憶される。なお、判断部605によって、特定の命令が含まれていると判断された場合、作成部603は、常時ONバンクに上述の特定の命令を呼び出すコードを配置するように設定した配置情報を作成する。   The determination unit 605 has a function of determining whether or not a specific command is included in the commands represented by the call graph 103 acquired by the acquisition unit 601. The specific command determined by the determination unit 605 can be arbitrarily set by the user. Therefore, a frequently used instruction can be set as a specific instruction according to the configuration of the instruction in the firmware. The determination result by the determination unit 605 is stored in a storage area such as the RAM 503 and the magnetic disk 505. When the determination unit 605 determines that a specific command is included, the creation unit 603 creates placement information that is set to place a code that calls the specific command in the always-on bank. .

このように、判断部605を設けることによって、コールグラフ103によって表された階層に関係なく、指定した命令の命令コードを常時ONバンクに配置させるように設定した配置情報を作成することができる。したがって、ファームウェアの命令の構成に応じて、柔軟に命令コードの配置を設定することができる。   In this manner, by providing the determination unit 605, it is possible to create arrangement information set so that the instruction code of the designated instruction is always arranged in the ON bank regardless of the hierarchy represented by the call graph 103. Therefore, it is possible to flexibly set the instruction code arrangement in accordance with the firmware instruction configuration.

抽出部606は、取得部601によって取得されたコールグラフ103によって表された命令のうち、所定数以上の命令からの呼び出し対象となっている命令を抽出する機能を有する。所定数は利用者によって適宜設定することができる。したがって、所定数として、たとえば3が設定されている場合、抽出部606は、コールグラフ103の呼び出し関係を参照して3回以上の呼び出し関係が発生している命令を抽出する。また、抽出部606による抽出結果は、RAM503、磁気ディスク505などの記憶領域に記憶される。なお、抽出部606によって、命令が抽出された場合、作成部603は、常時ONバンクに、抽出された命令を呼び出すコードを配置するように設定された配置情報を作成する。   The extraction unit 606 has a function of extracting an instruction that is a call target from a predetermined number or more of the instructions represented by the call graph 103 acquired by the acquisition unit 601. The predetermined number can be appropriately set by the user. Therefore, when 3 is set as the predetermined number, for example, the extracting unit 606 refers to the call relationship of the call graph 103 and extracts an instruction in which the call relationship is generated three times or more. The extraction result by the extraction unit 606 is stored in a storage area such as the RAM 503 and the magnetic disk 505. When an instruction is extracted by the extraction unit 606, the creation unit 603 creates placement information that is set to place a code that calls the extracted command in the always-on bank.

このように、抽出部606を設けることによって、複数の命令から呼び出される可能性のある命令を抽出することができる。複数の命令から呼び出される可能性が高いとは、すなわち、利用頻度が高くなる可能性が高いことを意味している。したがって、抽出部606を備えることによって、上述した判断部605のように、利用者の手作業によって利用頻度が高くなると想定される命令を指定しなくても、自動的に利用頻度の高い命令を抽出することができる。   In this manner, by providing the extraction unit 606, it is possible to extract an instruction that may be called from a plurality of instructions. The high possibility of being called from a plurality of instructions means that the frequency of use is high. Therefore, by providing the extraction unit 606, as in the determination unit 605 described above, a command that is frequently used can be automatically specified without specifying a command that is assumed to be frequently used by the user's manual work. Can be extracted.

算出部607は、配置情報によって常時ONバンクへ配置すると設定されたコードのデータの総量を算出する機能を有する。算出部607によって、あらかじめ、命令コードが配置された場合のデータの総量を算出しておくことによって、命令コードを常時ONバンクに格納できるのか否かを判断することができる。また、算出されたデータは、RAM503、磁気ディスク505などの記憶領域に記憶される。なお、作成部603は、算出部607によって算出されたデータの総量の値に応じて、常時ONバンクの数を変更し、変更後の常時ONバンクに、第1の命令群を呼び出すコードを分散して配置するように設定した配置情報を作成する。   The calculation unit 607 has a function of calculating the total amount of code data set to be always placed in the ON bank according to the placement information. By calculating the total amount of data when the instruction code is arranged in advance by the calculation unit 607, it is possible to determine whether or not the instruction code can always be stored in the ON bank. The calculated data is stored in a storage area such as the RAM 503 and the magnetic disk 505. The creation unit 603 changes the number of always-on banks according to the value of the total amount of data calculated by the calculation unit 607, and distributes the code for calling the first instruction group to the constantly-on banks after the change. Create placement information that is set to be placed.

また、算出部607は、常時ONバンク、電力制御バンクを問わず、配置情報によって同一のメモリバンク205に配置すると設定されたコードごとに、それぞれデータの総量を算出してもよい。また、算出部607によって算出した各バンクのデータの総量は、出力部604によって出力することによって利用者に提供される。   The calculation unit 607 may calculate the total amount of data for each code set to be arranged in the same memory bank 205 according to the arrangement information regardless of the always-on bank or the power control bank. Further, the total amount of data of each bank calculated by the calculation unit 607 is provided to the user by being output by the output unit 604.

このように、算出部607を設けることによって、第1の命令群として分類された命令コードが物理的に常時ONバンクに配置可能か否かを判断できる。また、常時ONバンク以外にも電力制御バンクに配置するために分類した第2の命令群も、それぞれ電力制御バンクに配置可能か否かを判断することができる。この算出結果に基づいて、命令コードが配置できないか(バンクの容量が足りない)、否かを判断して、常時ONバンクや電力制御バンクの数を増減することもでき、効率的なバンク構成が可能となる。   In this manner, by providing the calculation unit 607, it is possible to determine whether or not the instruction code classified as the first instruction group can be physically placed in the always-on bank. In addition to the always-on bank, it can be determined whether the second command group classified for placement in the power control bank can be placed in the power control bank. Based on this calculation result, it is possible to determine whether instruction codes cannot be placed (bank capacity is insufficient) or not, and the number of always-on banks and power control banks can be increased or decreased, making efficient bank configuration Is possible.

(命令配置処理の手順)
つぎに、命令配置装置100による命令配置処理の手順について説明する。図7は、命令配置処理の手順を示す説明図である。図7に示したように、以下の説明では、図4−1に例示したコールグラフ103によって表されるファームウェアの命令コードの配置情報105を作成する場合について説明する。
(Instruction placement procedure)
Next, the procedure of instruction placement processing by the instruction placement apparatus 100 will be described. FIG. 7 is an explanatory diagram showing a procedure of instruction arrangement processing. As shown in FIG. 7, in the following description, a case will be described in which the firmware instruction code arrangement information 105 represented by the call graph 103 illustrated in FIG.

1)
まず、初期設定として、最低1つ以上の常時ONバンクを設定しておく必要があるため、メモリバンク205のうちの1つのバンク(たとえば、バンク0)を常時ONバンクに設定して、電力制御をおこなわないものとする。また、後述する手順によって、電力制御バンクへの配置処理を制御するため、メモリバンク205の総数をN(=4)として設定しておく。
1)
First, since it is necessary to set at least one always-on bank as an initial setting, one of the memory banks 205 (for example, bank 0) is set to the always-on bank to control power. Shall not be performed. In addition, the total number of memory banks 205 is set to N (= 4) in order to control the placement process in the power control bank according to the procedure described later.

2)
つぎに、コールグラフ103のMAIN関数および割り込みハンドラーの呼び出し関係を参照し、直接呼び出し関係にある下位の関数への分岐を順に特定していく。ここで特定された分岐数がN−1のとき、その分岐の直後の関数を各バンクの最上位関数とする。図7の場合、MAIN関数から特定された分岐はB1,B2の2つ、割り込みハンドラーから特定された分岐はB3の1つで、計3つの関数が特定される。そして、上述したように、N=4であるため分岐数=N−1となり、関数B1,B2,B3が最上位関数となる。
2)
Next, referring to the call relationship between the MAIN function and the interrupt handler in the call graph 103, the branch to the lower-order function having the direct call relationship is specified in order. When the number of branches specified here is N-1, the function immediately after the branch is set as the highest function of each bank. In the case of FIG. 7, two branches B1 and B2 are identified from the MAIN function, and one branch B3 is identified from the interrupt handler, for a total of three functions. As described above, since N = 4, the number of branches = N−1, and the functions B1, B2, and B3 are the highest functions.

なお、特定された分岐数がN−1未満のときはMAIN関数からさらに、下位の関数へ移行して分岐を特定する。たとえば、図7の例であれば、B1からさらに、下位のC1,C2やB2からさらに、下位のC3が特定される。下位の分岐を特定後、いまだN−1未満であれば、さらに、下位の関数への分岐を特定して、特定される関数がN−1になるまで、同様の特定処理を繰り返す。   When the specified number of branches is less than N-1, the MAIN function is further shifted to a lower function to specify a branch. For example, in the example of FIG. 7, the lower C3 is further specified from B1, and the lower C1, C2 and B2. After specifying the lower branch, if it is still less than N−1, the branch to the lower function is further specified, and the same specifying process is repeated until the specified function becomes N−1.

なお、下位の関数を特定した際に、逆に分岐数がN−1を超えてしまうような場合には、特定処理を終了し、各分岐先から下位に接続されている関数を呼び出す際の命令コードの合計のサイズを計算する。ただし、サイズを計算する際に、複数の分岐先で使用されている関数分は除く。たとえば、図7において、B1から下位に接続されている関数の合計を求める際、D2,D3,E2,E3は、同じ階層のB2,B3の下位にも接続されている。したがって、B1以下に接続されている命令コードのサイズの合計を計算する場合には、排除される。こうして求めたサイズが大きい方からN−1個を選んで各バンクの最上位関数とする。   If the number of branches exceeds N-1 when a lower function is specified, the specifying process is terminated and a function connected to the lower level from each branch destination is called. Calculate the total size of the instruction code. However, when the size is calculated, functions used in multiple branch destinations are excluded. For example, in FIG. 7, when calculating the sum of the functions connected to the lower level from B1, D2, D3, E2, and E3 are also connected to the lower level of B2 and B3 in the same hierarchy. Therefore, it is excluded when calculating the total size of instruction codes connected to B1 or less. N-1 items are selected from the larger size thus obtained and set as the most significant function of each bank.

3)
上記2)において計算した最上位関数とそれ以下の関数のセットをメモリバンク205のうち電力制御バンクに配置する。そして、残った関数を(MAINや割り込みハンドラーなど)、常時ONバンクに配置する。
3)
The top-level function calculated in the above 2) and a set of functions lower than that are arranged in the power control bank in the memory bank 205. The remaining functions (MAIN, interrupt handler, etc.) are always placed in the ON bank.

4)
上記3)によって大まかな命令コードの配置が完了し、つぎに、関数の内容に応じて、より効率的な配置にするための調整処理がおこなわれる。まず、常時ONバンク以外の電力制御バンクに配置された関数のうち複数のバンクで使用されている関数およびライブラリ関数を常時ONバンクへ移動する。
4)
According to the above 3), the rough instruction code arrangement is completed, and then an adjustment process for more efficient arrangement is performed according to the contents of the function. First, among the functions arranged in the power control banks other than the always-on bank, functions and library functions used in a plurality of banks are moved to the always-on bank.

5)
さらに、常時ONバンクを除く各電力制御バンクのサイズと配置された関数の命令コードの合計を比較する。比較の結果、命令コードが格納できないと判断された電力制御バンクについては、さらに、バンク内の各関数を分割するための処理に移行する。たとえば、バンク内の最上位の関数について下位の接続を参照して、分岐可能な関数を探索する。ここでも、上記2)と同様に、分岐先から下位に接続されている関数を呼び出す際の命令コードの合計のサイズを計算して、電力制御バンクに配置可能となるように分岐を選択する。
5)
Further, the size of each power control bank excluding the always-on bank is compared with the sum of instruction codes of the arranged functions. As a result of the comparison, for the power control bank in which it is determined that the instruction code cannot be stored, the process further proceeds to a process for dividing each function in the bank. For example, a branchable function is searched by referring to the lower level connection for the highest level function in the bank. Again, as in 2) above, the total size of instruction codes for calling a function connected to the lower level from the branch destination is calculated, and the branch is selected so that it can be placed in the power control bank.

6)
つぎに、メモリバンク205のうち、電力制御バンクに配置された最上位関数の先頭部分を電力制御のオーバーヘッドにかかる時間分だけ常時ONに移動する。
6)
Next, in the memory bank 205, the head part of the highest function arranged in the power control bank is always turned ON for the time required for the power control overhead.

7)
その後、常時ONバンクのサイズと配置された関数の命令コードのサイズの合計とを比較する。この比較の結果、命令コードが常時ONバンクに格納しきれないと判断された場合には、メモリバンク205のうち、常時ONバンクの数を増加して、電力制御バンクへの配置処理を上記2)の処理からやり直す。なお、メモリバンク205の実装上、これ以上常時ONバンクが増やせない状況であれば、格納しきれないものとしてそのまま処理を終了する(この結果を利用者に提供することによって、ソース101の修正に利用される)。
7)
Thereafter, the size of the always-on bank is compared with the total size of instruction codes of the arranged functions. As a result of this comparison, if it is determined that the instruction code cannot be stored in the always-on bank, the number of always-on banks in the memory bank 205 is increased, and the placement process in the power control bank is performed as described above. ) If the number of ON banks cannot be increased any more due to the implementation of the memory bank 205, the processing is terminated as it cannot be stored (providing this result to the user to correct the source 101). Used).

8)
以上7)までの処理が完了すると、各メモリバンク205に配置された最上位関数の先頭アドレス(分割後)と終了アドレスを電力制御ON、OFFのトリガとなるアドレスとして出力して配置情報105として供される。なお、図8は、制御装置の構成を示す説明図であり、図9は、制御信号の構成例を示す説明図である。上述のように作成された配置情報105を用いて、図8のような構成の制御装置204による電力制御をおこなう場合、上記8)の処理によって出力された配置情報105のアドレスをハードウェアに設定するコードをスタートアップに追加する。
8)
When the processing up to the above 7) is completed, the top address (after division) and end address of the highest-order function arranged in each memory bank 205 are output as addresses for triggering power control ON and OFF as arrangement information 105. Provided. FIG. 8 is an explanatory diagram showing the configuration of the control device, and FIG. 9 is an explanatory diagram showing a configuration example of the control signal. When power control is performed by the control device 204 configured as shown in FIG. 8 using the layout information 105 created as described above, the address of the layout information 105 output by the process of 8) above is set in hardware. Add code to startup

そして、制御装置204のブート時にアドレスがハードウェアに設定され動的な電力制御が可能になる。電力制御が開始されると、図9に示すように、制御信号のリセット指示に応答して判定処理が実行される。PC(プログラムカウンタ)がONアドレスと一致すると、動作状態となり、OFFアドレスと一致するとスタンバイ状態となる。   Then, when the control device 204 is booted, an address is set in hardware, and dynamic power control becomes possible. When the power control is started, a determination process is executed in response to a control signal reset instruction, as shown in FIG. When the PC (program counter) coincides with the ON address, it enters an operating state, and when it coincides with the OFF address, it enters a standby state.

以上説明したように、本実施の形態にかかる命令配置処理を用いることによって、メモリバンク205ごとに関数をセットするため、常に常時ONバンクのみあるいは常時ONバンク+1バンクのみが稼動状態となり、残りのバンクは、電力制御バンクとなり、通常はスタンバイ状態となる。具体的に説明すると、図7の例では、メモリバンク205の総数が4で、常時ONバンク数が1のとき、個々のメモリバンク205に対して電力制御をおこなわない場合と比較すると、常に2バンク以上がスタンバイ状態となる。したがって、大幅な省電力化が期待できる。   As described above, since the function is set for each memory bank 205 by using the instruction arrangement processing according to the present embodiment, only the always-on bank or only the always-on bank + 1 bank is always in operation, and the remaining The bank is a power control bank and is normally in a standby state. More specifically, in the example of FIG. 7, when the total number of memory banks 205 is 4 and the number of always-on banks is 1, compared to the case where power control is not performed for each memory bank 205, it is always 2 Banks and higher are in standby state. Therefore, significant power saving can be expected.

また、頻繁に呼び出される利用頻度の高い命令を常時ONバンクに集中して配置した配置情報105を作成する。したがって、電力制御バンクへの切り替え回数を抑えてオーバーヘッドを削減させるとともに、電力制御バンクのスタンバイ状態を長く維持できる点でも省電力化効果が期待できる。以下上述した命令配置処理を実現する際の具体例について、いくつか説明する。   Also, the arrangement information 105 is created in which frequently used instructions that are frequently called are always arranged in the ON bank. Accordingly, it is possible to reduce the overhead by reducing the number of times of switching to the power control bank, and it is possible to expect a power saving effect in that the standby state of the power control bank can be maintained for a long time. Several specific examples for realizing the above-described instruction arrangement processing will be described below.

(実施例1)
まず、実施例1として図7にて説明した手順によって配置情報105を作成する際の具体的なロジックの一例について説明する。図10〜14は、実施例1における配置情報作成手順を示すフローチャートである。配置情報105を作成するために、まず、図10のフローチャートにおいて、まず、配置情報105の作成に利用する変数を初期化する(ステップS1001)。
Example 1
First, an example of specific logic when creating the arrangement information 105 according to the procedure described in FIG. 10 to 14 are flowcharts illustrating the arrangement information creation procedure according to the first embodiment. In order to create the arrangement information 105, first, in the flowchart of FIG. 10, first, variables used to create the arrangement information 105 are initialized (step S1001).

ステップS1001では、具体的には、下記の変数が初期化される。
N:メモリバンク205総数
P:各メモリバンク205のサイズ
k:常時ONバンク数
l:コールグラフ103のうち現在到達している分岐数
m,n,i:計数用変数
In step S1001, specifically, the following variables are initialized.
N: Total number of memory banks 205 P: Size of each memory bank 205 k: Number of always-on banks l: Number of branches currently reached in the call graph 103 m, n, i: Variables for counting

そして、変数k=1に設定し(ステップS1002)、メモリバンク205のうち、k個のバンクを常時ONバンクに設定する(ステップS1003)。つぎに、変数l=1に設定し(ステップS1004)、MAIN関数から分岐数lごとに関数個数を計数する(S1005)。ここで、図15は、分岐数の計数のイメージを示す説明図である。図15のように、コールグラフ103の接続状態に応じてMAINから分岐数l=1であれば、関数個数=2、分岐数l=2であれば関数個数=4とそれぞれ計数される。   Then, the variable k is set to 1 (step S1002), and the k banks among the memory banks 205 are always set to ON banks (step S1003). Next, the variable l = 1 is set (step S1004), and the number of functions is counted for each branch number l from the MAIN function (S1005). Here, FIG. 15 is an explanatory diagram showing an image of counting the number of branches. As shown in FIG. 15, according to the connection state of the call graph 103, if the number of branches is 1 = 1, the number of functions is counted as 2, and if the number of branches is 1 = 2, the number of functions is counted as 4.

つぎに、分岐数lにおける関数個数とN−1とを比較する(ステップS1006)。N−1とは、すなわち、メモリバンク205のうち、常時ONバンクを除いた電力制御バンクの総数を意味する。そして、ステップS1006において、関数個数とN−1とが等しいと判断された場合(ステップS1006:Yes)、図12のステップS1201の処理に移行する。   Next, the number of functions in the branch number l is compared with N−1 (step S1006). In other words, N−1 means the total number of power control banks in the memory bank 205 excluding the always-on bank. If it is determined in step S1006 that the number of functions is equal to N−1 (step S1006: Yes), the process proceeds to step S1201 in FIG.

一方、ステップS1006において、関数個数とN−1とが等しくないと判断された場合(ステップS1006:No)、関数個数がN−1よりも少ないか否かを判断する(ステップS1007)。ここで、関数個数がN−1よりも少ないと判断された場合(ステップS1007:Yes)、電力制御バンクに余裕があるため、関数個数を増加させるため、分岐数lを1インクリメントして(ステップS1008)、再度、ステップS1005の処理をおこなう。   On the other hand, if it is determined in step S1006 that the number of functions is not equal to N-1 (step S1006: No), it is determined whether the number of functions is less than N-1 (step S1007). Here, if it is determined that the number of functions is smaller than N−1 (step S1007: Yes), the power control bank has a margin, so the number of branches 1 is incremented by 1 to increase the number of functions (step S1007). S1008) The process of step S1005 is performed again.

ステップS1007において、関数個数がN−1よりも少なくないと判断された場合(ステップS1007:No)は、すなわち、関数個数が電力制御バンクよりも多い場合を表している(ステップS1006の判断において、同数ではないと判断されているため)。したがって、つぎに、図11のステップS1101の処理に移行する。   When it is determined in step S1007 that the number of functions is not smaller than N−1 (step S1007: No), that is, the number of functions is larger than that of the power control bank (in the determination of step S1006). Because it is judged that the number is not the same). Therefore, the process proceeds to step S1101 in FIG.

図11のフローチャートにおいて、まず、変数m,nを0に設定する(ステップS1101)。つぎに、MAIN関数からl分岐後のm番目の関数から分岐された関数のn番目func[m][n]が他でも使用されている関数か否かを判断する(ステップS1102)。上述のように、m,nは初期値0に設定されているため、後述する処理に応じてm,nの値は加算され、すべての関数に関して漏らすことなくステップS1102の判断がおこなわれる。   In the flowchart of FIG. 11, first, variables m and n are set to 0 (step S1101). Next, it is determined whether or not the nth func [m] [n] of the function branched from the mth function after l branching from the MAIN function is a function that is used elsewhere (step S1102). As described above, since m and n are set to the initial value 0, the values of m and n are added according to the processing described later, and the determination in step S1102 is performed without leaking all functions.

ステップS1102において、指定された関数が他では使用されていないと判断された場合(ステップS1102:No)、m配下の命令コードの量について、累積加算をおこなう。すなわち、仮サイズ[m]=仮サイズ[m]+(func[m][n]のサイズ)とする(ステップS1103)。ステップS1103において、仮サイズが求められた場合、もしくはステップS1102において、指定された関数が他では使用されていないと判断された場合(ステップS1102:Yes)、m番目の関数の配下をすべて数えたか否かを判断する(ステップS1104)。   If it is determined in step S1102 that the designated function is not used elsewhere (step S1102: No), cumulative addition is performed for the amount of instruction code under m. That is, provisional size [m] = provisional size [m] + (size of func [m] [n]) (step S1103). If the provisional size is obtained in step S1103, or if it is determined in step S1102 that the specified function is not used elsewhere (step S1102: Yes), all the subordinates of the mth function have been counted. It is determined whether or not (step S1104).

ステップS1104において、いまだに数えていない関数があると判断された場合は(ステップS1104:No)、nを1インクリメントして(ステップS1108)、ステップS1102の処理に移行する。一方、ステップS1104において、すべての関数について数え終えたと判断された場合(ステップS1104:Yes)、変数mが分岐数l−1よりも小さいか否かを判断する(ステップS1105)。ここで、小さいと判断された場合は(ステップS1105:Yes)、mを1インクリメントして(ステップS1106)、ステップS1102の処理に移行する。   If it is determined in step S1104 that there is a function that has not yet been counted (step S1104: No), n is incremented by 1 (step S1108), and the process proceeds to step S1102. On the other hand, when it is determined in step S1104 that all functions have been counted (step S1104: Yes), it is determined whether or not the variable m is smaller than the branch number l-1 (step S1105). If it is determined that the value is smaller (step S1105: Yes), m is incremented by 1 (step S1106), and the process proceeds to step S1102.

一方、ステップS1105において、変数mが分岐数l−1よりも小さくないと判断された場合(ステップS1105:No)、コードサイズとして、上位l−1におけるサイズを抽出する(ステップS1107)。ここで抽出されるコードサイズは、ステップS1103において算出された仮サイズ[m]の上位l−1個を抽出したサイズとなる。ここで、図16は、分岐数2以下と計数された場合の命令配置を示す説明図である。このように、コードサイズが特定されると、図12のステップS1201の処理に移行する。   On the other hand, if it is determined in step S1105 that the variable m is not smaller than the branch number l-1 (step S1105: No), the size in the upper l-1 is extracted as the code size (step S1107). The code size extracted here is the size obtained by extracting the top l-1 pieces of the temporary size [m] calculated in step S1103. Here, FIG. 16 is an explanatory diagram showing an instruction arrangement when it is counted that the number of branches is 2 or less. Thus, when the code size is specified, the process proceeds to step S1201 in FIG.

図16のように、MAIN関数から分岐数l=1に移行した後(S1)、N−1との比較によってさらに分岐数l=2に移行した場合(S2)、B1に着目すると、B1をm=0の関数とした場合、m=0の配下の関数としてB2,C1が特定される。このとき、B2がn=0の関数となり、C1がn=1の関数となり、B1,B2,C1がm=0配下の関数1600として図11にて説明した処理が施される。   As shown in FIG. 16, after shifting from the MAIN function to the number of branches l = 1 (S1) and further shifting to the number of branches l = 2 by comparison with N−1 (S2), when B1 is focused, B1 is When the function is m = 0, B2 and C1 are specified as functions under the control of m = 0. At this time, B2 becomes a function of n = 0, C1 becomes a function of n = 1, and B1, B2, and C1 are processed as described in FIG. 11 as a function 1600 under m = 0.

図12のフローチャートにおいて、まず、コードサイズ上位l−1個に入らなかった関数を常時ONバンクに移動する(ステップS1201)。その後、変数nを1に設定し(ステップS1202)、バンクnに配置された関数の中でバンクn以外でも使用されているものを常時ONバンクへ移動する(ステップS1203)。   In the flowchart of FIG. 12, first, a function that does not fall into the code size upper l−1 is always moved to the ON bank (step S1201). Thereafter, the variable n is set to 1 (step S1202), and the functions used in the bank n other than the bank n are always moved to the ON bank (step S1203).

最後に、変数nがメモリバンク205の総数Nよりも小さいか否かを判断し(ステップS1204)、小さいと判断された場合には(ステップS1204:Yes)、nをインクリメントして(ステップS1205)、あらたに設定されたnに基づいて、ステップS1203の処理をおこなう。そして、変数nがメモリバンクの総数Nよりも小さくはないと判断された場合(ステップS1204:No)、図13の、ステップS1301の処理に移行する。   Finally, it is determined whether or not the variable n is smaller than the total number N of memory banks 205 (step S1204). If it is determined that the variable n is smaller (step S1204: Yes), n is incremented (step S1205). Based on the newly set n, the process of step S1203 is performed. If it is determined that the variable n is not smaller than the total number N of memory banks (step S1204: No), the process proceeds to step S1301 in FIG.

ここで、図17は、常時ONバンクへの移動例を示す説明図である。図17のように、コードサイズ上位l−1に入らなかったMAIN関数並びにA1,A2は、常時ONバンクであるバンク0に配置される。また、図12の処理によってm=0の配下に特定された関数であっても、他で使用される命令B2,C1は、同じく常時OBバンクであるバンク0に移動される。   Here, FIG. 17 is an explanatory diagram showing an example of movement to the always-on bank. As shown in FIG. 17, the MAIN function and A1 and A2 that did not enter the upper code size 1-1 are placed in bank 0, which is always the ON bank. Even if the function is specified under m = 0 by the processing of FIG. 12, the instructions B2 and C1 used elsewhere are always moved to bank 0, which is also an OB bank.

つぎに、図13のフローチャートにおいて、まず変数nを常時ONバンクkの値に設定し(ステップS1301)、変数mを0に設定する(ステップS1302)。なお、ここで利用するmは思考回数(処理の実行回数)を意味する。さらに、計数用の変数iを1に設定する(ステップS1303)。そして、上位階層からi番目の階層は常時ONバンクに移動させたか否かを判断する(ステップS1304)。   Next, in the flowchart of FIG. 13, first, the variable n is always set to the value of the ON bank k (step S1301), and the variable m is set to 0 (step S1302). Note that m used here means the number of times of thinking (number of times of execution of processing). Further, the counting variable i is set to 1 (step S1303). Then, it is determined whether or not the i-th layer from the upper layer is always moved to the ON bank (step S1304).

ここで、上位階層からi番目の階層は常時ONバンクに移動させていないと判断された場合(ステップS1304:No)、つぎに、バンク内の関数を計数する(ステップS1305)。そして、計数結果に基づいて、バンク内の関数がメモリバンク205に収まるか否かを判断する(ステップS1306)。ここで、収まると判断された場合(ステップS1306:Yes)、さらに、変数nがメモリバンク205の総数Nよりも小さいか否かを判断する(ステップS1307)。ここで、小さくないと判断された場合(ステップS1307:No)、そのまま図14のステップS1401の処理に移行する。   If it is determined that the i-th hierarchy from the upper hierarchy is not always moved to the ON bank (step S1304: No), the functions in the bank are counted (step S1305). Then, based on the counting result, it is determined whether or not the function in the bank fits in the memory bank 205 (step S1306). Here, when it is determined that the value falls within the range (step S1306: Yes), it is further determined whether the variable n is smaller than the total number N of the memory banks 205 (step S1307). If it is determined that the value is not small (step S1307: NO), the process directly proceeds to step S1401 in FIG.

一方、ステップS1307において、変数nがメモリバンク205の総数Nよりも小さいと判断された場合(ステップS1307:Yes)、nを1インクリメントして(ステップS1308)、ステップS1302の処理に移行する。また、ステップS1304において、上位階層からi番目の階層は常時ONバンクに移動させていると判断された場合(ステップS1304:Yes)はそのまま、またステップS1306において、バンク内の関数がメモリバンクに収まらないと判断された場合(ステップS1306:No)、mを1インクリメントして(ステップS1309)、それぞれステップS1310の処理に移行する。   On the other hand, if it is determined in step S1307 that the variable n is smaller than the total number N of memory banks 205 (step S1307: Yes), n is incremented by 1 (step S1308), and the process proceeds to step S1302. If it is determined in step S1304 that the i-th layer from the upper layer is always moved to the ON bank (step S1304: Yes), the function in the bank is not stored in the memory bank in step S1306. If it is determined that there is not (step S1306: No), m is incremented by 1 (step S1309), and the process proceeds to step S1310.

ステップS1310では、まず、iを1インクリメントする(ステップS1310)。そして、つぎに、上位階層からi番目の関数があるか否かを判断する(ステップS1311)。ここで、上位階層からi番目の関数がないと判断された場合(ステップS1311:No)、さらに、上位階層からi+1番目の関数があるか否かを判断する(ステップS1312)。   In step S1310, first, i is incremented by 1 (step S1310). Next, it is determined whether or not there is an i-th function from the upper layer (step S1311). If it is determined that there is no i-th function from the upper layer (step S1311: No), it is further determined whether there is an i + 1-th function from the upper layer (step S1312).

ステップS1312において、上位階層からi+1番目の関数がないと判断された場合(ステップS1312:No)、サイズ=0として(ステップS1313)、ステップS1307の処理に移行する。一方、上位階層からi+1番目の関数があると判断された場合(ステップS1312:Yes)、ステップS1310に移行してiを1インクリメントする。   In step S1312, when it is determined that there is no i + 1-th function from the upper layer (step S1312: No), the size is set to 0 (step S1313), and the process proceeds to step S1307. On the other hand, when it is determined that there is an i + 1-th function from the upper layer (step S1312: Yes), the process proceeds to step S1310 and i is incremented by one.

そして、ステップS1311において、上位階層からi番目の関数があると判断された場合(ステップS1311:Yes)、さらに、上位階層からi番目の関数は1個か否かを判断する(ステップS1314)。ここで、上位階層からi番目の関数は1個であるとい判断された場合は(ステップS1314:Yes)、ステップS1305の処理に移行する。   If it is determined in step S1311 that there is an i-th function from the upper layer (step S1311: Yes), it is further determined whether there is one i-th function from the upper layer (step S1314). If it is determined that there is one i-th function from the upper layer (step S1314: YES), the process proceeds to step S1305.

一方、ステップS1314において、上位階層からi番目の関数は1個ではないと判断された場合(ステップS1314:No)、さらに、i番目の深さで最もサイズの大きい分岐を選択する(ステップS1315)。そして、i番目階層以降で選択された関数、すなわち、ステップS1315にて選択された関数以外の関数を常時ONバンクに移動し(ステップS1316)、ステップS1305の処理に移行する。   On the other hand, if it is determined in step S1314 that there is not one i-th function from the upper layer (step S1314: No), the branch having the largest size at the i-th depth is selected (step S1315). . Then, functions selected in the i-th hierarchy and thereafter, that is, functions other than the function selected in step S1315 are always moved to the ON bank (step S1316), and the process proceeds to step S1305.

このように、図13に示した処理によって、命令配置装置100では、バンク内に配置する命令コードの合計がオーバーフローしないように調整することができる。ここで、図18は、バンク内の容量がオーバーした場合の処理を示す説明図である。たとえば、メモリバンク205の1個あたりの容量が16[Kbyte]の場合、図18のように、バンク1に配置した命令の上位の命令B1のサイズが16[Kbyte]を上回った時点で、下位の命令B2,C1は常時ONバンクに移動される。また、バンク3のように、配置された命令の合計サイズが16[Kbyte]を上回ってしまった場合には、サイズの最も小さいC4を常時ONバンクに移動させる。すなわち、バンク3には、B3,C3の組み合わせが配置されることになり、合計サイズは13[Kbyte]となる。したがって、バンク3の中になるべく空き領域が発生しないような配置になっている。   As described above, the processing shown in FIG. 13 allows the instruction placement apparatus 100 to adjust so that the sum of the instruction codes placed in the bank does not overflow. Here, FIG. 18 is an explanatory diagram showing processing when the capacity in the bank is over. For example, when the capacity per memory bank 205 is 16 [Kbytes], when the size of the upper instruction B1 of the instructions arranged in the bank 1 exceeds 16 [Kbytes] as shown in FIG. The commands B2 and C1 are always moved to the ON bank. Further, when the total size of the arranged instructions exceeds 16 [Kbytes] as in the bank 3, the smallest C4 is always moved to the ON bank. That is, the combination of B3 and C3 is arranged in the bank 3, and the total size is 13 [Kbytes]. Therefore, the arrangement is such that as much free space as possible is not generated in the bank 3.

そして、図14のフローチャートにおいて、まず、各バンクの最上位関数の先頭部分を常時ONバンクへ移動する(ステップS1401)。このステップS1401をおこなうには、対象となる関数を分割する必要がある。したがって、ここで、図19〜21を用いて、上位関数の先頭部分を分割するための処理について説明する。   In the flowchart of FIG. 14, first, the head portion of the highest function of each bank is always moved to the ON bank (step S1401). In order to perform this step S1401, it is necessary to divide the target function. Therefore, the process for dividing the top part of the upper function will be described with reference to FIGS.

図19は、プログラムコードに含まれる関数の静的なコールグラフとメモリマップとの関係を示す説明図である。図19に示した例では、メモリ0を常時ONバンクとしてメイン関数funcMが配置されている。またメモリ0には、メイン関数funcMに呼び出される関数func1と関数func2の一定電圧部Z1、Z2が配置されている。またメモリ0には、関数func1、関数func2に呼び出されるその他の関数func3が配置されている。一方、メモリ1、メモリ2は、電力制御バンクとして機能するメモリであり、関数func1と関数func2の低電圧部K1、K2が配置されている。   FIG. 19 is an explanatory diagram showing a relationship between a static call graph of a function included in a program code and a memory map. In the example shown in FIG. 19, the main function funcM is arranged with the memory 0 being always ON bank. Further, the memory 0 is provided with constant voltage portions Z1 and Z2 of a function func1 and a function func2 called by the main function funcM. Further, in the memory 0, another function func3 called by the function func1 and the function func2 is arranged. On the other hand, the memories 1 and 2 are memories that function as power control banks, and low voltage portions K1 and K2 of the functions func1 and function func2 are arranged.

図14のステップS1401の処理では、電力制御バンクの上位関数として分類された関数は、図19の関数func1、関数func2のように、分割され一部分を常時ONバンクに配置させるものである。ここで、図20は、関数に分岐がない場合の分割位置の算出処理を示す説明図である。そして、図21は、関数に分岐がある場合の分割位置の算出処理を示す説明図である。   In the process of step S1401 of FIG. 14, the functions classified as the upper functions of the power control bank are divided and always placed in the ON bank as in the functions func1 and func2 of FIG. Here, FIG. 20 is an explanatory diagram showing the calculation processing of the division position when there is no branch in the function. FIG. 21 is an explanatory diagram illustrating a division position calculation process when the function has a branch.

図19のように関数を分割する場合、関数に分岐がない場合とある場合とを考慮する必要がある。まず、図20の(A)のように分岐のない関数の場合、まず、所定のサイクル数Nを設定する。これは電力制御によるオーバーヘッドにかかるサイクル数である。そして、(B)のように一命令を実行するサイクルを一サイクルとし、Nサイクル内の命令を辿った際に、分岐点を通過して到達し得る最も遠いアドレスを最遠アドレスとし、このアドレス部分を分割点として分割する。   When dividing a function as shown in FIG. 19, it is necessary to consider whether the function has no branch or not. First, in the case of a function having no branch as shown in FIG. 20A, first, a predetermined number of cycles N is set. This is the number of cycles for overhead due to power control. As shown in (B), a cycle for executing one instruction is defined as one cycle, and when the instruction in N cycles is traced, the farthest address that can be reached through the branch point is defined as the farthest address. Divide a part as a division point.

また、図21の(A)のように分岐のある関数の場合も基本的には、上述したように、分岐がない場合と同様にサイクル数Nを設定するが、このとき、分岐によって生じる各経路を探索する。図21の場合、経路1と経路2とが生じるため、(B)のように各経路についてNサイクルで到達しうる最も遠いアドレスを求め、これが分割点となり、関数が分割される。   Also, in the case of a function having a branch as shown in FIG. 21A, basically, as described above, the cycle number N is set in the same manner as in the case where there is no branch. Search for a route. In the case of FIG. 21, since a route 1 and a route 2 are generated, the farthest address that can be reached in N cycles is obtained for each route as shown in (B), and this becomes a dividing point, and the function is divided.

図14のフローチャートに戻り、ステップS1401の処理が完了すると、つぎに、常時ONバンクのサイズがP未満か否かを判断する(ステップS1402)。このステップS1402において、常時バンクのサイズがP未満であると判断された場合(ステップS1402:Yes)、電力制御バンクの最上位関数の先頭アドレス(ステップS1401による分割後)と、終了アドレスとを配置情報105として出力する(ステップS1403)。そして、最後に、配置情報105に、ステップS1401において分割した箇所に分岐命令を追加して(ステップS1404)一連の処理を終了する。   Returning to the flowchart of FIG. 14, when the process of step S1401 is completed, it is next determined whether or not the size of the always-on bank is less than P (step S1402). If it is determined in step S1402 that the size of the bank is always less than P (step S1402: Yes), the top address of the highest function of the power control bank (after division in step S1401) and the end address are arranged. It outputs as the information 105 (step S1403). Finally, a branch instruction is added to the arrangement information 105 at the location divided in step S1401 (step S1404), and the series of processing ends.

一方、ステップS1402において、常時ONバンクのサイズがP未満ではないと判断された場合(ステップS1402:No)、さらに、常時バンクのサイズがPより大きいか否かを判断する(ステップS1405)。ここで、そして、常時ONバンクのサイズがPより大きいと判断された場合は(ステップS1405:Yes)、常時ONバンクの数が足りないと判断され、常時ONバンク数kが1インクリメントされ(ステップS1406)、再度、図10のステップS1001の処理からやり直される。一方、ステップS1405において、常時ONバンクのサイズがPより大きくはないと判断された場合(ステップS1405:No)、常時ONバンクの数は足りないものの、これ以上常時ONバンクを増やせない状態であると判断され、最適な配置情報105を作成できないまま解なしとして(ステップS1407)、一連の処理を終了する。   On the other hand, if it is determined in step S1402 that the always-on bank size is not less than P (step S1402: No), it is further determined whether or not the always-bank size is larger than P (step S1405). If it is determined that the size of the always-on bank is larger than P (step S1405: Yes), it is determined that the number of always-on banks is insufficient, and the number of always-on banks k is incremented by 1 (step S1405). S1406), the processing from step S1001 in FIG. 10 is started again. On the other hand, if it is determined in step S1405 that the size of the always-on bank is not larger than P (step S1405: No), the number of always-on banks is insufficient, but the number of always-on banks cannot be increased any more. It is determined that there is no solution without creating the optimal arrangement information 105 (step S1407), and the series of processes is terminated.

以上説明したように、実施例1では、図10〜14に示したアルゴリズムに基づいて、コールグラフ103によって表された関数を常時ONバンクと電力制御バンクとのいずれかから効率的に呼び出すために設定された配置情報105を作成することができる。   As described above, in the first embodiment, in order to efficiently call the function represented by the call graph 103 from either the always-on bank or the power control bank based on the algorithm shown in FIGS. The set arrangement information 105 can be created.

(実施例2)
実施例2では、マルチコアを備えた対象装置に適応するファームウェアの命令コードを配置する際の配置情報105の作成について説明する。図22は、マルチコアによる電力制御システムの構成を示す説明図である。図22のように、電力制御システム2200の場合には、複数のプロセッサ201によってそれぞれ独立して命令コードの呼び出しがおこなわれる。
(Example 2)
In the second embodiment, the creation of the placement information 105 when placing the firmware instruction code adapted to the target device having a multi-core will be described. FIG. 22 is an explanatory diagram showing a configuration of a multi-core power control system. As shown in FIG. 22, in the case of the power control system 2200, the instruction codes are called independently by the plurality of processors 201.

したがって、電力制御システム2200の場合は、複数のプロセッサ201のうち、プロセッサ1を主体とするコア1と、プロセッサ2を主体とするコア2との呼び出し動作に分けて、それぞれ配置情報105を作成して、メモリバンク205に適用させる。   Therefore, in the case of the power control system 2200, among the plurality of processors 201, the arrangement information 105 is created for each of the call operations of the core 1 mainly including the processor 1 and the core 2 mainly including the processor 2. And applied to the memory bank 205.

ここで、図23は、マルチコアによる電力制御例を示す説明図である。図23のようにマルチコアの場合には、コア1用の配置情報105とコア2用の配置情報105とをそれぞれ作成するため、メモリバンク205も、あらかじめコア1用とコア2用とに分類しておく必要がある。さらに、通信用関数をMAIN関数と同様に最上位にもってきてツリーを構成することでシングルコアを各コア(コア1,2)に適用可能である。このとき、コアごとに使用バンクが分かれていない場合には、トップのMAIN関数と通信用関数がコアの数分あると考えてそれぞれ配置させれば、実施例1にて説明した処理をそのまま適用することができる。   Here, FIG. 23 is an explanatory diagram illustrating an example of power control by multi-core. In the case of multi-core as shown in FIG. 23, in order to create the arrangement information 105 for the core 1 and the arrangement information 105 for the core 2, respectively, the memory bank 205 is also classified into the core 1 and the core 2 in advance. It is necessary to keep. Furthermore, a single core can be applied to each core (cores 1 and 2) by bringing the communication function to the top as in the MAIN function and forming a tree. At this time, if the use bank is not divided for each core, the processing described in the first embodiment is applied as it is if the top MAIN function and the communication function are considered to be as many as the number of cores. can do.

(実施例3)
実施例3では、配置情報105の作成の際にメモリバンク205内のデータ量に関するログを利用した命令配置を最適化する。実施例1にて説明したように、本実施の形態では、配置情報105を作成する際に、図10〜14のアルゴリズムが利用されている。実施例3では、このアルゴリズムにおけるバンク内のサイズ比較に関する処理結果をログとして出力させる。出力されたログは、より効率的な配置情報105を作成するため、ファームウェアのソースの構成自体の修正に利用される。
(Example 3)
In the third embodiment, the instruction arrangement using the log regarding the data amount in the memory bank 205 is optimized when the arrangement information 105 is created. As described in the first embodiment, in the present embodiment, the algorithm shown in FIGS. 10 to 14 is used when the arrangement information 105 is created. In the third embodiment, the processing result relating to the size comparison in the bank in this algorithm is output as a log. The output log is used to correct the configuration of the firmware source itself in order to create more efficient arrangement information 105.

図24は、ログの出力手順を示すフローチャートである。図24のフローチャートは、図13の処理を表すフローチャートである。実施例3では、図13の処理におけるステップS1306およびステップS1313の結果をログとして出力させる(ステップS2401,S2402)。なお、ステップS1306の場合、Yes/Noにかかわらず判断結果をログとして出力させる。   FIG. 24 is a flowchart illustrating a log output procedure. The flowchart of FIG. 24 is a flowchart showing the process of FIG. In the third embodiment, the results of step S1306 and step S1313 in the process of FIG. 13 are output as a log (steps S2401 and S2402). In step S1306, the determination result is output as a log regardless of Yes / No.

たとえば、図25は、ログのフォーマットを示すデータテーブルである。図24にて説明したステップS2401ならびにS2402では、データテーブル2500のようなフォーマットに基づいたログを出力させる。また、図26は、各関数のデータサイズ例を示す説明図である。実施例1のアルゴリズムを実行させることによって、コールグラフ103を構成する関数のデータサイズが算出される。   For example, FIG. 25 is a data table showing a log format. In steps S2401 and S2402 described with reference to FIG. 24, a log based on a format such as the data table 2500 is output. FIG. 26 is an explanatory diagram showing an example of the data size of each function. By executing the algorithm of the first embodiment, the data size of the functions constituting the call graph 103 is calculated.

ここで、図27は、ログの出力例を示すデータテーブルである。図26のようなコールグラフ103についてログを出力させた場合、まず、データテーブル2700の思考1(1回目処理)の結果が提供される。利用者は、提供されたデータテーブル2700を参照して配置情報105を修正することができる。   FIG. 27 is a data table showing a log output example. When a log is output for the call graph 103 as shown in FIG. 26, first, the result of thought 1 (first process) of the data table 2700 is provided. The user can correct the arrangement information 105 with reference to the provided data table 2700.

データテーブル2700のように、思考1ではバンク3について容量が超えてしまっており、修正が必要なことが判断できる。したがって、思考2ではバンク3を分割してバンク0に関数を移動する。すると今度はバンク0が容量を超えてしまう。そこで、思考3にて、バンク1をあらたに常時ONバンクとして再計算をおこなう。思考3の結果、バンク3が容量を超えているため、思考4によって、再度バンク3を分割してバンク0に関数を移動し、容量不足を解消した配置情報105を作成することができる。その結果が思考4であり、これが答えとして出力される。   As in the data table 2700, in the thought 1, the capacity of the bank 3 has exceeded, and it can be determined that correction is necessary. Therefore, in thought 2, bank 3 is divided and the function is moved to bank 0. This time, bank 0 exceeds the capacity. Therefore, in the thought 3, the bank 1 is newly recalculated as a constantly ON bank. As a result of the thought 3, since the bank 3 exceeds the capacity, it is possible to divide the bank 3 again by the thought 4 and move the function to the bank 0 to create the arrangement information 105 in which the capacity shortage is resolved. The result is thought 4, which is output as an answer.

また、なるべく常時ONバンクの数を減らしたいという観点からデータテーブル2700とは異なる修正をおこなうこともできる。データテーブル2700のログを参照すると、バンク1,2の容量にはまだ余裕がある。そして、問題点はバンク3の余剰分をバンク0にもっていったときにバンク0が容量不足に陥る点にある。もしバンク0の関数をバンク1,2に分配できれば常時ONバンクは1つで済むことになる。   Further, from the viewpoint of reducing the number of always-on banks as much as possible, a modification different from that of the data table 2700 can be performed. Referring to the log of the data table 2700, the capacity of the banks 1 and 2 still has room. The problem is that when the surplus of the bank 3 is brought to the bank 0, the bank 0 falls into a capacity shortage. If the function of bank 0 can be distributed to banks 1 and 2, only one ON bank is required at all times.

そこで関数C2を呼び出す命令コードについては、中身は同じだが名称の異なるものを複数用意する。ここで、図28は、修正後のログの出力例を示すデータテーブルである。関数C2について呼び出される下位の命令の違いに応じて、関数C2_1と、関数C2_2という別名を設定する。この場合、データテーブル2700のように、同一の命令である関数C2_1と、関数C2_2とは、それぞれ別のバンクに配置される。この場合、常時ONバンクを1つに抑え、なおかつ電力制御バンクの容量問題も解決することができる。   Therefore, a plurality of instruction codes for calling the function C2 having the same contents but different names are prepared. Here, FIG. 28 is a data table showing a log output example after correction. The aliases C2_1 and C2_2 are set in accordance with the difference between the lower-level instructions called for the function C2. In this case, as in the data table 2700, the function C2_1 and the function C2_2 that are the same instruction are arranged in different banks. In this case, the number of always-on banks can be limited to one, and the capacity problem of the power control bank can be solved.

このように、実施例3では、配置情報105の修正を利用者によって人的におこなうための補助情報をログとして出力させている。そして、図29は、ログを用いたソース修正手順を示すフローチャートである。図29のフローチャートにおいて、まず、命令配置装置100では、命令配置処理の実行に伴う実行ログを出力させる(ステップS2901)。つぎに、利用者は、ステップS2901によって出力されたログを解析して命令配置装置100に入力されたソース101(図1参照)の配置情報105を修正する(ステップS2902)。   As described above, in the third embodiment, auxiliary information for manually correcting the arrangement information 105 by a user is output as a log. FIG. 29 is a flowchart showing a source correction procedure using a log. In the flowchart of FIG. 29, first, the instruction placement apparatus 100 outputs an execution log accompanying execution of the instruction placement process (step S2901). Next, the user analyzes the log output in step S2901, and corrects the arrangement information 105 of the source 101 (see FIG. 1) input to the instruction arrangement apparatus 100 (step S2902).

ステップS2902におけるソース101の修正が終了すると、命令配置装置100は、この修正ソースによる命令配置処理を実行させ、実行ログを出力させる(ステップS2903)。利用者は、ステップS2903によって出力された実行ログを参照して実行結果がOKか否かを判断する(ステップS2904)。このステップS2904において、実行結果に問題があると判断された場合は(ステップS2904:No)、再度、ステップS2902の処理に戻り、ソース(修正ソース)の修正処理に移行する。一方、ステップS2904において、実行結果に問題がなくOKであると判断された場合(ステップS2904:Yes)、そのまま、一連の処理を終了する。このように、実施例3では、実施例1における配置情報105作成処理によって作成された情報を出力させ、利用者による配置情報105の修正をアシストすることができる。   When the modification of the source 101 in step S2902 is completed, the instruction placement apparatus 100 executes an instruction placement process using the modified source and outputs an execution log (step S2903). The user refers to the execution log output in step S2903 and determines whether or not the execution result is OK (step S2904). If it is determined in step S2904 that there is a problem with the execution result (step S2904: No), the process returns to step S2902 again to shift to the source (correction source) correction process. On the other hand, if it is determined in step S2904 that there is no problem in the execution result and the result is OK (step S2904: Yes), the series of processing ends as it is. Thus, in the third embodiment, the information created by the placement information 105 creation process in the first embodiment can be output to assist the user in correcting the placement information 105.

以上実施例1〜3にて説明したように、本実施の形態にかかる命令配置プログラム、命令配置装置、および命令配置方法によれば、コールグラフ103によって、命令同士の呼び出し関係を特定し、利用頻度の高い命令群とそれ以外の命令群とに分類する。そして、対象装置に搭載されたメモリバンク205のうち、常時電力が供給されるメモリバンク205へ利用頻度の高い命令群を配置するように設定した配置情報105を作成する。結果として、電力供給先となるメモリバンク205を頻繁に切り替えるような事態を避け、効率的な電力制御を図ることができる。   As described above in Examples 1 to 3, according to the instruction placement program, the instruction placement apparatus, and the instruction placement method according to the present embodiment, the call relation between the instructions is specified by the call graph 103 and used. It is classified into a high-frequency instruction group and other instruction groups. And the arrangement information 105 set so that the instruction group with high use frequency is arranged in the memory bank 205 to which power is always supplied among the memory banks 205 mounted in the target device is created. As a result, it is possible to avoid a situation where the memory bank 205 as a power supply destination is frequently switched and to achieve efficient power control.

したがって、配置情報105を利用する対象装置のメモリバンク205のハードウェア構成にかかわらず、メモリバンク205へ適切に命令コードを配置して効率的な電力供給を可能にする。さらに、上述の処理によって作成された配置情報に応じて命令コードを配置することによって、メモリバンク205の省電力化を実現することができる。   Therefore, regardless of the hardware configuration of the memory bank 205 of the target device that uses the arrangement information 105, an instruction code is appropriately arranged in the memory bank 205 to enable efficient power supply. Furthermore, power saving of the memory bank 205 can be realized by arranging the instruction code according to the placement information created by the above-described processing.

一方、実施例1〜3を利用した場合であっても、省電力化が望めないような事態も発生する。たとえば、複数の関数から呼び出される命令が所定数以上(たとえば、1つのメモリバンクに格納できない程の容量となる数)ある場合には、複数個のメモリバンク205を常時ONバンクとして利用しなければならない。結果として、常時電力を供給しなければいけないメモリが増加し、命令配置処理による省電力効果が薄れてしまう。   On the other hand, even when the first to third embodiments are used, a situation where power saving cannot be expected occurs. For example, when there are more than a predetermined number of instructions called from a plurality of functions (for example, a number that has a capacity that cannot be stored in one memory bank), the plurality of memory banks 205 must be used as an ON bank at all times. Don't be. As a result, the number of memories that must always be supplied with power increases, and the power saving effect due to instruction placement processing is diminished.

そこで、複数の関数から呼び出される命令が所定数以上の場合であっても、省電力効果を得るための実施例として、以下の実施例4〜9について説明する。具体的には、実施例4〜9の場合、2つ以上の関数から呼び出される命令について、更に、呼び出し内容に応じた場合分けをおこない、常時ONバンクに配置する命令と、電力制御バンクに配置する命令とに振り分ける。そこで、実施例4では、2つ以上の関数から呼び出される命令についてのメモリバンク205への割当処理について説明する。そして、実施例5〜9では、実施例4の割当処理を利用した応用例について説明する。   Thus, the following Examples 4 to 9 will be described as examples for obtaining a power saving effect even when the number of instructions called from a plurality of functions is a predetermined number or more. Specifically, in the case of the fourth to ninth embodiments, instructions that are called from two or more functions are further divided into cases according to the contents of the call, and are always placed in the ON bank and placed in the power control bank. To be ordered. Thus, in the fourth embodiment, a process for allocating instructions called from two or more functions to the memory bank 205 will be described. In the fifth to ninth embodiments, application examples using the allocation process of the fourth embodiment will be described.

(実施例4〜9における命令配置装置の機能的構成)
図30は、実施例4〜9における命令配置装置の機能的構成を示すブロック図である。実施例4〜9の場合、命令配置装置100は、図6に示した分類部602の内部にさらに、機能部として、親関数決定部3001と、常時ONメモリ割当部3002と、コード量計算部3003と、電力制御メモリ割当部3004と、割当調整・アドレス計算部3005とを備える。そして、命令配置装置100は、実施例1〜3と同様にソース101と、コールグラフ103と、メモリ分割情報104と、を利用して、配置情報105を作成する。
(Functional Configuration of Instruction Arrangement Apparatus in Examples 4 to 9)
FIG. 30 is a block diagram illustrating a functional configuration of the instruction arrangement device according to the fourth to ninth embodiments. In the case of the fourth to ninth embodiments, the instruction arrangement device 100 further includes a parent function determination unit 3001, a constantly ON memory allocation unit 3002, and a code amount calculation unit as functional units in the classification unit 602 illustrated in FIG. 3003, a power control memory allocation unit 3004, and an allocation adjustment / address calculation unit 3005. Then, the instruction placement apparatus 100 creates the placement information 105 using the source 101, the call graph 103, and the memory partition information 104 as in the first to third embodiments.

なお、実施例4〜9において配置情報105を作成する際には、コールグラフ103に含まれている、ソース101内の各関数の呼び出し関係を表す関数呼出関係情報103−1および各関数を呼び出すためのコードの容量を表す関数コード量情報103−2と、メモリ分割情報104に含まれているメモリバンク205の構造を表すメモリ構造情報104−1と、が利用される。   Note that when the arrangement information 105 is created in the fourth to ninth embodiments, the function call relation information 103-1 representing the call relation of each function in the source 101 and each function included in the call graph 103 are called. The function code amount information 103-2 representing the capacity of the code for use and the memory structure information 104-1 representing the structure of the memory bank 205 included in the memory partition information 104 are used.

図31は、コールグラフの一例を示す説明図である。以下の実施例4〜9の説明では、ソース101から作成したコールグラフ103が、図31に示したような呼び出し関係をもつ場合を例に挙げて説明をおこなう。また、実施例1〜3と区別するため、階層数を表す変数を「L」とする。   FIG. 31 is an explanatory diagram of an example of a call graph. In the following description of the fourth to ninth embodiments, a case where the call graph 103 created from the source 101 has a call relationship as shown in FIG. 31 will be described as an example. Further, in order to distinguish from the first to third embodiments, the variable representing the number of layers is set to “L”.

親関数決定部3001は、ソース101を構成する関数fのうち、主要な親関数を決定する機能を有する。関数fの主要な親関数とは、関数fの親関数のうち、関数fを呼び出す回数が最多となる関数を指す。親関数決定部3001では、ソース101のコールグラフ103(実施例4〜9、図31の呼出関係をもつ)の場合を参照して主要親関数を決定する。   The parent function determination unit 3001 has a function of determining a main parent function among the functions f constituting the source 101. The main parent function of the function f refers to a function having the highest number of calls to the function f among the parent functions of the function f. The parent function determination unit 3001 determines the main parent function with reference to the case of the call graph 103 of the source 101 (Examples 4 to 9, having the calling relationship of FIG. 31).

常時ONメモリ割当部3002は、ソース101を構成する関数のうち、メモリバンク205群の常時ONバンクとして利用するメモリバンク205に配置する関数を決定する機能を有する。具体的には、コールグラフ103によって表された階層関係のうち、常時ONバンクとなるメモリバンク205に配置する関数の配置されている階層数や、具体的に常時ONメモリのどこに割り当てるかを決定する。   The always-on memory allocation unit 3002 has a function of determining a function to be arranged in the memory bank 205 used as the always-on bank of the memory bank 205 group among the functions constituting the source 101. Specifically, in the hierarchical relationship represented by the call graph 103, the number of hierarchies in which the function to be arranged in the memory bank 205 that is always ON bank is arranged, and specifically, where to allocate in the always ON memory is determined. To do.

コード量計算部3003は、ソース101を部分木に分解した際の部分木ごとのコード量を計算する機能を有する。なお、コールグラフ103をどのような部分木に分解するかは、任意に設定することができるが、親関数決定部3001にて決定した主要な親関数の情報を使用すると木構造となるため、一意に決定することができる。   The code amount calculation unit 3003 has a function of calculating the code amount for each subtree when the source 101 is decomposed into subtrees. Note that it is possible to arbitrarily set what subtree the call graph 103 is decomposed into. However, since the main parent function information determined by the parent function determination unit 3001 is used, a tree structure is obtained. Can be determined uniquely.

電力制御メモリ割当部3004は、ソース101を構成する関数のうち、常時ONバンク以外の電力制御バンクとして利用するメモリバンク205に配置する関数を決定する機能を有する。具体的には、常時ONメモリ割当部3002によって常時ONバンクに配置すると決定された関数以外の関数を、残りの電力制御バンクのいずれに配置するかを決定する。   The power control memory allocation unit 3004 has a function of determining a function to be arranged in the memory bank 205 used as a power control bank other than the always-on bank among the functions constituting the source 101. Specifically, a function other than the function determined to be placed in the always-on bank by the always-on memory allocation unit 3002 is determined in which of the remaining power control banks.

割当調整・アドレス計算部3005は、電力制御バンクに配置すると決定された関数のうち、親関数の配置関係(どの関数とどの関数とが同一のメモリバンク205に配置されているか)による常時ONバンク配置部分の要不要の調整処理(割当調整)と、配置された関数を呼び出すための関数の先頭のアドレスを計算処理(アドレス計算)する機能とを有する。割当調整によって、常時ONバンクへの割当コード量を削減し、また不必要な電力制御コード及び分岐またはジャンプ命令の挿入を削減するなど、より効率的なコードとなる。また、アドレス計算することによって、割り当てた関数を実際に配置するときのアドレスを特定することができる。   The allocation adjustment / address calculation unit 3005 is a constantly ON bank based on the arrangement relationship of parent functions (which function and which function are arranged in the same memory bank 205) among the functions determined to be arranged in the power control bank. It has an adjustment process (assignment adjustment) that does not require the arrangement part and a function that calculates the address of the beginning of the function for calling the arranged function (address calculation). Allocation adjustment results in a more efficient code, such as reducing the amount of code allocated to the always-on bank and reducing the insertion of unnecessary power control codes and branch or jump instructions. Further, by calculating the address, it is possible to specify the address when the allocated function is actually arranged.

以下には、図30のような機能的構成の命令配置装置100を利用した命令配置処理の実施例4〜9について順に説明する。   Hereinafter, embodiments 4 to 9 of instruction placement processing using the instruction placement device 100 having the functional configuration as shown in FIG. 30 will be described in order.

(実施例4)
実施例4は、実施例1〜3と同様に、メイン関数から、数階層以内の関数や、電力制御を解除するオーバーヘッド内に到達するアドレスまでの関数を常時ONバンクへ配置する。その一方で、実施例4の場合、複数(2つ以上)の関数から呼出のある関数については、呼出元となる関数と、呼出先となる関数との関係に応じて、常時ONバンクに配置する関数と、同一の電力制御バンクに配置する関数とに分ける処理をおこなう。
Example 4
In the fourth embodiment, as in the first to third embodiments, the function from the main function to the function within several layers and the function reaching the address reaching within the overhead for canceling the power control are always arranged in the ON bank. On the other hand, in the case of the fourth embodiment, a function that is called from a plurality (two or more) of functions is always placed in the ON bank according to the relationship between the function that becomes the call source and the function that becomes the call destination. And a function to be divided into a function to be arranged in the same power control bank.

図32は、実施例4における命令配置処理を示す説明図である。実施例4の場合、親関数決定部3001は、ソース101が入力されると、関数決定のための準備処理として、テーブルCと、テーブルSとをそれぞれ作成する。また、テーブル命令配置処理を実行する際には、テーブルCと、テーブルSに加えて、メモリ分割情報104からメモリ構造情報104−1を表すテーブルMも作成しておく。   FIG. 32 is an explanatory diagram illustrating instruction arrangement processing according to the fourth embodiment. In the case of the fourth embodiment, when the source 101 is input, the parent function determination unit 3001 creates a table C and a table S as preparation processing for function determination. Further, when executing the table instruction arrangement processing, in addition to the table C and the table S, a table M representing the memory structure information 104-1 is also created from the memory division information 104.

図33は、テーブルCのデータ例を示すデータテーブルであり、図34は、テーブルSのデータ例を示すデータテーブルである。テーブルCは、ソース101を構成する関数について、どのような呼出関係にあるかを一覧表示した構成になっている。なお、ソース101を構成する各関数のうち、呼出元(なんらかの関数を呼び出す)となる関数を「親関数」、呼出先(なんらかの関数から呼び出される)となる関数を「子関数」とよぶ。   FIG. 33 is a data table showing a data example of the table C, and FIG. 34 is a data table showing a data example of the table S. The table C is configured to display a list of the calling relationships of the functions constituting the source 101. Of the functions constituting the source 101, a function that becomes a call source (calls some function) is called a “parent function”, and a function that becomes a call destination (called from some function) is called a “child function”.

したがって、図33に例示した、データテーブル3300の場合、メイン関数(MAIN)は、ソース101をコンパイルしたオブジェクト102の実行状況に応じて、4つの子関数(A1,A2,A3,A4)を呼び出すような呼出関係になっている。また、テーブルSは、関数ごとのコード量をそれぞれ一覧表示した構成になっている。また、テーブルSによって表されるコード量は、図34に例示したデータテーブル3400のように、関数ごとの総コード量を表す「サイズ」と、関数を分割した際の「前半サイズ」と「後半サイズ」との3種類がある。   Therefore, in the case of the data table 3300 illustrated in FIG. 33, the main function (MAIN) calls four child functions (A1, A2, A3, A4) according to the execution status of the object 102 that compiled the source 101. The calling relationship is as follows. Further, the table S is configured to display a list of code amounts for each function. The code amount represented by the table S includes a “size” representing the total code amount for each function, a “first half size” and a “second half” when the function is divided, as in the data table 3400 illustrated in FIG. There are three types: “size”.

図35は、テーブルMのデータ例を示すデータテーブルである。命令配置装置100には、テーブルC,Sの他に、各メモリバンク205の構成を表すテーブルMが与えられる。テーブルMは、メモリバンク205の構成を一覧表示した構成になっており、メモリ構造情報104−1から作成される。具体的には、図35のデータテーブル3500のように、バンク0〜4の各メモリバンク205について開始アドレスと、サイズとが対応付けられている。   FIG. 35 is a data table showing a data example of the table M. In addition to the tables C and S, the instruction arrangement device 100 is provided with a table M representing the configuration of each memory bank 205. The table M has a configuration in which the configuration of the memory bank 205 is displayed as a list, and is created from the memory structure information 104-1. Specifically, as shown in the data table 3500 of FIG. 35, the start address and the size are associated with each of the memory banks 205 of the banks 0 to 4.

まず、親関数決定部3001は、テーブルSを参照して、関数ごとに、呼出回数が最多となる親関数を特定し、特定結果を一覧表示したテーブル1を作成する。一方、常時ONメモリ割当部3002では、テーブルSとテーブルMとを参照して、常時ONバンクに配置する関数の階層数とメモリ割当を決定する。常時ONメモリ割当部3002による処理結果として、階層数Lと常時ONバンクへの割当結果を表すテーブル3が作成される。なお、テーブル2は、常時ONメモリ割当部3002の内部処理の際に作成されるため、常時ONメモリ割当部3002の説明の際に詳しく説明する。   First, the parent function determination unit 3001 refers to the table S, identifies the parent function having the largest number of calls for each function, and creates the table 1 that lists the identification results. On the other hand, the always-on memory allocation unit 3002 refers to the table S and the table M to determine the number of layers of functions to be arranged in the always-on bank and the memory allocation. As a result of processing by the always-on memory allocation unit 3002, a table 3 representing the number of layers L and the result of allocation to the always-on bank is created. The table 2 is created during the internal processing of the always-on memory allocation unit 3002, and will be described in detail when the always-on memory allocation unit 3002 is described.

つぎに、コード量計算部3003は、テーブル1,S,Cと階層数Lを用いて、部分木ごとのコード量を計算してテーブル4を作成する。部分木とは、ある関数を親関数とした場合に、この関数と呼出関係にあるすべての子関数を抽出した子孫関数群である。子孫関数とは、ある親関数の子関数(子関数1世代目)と、子関数1世代目の子関数(子関数2世代目)である孫関数とを網羅した関数群を意味する。テーブル4は、関数ごとに、呼出関係にある子孫関数を抽出するとともに、子孫関数の合計コード量の計算結果が関連付けられて一覧表示されている(詳しくは後述する)。   Next, the code amount calculation unit 3003 uses the tables 1, S, C and the number of hierarchies L to calculate the code amount for each subtree and creates the table 4. The subtree is a descendant function group obtained by extracting all child functions having a calling relationship with this function when a certain function is a parent function. The descendant function means a function group that covers a child function of a certain parent function (first generation of child functions) and a grandchild function that is a child function of the first generation of child functions (second generation of child functions). The table 4 extracts descendant functions having a calling relationship for each function, and displays a list of the calculation results of the total code amount of the descendant functions in association with each other (details will be described later).

そして、電力制御メモリ割当部3004は、テーブル3,4,M,Sを利用して、部分木ごとのメモリ割当をおこなう。したがって、電力制御メモリ割当部3004では、各関数の子孫関数を電力制御バンクの中のどのバンクに配置するかの割当処理がおこなわれる。そして、電力制御メモリ割当部3004による割当結果は、テーブル5として出力される。   Then, the power control memory allocation unit 3004 performs memory allocation for each subtree using the tables 3, 4, M, and S. Therefore, the power control memory allocation unit 3004 performs an allocation process as to which bank in the power control bank the descendant function of each function is allocated. Then, the allocation result by the power control memory allocation unit 3004 is output as the table 5.

最後に、割当調整・アドレス計算部3005では、テーブルM,Sを利用してテーブル3,5に基づいた、メモリマップとしてテーブル6を作成する。テーブル6はソース101を構成するすべての関数について、それぞれ開始アドレスと配置されるメモリ名が対応付けて一覧表示された構成になっている。割当調整・アドレス計算部3005によって作成されたテーブル6は、配置情報105として格納される。以下に、上述した各機能部の処理を詳細に説明する。   Finally, the allocation adjustment / address calculation unit 3005 creates a table 6 as a memory map based on the tables 3 and 5 using the tables M and S. The table 6 has a configuration in which a start address and a memory name to be arranged are displayed in a list in association with all functions constituting the source 101. The table 6 created by the allocation adjustment / address calculation unit 3005 is stored as the arrangement information 105. Hereinafter, processing of each functional unit described above will be described in detail.

<親関数決定部の処理>
図36は、親関数決定部の詳細な処理を示す説明図である。親関数決定部3001では、ソース101が入力されると、ソース101を構成する関数ごとに関数別の呼出回数をカウントする(ステップS3601)。ステップS3601のカウント処理によってテーブル1−1が作成される。
<Processing of parent function determination unit>
FIG. 36 is an explanatory diagram showing detailed processing of the parent function determination unit. When the source 101 is input, the parent function determination unit 3001 counts the number of calls for each function for each function constituting the source 101 (step S3601). The table 1-1 is created by the count process in step S3601.

テーブル1−1は、ソース101を構成する関数ごとに、呼出先の関数と呼出回数とを対応付けて一覧表示した構成になっている。すなわち、図36に例示したテーブル1−1では、MAIN関数が、関数A1を10回呼び出していることがわかる。そして、親関数決定部3001は、テーブル1−1を参照して、呼出先関数ごとに回数の欄が最大となる呼出元関数を選択することによって(ステップS3602)、テーブル1を作成する。   The table 1-1 has a configuration in which a call destination function and the number of calls are associated and displayed for each function constituting the source 101. That is, in the table 1-1 illustrated in FIG. 36, it can be seen that the MAIN function calls the function A1 10 times. Then, the parent function determination unit 3001 creates a table 1 by referring to the table 1-1 and selecting a caller function having the maximum number of times for each callee function (step S3602).

テーブル1は、各関数について、それぞれ最も呼び出している呼出元の関数を表している。したがって、図36の場合、テーブル1では、関数A1を最も呼び出している呼出元はMAIN関数であり、関数B1を最も呼び出している呼出元は関数A1であることを意味する。   Table 1 shows the function of the caller that is calling most for each function. Therefore, in the case of FIG. 36, in Table 1, the caller that calls the function A1 most is the MAIN function, and the caller that calls the function B1 most is the function A1.

図37は、テーブル1の作成例を示すデータテーブルである。図37のデータテーブル3701のように、ステップS3601の処理によって作成されるテーブル1−1は、ソース101内の関数ごとに、呼出先の子関数と、呼出される回数とが関連付けられている。なお、テーブル1−1に表示されている回数は、実際の動作時の呼出履歴から特定された値ではなく、図31に示したようなコールグラフ103の呼出関係から特定される静的な値である。したがって、ソース101が表すコールグラフ103によって一意的に決定される値である。   FIG. 37 is a data table showing a creation example of the table 1. As in the data table 3701 in FIG. 37, the table 1-1 created by the processing in step S3601 associates a call destination child function and the number of calls for each function in the source 101. The number of times displayed in the table 1-1 is not a value specified from the call history during actual operation, but a static value specified from the call relationship of the call graph 103 as shown in FIG. It is. Therefore, the value is uniquely determined by the call graph 103 represented by the source 101.

また、図37に示すように、テーブル1−1を参照してテーブル1を作成する際、内部的には、まず、テーブル1−2が作成される。テーブル1−2は、データテーブル3702のように、テーブル1−1を子関数フィールドでソートした構成になっている。テーブル1−2を作成することによって、子関数ごとに最も回数の多い親関数(呼出元)が明らかになる。したがって、テーブル1−2の子関数ごとに回数が最大となる親関数を選択すれば、データテーブル3703のような構成のテーブル1が自動的に作成される。   Also, as shown in FIG. 37, when creating table 1 with reference to table 1-1, first, table 1-2 is created. The table 1-2 is configured by sorting the table 1-1 by the child function field like the data table 3702. By creating the table 1-2, the parent function (caller) having the highest number of times is made clear for each child function. Therefore, if the parent function having the maximum number of times is selected for each child function of the table 1-2, the table 1 having the configuration like the data table 3703 is automatically created.

<常時ONメモリ割当部の処理>
図38は、常時ONメモリ割当部の詳細な処理を示す説明図である。常時ONメモリ割当部3002では、テーブルS,Mと親関数決定部3001によって作成されたテーブル1とを用いて常時ONバンクに配置する関数の階層数Lと、常時ONバンクに配置する関数の割当結果を表すテーブル3を作成する。なお、常時ONメモリ割当部3002によって常時ONバンクに配置すると割り当てられた関数は、後述する割当調整・アドレス計算部3005によって変更される場合があり、言わば仮割当の状態となる。
<Processing of always-on memory allocation unit>
FIG. 38 is an explanatory diagram showing detailed processing of the always-on memory allocation unit. The always-on memory allocation unit 3002 uses the tables S and M and the table 1 created by the parent function determination unit 3001 to assign the number L of functions to be placed in the always-on bank and the function to be placed in the always-on bank. A table 3 representing the result is created. It should be noted that the function assigned to the always-on bank by the always-on memory allocation unit 3002 may be changed by an allocation adjustment / address calculation unit 3005, which will be described later.

図39は、常時ONメモリ割当処理の手順を示すフローチャートである。図39のフローチャートは、常時ONメモリ割当処理として、常時ONバンクに配置する関数の階層数Lと、常時ONバンクに配置する関数を一覧表示したテーブル3を作成する手順を表している。図39の各処理を実行することによって、ソース101を構成する関数のうち、常時ONバンクに配置する関数の候補(上述したように、割当調整・アドレス計算部3005によって変更される場合があるため)を抽出することができる。   FIG. 39 is a flowchart showing the procedure of the always-on memory allocation process. The flowchart of FIG. 39 represents a procedure for creating the table 3 that lists the number of functions L arranged in the always-on bank and the functions arranged in the always-on bank as the always-on memory allocation process. 39. By executing each process of FIG. 39, among the functions constituting the source 101, function candidates that are always placed in the ON bank (as described above, the assignment adjustment / address calculation unit 3005 may change them). ) Can be extracted.

図39において、まず、割当処理に利用する変数N,L,N_ONの値を初期化する(ステップS3901)。変数Nはメモリバンク205の総数、変数Lは常時ONバンクに配置する関数の階層数、変数N_ONは常時ONバンク数をそれぞれ表す。変数Nは、電力制御システム内の構成に応じて一意的に決定されるため、固定値となる。その他の、変数L,N_ONは、初期化時には、最小値の1が設定される。   In FIG. 39, first, the values of variables N, L, and N_ON used for allocation processing are initialized (step S3901). The variable N represents the total number of memory banks 205, the variable L represents the number of layers of functions placed in the always-on bank, and the variable N_ON represents the number of always-on banks. Since the variable N is uniquely determined according to the configuration in the power control system, the variable N is a fixed value. Other variables L and N_ON are set to a minimum value of 1 at the time of initialization.

つぎに、階層数に応じた関数の分岐数Fを設定する(ステップS3902)。具体的には、Fは現在の階層数Lから階層数L+1階層目までの分岐数が設定される。つぎに、分岐数Fが、N−N_ON、すなわち、電力制御バンク数よりも少ないか否かを判断する(ステップS3903)。ここで、F<N−N_ON、すなわち、分岐数Fが電力制御バンク数よりも少ないと判断された場合(ステップS3903:Yes)、階層数Lを+1インクリメントして(ステップS3904)、再度ステップS3902の処理をおこなう。   Next, the function branch number F corresponding to the number of layers is set (step S3902). Specifically, F is set to the number of branches from the current layer number L to the layer number L + 1. Next, it is determined whether the number of branches F is NN_ON, that is, whether the number is less than the number of power control banks (step S3903). Here, when it is determined that F <N−N_ON, that is, the number of branches F is smaller than the number of power control banks (step S3903: Yes), the number of layers L is incremented by +1 (step S3904), and step S3902 is performed again. Perform the process.

ステップS3903において、分岐数Fが電力制御バンク数以上であると判断されると(ステップS3903:No)、つぎに、テーブルM_rest・テーブル3を初期化する(ステップS3905)。テーブルM_restは、テーブルMによって表された各メモリバンク205に関数を配置後の残りの容量を一覧表示した構成になっている。   If it is determined in step S3903 that the number of branches F is equal to or greater than the number of power control banks (step S3903: No), the table M_rest / table 3 is then initialized (step S3905). The table M_rest is configured to display a list of remaining capacities after the function is arranged in each memory bank 205 represented by the table M.

図40は、初期化時のテーブルM_rest・テーブル3のデータ例を示すデータテーブルである。ステップS3905の初期化時は、いずれのメモリバンク205にも関数が割り当てられていない。したがって、テーブルM_restは、データテーブル4010のように、テーブルMと同じ値になっている。同様に、テーブル3もデータテーブル4020のように関数が割当られていない空の状態になっている。   FIG. 40 is a data table showing a data example of the table M_rest / table 3 at the time of initialization. At the time of initialization in step S3905, no function is assigned to any memory bank 205. Therefore, the table M_rest has the same value as the table M like the data table 4010. Similarly, the table 3 is in an empty state to which no function is assigned unlike the data table 4020.

各テーブルが初期化されると、つぎに、テーブル2に所定の条件を満たす関数funcを追加する(ステップS3906)。テーブル2は常時ONバンクに配置する関数の候補を抽出するためのテーブルである。   When each table is initialized, a function func that satisfies a predetermined condition is added to the table 2 (step S3906). Table 2 is a table for extracting function candidates to be always placed in the ON bank.

図41は、テーブル2の作成例を示すデータテーブルである。ステップS3906では、テーブルSを構成する関数フィールド テーブルS[func]の中から下記のような条件を満たす関数funcをテーブル2に追加する。追加された関数は、データテーブル4100のように、テーブル2を構成する関数フィールド テーブル2[func]として設定される。   FIG. 41 is a data table showing an example of creating the table 2. In step S3906, a function func satisfying the following conditions is added to the table 2 from the function field table S [func] constituting the table S. The added function is set as a function field table 2 [func] constituting the table 2 as in the data table 4100.

階層数Lまでの関数:
テーブル2[func].サイズ=テーブルS[func].サイズ
(なお、“テーブル2[func].サイズ”とはテーブル2の最も左にあるフィールドである関数フィールドがfuncであるようなエントリの、サイズフィールドの値を示す。ただし、テーブル2のようにフィールドが2つの場合は、“.”以降のフィールド名の指定を省略することもある。)
階層数L+1の関数:
テーブル2[func].サイズ=テーブルS[func].分割前半サイズ
階層数L+2以下の関数のうち、複数の関数から呼び出される関数:
テーブル2[func].サイズ=テーブルS[func].分割前半サイズ
Functions up to L number of layers:
Table 2 [func]. Size = table S [func]. Size (“table 2 [func] .size” indicates the value of the size field of the entry whose function field, which is the leftmost field of table 2, is func. When there are two fields, designation of field names after “.” May be omitted.)
Function of number of layers L + 1:
Table 2 [func]. Size = table S [func]. Division first half size Number of layers L + 2 or less, among functions that are called from a plurality of functions:
Table 2 [func]. Size = table S [func]. First half size

図39の説明に戻り、テーブル2に格納されている関数funcのサイズ順にテーブル3への割当処理をおこなう(ステップS3907)。ステップS3907では、サイズの大きな関数順に割当処理がおこなわれる。以下に、割当処理の手順について詳細に説明する。   Returning to the description of FIG. 39, the allocation processing to the table 3 is performed in the order of the size of the function func stored in the table 2 (step S3907). In step S3907, allocation processing is performed in order of functions having the largest size. Hereinafter, the procedure of the allocation process will be described in detail.

図42は、テーブル3への割当処理の手順を示すフローチャートである。図42のフローチャートは、テーブルMからテーブル2に抽出された関数について、First Hitアルゴリズムによりテーブル3へ割り当てる関数を抽出する手順を表している。図42の各処理を実行することによって、常時ONバンクに配置される関数を決定することができる。   FIG. 42 is a flowchart showing the procedure of the allocation process to the table 3. The flowchart of FIG. 42 represents a procedure for extracting a function assigned to the table 3 by the First Hit algorithm for the functions extracted from the table M to the table 2. By executing each process of FIG. 42, it is possible to determine a function that is always placed in the ON bank.

図42において、まず、テーブルMのメモリ名フィールドに属する要素mのうち、下記式(1)を満たす最初のメモリmを抽出する(ステップS4201)。   42, first, the first memory m satisfying the following formula (1) is extracted from the elements m belonging to the memory name field of the table M (step S4201).

M_rest[m]≧テーブル2[func] …(1)   M_rest [m] ≧ table 2 [func] (1)

つぎに、抽出したメモリM_rest[m]からテーブル2[func]を引いたものをあらたにM_rest[m]に設定する(ステップS4202)。最後に、テーブル3[m].の関数にfuncを追加して(ステップS4203)、一連の割当処理を終了する。   Next, a value obtained by subtracting table 2 [func] from the extracted memory M_rest [m] is newly set to M_rest [m] (step S4202). Finally, table 3 [m]. Func is added to the function (step S4203), and the series of allocation processes is terminated.

図43は、テーブルM_restのデータ例を示すデータテーブルであり、図44は、テーブル3への割当例を示すデータテーブルである。テーブルM_restの値がデータテーブル4100のような構成の場合、ステップS4201では、M_rest[m]≧テーブル2[func]となるサイズを満たす最初の要素mとしてバンク0が抽出される。したがって、ステップS4202では、バンク0のサイズとして、データテーブル4300のように、4096−3000=1096[byte]が設定される。また、ステップS4203の処理によってテーブル3には、データテーブル4400のように、バンク0のエントリにMAIN関数が追加される。   43 is a data table showing an example of data in the table M_rest, and FIG. 44 is a data table showing an example of assignment to the table 3. When the value of the table M_rest is configured as in the data table 4100, in step S4201, the bank 0 is extracted as the first element m that satisfies the size of M_rest [m] ≧ table 2 [func]. Accordingly, in step S4202, 4096-3000 = 1096 [bytes] is set as the size of the bank 0 as in the data table 4300. Further, the MAIN function is added to the entry of the bank 0 in the table 3 as in the data table 4400 by the processing in step S4203.

図39の説明に戻り、ステップS3907の処理が終了すると、つぎに、テーブル3内の空集合でないエントリ数がN_ONよりも多いか否かを判断する(ステップS3908)。テーブル3内の空集合でないエントリ数がN_ONよりも多いと判断された場合(ステップS3908:Yes)、常時ONバンクの数が足りないため、N_ONの値を+1インクリメントし、Lの値を1に設定して(ステップS3909)、再度、ステップS3902からの処理を繰り返す。   Returning to the explanation of FIG. 39, when the process of step S3907 is completed, it is next determined whether or not the number of non-empty entries in the table 3 is larger than N_ON (step S3908). If it is determined that the number of non-empty entries in the table 3 is greater than N_ON (step S3908: Yes), the number of always ON banks is insufficient, so the value of N_ON is incremented by +1 and the value of L is set to 1. After setting (step S3909), the processing from step S3902 is repeated again.

一方、テーブル3内の空集合でないエントリ数がN_ONよりも多くはないと判断された場合(ステップS3908:No)、テーブル3に割り当てた関数は常時ONバンクに配置可能となるため、現在設定されている階層数Lとテーブル3を出力して(ステップS3910)、一連の割当処理を終了する。   On the other hand, if it is determined that the number of non-empty entries in the table 3 is not more than N_ON (step S3908: No), the function assigned to the table 3 can always be placed in the ON bank, so it is currently set. The number of hierarchies L and the table 3 are output (step S3910), and the series of allocation processes is terminated.

図45は、常時ONメモリ割当処理の実行結果を示すデータテーブルである。図39のフローチャートを実行した結果、テーブルM_restとしてデータテーブル4510,テーブル3としてデータテーブル4520がそれぞれ出力される。   FIG. 45 is a data table showing the execution result of the always-on memory allocation process. As a result of executing the flowchart of FIG. 39, the data table 4510 is output as the table M_rest, and the data table 4520 is output as the table 3.

<コード量計算部の処理>
図46は、コード量計算部の詳細な処理を示す説明図である。コード量計算部3003では、テーブルS,Cと、親関数決定部3001によって作成されたテーブル1と、常時ONメモリ割当部3002によって作成された階層数Lとを用いて、電力制御バンクに配置する子孫関数のコードの総量を計算する。コード量計算部3003による計算処理によってテーブル4が作成される。
<Processing of code amount calculation unit>
FIG. 46 is an explanatory diagram showing detailed processing of the code amount calculation unit. The code amount calculation unit 3003 uses the tables S and C, the table 1 created by the parent function determination unit 3001 and the number of hierarchies L created by the always-on memory allocation unit 3002 to arrange in the power control bank. Calculate the total amount of descendant function code. Table 4 is created by calculation processing by the code amount calculation unit 3003.

図47は、コード量算出の手順を示すフローチャートである。図47のフローチャートは、親関数として決定された関数以外の子孫関数のコード量を表すテーブル4を作成する手順を表す。図47の各処理を実行することによって、同一の電力制御バンクに配置する関数群のコード量を特定することができる。   FIG. 47 is a flowchart showing the procedure for calculating the code amount. The flowchart in FIG. 47 represents a procedure for creating the table 4 representing the code amount of the descendant function other than the function determined as the parent function. 47 is executed, it is possible to specify the code amount of the function group arranged in the same power control bank.

コード量計算部3003では、まず、テーブル1上でのL+1階層の関数funcを抽出する(ステップS4701)。つぎに、抽出した各関数funcの値を下記のように設定する(ステップS4702)。   The code amount calculation unit 3003 first extracts the function func of the (L + 1) layer on the table 1 (step S4701). Next, the value of each extracted function func is set as follows (step S4702).

F_D={funcのテーブル1上での子孫}
s=テーブルS[func].分割後半サイズ+F_Dに含まれる各関数のテーブルSのサイズフィールドの総和
F_D = {descendant on func table 1}
s = table S [func]. Sum of size field of table S of each function included in division latter half size + F_D

そして、ステップS4702の設定値を利用してテーブル4の各値を下記のように設定する(ステップS4703)。設定後のテーブル4を出力して(ステップS4704)、一連の算出処理を終了する。   Then, each value in the table 4 is set as follows using the set value in step S4702 (step S4703). The table 4 after setting is output (step S4704), and a series of calculation processing is terminated.

テーブル4[func].子孫関数=F_D
テーブル4[func].合計コード量=s
Table 4 [func]. Descendant function = F_D
Table 4 [func]. Total code amount = s

たとえば、L+1=2(階層)の場合、ステップS4701によって抽出される関数funcは、A1,A2,A3,A4となる。関数A1において、ステップS4702の処理をおこなうと、F_D={B1,B2,B3,B10,C1}と設定される。これらの値は、テーブル1におけるA1の子孫関数であり、B1,B2,B3,B10がA1の子関数、C1がB10の子関数となる。   For example, when L + 1 = 2 (hierarchy), the function func extracted in step S4701 is A1, A2, A3, A4. In the function A1, when the process of step S4702 is performed, F_D = {B1, B2, B3, B10, C1} is set. These values are descendant functions of A1 in Table 1, B1, B2, B3, and B10 are child functions of A1, and C1 is a child function of B10.

同様に、s=12860[byte]となる。具体的には、s=関数A1の分割後半サイズ+関数B1のサイズ+関数B2のサイズ+関数B3のサイズ+関数B10のサイズ+関数C1のサイズ=2460+2560+2560+2560+2560+160=12860[byte]となる。   Similarly, s = 112860 [bytes]. Specifically, s = second half size of function A1 + size of function B1 + size of function B2 + size of function B3 + size of function B10 + size of function C1 = 2460 + 2560 + 2560 + 2560 + 2560 + 160 = 1860 [bytes].

図48は、テーブル4の作成例を示すデータテーブルである。ステップS4702において、まず、関数A1について各値が設定されデータテーブル4810が作成される。同様に、他の関数についても各値が設定され、データテーブル4820が作成され、テーブル4として出力される。   FIG. 48 is a data table showing a creation example of the table 4. In step S4702, first, each value is set for the function A1, and a data table 4810 is created. Similarly, values are set for other functions, and a data table 4820 is created and output as the table 4.

<電力制御メモリ割当部の処理>
図49は、電力制御メモリ割当部の詳細な処理を示す説明図である。電力制御メモリ割当部3004では、テーブルS,Mと、常時ONメモリ割当部3002によって作成されたテーブル3と、コード量計算部3003によって作成されたテーブル4とを用いて、部分木ごとの電力制御バンクを割り当てたテーブル5を作成する。なお、上述したように電力制御メモリ割当部3004では、部分木として子孫関数として同じ親関数に対応付けられた関数群が処理される。
<Processing of power control memory allocation unit>
FIG. 49 is an explanatory diagram showing detailed processing of the power control memory allocation unit. The power control memory allocation unit 3004 uses the tables S and M, the table 3 created by the always-on memory allocation unit 3002, and the table 4 created by the code amount calculation unit 3003 to control power for each subtree. A table 5 to which banks are assigned is created. As described above, the power control memory allocation unit 3004 processes a function group associated with the same parent function as a descendant function as a subtree.

図50は、電力制御メモリ割当の手順を示すフローチャートである。図50のフローチャートは、L+1階層以下の関数についてのメモリバンク205への割当処理の手順を表している。図50の各処理を実行することによって、ソース101を構成する関数のうち、配置先が決定していない残りの関数を適切な電力制御バンクに割り当てることができる。   FIG. 50 is a flowchart showing a procedure for power control memory allocation. The flowchart of FIG. 50 shows the procedure of the allocation process to the memory bank 205 for the functions of the (L + 1) th layer and below. By executing each process of FIG. 50, among the functions constituting the source 101, the remaining functions whose arrangement destinations are not determined can be assigned to an appropriate power control bank.

図50において、まず、テーブルM_rest、テーブル5の値を初期化する(ステップS5001)。テーブルM_restでは、テーブル3に設定されている関数が空集合でない場合は、すなわち、なんらかの関数が設定されているバンクについては、0[byte]、それ以外のバンクについてはテーブルMに設定されたサイズをそのまま流用する。また、テーブル5の関数(親関数)には、テーブル4の関数(親関数)、テーブル5の子孫関数には、テーブル4の子孫関数をそのまま流用する。   In FIG. 50, first, the values of the table M_rest and the table 5 are initialized (step S5001). In the table M_rest, when the function set in the table 3 is not an empty set, that is, 0 [byte] for a bank in which some function is set, and the size set in the table M for other banks. Is used as is. In addition, the function (parent function) in table 5 is used as the function in table 5 (parent function), and the descendant function in table 4 is used as the descendant function in table 5.

図51は、初期化時のテーブルM_rest・テーブル5のデータ例を示すデータテーブルである。ステップS5001のように初期化をおこなった場合、テーブルM_restは、データテーブル5110のように、常時ONバンクとして利用されるバンク0,1には、すでに関数が設定されているため、サイズは0[byte]となる。そして、残りのバンク2〜4には、関数が設定されていないため、それぞれ、テーブルMの値がそのまま設定される。また、テーブル5は、データテーブル5120のようにテーブル4の設定値がそのまま設定される。   FIG. 51 is a data table showing a data example of the table M_rest / table 5 at the time of initialization. When initialization is performed as in step S5001, the table M_rest has a size set to 0 [0] because functions are already set in the banks 0 and 1 that are always used as ON banks as in the data table 5110. byte]. Since no function is set in the remaining banks 2 to 4, the values in the table M are set as they are. In the table 5, the set value of the table 4 is set as it is like the data table 5120.

図50の説明に戻り、各テーブルを初期化後、テーブル4の関数をFirst Hit Decreasingアルゴリズムにより、電力制御バンクへの割当処理を実行する。すなわち、テーブル4の関数を合計コード量が大きい順に並べ替え(ステップS5002)、テーブル4の関数について並べ替えた順にテーブル5の割当処理を実行する(ステップS5003)。電力制御メモリ割当部3004は、ステップS5003の処理が終了すると、テーブル5を出力する(ステップS5004)。以下には、ステップS5003の割当処理について詳細に説明する。   Returning to the description of FIG. 50, after initializing each table, the function of the table 4 is assigned to the power control bank by the First Hit Dedecoring algorithm. That is, the functions in Table 4 are rearranged in the descending order of the total code amount (Step S5002), and the allocation process of Table 5 is executed in the order in which the functions in Table 4 are rearranged (Step S5003). When the process of step S5003 ends, the power control memory allocation unit 3004 outputs the table 5 (step S5004). Hereinafter, the allocation process in step S5003 will be described in detail.

図52は、ソートしたテーブル4を示すデータテーブルである。ステップS5002の処理によってソートしたテーブル4はデータテーブル5200のように、合計コード量が大きい順に並べられている。   FIG. 52 is a data table showing the sorted table 4. The table 4 sorted by the processing in step S5002 is arranged in the descending order of the total code amount as in the data table 5200.

図53は、テーブル5への割当処理の手順を示すフローチャートである。図53のフローチャートは、ステップS5003によるテーブル5への割当処理の手順を表している。図53の各処理を実行することによって、テーブル5に設定された各関数の子孫関数を割り当てるメモリバンク205(電力制御バンク)を設定することができる。   FIG. 53 is a flowchart showing the procedure of the allocation process to the table 5. The flowchart in FIG. 53 shows the procedure of the allocation process to the table 5 in step S5003. 53 is executed, a memory bank 205 (power control bank) to which a descendant function of each function set in the table 5 is assigned can be set.

図53において、まず、テーブルMのメモリ名フィールドに登場する要素mのうちM_rest[m]≧テーブル4[func].合計コード量を満たす最初のメモリmを抽出する(ステップS5301)。そして、抽出したM_rest[m]からテーブル4[func].合計コード量を引いたコード量をM_rest[m]のサイズに設定する(ステップS5302)。その後、テーブル5[func]の割当メモリとして抽出されたmを設定する(ステップS5303)。   In FIG. 53, first, of the elements m appearing in the memory name field of the table M, M_rest [m] ≧ table 4 [func]. The first memory m that satisfies the total code amount is extracted (step S5301). Then, from the extracted M_rest [m], Table 4 [func]. The code amount obtained by subtracting the total code amount is set to the size of M_rest [m] (step S5302). Thereafter, the extracted m is set as the allocation memory of the table 5 [func] (step S5303).

図54は、合計コード量に応じたテーブルM_restのデータ例を示すデータテーブルであり、図55は、テーブル5に割り当てられたデータ例を示すデータテーブルである。テーブルM_restの値がデータテーブル5110のような構成の場合、ステップS5301では要素mとしてバンク2が抽出される。したがって、ステップS5302では、バンク2のサイズとして、データテーブル5400のように、18384−12860=3524[byte]が設定される。また、ステップS5303の処理によってテーブル5には、データテーブル5500のように、関数A1の割当メモリとしてバンク2が設定される。   FIG. 54 is a data table showing a data example of the table M_rest according to the total code amount, and FIG. 55 is a data table showing a data example assigned to the table 5. When the value of the table M_rest is configured as in the data table 5110, the bank 2 is extracted as the element m in step S5301. Accordingly, in step S5302, 18384-12860 = 3524 [bytes] is set as the size of the bank 2 as in the data table 5400. Further, bank 2 is set in the table 5 as the allocation memory of the function A1, as in the data table 5500, by the processing in step S5303.

図56は、電力制御メモリの割当処理の実行結果を示すデータテーブルである。ステップS5004によってテーブル4に設定されたすべての関数についての割当処理が終了すると、テーブルM_restとしてデータテーブル5610、テーブル5としてデータテーブル5620がそれぞれ作成される。   FIG. 56 is a data table showing the execution result of the power control memory allocation process. When the allocation process for all the functions set in the table 4 in step S5004 is completed, the data table 5610 is created as the table M_rest and the data table 5620 is created as the table 5, respectively.

<割当調整・アドレス計算部の処理>
図57は、割当調整・アドレス計算部の詳細な処理を示す説明図である。割当調整・アドレス計算部3005では、常時ONバンク配置修正(ステップS5701)と、アドレス計算(ステップS5702)との2つの処理がおこなわれる。まず、テーブルCと、テーブル3,5と、階層数Lと、を利用して、テーブル6−1を作成する。その後、テーブルS,Mと、テーブル5,6−1と、階層数Lとを利用して、テーブル6を作成する。
<Processing of allocation adjustment / address calculation unit>
FIG. 57 is an explanatory diagram showing detailed processing of the allocation adjustment / address calculation unit. In the allocation adjustment / address calculation unit 3005, two processes of always-on bank arrangement correction (step S5701) and address calculation (step S5702) are performed. First, a table 6-1 is created using the table C, the tables 3 and 5, and the number of hierarchies L. Thereafter, the table 6 is created using the tables S and M, the tables 5 and 6-1, and the number L of layers.

図58は、割当調整処理の手順を示すフローチャートである。図58のフローチャートは、ステップS5701における常時ONバンク配置修正の手順を表す。図58の各処理を実行することによって、テーブル3に設定されている関数が常時ONバンクに配置する関数として適しているかを選別したテーブル6−1を作成することができる。   FIG. 58 is a flowchart showing the procedure of allocation adjustment processing. The flowchart in FIG. 58 represents the procedure for always-on bank arrangement correction in step S5701. By executing each processing of FIG. 58, it is possible to create a table 6-1 in which it is determined whether the function set in the table 3 is suitable as a function that is always placed in the ON bank.

図58において、まず、テーブル3上の関数funcを抽出し(ステップS5801)、抽出した関数funcがテーブル1において、L+2階層以下か否かを判断する(ステップS5802)。ステップS5802において、抽出した関数funcがテーブル1において、L+2階層以下であると判断された場合(ステップS5802:Yes)、さらに、抽出した関数funcがテーブルC上で親関数が複数存在するか否かを判断する(ステップS5803)。   58, first, a function func on the table 3 is extracted (step S5801), and it is determined whether or not the extracted function func is in the L + 2 hierarchy or lower in the table 1 (step S5802). If it is determined in step S5802 that the extracted function func is below the L + 2 hierarchy in table 1 (step S5802: Yes), whether or not the extracted function func has a plurality of parent functions on table C is determined. Is determined (step S5803).

ステップS5803において、抽出した関数funcがテーブルC上で親関数が複数存在すると判断された場合(ステップS5803:Yes)、さらに、抽出した関数funcがテーブル5上で親関数が同じバンクに分割されているか否かを判断する(ステップS5804)。ステップS5804において、抽出した関数funcがテーブル5上で親関数が同じバンクに分割されていると判断された場合(ステップS5804:Yes)、テーブル3からfuncを削除する(ステップS5805)。   If it is determined in step S5803 that the extracted function func has a plurality of parent functions on the table C (step S5803: Yes), the extracted function func is further divided into the same bank on the table 5 in the same bank. It is determined whether or not there is (step S5804). In step S5804, when it is determined that the extracted function func is divided into the same bank on the table 5 (step S5804: Yes), func is deleted from the table 3 (step S5805).

ステップS5805の処理が終了すると、つぎに、抽出した関数funcをすべて処理したか否かを判断し(ステップS5806)、未処理の関数funcが残っている場合には(ステップS5806:No)、ステップS5802の処理に戻り、未処理の関数funcについて同様に処理をおこなう。   When the process of step S5805 is completed, it is next determined whether or not all the extracted function func have been processed (step S5806). If an unprocessed function func remains (step S5806: No), the process proceeds to step S5805. Returning to the processing of S5802, the same processing is performed for the unprocessed function func.

また、抽出した関数funcがテーブル1において、L+2階層以下ではないと判断された場合(ステップS5802:No)、テーブルC上で親関数が複数存在しないと判断された場合(ステップS5803:No)、テーブル5上で親関数が同じバンクに分割されていないと判断された場合(ステップS5804:No)は、いずれもステップS5806の処理に移行して、未処理の関数funcが無くなるまで処理を繰り返す。その後、未処理の関数funcが残っていないと判断されると(ステップS5806:Yes)、一連の割当調整処理を終了する。   When it is determined that the extracted function func is not lower than the L + 2 hierarchy in the table 1 (step S5802: No), when it is determined that there are not a plurality of parent functions on the table C (step S5803: No), If it is determined on the table 5 that the parent function is not divided into the same bank (step S5804: NO), the process proceeds to step S5806, and the process is repeated until there is no unprocessed function func. Thereafter, when it is determined that an unprocessed function func does not remain (step S5806: Yes), a series of allocation adjustment processing ends.

図59は、割当調整後のテーブル3のデータ例を示すデータテーブルである。テーブル3上の関数MAIN,A1,…,A4の場合、L+2=3階層以下ではないため、そのままテーブル3に格納される。また、関数B2,B3の場合、3階層以下であり、テーブルCにおいて、複数の親関数が存在するが、テーブル5上で親関数が同一のバンクではないため、そのままテーブル3に格納される。一方、関数B4は、3階層以下であり、テーブルCにおいて、複数の親関数が存在し、なおかつ、親関数が同一バンクであるため、データテーブル5900のようにバンク0から削除される。   FIG. 59 is a data table showing a data example of the table 3 after allocation adjustment. The functions MAIN, A1,..., A4 on the table 3 are stored in the table 3 as they are because they are not lower than L + 2 = 3 layers. In the case of the functions B2 and B3, there are three or lower layers, and there are a plurality of parent functions in the table C. However, since the parent functions are not in the same bank on the table 5, they are stored in the table 3 as they are. On the other hand, the function B4 is not more than three layers, and since there are a plurality of parent functions in the table C and the parent functions are in the same bank, the function B4 is deleted from the bank 0 as in the data table 5900.

図60は、テーブル6−1の出力例を示すデータテーブルである。テーブル3上のすべての関数について、図58の処理が完了すると、テーブル3からさらにB7,C2が削除されたデータテーブル6000が作成される。データテーブル6000のように、テーブル3から所定の条件下の関数を削除したテーブルがテーブル6−1として出力される。   FIG. 60 is a data table showing an output example of the table 6-1. When the processing of FIG. 58 is completed for all the functions on the table 3, a data table 6000 in which B7 and C2 are further deleted from the table 3 is created. A table obtained by deleting a function under a predetermined condition from the table 3 like the data table 6000 is output as the table 6-1.

図61は、アドレス計算処理の手順を示すフローチャートである。図61のフローチャートは、割当調整・アドレス計算部3005における2つめのステップであるアドレス計算処理の手順を表す。図61の処理をおこなうことによって、各関数をメモリに配置する際の、アドレスを特定することができる。   FIG. 61 is a flowchart showing the procedure of the address calculation process. The flowchart in FIG. 61 shows the procedure of address calculation processing, which is the second step in the allocation adjustment / address calculation unit 3005. By performing the processing of FIG. 61, it is possible to specify an address when each function is arranged in the memory.

図61において、まず、配列addr[m]=(テーブルM[m].開始アドレス)に初期化する(ステップS6101)。さらに、func1ではテーブル6−1上の関数ごとに、func2ではテーブル5上の関数ごとに、それぞれメモリアドレス設定処理をおこなう(ステップS6102,S6103)。以上の処理が終了すると、メモリアドレス設定結果を反映したテーブル6を出力して(ステップS6104)、一連のアドレス計算処理を終了する。   In FIG. 61, first, the array addr [m] = (table M [m] .start address) is initialized (step S6101). Further, memory address setting processing is performed for each function on the table 6-1 in func1, and for each function on the table 5 in func2 (steps S6102 and S6103). When the above processing ends, the table 6 reflecting the memory address setting result is output (step S6104), and the series of address calculation processing ends.

図62は、初期化時の配列addrのデータ例を示すデータテーブルである。配列addrは、メモリバンク205ごとの開始アドレスの設定が一覧表示された構成になる。したがって、ここでは、データテーブル6200のように、バンク0〜4の5つのメモリバンク205についての開始アドレスが設定されている。   FIG. 62 is a data table showing a data example of the array addr at the time of initialization. The array addr has a configuration in which the start address settings for each memory bank 205 are listed. Therefore, here, as in the data table 6200, start addresses for the five memory banks 205 of the banks 0 to 4 are set.

図63は、常時ONメモリのメモリアドレス設定処理の手順を示すフローチャートである。図63のフローチャートは、ステップS6102におけるfunc1におけるメモリアドレス設定処理の手順を示す。図63の処理を実行することによって、常時ONバンクに配置された各関数についてのメモリアドレスを設定することができる。   FIG. 63 is a flowchart showing the procedure of the memory address setting process for the always-on memory. The flowchart in FIG. 63 shows the procedure of memory address setting processing in func1 in step S6102. By executing the processing of FIG. 63, it is possible to set the memory address for each function arranged in the always-on bank.

図63において、まず、m,sを下記のように設定する(ステップS6301)。   In FIG. 63, first, m and s are set as follows (step S6301).

m=テーブル6−1[func1].メモリ名
s=テーブルS[func1].サイズ(func1がL階層以上の場合)
もしくは
s=テーブルS[func1].分割前半サイズ(func1がL階層以上ではない場合)
m = Table 6-1 [func1]. Memory name s = table S [func1]. Size (when func1 is L level or higher)
Or s = table S [func1]. First half size (when func1 is not higher than L level)

つぎに、テーブル6に下記のエントリを追加する(ステップS6302)。最後に、配列addr[m]にsを追加して(ステップS6303)、一連のアドレス設定処理を終了する。   Next, the following entry is added to the table 6 (step S6302). Finally, s is added to the array addr [m] (step S6303), and the series of address setting processes is terminated.

テーブル6[func1].アドレス=addr[m]
テーブル6[func1].メモリ名=m
Table 6 [func1]. Address = addr [m]
Table 6 [func1]. Memory name = m

図64は、常時ONメモリのアドレス計算開始時のテーブル6・配列addrのデータ例を示すデータテーブルである。図63の処理を実行することによって、データテーブル6410のようにm=バンク0、s=テーブルS[MAIN].サイズ=3000が追加されたテーブル6が設定される。したがって、配列addrはデータテーブル6420のように、バンク0にあらたな開始アドレスが追加される。   FIG. 64 is a data table showing a data example of the table 6 / array addr at the start of address calculation of the always-on memory. 63 is executed, m = bank 0, s = table S [MAIN]. A table 6 to which size = 3000 is added is set. Therefore, a new start address is added to bank 0 as in the data table 6420 in the array addr.

図65は、常時ONメモリのアドレス計算完了時のテーブル6・配列addrのデータ例を示すデータテーブルである。図63の処理によってテーブル6−1に設定されたすべての関数が処理されると、データテーブル6510のようなアドレスが設定されたテーブル6が作成される。同様に、配列addrも、データテーブル6520のように、バンク0,1にあらたな開始アドレスが追加される。   FIG. 65 is a data table showing a data example of the table 6 / array addr when the address calculation of the always-on memory is completed. When all the functions set in the table 6-1 are processed by the processing of FIG. 63, the table 6 in which addresses such as the data table 6510 are set is created. Similarly, a new start address is added to the banks 0 and 1 in the array addr as in the data table 6520.

図66および図67は、電力制御メモリのメモリアドレス設定処理の手順を示すフローチャートである。図66および図67のフローチャートは、ステップS6103におけるfunc2におけるメモリアドレス設定処理の手順を示す。図66および図67の処理を実行することによって、電力制御バンクに配置された各関数についてのメモリアドレスを設定することができる。   66 and 67 are flowcharts showing the procedure of the memory address setting process of the power control memory. The flowcharts in FIGS. 66 and 67 show the procedure of the memory address setting process in func2 in step S6103. By executing the processing of FIGS. 66 and 67, the memory address for each function arranged in the power control bank can be set.

図66において、まず、func3をfunc2として、メモリアドレス設定処理を実行する(ステップS6601)。そして、同様にfunc3をテーブル5[func2].子孫関数の各関数として、メモリアドレス設定処理を実行し(ステップS6602)、一連の処理を終了する。   In FIG. 66, first, memory address setting processing is executed with func3 as func2 (step S6601). Similarly, func3 is stored in table 5 [func2]. As each function of the descendant function, a memory address setting process is executed (step S6602), and the series of processes ends.

図67は、上述したステップS6601,S6602におけるメモリアドレス設定処理を表す。図67において、まず、m,s,fを下記のように設定する(ステップS6701)。   FIG. 67 shows the memory address setting process in steps S6601 and S6602 described above. In FIG. 67, first, m, s, and f are set as follows (step S6701).

m=テーブル5[func2].メモリ名
s=テーブルS[func3].分割後半サイズ(func3がテーブル6−1に含まれる場合)
もしくは
s=テーブルS[func3].サイズ(func3がテーブル6−1に含まれない場合)
f=func3の後ろに“_L”を連結した文字列
m = table 5 [func2]. Memory name s = table S [func3]. Second half size of division (when func3 is included in table 6-1)
Or s = table S [func3]. Size (when func3 is not included in table 6-1)
Character string with “_L” concatenated after f = func3

つぎに、テーブル6に下記のエントリを追加する(ステップS6702)。最後に、配列addr[m]にsを追加して(ステップS6703)一連のアドレス設定処理を終了する。   Next, the following entry is added to the table 6 (step S6702). Finally, s is added to the array addr [m] (step S6703), and the series of address setting processes is terminated.

テーブル6[f].アドレス=addr[m]
テーブル6[f].メモリ名=m
Table 6 [f]. Address = addr [m]
Table 6 [f]. Memory name = m

図68は、電力制御メモリのアドレス計算開始時のテーブル6・配列addrのデータ例を示すデータテーブルである。図66および図67によって、func2=A1として処理をおこなった場合、m=バンク2、s=テーブルS[A1].分割後半サイズ=2460となる。したがって、テーブル6には、データテーブル6810のように、関数A1_Lが追加される。また、今回のメモリアドレス設定処理によって、配列addrには、データテーブル6820のようにバンク2の開始アドレスが関数A1_Lに応じてあらたに追加される。   FIG. 68 is a data table showing a data example of the table 6 / array addr at the start of address calculation of the power control memory. 66 and 67, when processing is performed with func2 = A1, m = bank 2, s = table S [A1]. The latter half size = 2460. Therefore, the function A1_L is added to the table 6 as in the data table 6810. In addition, by the memory address setting process this time, the start address of the bank 2 is newly added to the array addr according to the function A1_L as in the data table 6820.

図69は、電力制御メモリのアドレス計算実行後のテーブル6・配列addrのデータ例を示すデータテーブルである。図66,67によって、func2=A1として処理をおこない、テーブル5[A1]の子孫関数についてメモリアドレス設定処理をおこなう場合、対象となるfunc3は関数B1となる。したがって、m=バンク2、s=テーブルS[A1].サイズ=2560となる(B1はテーブル6には含まれていないため)。したがって、テーブル6には、データテーブル6910のように、関数B1_Lが追加される。また、今回のメモリアドレス設定処理によって、配列addrには、データテーブル6920のようにバンク2の開始アドレスが関数B1_Lに応じてあらたに追加される。   FIG. 69 is a data table showing a data example of the table 6 / array addr after execution of address calculation of the power control memory. 66 and 67, when processing is performed with func2 = A1 and the memory address setting processing is performed for the descendant function of the table 5 [A1], the target func3 is the function B1. Therefore, m = bank 2, s = table S [A1]. Size = 2560 (since B1 is not included in Table 6). Therefore, a function B1_L is added to the table 6 as in the data table 6910. In addition, by the memory address setting process this time, the start address of the bank 2 is newly added to the array addr according to the function B1_L as in the data table 6920.

図70は、子孫関数についてのアドレス計算時のテーブル6・配列addrのデータ例を示すデータテーブルである。図66および図67によって、テーブル5[A1]の子孫関数についてすべてメモリアドレス設定処理をおこなうと、テーブル6には、データテーブル7010のように、関数A_1,B1_L,B2_L,B3_L,B10,C1_Lが追加される。また、配列addrには、データテーブル7020のようにバンク2の開始アドレスが追加されたエントリに応じて追加された状態となる。   FIG. 70 is a data table showing a data example of the table 6 and the array addr at the time of address calculation for the descendant function. 66 and 67, when all the memory address setting processes are performed for the descendant functions of the table 5 [A1], the functions A_1, B1_L, B2_L, B3_L, B10, and C1_L are stored in the table 6 as in the data table 7010. Added. Further, the array addr is added according to the entry to which the start address of the bank 2 is added as in the data table 7020.

図71は、子孫関数についてのアドレス計算完了時のテーブル6・配列addrのデータ例を示すデータテーブルである。図66および図67によって、テーブル5の各関数についてすべてメモリアドレス設定処理をおこなうと、図71のデータテーブル7110のようなテーブル6と、データテーブル7120のような配列addrが作成される。   FIG. 71 is a data table showing a data example of the table 6 / array addr at the time of completion of address calculation for the descendant function. 66 and 67, when the memory address setting processing is performed for all the functions of the table 5, the table 6 such as the data table 7110 of FIG. 71 and the array addr such as the data table 7120 are created.

割当調整・アドレス計算部3005によって作成されたテーブル6が配置情報105として、ソース101を構成する各関数の配置処理に利用される。   The table 6 created by the allocation adjustment / address calculation unit 3005 is used as arrangement information 105 for arrangement processing of each function constituting the source 101.

以上説明したように、実施例4の処理を実現することによって、実施例1〜3を利用した場合には多数の関数を常時ONバンクに配置しなければならない場合であっても、子孫関数の有無や、子孫関数が同一のメモリバンク205に配置されているか否かといった呼出関係の詳細な状況が判断される。そして、他の親関数と比較して、より呼出の頻度が高く、また、常時ONバンクに配置した方が効率的であると判断された関数のみが常時ONバンクに配置される。したがって、ソースの101を構成する関数同士の呼出関係にかかわらず、省電力効果を備えた命令配置処理が可能となる。   As described above, by realizing the processing of the fourth embodiment, even when a large number of functions have to be always placed in the ON bank when the first to third embodiments are used, The detailed situation of the call relationship such as presence / absence and whether or not descendant functions are arranged in the same memory bank 205 is determined. Only functions that are called more frequently than the other parent functions and that are determined to be more efficient when placed in the always-on bank are placed in the always-on bank. Therefore, it is possible to perform instruction arrangement processing having a power saving effect regardless of the calling relationship between the functions constituting the source 101.

(実施例5)
実施例5は、ソース101を利用した動作履歴を考慮して、実際に呼出の多い親関数を主要な親関数に決定する処理が追加されている。具体的には、親関数決定部3001において、あらたに、関数の呼出履歴に関する情報を取得する。そして呼出履歴が多い親関数については、優先的に主要な親関数に決定されるように重み付けをおこなう。
(Example 5)
In the fifth embodiment, in consideration of an operation history using the source 101, a process for determining a parent function that is actually frequently called as a main parent function is added. Specifically, the parent function determination unit 3001 newly acquires information related to the function call history. For parent functions with a large call history, weighting is performed so that the main parent functions are preferentially determined.

図72は、実施例5における親関数決定部の処理を示す説明図である。図72のように、実施例5の場合、親関数決定部3001への入力情報として、ソース101の他に、ソース101を構成する各関数についての呼出履歴7200が追加される。親関数決定部30001では、ソース101を静的情報、呼出履歴7200を動的情報として、それぞれの呼出回数をカウントして重み付けをおこない、テーブル1を作成する。   FIG. 72 is an explanatory diagram illustrating processing of the parent function determination unit according to the fifth embodiment. As shown in FIG. 72, in the case of the fifth embodiment, in addition to the source 101, a call history 7200 for each function constituting the source 101 is added as input information to the parent function determination unit 3001. The parent function determination unit 30001 creates the table 1 by counting the number of calls and weighting the source 101 as static information and the call history 7200 as dynamic information.

図73は、重み付け和を利用した親関数決定処理を示す説明図である。また、図74は、重み付け例を示すデータテーブルである。図73のように、親関数決定部3001では、入力されたソース101を参照して関数ごとに関数別の呼出回数をカウントして、テーブル1−1を作成する(ステップS7301)。同様に、親関数決定部3001では、入力された呼出履歴7200を参照して関数ごとに関数別の呼出回数をカウントしてテーブル1−3を作成する(ステップS7302)。その後、親関数決定部3001は、ステップS7301,S7302のカウント結果を加算し、さらに重み付け和を考慮してテーブル1−4を作成する(ステップS7303)。   FIG. 73 is an explanatory diagram showing parent function determination processing using a weighted sum. FIG. 74 is a data table showing an example of weighting. As shown in FIG. 73, the parent function determination unit 3001 refers to the input source 101, counts the number of calls for each function for each function, and creates a table 1-1 (step S7301). Similarly, the parent function determination unit 3001 creates a table 1-3 by counting the number of calls for each function for each function with reference to the input call history 7200 (step S7302). Thereafter, the parent function determination unit 3001 adds the count results of steps S7301 and S7302 and further creates a table 1-4 in consideration of the weighted sum (step S7303).

図74に例示したように、ステップS7301によって作成されるテーブル1−1は、実施例4の親関数決定部3001と同様に、コールグラフ103から各親関数の呼出回数が子関数ごとにカウントされたデータテーブル7410のような構成になる。また、ステップS7302によって作成されるテーブル1−3は、呼出履歴7200に記録された実際の呼出回数がカウントされたデータテーブル7420のような構成になる。   As illustrated in FIG. 74, in the table 1-1 created in step S7301, the number of calls of each parent function is counted for each child function from the call graph 103, like the parent function determination unit 3001 of the fourth embodiment. The data table 7410 is configured. Further, the table 1-3 created in step S7302 has a configuration like a data table 7420 in which the actual number of calls recorded in the call history 7200 is counted.

そして、ステップS7303では、テーブル1−1とテーブル1−3のカウント結果をどのように反映させるかに応じて重み付け和が設定される。図74では、呼出履歴7200の情報を重用して主要な親関数を決定するため、静的なテーブル1−1のカウント回数と、動的なテーブル1−3のカウント回数との比率を1:9に設定している。   In step S7303, a weighted sum is set according to how the count results of the tables 1-1 and 1-3 are reflected. In FIG. 74, since the main parent function is determined by using the information of the call history 7200, the ratio of the count number of the static table 1-1 and the count number of the dynamic table 1-3 is 1: 9 is set.

したがって、テーブル1−4は、テーブル1−1のカウント回数×1と、テーブル1−3のカウント回数×9との加算結果が親関数と子関数との呼出の優先度を表すポイントとして設定されたデータテーブル7430のような構成になる。たとえば、MAIN−A1の呼出関係のポイントは、2(回数)×1(重み)+15(回数)×9(重み)=137(ポイント)と決定される。   Therefore, the table 1-4 is set as a point where the addition result of the number of counts x1 of the table 1-1 and the number of counts x9 of the table 1-3 represents the priority of calling the parent function and the child function. The data table 7430 is configured. For example, the call-related point of MAIN-A1 is determined as 2 (number of times) × 1 (weight) +15 (number of times) × 9 (weight) = 137 (points).

最後に、親関数決定部3001は、ステップS7303によって作成されたテーブル1−4を参照して、呼出先関数ごとに回数の欄が最大である呼出元関数を主要親関数として選択し(ステップS7304)、テーブル1を作成する。したがって、ステップS7304によって作成されたテーブル1は、実施例4の場合と異なり呼出履歴7200が反映された構成になっている。   Finally, the parent function determination unit 3001 refers to the table 1-4 created in step S7303 and selects the caller function having the maximum number of times for each callee function as the main parent function (step S7304). ), Create table 1. Therefore, unlike the case of the fourth embodiment, the table 1 created in step S7304 has a configuration in which the call history 7200 is reflected.

以上説明したように、実施例5の処理を実現することによって、ソース101を利用した処理について、より動作実態に近い呼出状況を想定することができる。すなわち、複数の関数から呼び出される可能性がある親関数のうち、実際に呼び出される可能性が高い親関数が優先的に常時ONバンクに割り当てられる。したがって、作成された配置情報105による関数の振り分けによる省電力効果を高めることができる。   As described above, by realizing the processing of the fifth embodiment, it is possible to assume a calling situation that is closer to the actual operation of the processing using the source 101. That is, among the parent functions that can be called from a plurality of functions, the parent function that is likely to be actually called is always preferentially assigned to the ON bank. Therefore, it is possible to enhance the power saving effect due to the function distribution based on the created arrangement information 105.

(実施例6)
実施例6は、用意されたメモリバンク205群のうち、優先的に電力制御バンクとして利用したいメモリを設定する処理が追加されている。優先的に電力制御バンクとして利用したいメモリとは、たとえば、高速な電圧変化が可能なメモリや、消費電力の少ないメモリなどが挙げられる。上述のような特徴を備えたメモリを電力制御バンクとして利用することによって、無作為に電力制御バンクを設定する場合と比較して、電力消費量を抑えることができる。
(Example 6)
In the sixth embodiment, a process for preferentially setting a memory to be used as a power control bank in the prepared memory bank 205 group is added. Examples of the memory that is preferentially used as the power control bank include a memory that can change voltage at high speed and a memory that consumes less power. By using a memory having the above-described features as a power control bank, power consumption can be reduced as compared with a case where a power control bank is set at random.

図75は、実施例6におけるメモリ割当処理を示す説明図である。実施例6では、常時ONメモリ割当部3002と、電力制御メモリ割当部3004とにおける割当処理の際に、あらたに割当優先度情報付きのテーブルM(以下、「テーブルM’」とよぶ)を利用する。したがって、常時ONメモリ割当部3002によって作成されるテーブル3も、電力制御メモリ割当部3004によって作成されるテーブル5もテーブルM’を参照した値になっている。   FIG. 75 is an explanatory diagram of the memory allocation process according to the sixth embodiment. In the sixth embodiment, a table M with allocation priority information (hereinafter referred to as “table M ′”) is used for allocation processing in the always-on memory allocation unit 3002 and the power control memory allocation unit 3004. To do. Accordingly, both the table 3 created by the always-on memory allocation unit 3002 and the table 5 created by the power control memory allocation unit 3004 have values referring to the table M ′.

図76は、割当優先度情報付きのメモリ情報のデータ例を示すデータテーブル。割当優先度付きのメモリ情報として提供されるテーブルM’は、データテーブル7600のように、メモリバンク205ごとに、優先度が関連付けられた構成になっている。優先度は、常時ONバンクにしたいメモリバンク205ほど値が大きくなるように設定されている。なお、優先度の設定は、利用者が手動でおこなってもよいし、上位プログラムが電力制御システムとして提供されたメモリバンク205のスペックから一意的に設定してもよく、特に限定はない。   FIG. 76 is a data table showing a data example of memory information with allocation priority information. The table M ′ provided as the memory information with the allocation priority has a configuration in which the priority is associated with each memory bank 205 as in the data table 7600. The priority is set so that the value increases as the memory bank 205 that is to be always ON is set. The priority may be set manually by the user, or the upper program may be uniquely set from the specifications of the memory bank 205 provided as the power control system, and there is no particular limitation.

実施例6の場合、常時ONメモリ割当部3002と、電力制御メモリ割当部3004とでは、実施例4において説明した割当処理を実行する前段の処理として、テーブルM’を優先度順位ソートする手順が追加される。   In the case of the sixth embodiment, the always-on memory allocation unit 3002 and the power control memory allocation unit 3004 have a procedure for sorting the priority order of the table M ′ as the preceding process for executing the allocation process described in the fourth embodiment. Added.

図77は、常時ONメモリ割当時ソートの手順を示すフローチャートである。図77において、まず、テーブルM’を優先度順にソートする(ステップS7701)。そして、ソートされたテーブルM’に応じて常時OMメモリに配置する階層数・メモリ割当を決定して(ステップS7702)、一連の処理を終了する。   FIG. 77 is a flowchart showing the procedure for sorting when the always-on memory is allocated. In FIG. 77, first, the table M 'is sorted in order of priority (step S7701). Then, the number of hierarchies and memory allocation to be always arranged in the OM memory are determined according to the sorted table M '(step S7702), and the series of processes is terminated.

図78は、ソート後の割当優先度情報付きのメモリ情報のデータ例を示すデータテーブル。ステップS7701のソート処理では、テーブルM’の各エントリを優先度が大きい順に並べ替えるため、データテーブル7800のような構成に変更される。   FIG. 78 is a data table showing a data example of memory information with allocation priority information after sorting. In the sorting process in step S7701, the entries in the table M ′ are rearranged in descending order of priority, so that the configuration is changed to a data table 7800.

図79は、電力制御メモリ割当時ソートの手順を示すフローチャートである。図79において、まず、テーブルM’を優先度順にソートする(ステップS7901)。そして、ソートされたテーブルM’に応じて部分木ごとのメモリ割当を決定して(ステップS7902)、一連の処理を終了する。図77,79のフローチャートから明らかなように、実施例6は、実施例4にソート処理を実行するステップを追加するだけで容易に実現可能となる。   FIG. 79 is a flowchart showing the sorting procedure when allocating power control memory. In FIG. 79, first, the table M 'is sorted in order of priority (step S7901). Then, memory allocation for each subtree is determined in accordance with the sorted table M ′ (step S7902), and a series of processing ends. As is apparent from the flowcharts of FIGS. 77 and 79, the sixth embodiment can be easily realized by adding a step for executing the sort process to the fourth embodiment.

以上説明したように、実施例6の処理を実現することによって、メモリバンク205群の中に電力制御バンクとしての利用が適しているメモリがある場合には、このメモリを優先的に電力制御バンクとして利用することができる。したがって、メモリの機能を活かした効率的な電力供給が可能となり、さらなる省電力効果が期待できる。   As described above, by realizing the processing of the sixth embodiment, when there is a memory suitable for use as a power control bank in the memory bank 205 group, this memory is preferentially used as the power control bank. Can be used as Therefore, efficient power supply utilizing the function of the memory becomes possible, and further power saving effect can be expected.

(実施例7)
実施例7は、各メモリバンク205の割当処理と同時に、メモリバンク205の残容量のより精密な評価を可能にする。関数を配置した後のメモリバンク205の空き容量を正確に評価することによって、わずかな評価誤差で関数を配置できる、もしくは配置できないといった判断をおこなう場合であってもメモリの容量を最大限に活用することができる。
(Example 7)
The seventh embodiment enables more precise evaluation of the remaining capacity of the memory bank 205 simultaneously with the allocation process of each memory bank 205. By accurately evaluating the free capacity of the memory bank 205 after the function is placed, even if it is determined that the function can be placed or cannot be placed with a slight evaluation error, the memory capacity is utilized to the maximum. can do.

図80は、実施例7における電力制御メモリ割当処理を示す説明図である。実施例7では、電力制御メモリ割当部3004において、割当処理を実行後に、あらたに残りメモリ量を評価するステップを追加する。この追加ステップによって、実施例4よりも、精密に残りメモリ量を評価する。   FIG. 80 is an explanatory diagram of power control memory allocation processing according to the seventh embodiment. In the seventh embodiment, the power control memory allocation unit 3004 newly adds a step of evaluating the remaining memory amount after executing the allocation process. By this additional step, the remaining memory amount is evaluated more precisely than in the fourth embodiment.

図81は、残りメモリ量の評価の手順を示すフローチャートである。図81のフローチャートは、図53にて説明したテーブル5への割当処理の手順を示すフローチャートにおいて、ステップS5303の後に実行する処理を表す。   FIG. 81 is a flowchart showing a procedure for evaluating the remaining memory capacity. The flowchart in FIG. 81 represents a process executed after step S5303 in the flowchart showing the procedure of the allocation process to the table 5 described in FIG.

図81において、まず、テーブル5に割り当てた関数の中に、他の電力制御バンクから呼び出される関数があるか否かを判断する(ステップS8101)。他の電力制御バンクから呼び出される関数があると判断された場合(ステップS8101:Yes)、該当する関数についてのメモリ量を評価して(ステップS8102)、一連の評価処理を終了する。   In FIG. 81, first, it is determined whether or not there is a function called from another power control bank among the functions assigned to the table 5 (step S8101). If it is determined that there is a function called from another power control bank (step S8101: YES), the memory amount for the corresponding function is evaluated (step S8102), and the series of evaluation processes is terminated.

ステップS8102の評価処理とは、具体的には、まず、他の電力制御バンクから呼び出される関数func’と、func’が割り当てられているメモリm’のメモリ量を求める。なお、メモリm’を一覧表示したのが、図80のテーブル3’となる。そして、現在の残りメモリ量M_rest[m’]に、テーブルS[m’]サイズからテーブルS[m’].分割後半サイズを引いた値を加算した値が正確な残りメモリ量となる。なお、ステップS8101において、他の電力制御バンクから呼び出される関数がないと判断された場合には(ステップS8101:No)、そのまま、一連の評価処理を終了する。   Specifically, the evaluation processing in step S8102 first obtains the function func 'called from another power control bank and the memory amount of the memory m' to which func 'is allocated. The list of the memory m 'is a table 3' in FIG. Then, the current remaining memory amount M_rest [m ′] is changed from the table S [m ′] size to the table S [m ′]. A value obtained by adding a value obtained by subtracting the size of the latter half of the division is an accurate remaining memory amount. If it is determined in step S8101 that there is no function called from another power control bank (step S8101: No), the series of evaluation processes is terminated as it is.

図82は、残りメモリ量の評価時のテーブル5・テーブルM_restのデータ例を示すデータテーブルである。たとえば、関数A1〜関数A4について、メモリ量の評価処理をおこなうと、テーブル5はデータテーブル8210のような構成となる。たとえば、バンク2に割り当てられているC1が関数A1〜関数A4以外の他の関数によって呼び出されていれば、M_rest[バンク2]=M_rest[バンク2]+(テーブルS[C1].サイズ−テーブルS[C1].分割後半サイズ)となる。したがって、M_rest[バンク2]=3524+(2560−2460)=3624となり、データテーブル8220のような構成となる。   FIG. 82 is a data table showing a data example of the table 5 and the table M_rest when the remaining memory amount is evaluated. For example, when the memory amount evaluation process is performed for the function A1 to the function A4, the table 5 has a configuration like the data table 8210. For example, if C1 assigned to bank 2 is called by a function other than the functions A1 to A4, M_rest [bank 2] = M_rest [bank 2] + (table S [C1] .size−table S [C1]. The latter half size). Therefore, M_rest [Bank 2] = 3524 + (2560-2460) = 3624, and the data table 8220 is configured.

以上説明したように、実施例7では、L+1階層の関数ごとに残りのメモリ量を評価する。実施例4の場合、たとえば、オーバーヘッドが存在するが、その一方で、複数のメモリバンク205から呼び出されるために常時ONバンクに配置される関数などは、メモリ量が重複して計算されてしまっていた。一方、実施例7では、メモリ量を正しく計算するため、従来発生していた重複計算された容量を空き領域として利用することが可能となる。したがって、使用するメモリバンク205の総数も減少可能となり、消費電力の削減が期待できる。   As described above, in the seventh embodiment, the remaining memory amount is evaluated for each function of the L + 1 hierarchy. In the case of the fourth embodiment, for example, there is overhead, but on the other hand, the functions that are always placed in the ON bank to be called from the plurality of memory banks 205 are calculated with overlapping memory amounts. It was. On the other hand, in the seventh embodiment, since the memory amount is correctly calculated, it is possible to use the previously calculated overlapped capacity as a free area. Therefore, the total number of memory banks 205 to be used can be reduced, and a reduction in power consumption can be expected.

(実施例8)
実施例8は、複数の関数から呼び出される関数を複製する第1の手法である。実施例8では、コールグラフ103によって示した際に、末端階層にあたる関数のコードを複製することによって、複数の関数から呼び出される親関数の数を削減する。
(Example 8)
The eighth embodiment is a first technique for duplicating a function called from a plurality of functions. In the eighth embodiment, when indicated by the call graph 103, the number of parent functions called from a plurality of functions is reduced by duplicating the code of the function corresponding to the terminal hierarchy.

図83は、実施例8における関数複製処理を示す説明図である。実施例8では、親関数決定部3001の前段に、関数を複製する関数複製部8300を追加した構成になっている。関数複製部8300では、呼出関係を参照して末端階層にある関数を複製する。したがって、親関数決定部3001以降の各機能部では、ソース101に代わって、関数複製部8300によって関数が複製された複製済みソース8301を利用して処理をおこなう。   FIG. 83 is an explanatory diagram of function replication processing according to the eighth embodiment. In the eighth embodiment, a function duplicating unit 8300 for duplicating a function is added to the preceding stage of the parent function determining unit 3001. The function duplicating unit 8300 duplicates the function in the terminal hierarchy with reference to the calling relationship. Therefore, each function unit after the parent function determination unit 3001 performs processing using the copied source 8301 in which the function is copied by the function copying unit 8300 instead of the source 101.

図84は、実施例8における関数複製処理の手順を示すフローチャートである。図84のフローチャートは、ソース101と、テーブルCとの入力をトリガに開始される関数複製処理の手順を表す。図84の各処理を実行することによって、所定の条件を満たす関数を自動的に複製することができる。   FIG. 84 is a flowchart illustrating the procedure of function replication processing according to the eighth embodiment. The flowchart in FIG. 84 shows the procedure of the function duplication process started with the input of the source 101 and the table C as a trigger. By executing each process in FIG. 84, a function that satisfies a predetermined condition can be automatically replicated.

図84において、まず、funcは、テーブルCの末端にあたる関数か否かを判断する(ステップS8401)。funcが、テーブルCの末端にあたる関数であると判断された場合(ステップS8401:Yes)、つぎに、funcは、複数の親をもつ関数であるか否かを判断する(ステップS8402)。   In FIG. 84, first, func determines whether or not the function corresponds to the end of table C (step S8401). When it is determined that func is a function corresponding to the end of the table C (step S8401: Yes), it is determined whether func is a function having a plurality of parents (step S8402).

ステップS8402において、funcが、複数の親をもつ関数であると判断された場合(ステップS8402:Yes)、funcの名前を書き換えて複製する(ステップS8403)。ステップS8403では、具体的には、まず、funcを親関数の数だけコピーして関数名をfuncPi_func(ただし、funcPi(i=1,2,…,(親関数の数))は親関数)と変更する。その後、funcPi内でfuncを呼び出している部分を、funcPi_funcを呼び出すように書き換える。   If it is determined in step S8402 that func is a function having a plurality of parents (step S8402: Yes), the func name is rewritten and copied (step S8403). In step S8403, specifically, first, func is copied by the number of parent functions, and the function name is funcPi_func (where funcPi (i = 1, 2,... (Number of parent functions)) is a parent function). change. After that, the part that calls func in funcPi is rewritten to call funcPi_func.

ステップS8403においてfuncが複製されると、一連の処理が終了する。なお、ステップS8401においてfuncが、テーブルCの末端にあたる関数ではないと判断された場合(ステップS8401:No)、もしくは、ステップS8402においてfuncが、複数の親をもつ関数ではないと判断された場合(ステップS8402:No)、それぞれ、複製を用意する必要はないため、そのまま一連の処理を終了する。   When func is copied in step S8403, a series of processing ends. If it is determined in step S8401 that func is not a function corresponding to the end of table C (step S8401: No), or if it is determined in step S8402 that func is not a function having a plurality of parents ( In step S8402: No), since it is not necessary to prepare a replica for each, a series of processing ends.

図85は、関数複製対象となるテーブルCのデータ例を示すデータテーブルであり、図86は、関数複製済後のテーブルCのデータ例を示すデータテーブルである。関数複製部8300にデータテーブル8500のような構成のテーブルCが入力された場合、関数C1,C2がステップS8401,S8402の条件を満たす。したがって、データテーブル8600のように、関数複製部8300は、関数C1の先頭に呼出元のB9と“_”を付加してB9_C1を複製する。同様に、B10_C1,B11_C2,B12_C2が複製される。   FIG. 85 is a data table showing a data example of the table C to be a function replication target, and FIG. 86 is a data table showing a data example of the table C after the function replication is completed. When the table C configured as the data table 8500 is input to the function duplication unit 8300, the functions C1 and C2 satisfy the conditions of steps S8401 and S8402. Therefore, as in the data table 8600, the function duplication unit 8300 duplicates B9_C1 by adding B9 and “_” of the caller to the head of the function C1. Similarly, B10_C1, B11_C2, and B12_C2 are duplicated.

(実施例9)
実施例9は、複数の関数から呼び出される関数を複製する第2の手法である。実施例8と異なり、実施例9では、電力制御メモリ割当部3004において、複数の関数から呼び出される関数を複製する処理を実行する。電力制御メモリ割当部3004では、合計コード量の多い順にL+1階層以下の関数のまとまりを、First Fit Decreasingアルゴリズムによりメモリバンク205に割り当てている。そこで、実施例9では、割当処理の結果、親関数(呼出元)が複数のバンクに配置されていることがわかったタイミングで関数を表現するコードの複製をおこなう。
Example 9
The ninth embodiment is a second technique for duplicating a function called from a plurality of functions. Unlike the eighth embodiment, in the ninth embodiment, the power control memory allocation unit 3004 executes a process of copying a function called from a plurality of functions. The power control memory allocation unit 3004 allocates a group of functions in the L + 1 layer or lower in order of increasing total code amount to the memory bank 205 using the First Fit Decreasing algorithm. Therefore, in the ninth embodiment, the code representing the function is duplicated at the timing when it is found that the parent function (calling source) is arranged in a plurality of banks as a result of the allocation process.

図87,88は、実施例9における関数複製処理の手順を示すフローチャートである。図87,88のフローチャートは、図53と同様に、テーブル5への割当処理の手順を表している。図87,88の各処理を実行することによって、テーブル5に設定された各関数の子孫関数を割り当てるとともに、複数の関数から呼び出される関数については適宜複製し、複製関数を電力制御バンクに割り当てることもできる。   87 and 88 are flowcharts showing the procedure of the function replication process in the ninth embodiment. The flowcharts of FIGS. 87 and 88 show the procedure of the allocation process to the table 5 as in FIG. 87 and 88, the descendant functions of each function set in Table 5 are assigned, and functions called from a plurality of functions are appropriately duplicated, and the duplicate function is assigned to the power control bank. You can also.

図87,88において、まず、テーブルMのメモリ名フィールドに登場する要素mのうちM_rest[m]≧テーブルS[func].サイズを満たす最初のメモリを抽出する(ステップS8701)。そして、抽出したM_rest[m]をテーブル4の合計コード量との差分サイズに設定する(ステップS8702)。その後、テーブル5[func].割当メモリとして抽出されたmを設定する(ステップS8703)。   87 and 88, first, M_rest [m] ≧ table S [func] .m among the elements m appearing in the memory name field of the table M. The first memory satisfying the size is extracted (step S8701). Then, the extracted M_rest [m] is set to a difference size from the total code amount in Table 4 (step S8702). Then, table 5 [func]. The extracted m is set as the allocation memory (step S8703).

さらに、他の電力制御バンクから呼び出される関数があるか否かを判断する(ステップS8704)。このステップS8704において、他の電力制御バンクから呼び出される関数があると判断された場合(ステップS8704:Yes)、該当する関数についてのメモリ量を評価する(ステップS8705)。一方、他の電力制御バンクから呼び出される関数がないと判断された場合(ステップS8704:No)、そのまま一連の処理を終了する。   Further, it is determined whether there is a function called from another power control bank (step S8704). If it is determined in step S8704 that there is a function called from another power control bank (step S8704: Yes), the memory amount for the corresponding function is evaluated (step S8705). On the other hand, if it is determined that there is no function to be called from another power control bank (step S8704: No), the series of processing ends.

つぎに、図88を用いて、ステップS8705の処理について詳細に説明する。図88において、まず、処理対象のfuncがテーブルCの末端にあたる関数か否かを判断する(ステップS8801)。funcが、テーブルCの末端にあたる関数であると判断された場合(ステップS8801:Yes)、つぎに、funcの名前を書き換えて複製する(ステップS8802)。その後、子孫関数に複製した関数を追加して再度、割当メモリを設定して(ステップS8803)、一連の処理を終了する。   Next, the processing in step S8705 will be described in detail with reference to FIG. In FIG. 88, first, it is determined whether or not the func to be processed is a function corresponding to the end of the table C (step S8801). If it is determined that func is a function corresponding to the end of the table C (step S8801: YES), then the func name is rewritten and copied (step S8802). Thereafter, the duplicated function is added to the descendant function, the allocated memory is set again (step S8803), and the series of processing ends.

なお、ステップS8803における複製処理の詳細は、実施例8と同一であるため、ここでは説明を省略する。また、ステップS8801において、funcが、テーブルCの末端にあたる関数ではないと判断された場合(ステップS8801:No)、関数を複製する必要がないため、割当メモリを設定して(ステップS8804)、そのまま一連の処理を終了する。   Note that details of the duplication process in step S8803 are the same as those in the eighth embodiment, and a description thereof will be omitted here. If it is determined in step S8801 that func is not a function corresponding to the end of the table C (step S8801: No), it is not necessary to duplicate the function, so the allocation memory is set (step S8804) and is left as it is. A series of processing ends.

図89は、関数複製済後のテーブルCのデータ例を示すデータテーブルであり、図90は、関数複製後のテーブルM_restのデータ例を示すデータテーブルである。通常の割当処理の場合、データテーブル8920のようなテーブル5が作成される。したがって、図87,88の処理を追加することによって、データテーブル8910のように、関数A4に複製された子孫関数B9_C1が追加される。複製された子孫関数B9_C1が追加されることによって、デーブルM_restの値も、データテーブル9000のバンク4のように、追加分のメモリが利用され、残りメモリ量が変更される。   FIG. 89 is a data table showing a data example of the table C after the function replication, and FIG. 90 is a data table showing a data example of the table M_rest after the function replication. In the case of normal allocation processing, a table 5 such as a data table 8920 is created. Therefore, by adding the processes of FIGS. 87 and 88, the descendant function B9_C1 copied to the function A4 is added as in the data table 8910. By adding the copied descendant function B9_C1, the value of the table M_rest also uses the additional memory as in the bank 4 of the data table 9000, and the remaining memory amount is changed.

以上説明したように、実施例8,9の処理を実現することによって、実施例4に関数複製部8300を追加するまたは、電力制御メモリ割当部3004に処理を追加するといった比較的簡易な処置のみで、複数の関数から呼び出される関数を複製することができる。すなわち、下位の階層でありながら、複数の関数に呼び出されるような関数については、あらかじめ複製を用意するため、複数のメモリバンク205に配置されるような呼出元関数の発生を防ぐことができ、常時ONバンクの増加を防ぎ、省電力効果を保つことができる。   As described above, by realizing the processing of the eighth and ninth embodiments, only a relatively simple measure such as adding the function duplicating unit 8300 to the fourth embodiment or adding the processing to the power control memory allocation unit 3004. Thus, a function called from a plurality of functions can be duplicated. In other words, for functions that are called by a plurality of functions in a lower hierarchy, since a copy is prepared in advance, it is possible to prevent occurrence of caller functions that are arranged in a plurality of memory banks 205, It is possible to prevent an increase in the number of always-on banks and maintain a power saving effect.

なお、実施例5にて説明した関数の呼出履歴を利用した親関数設定処理、実施例6にて説明した優先度に応じたメモリバン205の設定処理、実施例7にて説明したメモリ量計算、さらに、実施例8,9にて説明した命令の複製処理は、それぞれ実施例1〜3にも適用してもよい。   The parent function setting process using the function call history described in the fifth embodiment, the memory van 205 setting process according to the priority described in the sixth embodiment, the memory amount calculation described in the seventh embodiment, Further, the instruction duplication processing described in the eighth and ninth embodiments may be applied to the first to third embodiments.

以上実施例4〜9にて、説明したように、本実施の形態にかかる命令配置プログラム、命令配置装置、および命令配置方法によれば、コールグラフ103によって、命令同士の呼び出し関係を特定し、利用頻度の高い命令群とそれ以外の命令群とに分類する。さらに、実施例4〜9では、利用頻度と、配置効率を考慮した条件を設けている。したがって、利用頻度の高い命令群の中でも、必要最低限の命令群のみを、常時電力が供給されるメモリバンク205へ配置するように設定した配置情報105を作成する。結果として、コールグラフ103の表す呼出関係の状態にかかわらず、電力供給先となるメモリバンク205を頻繁に切り替えるような事態を避け、効率的な電力制御を図ることができる。   As described in Examples 4 to 9 above, according to the instruction placement program, the instruction placement apparatus, and the instruction placement method according to the present embodiment, the call relationship between the instructions is specified by the call graph 103, The command group is classified into a frequently used instruction group and other instruction groups. Furthermore, in Examples 4 to 9, conditions that take into account the use frequency and the arrangement efficiency are provided. Therefore, the arrangement information 105 is created so that only the minimum necessary instruction group among the frequently used instruction groups is arranged in the memory bank 205 to which power is always supplied. As a result, regardless of the state of the call relationship represented by the call graph 103, it is possible to avoid a situation in which the memory bank 205 as the power supply destination is frequently switched and to achieve efficient power control.

なお、本実施の形態で説明した命令配置方法は、あらかじめ用意されたプログラムをパーソナル・コンピュータやワークステーションなどのコンピュータで実行することにより実現することができる。本命令配置プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVDなどのコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本命令配置プログラムは、インターネットなどのネットワークを介して配布してもよい。   The instruction arrangement method described in the present embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. The command arrangement program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer. The instruction placement program may be distributed via a network such as the Internet.

また、本実施の形態で説明した命令配置装置100は、スタンダードセルやストラクチャードASIC(Application Specific Integrated Circuit)などの特定用途向けIC(以下、単に「ASIC」と称す。)やFPGAなどのPLD(Programmable Logic Device)によっても実現することができる。具体的には、たとえば、上述した命令配置装置100の機能(取得部601〜算出部607)をHDL記述によって機能定義し、そのHDL記述を論理合成してASICやPLDに与えることにより、命令配置装置100を製造することができる。   In addition, the instruction placement apparatus 100 described in the present embodiment is a specific application IC (hereinafter simply referred to as “ASIC”) such as a standard cell or a structured ASIC (Application Specific Integrated Circuit), or a PLD (Programmable) such as an FPGA. It can also be realized by Logic Device). Specifically, for example, the function (acquisition unit 601 to calculation unit 607) of the above-described instruction arrangement device 100 is defined by HDL description, and the HDL description is logically synthesized and given to the ASIC or PLD. The device 100 can be manufactured.

上述した実施の形態に関し、さらに以下の付記を開示する。   The following additional notes are disclosed with respect to the embodiment described above.

(付記1)コンピュータを、
対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する取得手段、
前記取得手段によって取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する分類手段、
前記分類手段によって第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する作成手段、
前記作成手段によって作成された配置情報を出力する出力手段、
として機能させることを特徴とする命令配置プログラム。
(Appendix 1) Computer
An acquisition means for acquiring a call graph representing a call relationship between instructions in firmware applied to a target device;
Among the instructions represented by the call graph acquired by the acquisition means, a classification means for classifying into a first instruction group located above a predetermined hierarchy from the top and a second instruction group other than the instruction,
The code for calling the instructions classified into the first instruction group by the classification means is set to be arranged in the first memory bank to which power is always supplied among the memory banks mounted on the target device. Creating means for creating the arranged information,
Output means for outputting the arrangement information created by the creating means;
An instruction placement program characterized by causing it to function as

(付記2)前記作成手段は、前記第2の命令群に分類された命令を呼び出すためのコードを、前記第1のメモリバンク以外のメモリバンクへ配置するように設定した配置情報を作成することを特徴とする付記1に記載の命令配置プログラム。 (Additional remark 2) The said preparation means produces the arrangement | positioning information set so that the code for calling the instruction classified into the said 2nd instruction group might be arrange | positioned to memory banks other than the said 1st memory bank The instruction arrangement program according to appendix 1, characterized by:

(付記3)前記コンピュータを、さらに、
前記取得手段によって取得されたコールグラフによって表された命令に特定の命令が含まれているか否かを判断する判断手段、として機能させ、
前記作成手段は、前記判断手段によって前記特定の命令が含まれていると判断された場合、前記第1のメモリバンクに前記特定の命令を呼び出すコードを配置するように設定した配置情報を作成することを特徴とする付記1または2に記載の命令配置プログラム。
(Supplementary note 3)
Function as a determination unit that determines whether or not a specific command is included in the command represented by the call graph acquired by the acquisition unit;
The creation means creates placement information set to place a code that calls the particular instruction in the first memory bank when the judgment means determines that the specific instruction is included. The instruction arrangement program according to appendix 1 or 2, characterized in that:

(付記4)前記コンピュータを、さらに、
前記取得手段によって取得されたコールグラフによって表された命令のうち、所定数以上の命令からの呼び出し対象となっている命令を抽出する抽出手段、として機能させ、
前記作成手段は、前記抽出手段によって前記所定数以上の命令からの呼び出し対象となっている命令が抽出された場合、前記第1のメモリバンクに、前記抽出された命令を呼び出すコードを配置するように設定された配置情報を作成することを特徴とする付記1〜3のいずれか一つに記載の命令配置プログラム。
(Supplementary note 4)
Among the instructions represented by the call graph acquired by the acquisition means, function as an extraction means for extracting instructions that are call targets from a predetermined number of instructions,
The creation means arranges a code for calling the extracted instruction in the first memory bank when the extraction means extracts instructions to be called from the predetermined number of instructions or more. 4. The instruction placement program according to any one of appendices 1 to 3, wherein the placement information set in the above is created.

(付記5)前記コンピュータを、さらに、
前記抽出手段は、前記取得手段によって取得されたコールグラフによって表された命令のうち、ライブラリ関数となっている命令を抽出し、
前記作成手段は、前記抽出手段によってライブラリ関数となっている命令が抽出された場合、前記第1のメモリバンクに、前記抽出された命令を呼び出すコードを配置するように設定された配置情報を作成することを特徴とする付記4に記載の命令配置プログラム。
(Supplementary note 5)
The extraction unit extracts an instruction that is a library function from among the instructions represented by the call graph acquired by the acquisition unit,
The creation means creates placement information set to place a code that calls the extracted instruction in the first memory bank when an instruction that is a library function is extracted by the extraction means. The instruction arrangement program according to appendix 4, characterized in that:

(付記6)前記コンピュータを、さらに、
前記配置情報によって前記第1のメモリバンクへ配置すると設定されたコードのデータの総量を算出する算出手段、
前記作成手段は、前記算出手段によって算出されたデータの総量の値に応じて、前記第1のメモリバンクの数を変更し、変更後の第1のメモリバンクに、前記第1の命令群を呼び出すコードを分散して配置するように設定した配置情報を作成することを特徴とする付記1〜5のいずれか一つに記載の命令配置プログラム。
(Supplementary note 6)
Calculating means for calculating a total amount of code data set to be arranged in the first memory bank according to the arrangement information;
The creating means changes the number of the first memory banks according to the value of the total amount of data calculated by the calculating means, and the first instruction group is stored in the changed first memory bank. 6. The instruction arrangement program according to any one of appendices 1 to 5, wherein arrangement information set so as to distribute and arrange codes to be called is created.

(付記7)前記作成手段は、前記第2の命令群を呼び出すコードのうち、上位の階層の命令が一致する命令同士を前記第1のメモリバンク以外の同一のメモリバンクへ配置するように設定した配置情報を作成することを特徴とする付記1〜6のいずれか一つに記載の命令配置プログラム。 (Additional remark 7) The said creation means sets so that the instructions in which the instruction | command of an upper hierarchy corresponds among the codes which call the said 2nd instruction group may be arrange | positioned in the same memory bank other than the said 1st memory bank The instruction placement program according to any one of appendices 1 to 6, wherein the placement information is created.

(付記8)前記算出手段は、配置情報によって同一のメモリバンクに配置すると設定されたコードごとに、それぞれデータの総量を算出し、
前記出力手段は、前記算出手段によって算出されたデータの総量を出力することを特徴とする付記5〜7のいずれか一つに記載の命令配置プログラム。
(Supplementary note 8) The calculation means calculates the total amount of data for each code set to be arranged in the same memory bank according to the arrangement information,
The instruction output program according to any one of appendices 5 to 7, wherein the output means outputs a total amount of data calculated by the calculation means.

(付記9)前記分類手段は、前記第1の命令群に分類された命令の中から所定の条件を満たす命令を、あらたに前記第2の命令群に分類することを特徴とする付記1〜8のいずれか一つに記載の命令配置プログラム。 (Additional remark 9) The said classification | category means newly classify | categorizes the instruction which satisfy | fills a predetermined condition among the instructions classified into the said 1st instruction group into the said 2nd instruction group. The instruction arrangement program according to any one of 8.

(付記10)前記分類手段は、前記第1の命令群に分類された命令について、それぞれ、前記コールグラフから特定される同一の命令からの呼び出し回数が最多となる命令以外の命令を、あらたに前記第2の命令群に分類することを特徴とする付記9に記載の命令配置プログラム。 (Supplementary Note 10) For the instructions classified into the first instruction group, the classification means newly adds instructions other than the instruction that has the highest number of calls from the same instruction specified from the call graph. The instruction placement program according to appendix 9, wherein the instruction placement program is classified into the second instruction group.

(付記11)前記分類手段は、前記第1の命令群に分類された命令について、それぞれ、前記ファームウェアの動作履歴から特定される同一の命令からの呼び出し回数が最多となる命令以外の命令を、あらたに前記第2の命令群に分類することを特徴とする付記9に記載の命令配置プログラム。 (Supplementary Note 11) For the instructions classified into the first instruction group, each of the classification means includes an instruction other than the instruction having the highest number of calls from the same instruction specified from the operation history of the firmware. The instruction placement program according to appendix 9, wherein the instruction placement program is newly classified into the second instruction group.

(付記12)前記作成手段は、前記メモリバンクの中から指定されたメモリバンクに優先的に前記第1の命令群を呼び出すためのコードを配置するように設定した配置情報を作成することを特徴とする付記1〜11のいずれか一つに記載の命令配置プログラム。 (Additional remark 12) The said creation means produces the arrangement information set so that the code | cord | chord for calling the said 1st instruction group preferentially may be arrange | positioned to the memory bank designated from the said memory bank. The instruction arrangement program according to any one of appendices 1 to 11.

(付記13)前記算出手段は、算出結果として得られた前記第1のメモリバンクへ配置すると設定されたコードのデータの総量から、前記第1のメモリバンクに配置された同一の命令を呼び出すコードの容量を減算し、
前記出力手段は、
前記算出手段による減算結果を出力することを特徴とする付記6に記載の命令配置プログラム。
(Additional remark 13) The said calculation means is a code which calls the same instruction | indication arrange | positioned in the said 1st memory bank from the total amount of the data of the code | cord | chord set when arrange | positioning to the said 1st memory bank obtained as a calculation result Subtract the capacity of
The output means includes
The instruction arrangement program according to appendix 6, wherein a subtraction result obtained by the calculating means is output.

(付記14)前記コンピュータを、さらに、
前記コールグラフによって表された最下層の命令のうち、複数の命令から呼び出される命令の複製を当該命令とは異なる命令として作成する複製手段として機能させ、
前記分類手段は、前記複製手段によって作成された命令をそれぞれ前記第1の命令群と前記第2の命令群とに分類することを特徴とする付記1〜8のいずれか一つに記載の命令配置プログラム。
(Supplementary note 14)
Among the lowermost instructions represented by the call graph, function as a duplicating means for creating a duplicate of an instruction called from a plurality of instructions as an instruction different from the instruction,
The instruction according to any one of appendices 1 to 8, wherein the classification means classifies the instructions created by the duplication means into the first instruction group and the second instruction group, respectively. Placement program.

(付記15)前記コンピュータを、さらに、
前記コールグラフによって表された最下層の命令のうち、複数の命令から呼び出される命令の複製を当該命令とは異なる命令として作成する複製手段として機能させ、
前記分類手段は、前記第1の命令群に分類された命令の中から所定の条件を満たす命令を、あらたに前記第2の命令群に分類することを特徴とする付記9〜13のいずれか一つに記載の命令配置プログラム。
(Supplementary note 15)
Among the lowermost instructions represented by the call graph, function as a duplicating means for creating a duplicate of an instruction called from a plurality of instructions as an instruction different from the instruction,
Any one of appendices 9 to 13, wherein the classifying unit newly classifies an instruction satisfying a predetermined condition from among the instructions classified into the first instruction group, into the second instruction group. The instruction arrangement program according to one.

(付記16)前記コンピュータを、さらに、
前記分類手段によって分類された第2の命令群のうち、複数の命令から呼び出される命令の複製を当該命令とは異なる命令として作成する複製手段として機能させ、
前記分類手段は、前記複製手段によって前記命令の複製が作成された場合、当該複製後の命令をそれぞれ前記第1の命令群と前記第2の命令群とに分類することを特徴とする付記1〜8のいずれか一つに記載の命令配置プログラム。
(Supplementary note 16)
Of the second instruction group classified by the classification means, function as a duplication means for creating a duplicate of an instruction called from a plurality of instructions as an instruction different from the instruction,
The classifying means classifies the copied instruction into the first instruction group and the second instruction group, respectively, when the instruction is duplicated by the duplicating means. The instruction arrangement program according to any one of 8 to 8.

(付記17)前記コンピュータを、さらに、
前記分類手段によって分類された第2の命令群のうち、複数の命令から呼び出される命令の複製を当該命令とは異なる命令として作成する複製手段として機能させ、
前記分類手段は、前記複製手段によって前記命令の複製が作成された場合、当該複製後の命令について、前記第1の命令群に分類された命令の中から所定の条件を満たす命令を、あらたに前記第2の命令群に分類することを特徴とする付記9〜13のいずれか一つに記載の命令配置プログラム。
(Supplementary note 17)
Of the second instruction group classified by the classification means, function as a duplication means for creating a duplicate of an instruction called from a plurality of instructions as an instruction different from the instruction,
In the case where a copy of the instruction is created by the duplication unit, the classification unit newly adds an instruction satisfying a predetermined condition from among the instructions classified in the first instruction group for the instruction after the duplication. The instruction arrangement program according to any one of appendices 9 to 13, wherein the instruction arrangement program is classified into the second instruction group.

(付記18)対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する取得手段と、
前記取得手段によって取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する分類手段と、
前記分類手段によって第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する作成手段と、
前記作成手段によって作成された配置情報を出力する出力手段と、
を備えることを特徴とする命令配置装置。
(Supplementary Note 18) Acquisition means for acquiring a call graph representing a call relationship between instructions in firmware applied to a target device;
Among the instructions represented by the call graph acquired by the acquisition means, a classification means for classifying into a first instruction group located above a predetermined hierarchy from the top and a second instruction group other than the instruction;
The code for calling the instructions classified into the first instruction group by the classification means is set to be arranged in the first memory bank to which power is always supplied among the memory banks mounted on the target device. Creating means for creating the arranged information,
Output means for outputting the arrangement information created by the creating means;
An instruction arrangement device comprising:

(付記19)コンピュータが、
対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する取得工程と、
前記取得工程によって取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する分類工程と、
前記分類工程によって第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する作成工程と、
前記作成工程によって作成された配置情報を出力する出力工程と、
を実行することを特徴とする命令配置方法。
(Supplementary note 19)
An acquisition step of acquiring a call graph representing a call relationship between instructions in firmware applied to the target device;
Of the instructions represented by the call graph obtained by the obtaining step, a classification step for classifying into a first instruction group located above a predetermined hierarchy from the top and a second instruction group other than the instruction,
A code for calling the instructions classified into the first instruction group by the classification step is set to be arranged in the first memory bank to which power is always supplied among the memory banks mounted on the target device. Creation process to create the arranged information,
An output step of outputting the arrangement information created by the creation step;
Instruction placement method characterized by executing

100 命令配置装置
101 ソース
102 オブジェクト
103 コールグラフ
104 メモリ分割情報
105 配置情報
110 コンパイラ
120 コールグラフ作成部
200 電力制御システム
201 プロセッサ
202 周辺回路
203 電源
204 制御装置
205 メモリバンク
206 バス
601 取得部
602 分類部
603 作成部
604 出力部
605 判断部
606 抽出部
607 算出部
3001 親関数決定部
3002 常時ONメモリ割当部
3003 コード量計算部
3004 電力制御メモリ割当部
3005 割当調整・アドレス計算部
DESCRIPTION OF SYMBOLS 100 Instruction arrangement apparatus 101 Source 102 Object 103 Call graph 104 Memory division information 105 Arrangement information 110 Compiler 120 Call graph creation part 200 Power control system 201 Processor 202 Peripheral circuit 203 Power supply 204 Control apparatus 205 Memory bank 206 Bus 601 Acquisition part 602 Classification part 603 creation unit 604 output unit 605 determination unit 606 extraction unit 607 calculation unit 3001 parent function determination unit 3002 always-on memory allocation unit 3003 code amount calculation unit 3004 power control memory allocation unit 3005 allocation adjustment / address calculation unit

Claims (6)

コンピュータを、
対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する取得手段、
前記取得手段によって取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する分類手段、
前記分類手段によって第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する作成手段、
前記作成手段によって作成された配置情報を出力する出力手段、
として機能させることを特徴とする命令配置プログラム。
Computer
An acquisition means for acquiring a call graph representing a call relationship between instructions in firmware applied to a target device;
Among the instructions represented by the call graph acquired by the acquisition means, a classification means for classifying into a first instruction group located above a predetermined hierarchy from the top and a second instruction group other than the instruction,
The code for calling the instructions classified into the first instruction group by the classification means is set to be arranged in the first memory bank to which power is always supplied among the memory banks mounted on the target device. Creating means for creating the arranged information,
Output means for outputting the arrangement information created by the creating means;
An instruction placement program characterized by causing it to function as
前記作成手段は、前記第2の命令群に分類された命令を呼び出すためのコードを、前記第1のメモリバンク以外のメモリバンクへ配置するように設定した配置情報を作成することを特徴とする請求項1に記載の命令配置プログラム。   The creation means creates placement information set so that a code for calling an instruction classified into the second instruction group is placed in a memory bank other than the first memory bank. The instruction arrangement program according to claim 1. 前記コンピュータを、さらに、
前記取得手段によって取得されたコールグラフによって表された命令に特定の命令が含まれているか否かを判断する判断手段、として機能させ、
前記作成手段は、前記判断手段によって前記特定の命令が含まれていると判断された場合、前記第1のメモリバンクに前記特定の命令を呼び出すコードを配置するように設定した配置情報を作成することを特徴とする請求項1または2に記載の命令配置プログラム。
Said computer further
Function as a determination unit that determines whether or not a specific command is included in the command represented by the call graph acquired by the acquisition unit;
The creation means creates placement information set to place a code that calls the particular instruction in the first memory bank when the judgment means determines that the specific instruction is included. The instruction arrangement program according to claim 1 or 2, characterized in that
前記分類手段は、前記第1の命令群に分類された命令の中から所定の条件を満たす命令を、あらたに前記第2の命令群に分類することを特徴とする請求項1〜3のいずれか一つに記載の命令配置プログラム。   4. The classification means according to claim 1, wherein the instruction that satisfies a predetermined condition among the instructions classified into the first instruction group is newly classified into the second instruction group. The instruction arrangement program according to any one of the above. 対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する取得手段と、
前記取得手段によって取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する分類手段と、
前記分類手段によって第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する作成手段と、
前記作成手段によって作成された配置情報を出力する出力手段と、
を備えることを特徴とする命令配置装置。
An acquisition means for acquiring a call graph representing a call relationship between instructions in firmware applied to a target device;
Among the instructions represented by the call graph acquired by the acquisition means, a classification means for classifying into a first instruction group located above a predetermined hierarchy from the top and a second instruction group other than the instruction;
The code for calling the instructions classified into the first instruction group by the classification means is set to be arranged in the first memory bank to which power is always supplied among the memory banks mounted on the target device. Creating means for creating the arranged information,
Output means for outputting the arrangement information created by the creating means;
An instruction arrangement device comprising:
コンピュータが、
対象装置に適用されたファームウェア内の命令同士の呼び出し関係を表すコールグラフを取得する取得工程と、
前記取得工程によって取得されたコールグラフによって表された命令のうち、最上位から所定階層以上に位置する第1の命令群と、当該命令以外の第2の命令群とに分類する分類工程と、
前記分類工程によって第1の命令群に分類された命令を呼び出すためのコードを、前記対象装置に搭載されたメモリバンクのうち、常時電力が供給される第1のメモリバンクへ配置するように設定した配置情報を作成する作成工程と、
前記作成工程によって作成された配置情報を出力する出力工程と、
を実行することを特徴とする命令配置方法。
Computer
An acquisition step of acquiring a call graph representing a call relationship between instructions in firmware applied to the target device;
Of the instructions represented by the call graph obtained by the obtaining step, a classification step for classifying into a first instruction group located above a predetermined hierarchy from the top and a second instruction group other than the instruction,
A code for calling the instructions classified into the first instruction group by the classification step is set to be arranged in the first memory bank to which power is always supplied among the memory banks mounted on the target device. Creation process to create the arranged information,
An output step of outputting the arrangement information created by the creation step;
Instruction placement method characterized by executing
JP2009182372A 2009-03-30 2009-08-05 Instruction placement program, instruction placement apparatus, and instruction placement method Expired - Fee Related JP5202472B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009182372A JP5202472B2 (en) 2009-03-30 2009-08-05 Instruction placement program, instruction placement apparatus, and instruction placement method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2009082487 2009-03-30
JP2009082487 2009-03-30
JP2009182372A JP5202472B2 (en) 2009-03-30 2009-08-05 Instruction placement program, instruction placement apparatus, and instruction placement method

Publications (2)

Publication Number Publication Date
JP2010257437A JP2010257437A (en) 2010-11-11
JP5202472B2 true JP5202472B2 (en) 2013-06-05

Family

ID=43318227

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009182372A Expired - Fee Related JP5202472B2 (en) 2009-03-30 2009-08-05 Instruction placement program, instruction placement apparatus, and instruction placement method

Country Status (1)

Country Link
JP (1) JP5202472B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5598375B2 (en) * 2011-02-22 2014-10-01 富士通株式会社 Allocation method for allocating code included in program to memory area and memory system for executing the method
JP5776347B2 (en) * 2011-06-10 2015-09-09 富士通株式会社 Power control method, electronic device, program, and program generation method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3274780B2 (en) * 1994-11-22 2002-04-15 日本無線株式会社 Power supply method
JP2001101010A (en) * 1999-09-30 2001-04-13 Hitachi Ltd Method for optimizing virtual machine
JP2002026803A (en) * 2000-07-12 2002-01-25 Fujitsu Ltd Portable radio terminal device
CN101395580B (en) * 2006-03-01 2012-06-20 诺基亚公司 Reducing the size of computer executable code
JP2007293383A (en) * 2006-04-20 2007-11-08 Toshiba Corp Program development support device and method for operating same device

Also Published As

Publication number Publication date
JP2010257437A (en) 2010-11-11

Similar Documents

Publication Publication Date Title
US5740431A (en) Configuration file management
US20100313182A1 (en) Extensible user interface generation
US7752597B2 (en) Layered software development and implementation using files
JP5352890B2 (en) Computer system operation management method, computer system, and computer-readable medium storing program
US8468496B2 (en) Flexible attribute management in workflow processing systems
JP2002518731A (en) A method for dynamically displaying controls in the toolbar display based on the usage of the controls
KR20130139724A (en) A computing system, a method for controlling thereof, and a computer-readable recording medium having a computer program for controlling thereof
CN115543224B (en) ZNS SSD-based file system control method, device and equipment
CN104216902A (en) Paging data loading method, device and system based on server paging
US20050172235A1 (en) System and method for excluded elements mapping in a user interface
GB2611177A (en) Multi-task deployment method and electronic device
JP5202472B2 (en) Instruction placement program, instruction placement apparatus, and instruction placement method
US9342527B2 (en) Sharing electronic file metadata in a networked computing environment
JP3762829B2 (en) Object management method and information processing system
CN112069189A (en) Method and system for updating multi-level mapping table, terminal device and storage medium
JP6251860B2 (en) Information management apparatus and file management method
US8413114B1 (en) Method to simplify developing software having localization
CN115576565A (en) Application program deployment method and device, electronic equipment and storage medium
CN115292169A (en) UI automation test method and system
US8296731B2 (en) Dynamic method selection based on declarative requirements of interaction scope
CN111966478A (en) Custom task ordering method and device, electronic device and medium
US11113190B2 (en) Mutable type builder
JP5207008B2 (en) Program reorganization system and program reorganization method
JP2003330730A (en) Operating system arranging device
CN113901127B (en) Data management and display method, device and equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120220

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130123

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130129

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130212

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160222

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees