JPH0736705A - Compiler execution system - Google Patents
Compiler execution systemInfo
- Publication number
- JPH0736705A JPH0736705A JP17579493A JP17579493A JPH0736705A JP H0736705 A JPH0736705 A JP H0736705A JP 17579493 A JP17579493 A JP 17579493A JP 17579493 A JP17579493 A JP 17579493A JP H0736705 A JPH0736705 A JP H0736705A
- Authority
- JP
- Japan
- Prior art keywords
- token data
- phase
- compiler
- processing module
- shared memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明はコンパイラ実行方式、特
にコンパイラの内部処理が複数のフェーズ処理により行
なわれるコンパイラ実行方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler execution system, and more particularly to a compiler execution system in which the internal processing of the compiler is performed by a plurality of phase processes.
【0002】[0002]
【従来の技術】従来、この種のコンパイラ実行方式は、
図2に代表例を示すように、内部処理フェーズの実行は
直列的に順番に実行され、各フェーズにおけるトークン
の受渡しは、それぞれ中間ファイルを介することで実現
している。2. Description of the Related Art Conventionally, this type of compiler execution method has been
As shown in the representative example in FIG. 2, the execution of the internal processing phase is executed serially and in order, and the tokens in each phase are passed through the intermediate files.
【0003】[0003]
【発明が解決しようとする課題】上述した従来のコンパ
イラ実行方式は、内部処理フェーズの実行方式が単一タ
スクによる直列処理のため、フェーズによって生成され
たトークンを一旦全て中間ファイルに保存しなければな
らない。従ってこの方法では大量な補助記憶装置を使用
することと、マルチプロセッサ式中央処理装置の場合で
も、CPUが一つしか使用されないためにハードウェア
資源の使用効率が悪いという問題点がある。In the conventional compiler execution method described above, since the execution method of the internal processing phase is serial processing by a single task, all tokens generated by the phase must be temporarily saved in the intermediate file. I won't. Therefore, this method has a problem that a large amount of auxiliary storage device is used and even in the case of a multiprocessor type central processing unit, the utilization efficiency of hardware resources is poor because only one CPU is used.
【0004】[0004]
【課題を解決するための手段】本発明のコンパイラ実行
方式は、コンパイラの内部処理が複数のフェーズにより
行なわれるコンパイラ実行方式において、複数のフェー
ズを別タスクとして起動し、各フェーズで生成されたト
ークンデータを主記憶装置上に設けた共有メモリを介し
てフェーズ同士間で受渡し、各フェーズでの処理を並列
に行なうことにより構成される。According to the compiler execution method of the present invention, in a compiler execution method in which the internal processing of the compiler is performed in a plurality of phases, a plurality of phases are activated as separate tasks and tokens generated in each phase. It is configured by passing data between phases via a shared memory provided on the main storage device and performing processing in each phase in parallel.
【0005】[0005]
【実施例】次に、本発明について図面を参照して説明す
る。DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.
【0006】図1は本発明の一実施例の構成図である。
図1の実施例は処理フェーズが四つある場合を示してお
り、コンパイラ1,主記憶装置2,ソースプログラムフ
ァイル3,およびオブジェクトプログラム4から構成さ
れ、コンパイラ1は制御部11,第1フェーズ処理モジ
ュール12,第2フェーズ処理モジュール13,第3処
理モジュール14,および第4処理モジュール15を有
し、主記憶装置2には三つの共有メモリ21,22,お
よび23が設けられている。なお、トークンテキスト以
外のデータテーブルやディクショナリ等に関しては本発
明に関係しないので全て示してない。FIG. 1 is a block diagram of an embodiment of the present invention.
The embodiment of FIG. 1 shows a case in which there are four processing phases, and is composed of a compiler 1, a main storage device 2, a source program file 3, and an object program 4, and the compiler 1 includes a control unit 11 and a first phase process. It has a module 12, a second phase processing module 13, a third processing module 14, and a fourth processing module 15, and the main memory 2 is provided with three shared memories 21, 22, and 23. Note that data tables other than token text, dictionaries, etc. are not shown because they are not related to the present invention.
【0007】以上の構成において、コンパイラ1が起動
されると制御部11が全てのフェーズ処理モジュールを
サブタスクの形式で主記憶装置上ににロードして各フェ
ーズ処理モジュールを起動する。第1フェーズ処理モジ
ュール12はソースプログラムファイル3からテキスト
を読込み、1件分のトークンデータ(コンパイラ内部で
生成する中間言語)を生成し、そのトークンデータを共
有メモリ21に書込む。第2フェーズ処理モジュール1
3は、第1フェーズ処理モジュール12により格納され
たトークンデータを共有メモリ21から読込みフェーズ
の処理を行う。第2フェーズ処理モジュール13は1件
分の処理が完了すると、そのフェーズが生成したトーク
ンデータを共有メモリ22に書込む。第3フェーズ処理
モジュール14は、第2フェーズ処理モジュール13に
より格納されたトークンデータを共有メモリ22から読
込みフェーズの処理を行う。第3フェーズ処理モジュー
ル14は1件分の処理を完了すると、そのフェーズが生
成したトークンデータを共有メモリ23に書込む。第4
フェーズ処理モジュール15は、第3フェーズ処理モジ
ュール14により格納されたトークンデータを共有メモ
リ23から読込みフェーズの処理を行う。第4フェーズ
処理モジュール15はオブジェクトを生成して、オブジ
ェクトプログラムファイル4を生成する。このように、
フェーズ間でのデータの受渡しは、トークンデータ1件
単位で行う。In the above configuration, when the compiler 1 is activated, the control unit 11 loads all the phase processing modules in the form of subtasks on the main storage device and activates each phase processing module. The first phase processing module 12 reads a text from the source program file 3, generates one token data (intermediate language generated in the compiler), and writes the token data in the shared memory 21. Second phase processing module 1
3 reads the token data stored by the first phase processing module 12 from the shared memory 21 and executes the processing of the phase. When the processing for one case is completed, the second phase processing module 13 writes the token data generated in that phase in the shared memory 22. The third phase processing module 14 processes the token data stored by the second phase processing module 13 from the shared memory 22 in the reading phase. When the third phase processing module 14 completes the processing for one case, it writes the token data generated in that phase in the shared memory 23. Fourth
The phase processing module 15 reads the token data stored by the third phase processing module 14 from the shared memory 23 and processes the read phase. The fourth phase processing module 15 creates an object and creates the object program file 4. in this way,
Data is passed between phases in units of token data.
【0008】図3は図1中の共有メモリ21,22,お
よび23の構造を説明するための図で、何れの共有メモ
リも同構造である。共有メモリは、各フェーズの処理速
度の違いを吸収するためにトークンデータを複数ためて
おくためのバッファリング機能と、タスク間でのデータ
の受渡しを行う機能を持つ。共有メモリは複数のタスク
から自由に読出し、書込みができるメモリ空間に、図3
に示すような構造で作成される。バッファキュー201
には有効トークンデータの数がセットされる。書込みポ
インタ202には、書込まれたトークンデータのレコー
ド番号がセットされる。読込みポインタ203には、最
後に読込まれたトークンデータのレコード番号がセット
される。未使用領域先頭ポインタ204には、使用され
ていないトークンデータ格納領域206の先頭アドレス
がセットされる。未使用領域終了ポインタ205には、
使用されていないトークンデータ格納領域206の最終
部のアドレスがセットされる。トークンデータ格納領域
206はトークンが格納されるメモリ空間である。この
領域の大きさは、システムの実装メモリの容量によりユ
ーザ側が設定する。レコード索引部207は、格納した
トークンデータのレコードポインタ208とレングス2
09とをレコード番号に対応づけて格納する場所で、読
込みポインタにより小さいレコード番号領域は再使用さ
れる。FIG. 3 is a diagram for explaining the structure of the shared memories 21, 22, and 23 in FIG. 1, and all the shared memories have the same structure. The shared memory has a buffering function for storing a plurality of token data in order to absorb the difference in processing speed of each phase, and a function for passing data between tasks. The shared memory is a memory space that can be freely read and written by multiple tasks.
It is created with the structure shown in. Buffer queue 201
Is set to the number of valid token data. The record number of the written token data is set in the write pointer 202. In the read pointer 203, the record number of the last read token data is set. The unused area start pointer 204 is set with the start address of the token data storage area 206 that is not used. The unused area end pointer 205 includes
The address of the last part of the unused token data storage area 206 is set. The token data storage area 206 is a memory space in which tokens are stored. The size of this area is set by the user side according to the capacity of the mounted memory of the system. The record index unit 207 stores the record pointer 208 and the length 2 of the stored token data.
09 is stored in association with the record number, the smaller record number area for the read pointer is reused.
【0009】図4はトークンデータを共有メモリに書込
む処理のフロー図で、図4を参照してトークンデータの
書込み処理について説明する。先ずトークンデータ格納
領域206に未使用領域が、格納しようとするトークン
の大きさだけ残っているかどうかを、未使用領域先頭ポ
インタ204にトークンレングスを加えた値がトークン
格納領域の最終アドレスより小さいかにより判断し、残
っていない場合は、未使用領域先頭ポインタ204の値
をトークンデータ格納領域先頭アドレスにセットする
(ステップ401,402)。次に、この未使用領域先
頭ポインタ204の値に格納したいトークンデータの長
さを加算した値が未使用領域終了ポインタ206の値を
越えるかを調べ、越える場合は空き領域なしのため、ト
ークンデータ格納領域206に空きができるまでウエイ
ト状態とする(ステップ403)。トークンデータ格納
領域206にトークンデータを格納させる分の領域が確
保できた場合は、トークンデータをトークンデータ格納
領域206に複写し(ステップ404)、レコード索引
部207のレコードポインタ208およびレングス20
9をセットする(ステップ405,406)。そして、
未使用領域先頭ポインタ204の値にトークンデータの
レングスの値を加算し(ステップ407)、バッファキ
ュー201の値を1加算する(ステップ408)。FIG. 4 is a flow chart of the process of writing the token data in the shared memory. The process of writing the token data will be described with reference to FIG. First, it is determined whether the unused area remains in the token data storage area 206 by the size of the token to be stored, and whether the value obtained by adding the token length to the unused area start pointer 204 is smaller than the final address of the token storage area. If there is no remaining area, the value of the unused area start pointer 204 is set to the token data storage area start address (steps 401 and 402). Next, it is checked whether the value obtained by adding the length of the token data to be stored to the value of the unused area start pointer 204 exceeds the value of the unused area end pointer 206. The storage area 206 is kept in a wait state until there is a free space (step 403). When the token data storage area 206 has a sufficient area for storing the token data, the token data is copied to the token data storage area 206 (step 404), and the record pointer 208 and the length 20 of the record index unit 207 are copied.
9 is set (steps 405 and 406). And
The value of the token data length is added to the value of the unused area start pointer 204 (step 407), and the value of the buffer queue 201 is added by 1 (step 408).
【0010】図5はトークンデータを共有メモリから読
込む処理のフロー図で、図5を参照してトークンデータ
の読込み処理について説明する。バッファキュー201
の値が0である場合は処理待ちトークンデータがないた
め、ウエイト状態とする(ステップ501)。バッファ
キュー201の値が0以外の場合は、読込みポインタ2
03とレコード索引部207を参照してトークンデータ
を読出す(ステップ502)。未使用領域最終ポインタ
205の値に引取ったトークンレングスの値を加算する
(ステップ503)。読込みポインタ203の値に1を
加算し(ステップ504)、バッファキュー1の値を1
減算する(ステップ505)。このバッファキュー1の
値を参照することにより、書込み中のトークンデータを
誤って引取ること無く受渡すことができる。FIG. 5 is a flow chart of a process of reading token data from the shared memory. The process of reading token data will be described with reference to FIG. Buffer queue 201
If the value of 0 is 0, there is no token data waiting to be processed, and a wait state is set (step 501). If the value of the buffer queue 201 is other than 0, the read pointer 2
03 and the record index unit 207 to read the token data (step 502). The value of the taken token length is added to the value of the unused area final pointer 205 (step 503). 1 is added to the value of the read pointer 203 (step 504) and the value of the buffer queue 1 is set to 1
Subtract (step 505). By referring to the value of the buffer queue 1, the token data being written can be delivered without being mistakenly taken.
【0011】図6本発明により複数のプログラムをコン
パイルした場合の処理の流れを示す図で、n個のプログ
ラムが四つの処理フェーズによりコンパイルされる場合
を示している。FIG. 6 is a diagram showing the flow of processing when a plurality of programs are compiled according to the present invention, showing a case where n programs are compiled in four processing phases.
【0012】[0012]
【発明の効果】以上に説明したように本発明は、前フェ
ーズの処理の完了を待つこと無く次のフェーズの処理を
開始できる。また、トークンデータの生成側と受取り側
が同時に存在するため中間ファイルを作成する必要が無
い。一般に中間ファイルは磁気ディスク上に作成される
ため物理的入出力が発生するためコンパイル性能低下の
原因となっているが、本発明では中間ファイルを使用す
ることなくトークンデータの受渡しを行うことができ
る。ことによりコンパイル速度性能の向上がはかれると
いう効果がある。また、複数のプログラムをコンパイル
する場合でもフェーズ数以上のタスクを起動しなくて良
いためタイムシェアリングが発生しにくく効率的であ
り、複数のプログラムを一括コンパイルする場合に、各
MPUをフルに占有して処理を行うことができること
で、MPU資源の消費効率を良くできるという効果があ
る。As described above, according to the present invention, the processing of the next phase can be started without waiting for the completion of the processing of the previous phase. Further, since the token data generation side and the token data reception side exist at the same time, it is not necessary to create an intermediate file. Generally, since an intermediate file is created on a magnetic disk, physical input / output occurs, which causes a decrease in compilation performance. However, in the present invention, token data can be delivered without using an intermediate file. . This has the effect of improving the compile speed performance. In addition, even if you compile multiple programs, you do not have to start more tasks than the number of phases, so time sharing is less likely to occur and it is efficient. When you compile multiple programs at once, each MPU is fully occupied. By performing the processing in this manner, there is an effect that the consumption efficiency of MPU resources can be improved.
【図1】本発明の一実施例の構成図である。FIG. 1 is a configuration diagram of an embodiment of the present invention.
【図2】従来のコンパイラ実行方式の一例を示す図であ
る。FIG. 2 is a diagram showing an example of a conventional compiler execution method.
【図3】図1の実施例の共有メモリの構成図である。FIG. 3 is a configuration diagram of a shared memory according to the embodiment of FIG.
【図4】図3の共有メモリの書込時の処理のフロー図で
ある。FIG. 4 is a flow chart of processing at the time of writing to the shared memory of FIG.
【図5】図3の共有メモリの読出時の処理のフロー図で
ある。5 is a flow chart of processing at the time of reading from the shared memory of FIG.
【図6】複数のプログラムを本発明によりコンパイルし
た時の状態図である。FIG. 6 is a state diagram when a plurality of programs are compiled according to the present invention.
1 コンパイラ 2 主記憶装置 3 ソースプログラムファイル 4 オブジェクトプログラムファイル 12 第1フェーズ処理モジュール 13 第2フェーズ処理モジュール 14 第3フェーズ処理モジュール 15 第4フェーズ処理モジュール 21,22,23 共有メモリ 61,62,63 中間ファイル 1 Compiler 2 Main Memory 3 Source Program File 4 Object Program File 12 First Phase Processing Module 13 Second Phase Processing Module 14 Third Phase Processing Module 15 Fourth Phase Processing Module 21, 22, 23 Shared Memory 61, 62, 63 Intermediate file
Claims (1)
により行なわれるコンパイラ実行方式において、複数の
フェーズを別タスクとして起動し、各フェーズで生成さ
れたトークンデータを主記憶装置上に設けた共有メモリ
を介してフェーズ同士間で受渡し、各フェーズでの処理
を並列に行なうことを特徴とするコンパイラ実行方式。1. In a compiler execution method in which the internal processing of a compiler is performed in a plurality of phases, a plurality of phases are started as separate tasks, and a token memory generated in each phase is provided in a shared memory provided in a main storage device. A compiler execution method characterized in that the phases are passed between each other and the processing in each phase is performed in parallel.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP17579493A JPH0736705A (en) | 1993-07-16 | 1993-07-16 | Compiler execution system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP17579493A JPH0736705A (en) | 1993-07-16 | 1993-07-16 | Compiler execution system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0736705A true JPH0736705A (en) | 1995-02-07 |
Family
ID=16002369
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP17579493A Withdrawn JPH0736705A (en) | 1993-07-16 | 1993-07-16 | Compiler execution system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0736705A (en) |
-
1993
- 1993-07-16 JP JP17579493A patent/JPH0736705A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2928695B2 (en) | Multi-thread microprocessor using static interleave and instruction thread execution method in system including the same | |
JP2818249B2 (en) | Electronic computer | |
US7904702B2 (en) | Compound instructions in a multi-threaded processor | |
US9886278B2 (en) | Computing architecture and method for processing data | |
JP2008515117A (en) | Method and apparatus for providing source operands for instructions in a processor | |
US10223269B2 (en) | Method and apparatus for preventing bank conflict in memory | |
JPS6297036A (en) | Calculator system | |
CN108845829B (en) | Method for executing system register access instruction | |
US9513923B2 (en) | System and method for context migration across CPU threads | |
Kim et al. | Automatically exploiting implicit pipeline parallelism from multiple dependent kernels for gpus | |
TW449720B (en) | Routing dependent instructions to clustered execution units | |
CN112631955A (en) | Data processing method, data processing device, electronic device, and medium | |
EP0496407A2 (en) | Parallel pipelined instruction processing system for very long instruction word | |
JPWO2019008715A1 (en) | Data load program, data load method and data load device | |
JPH0736705A (en) | Compiler execution system | |
Khare et al. | High-level synthesis with synchronous and RAMBUS DRAMs | |
US20040034858A1 (en) | Programming a multi-threaded processor | |
JP2883465B2 (en) | Electronic computer | |
JP3692884B2 (en) | Program processing method and recording medium | |
JP2001022581A (en) | Data processor and computer readable storage medium | |
JP2883488B2 (en) | Instruction processing unit | |
JPH0476731A (en) | Pipeline type microprocessor assembler processing system | |
JP2933569B2 (en) | Central processing unit | |
CN118170515A (en) | Processor task package scheduling device and method | |
KR19980034448A (en) | One Cycle Stack Operation Light Circuit in Microprocessor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20001003 |