JPH05120028A - Micro computer device - Google Patents

Micro computer device

Info

Publication number
JPH05120028A
JPH05120028A JP28169991A JP28169991A JPH05120028A JP H05120028 A JPH05120028 A JP H05120028A JP 28169991 A JP28169991 A JP 28169991A JP 28169991 A JP28169991 A JP 28169991A JP H05120028 A JPH05120028 A JP H05120028A
Authority
JP
Japan
Prior art keywords
information
variable
source program
subroutine
address
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.)
Granted
Application number
JP28169991A
Other languages
Japanese (ja)
Other versions
JP3018666B2 (en
Inventor
Hiroyuki Masuyama
裕之 増山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP3281699A priority Critical patent/JP3018666B2/en
Publication of JPH05120028A publication Critical patent/JPH05120028A/en
Application granted granted Critical
Publication of JP3018666B2 publication Critical patent/JP3018666B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To generate an object including the high speed operation of a variable and to generate a compact object. CONSTITUTION:In a micro computer device having a specified memory area where data can be read and written at high speed, inputting and analyzing source program information and outputting object information, a means 107 generating function relation information on the call of respective sub-routines in source program information, a means 108 detecting the number of appearing times of all variables used in source program information and generating appearing times information and a means 109 generating variable allocation information as to the variable used in source program information from correlation information and information on the number of the appearing times of the variables are provided. The variables used in source program information are sequentially allocated to a high speed data accessible area from the large number of the appearing times.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、命令によってデータを
高速に呼出しまたは書き込み可能な特定のメモリ領域
(以下、高速アクセスメモリと呼ぶ)を内部に有するマ
イクロコンピュータ用の言語処理プログラムの実行に利
用する。本発明は、コンパクトなオブジェクトを生成す
ることができるマイクロコンピュータ装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is used to execute a language processing program for a microcomputer having a specific memory area (hereinafter referred to as high speed access memory) in which data can be called or written at high speed by an instruction. To do. The present invention relates to a microcomputer device capable of generating compact objects.

【0002】[0002]

【従来の技術】言語処理プログラムが入力したソースを
翻訳し、その結果として生成したファイルをオブジェク
トモジュール(以下、オブジェクトと呼ぶ)と言う。
2. Description of the Related Art A source input by a language processing program is translated, and a file generated as a result is called an object module (hereinafter referred to as an object).

【0003】マイクロコンピュータ、特にシングルチッ
プマイクロコンピュータでは、コストの低減を図ろうと
すると、性能面で制限が生じる。従って、言語処理プロ
グラムにおいては、言語処理を行った結果であるオブジ
ェクトの実行が速いこと、およびオブジェクトのサイズ
が小さいことが望まれている。
In a microcomputer, particularly in a single-chip microcomputer, there is a limitation in performance when trying to reduce the cost. Therefore, in the language processing program, it is desired that the object that is the result of the language processing be executed quickly and that the size of the object be small.

【0004】一般にマイクロコンピュータにおいては、
短い命令コードによりアクセスできるメモリ領域を持つ
ことが普通であり、これを高速アクセスメモリと呼ぶ。
短い命令コードによりアクセスできるため、命令バイト
数を小さくすることができるだけでなく、命令フェッチ
および命令デコードが高速にできるために命令実行時間
も短くなるという利点がある。
Generally, in a microcomputer,
It is common to have a memory area that can be accessed by a short instruction code, and this is called a high-speed access memory.
Since it can be accessed by a short instruction code, the number of instruction bytes can be reduced, and the instruction execution time can be shortened because the instruction fetch and instruction decode can be performed at high speed.

【0005】従来の言語処理プログラムの実行方式で
は、マイクロコンピュータが高速アクセスメモリを持っ
ていた場合でも、高速アクセスメモリは通常のメモリよ
りメモリサイズが小さく、メモリへの割り付けについて
は考慮されていなかったため、すべての変数を通常のメ
モリに割り付けていた。
In the conventional language processing program execution method, even if the microcomputer has a high-speed access memory, the high-speed access memory has a smaller memory size than a normal memory, and the allocation to the memory is not considered. , All variables were allocated in normal memory.

【0006】[0006]

【発明が解決しようとする課題】上述した従来の言語処
理プログラムの実行方式では、変数を通常のメモリに割
り付けていたため、通常のメモリのデータの読み出し、
書き込みのスピードは、高速アクセスメモリのデータの
読み出し、書き込みスピードよりかなり遅くなり、従来
の言語処理プログラムの実行方式では、高速な変数の操
作を含むオブジェクトを生成できなかった。さらに、通
常のメモリのデータの読み出し、書き込みのオブジェク
トコードは、高速アクセスメモリのデータの読み出し、
書き込みのオブジェクトコードよりバイト数が大きいた
め、コンパクトなオブジェクトを生成することができな
かった。
In the above-described conventional language processing program execution method, since variables are assigned to the normal memory, reading of data from the normal memory,
The speed of writing is much slower than the speed of reading and writing data from the high-speed access memory, and the conventional language processing program execution method cannot generate objects including high-speed variable operations. Furthermore, the object code for reading and writing normal memory data is
It was not possible to generate a compact object because the number of bytes was larger than the written object code.

【0007】本発明はこのような問題を解決するもの
で、変数を通常のメモリに割り付ける代わりに、出現回
数の多い順に変数を高速アクセスメモリに割り付け、高
速な変数の操作を含むオブジェクトを生成し、さらにコ
ンパクトなオブジェクトを生成できる装置を提供するこ
とを目的とする。
The present invention solves such a problem. Instead of allocating variables to a normal memory, variables are allocated to a high-speed access memory in descending order of the number of occurrences, and an object including a high-speed variable operation is generated. An object of the present invention is to provide a device that can generate a more compact object.

【0008】[0008]

【課題を解決するための手段】本発明は、データの高速
な読み出し、および書き込みができるメモリ領域と、入
力部および出力部を有し、ソースプログラム情報を入力
して解析しオブジェクト情報を出力する言語処理プログ
ラム実行手段とを備えたマイクロコンピュータ装置にお
いて、前記言語処理プログラム実行手段に、ソースプロ
グラム情報中の各サブルーチンの呼び出しの相関関係情
報を生成する相関関係情報生成部と、ソースプログラム
情報中で使用するすべての変数の出現回数を検出し出現
回数情報を生成する変数出現回数情報生成部と、生成さ
れた相関関係情報および変数の出現回数情報からソース
プログラム情報中で使用する変数についての変数割り付
け情報を生成する変数割り付け情報生成部とを含む構文
解析部を備えたことを特徴とする。
The present invention has a memory area for high-speed reading and writing of data, an input section and an output section, inputs source program information, analyzes it, and outputs object information. In a microcomputer device provided with language processing program executing means, in the language processing program executing means, a correlation information generating section for generating correlation information for calling each subroutine in the source program information, and in the source program information Variable occurrence count information generator that detects the occurrence count of all variables used and generates appearance count information, and variable allocation for variables used in the source program information from the generated correlation information and variable appearance count information It is equipped with a parser that includes a variable allocation information generator that generates information. The features.

【0009】[0009]

【作用】ソースプログラム情報中の各サブルーチンの呼
び出しの相関関係情報、およびソースプログラム情報中
で使用するすべての変数の出現回数の検出による出現回
数情報を生成し、この生成した相関関係情報と変数の出
現回数情報とからソースプログラム情報中で使用する変
数についての変数割り付け情報を生成して、ソースプロ
グラム情報中で使用する変数を出現回数の多い順に高速
データアクセス可能領域に割り付ける。
Operation: Correlation information of each subroutine call in the source program information and appearance frequency information by detecting the appearance frequency of all variables used in the source program information are generated, and the generated correlation information and the variables are generated. Variable allocation information about variables used in the source program information is generated from the appearance frequency information, and variables used in the source program information are allocated to the high-speed data accessible area in descending order of appearance frequency.

【0010】これにより、すべての変数を高速アクセス
メモリに割り付けることができない場合でも、従来の言
語処理プログラムの実行方式による処理に比較して高速
な変数の操作を含むオブジェクトを生成できるととも
に、コンパクトなオブジェクトを生成することができ
る。また、頻繁にアクセスされる変数が優先的に高速ア
クセスメモリに割りつけられるためにより実行速度を向
上させることができる。
As a result, even if all variables cannot be assigned to the high-speed access memory, it is possible to generate an object including a variable operation that is faster than the conventional processing by the language processing program execution method, and it is compact. Objects can be created. Further, since frequently accessed variables are preferentially allocated to the high speed access memory, the execution speed can be improved.

【0011】[0011]

【実施例】次に、本発明実施例を図面に基づいて説明す
る。図1は本発明実施例の構成を示すブロック図であ
る。
Embodiments of the present invention will now be described with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the embodiment of the present invention.

【0012】本発明実施例は、データの高速な読み出
し、および書き込みができるメモリ領域100と、入力
部103および出力部105を有し、ソースプログラム
情報を入力して解析しオブジェクト情報を出力する言語
処理プログラム実行手段102とを備え、言語処理プロ
グラム実行手段102に、ソースプログラム情報中の各
サブルーチンの呼び出しの相関関係情報を生成する相関
関係情報生成部107と、ソースプログラム情報中で使
用するすべての変数の出現回数を検出し出現回数情報を
生成する変数出現回数情報生成部108と、生成された
相関関係情報および変数の出現回数情報からソースプロ
グラム情報中で使用する変数についての変数割り付け情
報を生成する変数割り付け情報生成部109とを含む構
文解析部104を備える。
The embodiment of the present invention has a memory area 100 capable of high-speed reading and writing of data, an input unit 103 and an output unit 105, and is a language for inputting and analyzing source program information and outputting object information. The language processing program executing means 102 is provided with a processing program executing means 102, and in the language processing program executing means 102, a correlation information generating part 107 for generating the correlation information of the call of each subroutine in the source program information, and all the information used in the source program information. A variable appearance number information generation unit 108 for detecting the number of appearances of variables and generating appearance number information, and variable allocation information for variables used in source program information from the generated correlation information and appearance number information of variables. And a syntax analysis unit 104 including a variable allocation information generation unit 109 That.

【0013】次に、このように構成された本発明実施例
の動作について説明する。
Next, the operation of the embodiment of the present invention thus constructed will be described.

【0014】本実施例では、本発明の要点を鮮明にする
ため各サブルーチン中のルーチン呼び出しには再帰的呼
び出しはないものとし、取り扱う変数は、サブルーチン
内の変数のみとする。
In the present embodiment, in order to clarify the point of the present invention, it is assumed that there is no recursive call in the routine call in each subroutine, and the variables handled are only the variables in the subroutine.

【0015】相関関係情報生成部107の処理および変
数出現回数情報生成部108の処理は、既存の言語処理
プログラムの構文解析部が生成する情報により実現可能
である。
The processing of the correlation information generation unit 107 and the processing of the variable appearance number information generation unit 108 can be realized by the information generated by the syntax analysis unit of the existing language processing program.

【0016】図2は、本発明実施例における相関関係情
報生成部により生成された各サブルーチンの呼び出しの
双方向の相関関係情報のイメージ図である。名前mai
n、〔外1〕などはサブルーチン名である。
FIG. 2 is an image diagram of bidirectional correlation information for calling each subroutine generated by the correlation information generating unit in the embodiment of the present invention. Name mai
n, [outer 1], etc. are subroutine names.

【0017】[0017]

【外1】 本実施例では、相関関係情報生成部107、変数出現回
数情報生成部108および変数割り付け情報生成部10
9により生成された情報が格納される場所を示すものを
レコード番号と呼ぶ。レコード番号は(1)から順に割
り付けられ、(0)は何も割り付けられていないことを
示す。さらに、ルーチンを呼ぶ側を親、呼ばれる側を子
供およびルーチン呼び出しがないルーチンをリーフ関数
と呼ぶ。図2の場合は、〔外2〕はmainの子供であ
り、〔外3〕の親である。〔外3〕はリーフ関数であ
る。
[Outer 1] In this embodiment, the correlation information generation unit 107, the variable appearance count information generation unit 108, and the variable allocation information generation unit 10
A record number indicates a location where the information generated by 9 is stored. The record numbers are assigned sequentially from (1), and (0) indicates that nothing is assigned. Furthermore, the side that calls a routine is called a parent, the called side is called a child, and a routine that does not call a routine is called a leaf function. In the case of FIG. 2, [outer 2] is a child of main and is a parent of [outer 3]. [Outer 3] is a leaf function.

【0018】[0018]

【外2】 [Outside 2]

【0019】[0019]

【外3】 図3は本発明実施例における相関関係情報生成部から生
成される各サブルーチンの双方向の相関関係情報を示す
図である。相関関係情報は、サブルーチン名、サブルー
チン内の変数の割り付け番地情報、親のレコード番号の
並び、子供のレコード番号の並び、およびサブルーチン
内の各変数の情報を含む。
[Outside 3] FIG. 3 is a diagram showing bidirectional correlation information of each subroutine generated from the correlation information generating unit in the embodiment of the present invention. The correlation information includes a subroutine name, variable allocation address information in the subroutine, a parent record number sequence, a child record number sequence, and information of each variable in the subroutine.

【0020】図4は本発明実施例における変数出現回数
情報生成部により生成される変数の情報を示す図であ
る。この変数の情報は、変数名、変数のサイズ、出現回
数、次の変数のレコード番号、および割り付け番地を含
み、図3に示すサブルーチンの相関関係情報に含まれて
いるサブルーチン内の各変数の情報に相当する。また、
サブルーチンの相関関係情報に含まれている割り付け番
地情報は変数の情報に含まれている割り付け番地から生
成される情報である。
FIG. 4 is a diagram showing variable information generated by the variable appearance number information generation unit in the embodiment of the present invention. The information of this variable includes the variable name, the size of the variable, the number of appearances, the record number of the next variable, and the allocation address, and the information of each variable in the subroutine included in the correlation information of the subroutine shown in FIG. Equivalent to. Also,
The allocation address information included in the correlation information of the subroutine is information generated from the allocation address included in the variable information.

【0021】図5は図2に示した内容の相関関係情報を
持つソースプログラムを構文解析部に入力して、相関関
係情報生成部および変数出現回数情報生成部により生成
されたサブルーチンの相関関係情報およびサブルーチン
内の各変数の情報を示す図である。
FIG. 5 shows the correlation information of the subroutine generated by the correlation information generation unit and the variable appearance number information generation unit when the source program having the correlation information of the contents shown in FIG. 2 is input to the syntax analysis unit. It is a figure which shows the information of each variable in a subroutine.

【0022】レコード番号(1)からレコード番号
(4)に格納されているサブルーチンmainの相関関
係情報についてみると、親のレコード番号の並びが
(0)であることから、親を持たず、子供のレコード番
号の並びが(5)(11)(15)(20)(24)で
あることから、サブルーチン〔外1〕、〔外4〕、〔外
5〕、〔外2〕および〔外3〕を子供として持ち、サブ
ルーチンmain内に変数a、bおよびcを持ち、変数
の各々のサイズが2,2、および2、各々の出現回数が
4,3、および9であることがわかる。変数のサイズの
単位はバイトである。
Looking at the correlation information of the subroutine main stored in the record number (1) to the record number (4), since the sequence of the parent record numbers is (0), it has no parents and children. Since the sequence of record numbers of (5), (11), (15), (20), and (24) is, the subroutines [outer 1], [outer 4], [outer 5], [outer 2], and [outer 3] ] As a child, and variables a, b, and c in the subroutine main, and the sizes of the variables are 2, 2, and 2, and the number of occurrences of each is 4, 3, and 9. Variable size is in bytes.

【0023】[0023]

【外4】 [Outside 4]

【0024】[0024]

【外5】 先頭変数のレコード番号格納領域501(以下、hea
dとする)には、出現回数の最も多い変数の情報のレコ
ード番号(21)が格納されている。レコード番号(2
1)に格納されているサブルーチン〔外2〕内の変数f
11の情報中の次の変数のレコード番号には、変数f1
1の次に出現回数の多い変数の情報のレコード番号(2
3)が格納されている。
[Outside 5] First variable record number storage area 501 (hereinafter referred to as "hea")
In d), the record number (21) of the information of the variable having the largest number of appearances is stored. Record number (2
Variable f in the subroutine [outside 2] stored in 1)
The record number of the next variable in the information 11 is the variable f1.
The record number (2
3) is stored.

【0025】前記各変数の情報中の次の変数のレコード
番号を参照することにより、各変数を出現回数の多い順
に参照できる。出現回数が等しい変数については、出現
順に参照できるようになっている。サブルーチンの相関
関係情報中の割り付け番地情報および各変数の情報中の
割り付け番地には、初期値として0x0000および0
x00が設定されている。0xで始まる数字は16進数
である。
By referring to the record number of the next variable in the information of each variable, it is possible to refer to each variable in descending order of appearance frequency. Variables with the same number of appearances can be referenced in the order of appearance. The assigned address information in the correlation information of the subroutine and the assigned address in the information of each variable are 0x0000 and 0 as initial values.
x00 is set. Numbers starting with 0x are hexadecimal numbers.

【0026】図6は本発明実施例の言語処理プログラム
実行手段の変数割り付け情報生成部における処理の流れ
を示すフローチャートである。
FIG. 6 is a flow chart showing the flow of processing in the variable allocation information generating section of the language processing program executing means of the embodiment of the present invention.

【0027】本実施例では、図5に示す内容のサブルー
チンの相関関係情報およびサブルーチン内の各変数の情
報を変数割り付け情報生成部109の入力情報とする。
In this embodiment, the correlation information of the subroutine having the contents shown in FIG. 5 and the information of each variable in the subroutine are used as the input information of the variable allocation information generating unit 109.

【0028】変数割り付け情報生成部109は、各サブ
ルーチン内の変数を出現回数の多い順に処理し、割り付
け番地を決定する際には処理中の変数を含むルーチンか
らスタートし、ルーチンmainおよびリーフ関数に至
るまで再帰的に処理を行う。
The variable allocation information generator 109 processes the variables in each subroutine in descending order of the number of appearances, and when determining the allocation address, it starts from the routine including the variable being processed, and the routine main and the leaf function are processed. Processes recursively up to the end.

【0029】相関関係情報生成部107および変数出現
回数情報生成部108から生成されたサブルーチンの相
関関係情報およびサブルーチン内の各変数の情報は、変
数割り付け情報生成部109において次の手順で処理さ
れる。
The correlation information of the subroutine and the information of each variable in the subroutine generated from the correlation information generation unit 107 and the variable appearance number information generation unit 108 are processed by the variable allocation information generation unit 109 in the following procedure. ..

【0030】変数のレコード番号初期化処理ステップ6
01は、処理中の変数の次の変数のレコード番号を格納
するメモリ領域100(以下、〔外6〕とする)をhe
adの内容で初期化する。
Variable record number initialization processing step 6
01 is a memory area 100 (hereinafter referred to as [outer 6]) that stores the record number of the variable next to the variable being processed.
Initialize with the contents of ad.

【0031】[0031]

【外6】 変数のレコード番号判定処理ステップ602は、〔外
6〕が(0)であるか否かを判定する。以下の処理は、
各サブルーチン内の全変数に対して行われる。
[Outside 6] In the variable record number determination processing step 602, it is determined whether [outer 6] is (0). The following process
This is done for all variables in each subroutine.

【0032】割り付け番地情報初期化処理ステップ60
3は、各変数の割り付け番地情報を格納するメモリ領域
100(以下、addressとする)を処理中のルー
チン内の各変数の割り付け番地情報で初期化する。
Allocation address information initialization processing step 60
3 initializes a memory area 100 (hereinafter, referred to as "address") that stores the allocation address information of each variable with the allocation address information of each variable in the routine being processed.

【0033】親の変数割り付け番地情報検出処理ステッ
プ604は、処理中のルーチンの親の変数割り付け番地
情報を再帰的に検出し、addressに設定する。
(以下、親の変数割り付け番地情報検出処理ステップ6
04の処理ルーチン名を〔外7〕とする)
In the parent variable allocation address information detection processing step 604, the parent variable allocation address information of the routine being processed is recursively detected and set to address.
(Hereinafter, parent variable allocation address information detection processing step 6
The processing routine name of 04 is [External 7])

【0034】[0034]

【外7】 [Outside 7]

【0035】[0035]

【外8】 子供の変数割り付け番地情報検出処理ステップ605
は、処理中のルーチンの子供の変数割り付け番地情報を
再帰的に検出し、addressに設定する。(以下、
子供の変数割り付け番地情報検出処理ステップ605の
処理ルーチン名を〔外8〕とする) 変数の割り付け番地設定処理ステップ606は、add
ressで割り付けられていない番地で、処理中の変数
のサイズを割り付けられる最小の番地を処理中の変数の
割り付け番地に設定する。
[Outside 8] Variable allocation address information detection processing step 605 of child
Automatically recursively detects the variable allocation address information of the child of the routine being processed and sets it to address. (Less than,
The processing routine name of the variable allocation address information detection processing step 605 of the child is [external 8]) The variable allocation address setting processing step 606 is add.
In the addresses that are not allocated by ress, the smallest address to which the size of the variable being processed can be allocated is set as the allocated address of the variable being processed.

【0036】割り付け番地情報設定処理ステップ607
は、処理中のルーチンの割り付け番地情報に、処理中の
変数の割り付け番地に対応する情報を追加する。
Allocation address information setting processing step 607
Adds information corresponding to the allocation address of the variable being processed to the allocation address information of the routine being processed.

【0037】変数のレコード番号設定処理ステップ60
8は、処理中の変数の次の変数のレコード番号を〔外
6〕に設定する。
Variable record number setting processing step 60
8 sets the record number of the variable next to the variable being processed to [external 6].

【0038】さらに、処理ルーチン〔外7〕では、次の
手順でルーチンmainに至るまで再帰的に処理され
る。
Further, in the processing routine [outer 7], the processing is recursively performed up to the routine main in the following procedure.

【0039】親のレコード番号初期化処理ステップ60
9は、処理中のルーチンの親または子供のレコード番号
を格納するメモリ領域(以下、recordとする)を
処理中のルーチンの親のレコード番号の並びの先頭の要
素で初期化する。
Parent record number initialization processing step 60
Reference numeral 9 initializes a memory area (hereinafter referred to as “record”) for storing the record number of the parent or child of the routine being processed with the first element of the sequence of record numbers of the parent of the routine being processed.

【0040】親のレコード番号判定処理ステップ610
は、recordが(0)であるか否かを判定する。も
し、recordが(0)でなければ、割り付け番地情
報検出処理ステップ611に移る。そうでなければ、処
理中のルーチンのすべての親に対して処理が終了したと
判定され、処理ルーチン〔外8〕に移る。
Parent record number determination processing step 610
Determines whether record is (0). If record is not (0), the process proceeds to the allocation address information detection processing step 611. Otherwise, it is determined that the processing has been completed for all parents of the routine being processed, and the routine proceeds to the processing routine [outer 8].

【0041】割り付け番地情報検出処理ステップ611
は、addressとrecord番地の割り付け番地
情報の論理和をaddressに設定する。
Allocation address information detection processing step 611
Sets the logical sum of the assigned address information of the address and the record address in the address.

【0042】親の変数割り付け番地情報検出処理ステッ
プ612は、処理中のルーチンの親の変数割り付け番地
情報を検出するために、処理ルーチン〔外7〕の再帰的
呼び出しを行う。
The parent variable allocation address information detecting step 612 recursively calls the processing routine [outer 7] in order to detect the parent variable allocation address information of the routine being processed.

【0043】親のレコード番号設定処理ステップ613
は、処理中のルーチンの親のレコード番号の並びの次の
要素をrecordに設定する。
Parent record number setting processing step 613
Sets the next element in the list of parent record numbers of the routine being processed to record.

【0044】処理ルーチン〔外8〕は、処理ルーチン
〔外7〕と同じ手順でリーフ関数に至るまで再帰的に処
理される。
The processing routine [outer 8] is recursively processed up to the leaf function in the same procedure as the processing routine [outer 7].

【0045】以下、図5に示した内容のサブルーチンの
相関関係情報およびサブルーチン内の各変数の情報が変
数割り付け情報生成部109に入力されて、各サブルー
チン内の変数の割り付け番地を求める処理を説明する。
本実施例では、高速アクセスメモリのメモリサイズを1
6バイトとし、割り付け番地は0x40以降とし、各サ
ブルーチンの割り付け番地情報の0ビットは割り付け番
地の0x40、1ビットは割り付け番地の0x41、以
下同様に、15ビットは割り付け番地の0x4fに対応
している。
Hereinafter, a process of inputting the correlation information of the subroutine having the contents shown in FIG. 5 and the information of each variable in the subroutine to the variable allocation information generation unit 109 and obtaining the allocation address of the variable in each subroutine will be described. To do.
In this embodiment, the memory size of the high speed access memory is set to 1
6 bytes, the allocation address is 0x40 or later, 0 bit of allocation address information of each subroutine is 0x40 of allocation address, 1 bit corresponds to 0x41 of allocation address, and similarly, 15 bits corresponds to 0x4f of allocation address. ..

【0046】最初に、headの内容であるレコード番
号(21)に格納されているルーチン〔外2〕内の変数
f11の割り付け番地を求める。
First, the allocation address of the variable f11 in the routine [outer 2] stored in the record number (21) which is the contents of the head is obtained.

【0047】まず、addressをルーチン〔外2〕
の割り付け番地情報で初期化し、第一レベルとして、ル
ーチン〔外2〕の親であるmainに対して、addr
essとルーチンmainの割り付け番地情報の論理和
をaddressに設定する。
First, the address routine is executed [outer 2].
Is initialized with the allocation address information of, and as the first level, addr is added to the main that is the parent of the routine [outside 2].
The logical sum of the allocation address information of ess and the routine main is set in address.

【0048】第二レベルとしては、ルーチンmainに
親が存在しないため、addressの値は変わらな
い。ルーチン〔外2〕の子供に対しても同様な処理を行
う。
As a second level, the value of address does not change because there is no parent in the routine main. The same process is performed on the child in the routine [outer 2].

【0049】変数f11に対する処理の結果、addr
essの値は0x0000となる。変数f11のサイズ
は2なので、割り付け番地は0x40となる。ルーチン
〔外2〕の割り付け番地情報は、0x40番地および0
x41番地に対応する情報である0ビットおよび1ビッ
トを1に設定した0x0003となる。
As a result of the processing for the variable f11, addr
The value of ess is 0x0000. Since the size of the variable f11 is 2, the assigned address is 0x40. The assigned address information of the routine [outside 2] is 0x40 address and 0
The 0 bit and the 1 bit, which are the information corresponding to the x41 address, are set to 1 to be 0x0003.

【0050】次に、変数f11の次の変数のレコード番
号(23)に格納されているルーチン〔外2〕内の変数
f13の割り付け番地を求める。前記変数と同様な処理
を行うことにより、addressの値は0x0003
となる。変数f13のサイズは2なので、割り付け番地
は0x42となる。ルーチン〔外2〕の割り付け番地情
報は、0x42番地および0x43番地に対応する情報
である2ビットおよび3ビットを1に設定した0x00
0fとなる。
Next, the allocation address of the variable f13 in the routine [outer 2] stored in the record number (23) of the variable next to the variable f11 is obtained. By performing the same processing as the variable, the value of address is 0x0003.
Becomes Since the size of the variable f13 is 2, the assigned address is 0x42. The allocation address information of the routine [outer 2] is 0x00 in which 2 bits and 3 bits which are information corresponding to addresses 0x42 and 0x43 are set to 1.
It becomes 0f.

【0051】以下、同様な処理をレコード番号(10)
まで行った結果が、図7に示すサブルーチンの相関関係
情報およびサブルーチン内の各変数の情報である。
Thereafter, the same processing is performed for the record number (10).
The results obtained up to this point are the correlation information of the subroutine shown in FIG. 7 and the information of each variable in the subroutine.

【0052】次に、変数p21の次の変数のレコード番
号(13)に格納されているルーチン〔外4〕内の変数
p32の割り付け番地を求める。前記変数と同様な処理
を行うことにより、addressの値は0x0031
となる。変数p32のサイズは4なので、割り付け番地
は0x41ではなく0x46となる。ルーチ〔外4〕の
割り付け番地情報は、0x46番地、0x47番地、0
x48番地および0x49番地に対応する情報である6
ビット、7ビット、8ビットおよび9ビットを1に設定
した0x03c0となる。
Next, the allocation address of the variable p32 in the routine [outer 4] stored in the record number (13) of the variable next to the variable p21 is obtained. By performing the same process as the above variable, the value of address is 0x0031.
Becomes Since the size of the variable p32 is 4, the assigned address is 0x46 instead of 0x41. The assigned address information of the rout [outer 4] is 0x46, 0x47, 0
6 which is the information corresponding to the address x48 and the address 0x49
It becomes 0x03c0 in which 1 bit is set to 7 bit, 7 bit, 8 bit and 9 bit.

【0053】次に、変数p32の次の変数のレコード番
号(14)に格納されているルーチン〔外4〕内の変数
p33の割り付け番地を求める。前記変数と同様な処理
を行うことにより、addressの値は0x03f1
となる。変数p33のサイズは2なので、割り付け番地
は0x41となる。ルーチン〔外4〕の割り付け番地情
報は、0x41番地および0x42番地に対応する情報
である1ビットおよび2ビットを1に設定した0x03
c6となる。
Next, the allocation address of the variable p33 in the routine [outer 4] stored in the record number (14) of the variable next to the variable p32 is obtained. By performing the same process as the above variable, the value of address is 0x03f1.
Becomes Since the size of the variable p33 is 2, the assigned address is 0x41. The assigned address information of the routine [outer 4] is 0x03 in which 1 bit and 2 bits which are information corresponding to the 0x41 address and the 0x42 address are set to 1.
It becomes c6.

【0054】以下、同様な処理をレコード番号(2)ま
で行う。
Thereafter, similar processing is performed up to the record number (2).

【0055】次に、変数aの次の変数のレコード番号
(3)に格納されているルーチンmain内の変数bの
割り付け番地を求める。前記変数と同様な処理を行うこ
とにより、addressの値は0xffffとなる。
変数bのサイズは2なので、変数bを高速アクセスメモ
リに割り付けることはできない。ルーチンmainの割
り付け番地情報は、0x8030のままである。
Next, the allocation address of the variable b in the routine main stored in the record number (3) of the variable next to the variable a is obtained. By performing the same process as the variable, the value of address becomes 0xffff.
Since the size of the variable b is 2, the variable b cannot be assigned to the high speed access memory. The assigned address information of the routine main remains 0x8030.

【0056】以下、同様な処理を最後の変数の情報が格
納されているレコード番号(16)まで行った最終結果
が図8に示すサブルーチンの相関関係情報およびサブル
ーチン内の各変数の情報である。
Below, the same result is obtained up to the record number (16) in which the information of the last variable is stored, and the final result is the correlation information of the subroutine shown in FIG. 8 and the information of each variable in the subroutine.

【0057】この図8から、ルーチンmain内の変数
b、ルーチン〔外1〕内の変数p11およびルーチン
〔外5〕内の変数p41を除くすべての変数が高速アク
セスメモリに割り付けられたことがわかる。
From FIG. 8, it can be seen that all variables except the variable b in the routine main, the variable p11 in the routine [outer 1] and the variable p41 in the routine [outer 5] are assigned to the high speed access memory. ..

【0058】[0058]

【発明の効果】以上説明したように本発明によれば、す
べての変数を高速アクセスメモリに割り付けることがで
きない場合でも、出現回数の多い順に変数を高速アクセ
スメモリに割り付けることによって、従来の言語処理プ
ログラムの実行方式よりも高速な変数の操作を含むオブ
ジェクト、およびコンパクトなオブジェクトを生成する
ことができる。さらに、変数の高速アクセスメモリへの
割り付けを変数の処理順ではなく、出現回数の多い順に
行うことにより、頻繁にアクセスされる変数が優先的に
高速アクセスメモリに割り付けられ、より実行速度の向
上を図ることができる効果がある。
As described above, according to the present invention, even if all variables cannot be assigned to the high speed access memory, the variables are assigned to the high speed access memory in the descending order of the number of occurrences, so that the conventional language processing can be performed. It is possible to generate objects including variable operations that are faster than the program execution method, and compact objects. Furthermore, by allocating variables to the high-speed access memory in the descending order of the number of occurrences rather than in the variable processing order, variables that are frequently accessed are preferentially allocated to the high-speed access memory, further improving execution speed. There is an effect that can be achieved.

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

【図1】本発明実施例の構成を示すブロック図。FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.

【図2】本発明実施例における相関関係情報生成部から
生成された各サブルーチンの呼び出しの双方向の相関関
係情報のイメージを示す図。
FIG. 2 is a diagram showing an image of bidirectional correlation information for calling each subroutine, which is generated from a correlation information generation unit in the embodiment of the present invention.

【図3】本発明実施例における相関関係情報生成部から
生成される各サブルーチンの双方向の相関関係情報を示
す図。
FIG. 3 is a diagram showing bidirectional correlation information of each subroutine generated from a correlation information generation unit in the embodiment of the present invention.

【図4】本発明実施例における変数出現回数情報生成部
から生成される変数の情報を示す図。
FIG. 4 is a diagram showing variable information generated by a variable appearance number information generation unit in the embodiment of the present invention.

【図5】図2に示す内容の相関関係情報を持つソースプ
ログラムのサブルーチンの相関関係情報およびサブルー
チン内の各変数の情報を示す図。
5 is a diagram showing correlation information of a subroutine of the source program having the correlation information having the content shown in FIG. 2 and information of each variable in the subroutine.

【図6】本発明実施例の言語処理プログラム実行手段の
変数割り付け情報生成部における処理の流れを示すフロ
ーチャート。
FIG. 6 is a flowchart showing the flow of processing in the variable allocation information generation unit of the language processing program execution means of the exemplary embodiment of the present invention.

【図7】図5に示すレコード番号(10)に格納されて
いる変数の割り付け番地の設定まで行ったサブルーチン
の相関関係情報およびサブルーチン内の各変数の情報を
示す図。
7 is a diagram showing correlation information of a subroutine performed up to setting of variable allocation addresses stored in the record number (10) shown in FIG. 5 and information of each variable in the subroutine.

【図8】図5に示すすべての変数の割り付け番地の設定
を行ったサブルーチンの相関関係情報およびサブルーチ
ン内の各変数の情報を示す図。
FIG. 8 is a diagram showing correlation information of a subroutine in which allocation addresses of all variables shown in FIG. 5 are set and information of each variable in the subroutine.

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

100 メモリ領域 101 入力ファイル 102 言語処理プログラム実行手段 103 入力部 104 構文解析部 105 出力部 106 出力ファイル 107 相関関係情報生成部 108 変数出現回数情報生成部 109 変数割り付け情報生成部 501 先頭変数のレコード番号格納領域 601 変数のレコード番号初期化処理ステップ 602 変数のレコード番号判定処理ステップ 603 割り付け番地情報初期化処理ステップ 604、612 親の変数割り付け番地情報検出処理
ステップ 605、617 子供の変数割り付け番地情報検出処
理ステップ 606 変数の割り付け番地設定処理ステップ 607 割り付け番地情報設定処理ステップ 608 変数のレコード番号設定処理ステップ 609 親のレコード番号初期化処理ステップ 610 親のレコード番号判定処理ステップ 611、616 割り付け番地情報検出処理ステップ 613 親のレコード番号設定処理ステップ 614 子供のレコード番号初期化処理ステップ 615 子供のレコード番号判定処理ステップ 618 子供のレコード番号設定処理ステップ
100 memory area 101 input file 102 language processing program execution means 103 input section 104 syntax analysis section 105 output section 106 output file 107 correlation information generation section 108 variable appearance count information generation section 109 variable allocation information generation section 501 record number of the first variable Storage area 601 Variable record number initialization processing step 602 Variable record number determination processing step 603 Allocation address information initialization processing step 604, 612 Parent variable allocation address information detection processing step 605, 617 Child variable allocation address information detection processing Step 606 Variable allocation address setting processing step 607 Allocation address information setting processing step 608 Variable record number setting processing step 609 Parent record number initialization processing step 610 Parent Record number determination processing steps 611,616 allocation address information detection processing step 613 the parent of the record number setting processing step 614 child record number initializing processing step 615 children record number determination processing step 618 child record number setting process step

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 データの高速な読み出し、および書き込
みができるメモリ領域と、 入力部および出力部を有し、ソースプログラム情報を入
力して解析しオブジェクト情報を出力する言語処理プロ
グラム実行手段とを備えたマイクロコンピュータ装置に
おいて、 前記言語処理プログラム実行手段に、 ソースプログラム情報中の各サブルーチンの呼び出しの
相関関係情報を生成する相関関係情報生成部と、 ソースプログラム情報中で使用するすべての変数の出現
回数を検出し出現回数情報を生成する変数出現回数情報
生成部と、 生成された相関関係情報および変数の出現回数情報から
ソースプログラム情報中で使用する変数についての変数
割り付け情報を生成する変数割り付け情報生成部とを含
む構文解析部を備えたことを特徴とするマイクロコンピ
ュータ装置。
1. A language processing program executing means for inputting and analyzing source program information and outputting object information, comprising a memory area capable of high-speed reading and writing of data, an input section and an output section. In the microcomputer device, in the language processing program execution means, a correlation information generation unit that generates correlation information of the call of each subroutine in the source program information, and the number of appearances of all variables used in the source program information. Variable occurrence count information generation unit that detects occurrences and generates appearance count information, and variable allocation information generation that generates variable allocation information for variables used in source program information from the generated correlation information and variable appearance count information And a parsing section including a section Computer equipment.
JP3281699A 1991-10-28 1991-10-28 Language processor Expired - Lifetime JP3018666B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3281699A JP3018666B2 (en) 1991-10-28 1991-10-28 Language processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3281699A JP3018666B2 (en) 1991-10-28 1991-10-28 Language processor

Publications (2)

Publication Number Publication Date
JPH05120028A true JPH05120028A (en) 1993-05-18
JP3018666B2 JP3018666B2 (en) 2000-03-13

Family

ID=17642750

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3281699A Expired - Lifetime JP3018666B2 (en) 1991-10-28 1991-10-28 Language processor

Country Status (1)

Country Link
JP (1) JP3018666B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6182243A (en) * 1984-09-29 1986-04-25 Toshiba Corp Object program generating method
JPS6234240A (en) * 1985-08-08 1987-02-14 Nec Corp Data allotting system
JPS6481035A (en) * 1987-09-22 1989-03-27 Nec Corp C compiler
JPH02144629A (en) * 1988-11-25 1990-06-04 Nec Corp Processing system for language processing program
JPH02171831A (en) * 1988-12-23 1990-07-03 Nec Corp Data access system for compiler
JPH02171830A (en) * 1988-12-23 1990-07-03 Nec Corp Optimum data allocating system in compiler
JPH03109642A (en) * 1989-09-22 1991-05-09 Nec Corp Compiling device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6182243A (en) * 1984-09-29 1986-04-25 Toshiba Corp Object program generating method
JPS6234240A (en) * 1985-08-08 1987-02-14 Nec Corp Data allotting system
JPS6481035A (en) * 1987-09-22 1989-03-27 Nec Corp C compiler
JPH02144629A (en) * 1988-11-25 1990-06-04 Nec Corp Processing system for language processing program
JPH02171831A (en) * 1988-12-23 1990-07-03 Nec Corp Data access system for compiler
JPH02171830A (en) * 1988-12-23 1990-07-03 Nec Corp Optimum data allocating system in compiler
JPH03109642A (en) * 1989-09-22 1991-05-09 Nec Corp Compiling device

Also Published As

Publication number Publication date
JP3018666B2 (en) 2000-03-13

Similar Documents

Publication Publication Date Title
US20080072216A1 (en) Method and device for ANBF string pattern matching and parsing
US6851106B1 (en) Object oriented optimizing code generator with user selection of use or do not use for dynamic generation of functions
CN113703779B (en) Cross-platform multi-language compiling method and ultra-light Internet of things virtual machine
JPH0721033A (en) Device and method for processing language
CN111124870A (en) Interface testing method and device
CN110096264A (en) A kind of code operation method and device
CN113900657A (en) Method for reading data rule, electronic device and storage medium
CN110110299B (en) Text conversion method, device and server
JPH05120028A (en) Micro computer device
US6286136B1 (en) Compile processing apparatus and method and program executing apparatus and method
US7318221B2 (en) Windows™ F-language interpreter
CN113031952A (en) Method and device for determining execution code of deep learning model and storage medium
CN114489683B (en) JVM-based functional programming grammar implementation method for java-like language
JP2003015914A (en) Method for producing test program for evaluating information processing unit, device and program describing processing therefor
EP4068141B1 (en) Method and system to enable print functionality in high-level synthesis (hls) design platforms
JPH0683633A (en) Execution system for language processing program
US5802372A (en) Language processing system
JPH09179738A (en) Object-oriented language processing method and processor
US7765502B1 (en) ASIC functional specification parser
JPH0535495A (en) Language processing program execution system
JP2000305790A (en) Label address converting device and its method and computer readable medium
WO1997007452A1 (en) Programmable compiler
CN114896023A (en) Data processing method, device, equipment and storage medium
JPH03186933A (en) Symbol processing system for language processing system
JPH036624A (en) Processing system for translation list output corresponding to plural code systems