JPH0659933A - Code converter - Google Patents

Code converter

Info

Publication number
JPH0659933A
JPH0659933A JP4213135A JP21313592A JPH0659933A JP H0659933 A JPH0659933 A JP H0659933A JP 4213135 A JP4213135 A JP 4213135A JP 21313592 A JP21313592 A JP 21313592A JP H0659933 A JPH0659933 A JP H0659933A
Authority
JP
Japan
Prior art keywords
instruction
execution
program
instructions
parallel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4213135A
Other languages
Japanese (ja)
Inventor
Akiyoshi Mogi
章善 茂木
Atsushi Inoue
淳 井上
Kenji Shirakawa
健治 白川
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP4213135A priority Critical patent/JPH0659933A/en
Publication of JPH0659933A publication Critical patent/JPH0659933A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To convert a program into a code capable of guaranteeing the stop of execution on an execution stop position specified by a user and rapidly executing other parts by parallel processing in the case of executing the sym bolic debugging of the program by a VLIW or super color system computer. CONSTITUTION:A program is analyzed (13), parallel optimization to be normally executed is executed (17) and the optimized program is converted into an object code (18). In order to stop execution in each sentence or in each function (specified in a debugging request specified and inputted (12)), the head of instructions constituting a sentence or a function is positioned on the head of an instruction string to be simultaneously executed and the arrangement of remaining instructions is corrected (16) by inserting an NOP instruction. The processing is controlled so as not to execute parallel optimizing processing over the range of one sentence or the range of one function.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数の命令を並列に実
行可能である電子計算機におけるコード変換装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a code conversion device in an electronic computer capable of executing a plurality of instructions in parallel.

【0002】[0002]

【従来の技術】近年、命令単位で並列実行を可能とする
計算機技術が導入されており、1サイクルあたり1個以
上の命令を処理することが可能になっている。VLIW
(Very Long Instruction Wo
rd)技術とスーパースカラー技術と呼ばれる2つの手
法が代表的なものである。
2. Description of the Related Art In recent years, computer technology has been introduced which enables parallel execution in units of instructions, and it is possible to process one or more instructions per cycle. VLIW
(Very Long Instruction Wo
The two methods, rd) technology and superscalar technology, are typical.

【0003】VLIW技術は、予め定められた数の複数
の命令を組み合わせて、1つの実行単位(Long I
nstruction)を構成し計算機に供給する。計
算機は与えられた複数命令の組を所定の演算器に振り分
けて並列処理を行う。この際には複数命令の同時実行可
能性を判定する必要はなく、制御が単純であるため少な
いハードウェア量で実現可能である。しかしながら処理
を並列に行うため、コンパイラまたは人手により並列に
実行可能な命令群を抽出し、1つの実行単位にまとめる
「命令スケジューリング」と呼ばれる最適化を行ってお
くことが必要になる。
The VLIW technology combines a predetermined number of instructions into one execution unit (Long I).
nStructure) and supplies it to the computer. The computer distributes a given set of a plurality of instructions to a predetermined arithmetic unit and performs parallel processing. In this case, it is not necessary to determine the possibility of simultaneous execution of a plurality of instructions, and since the control is simple, it can be realized with a small amount of hardware. However, since processing is performed in parallel, it is necessary to perform optimization called "instruction scheduling" in which a group of instructions that can be executed in parallel is extracted by a compiler or manually and the instructions are combined into one execution unit.

【0004】一方、スーパースカラー方式は、従来と同
様の逐次実行を前提とした命令列を解釈して複数命令の
並列実行可能性を調べるハードウェアを備え、読みだし
た複数の命令が並列実行可能な場合にはこれらを並列実
行するように制御する方式である。
On the other hand, the superscalar system is equipped with hardware for interpreting an instruction string assuming sequential execution as in the conventional case and checking the possibility of parallel execution of a plurality of instructions, and a plurality of read instructions can be executed in parallel. In such a case, it is a method of controlling these to be executed in parallel.

【0005】この方式では命令の並列実行可能性判定を
専用ハードウェアに委ねているため、通常の逐次処理用
プログラムであっても逐次実行時との互換性を保った実
行が保証される。しかし実際にスーパースカラー方式で
性能向上を目指す場合には、ハードウェアリソース(演
算ユニットの数、演算の遅延)やデータ依存性等の情報
を元に複数の演算ユニットが出来る限り動作状態にある
ようにするため、やはり「命令スケジューリング」を行
っておくことが必須である。
In this method, since the parallel executability determination of the instruction is entrusted to the dedicated hardware, even an ordinary serial processing program is guaranteed to be executed while maintaining compatibility with the serial execution time. However, when actually aiming to improve performance with the superscalar method, it seems that multiple arithmetic units are in the operating state as much as possible based on information such as hardware resources (number of arithmetic units, arithmetic delay) and data dependency. Therefore, it is essential to perform "instruction scheduling" in advance.

【0006】スーパースカラー方式における命令スケジ
ューリング手法としては、1つの基本ブロック(プログ
ラムのうち分岐脱出のない命令列)を処理対象としてハ
ードウェアリソース制約条件、データ依存制約条件を元
に命令を並べ替えていく「リストスケジューリング」と
呼ばれる方式や、プログラムのループ部分を高速化する
ために、ループの1反復分を固有のハードウェアリソー
スに割り当てて仮想的に複数のループ反復を個別の処理
ユニットを用いてパイプライン的に同時実行する「ソフ
トウェアパイプライニング(Software Pip
elining)」と呼ばれる方式などが知られてい
る。またリストスケジューリングの効果を高めるため、
プログラムのループ部分の命令列を複数反復分展開して
処理する「ループアンローリング(Loop Unro
lling)」と呼ばれる手法を組み合わせて使用する
こともある。
As an instruction scheduling method in the superscalar system, one basic block (an instruction sequence in a program that does not leave a branch) is processed and instructions are rearranged based on hardware resource constraint conditions and data dependency constraint conditions. In order to speed up the loop part of a program called "list scheduling" or a program, one iteration portion of the loop is allocated to a specific hardware resource, and a plurality of loop iterations are virtually used by using individual processing units. “Software Pipelining (Software Pipe)
A method called "elining)" is known. Also, to enhance the effect of list scheduling,
Loop Unrolling (Loop Unro) that expands and processes the instruction sequence of the loop part of the program for multiple iterations
In some cases, a technique called "lling)" is used in combination.

【0007】VLIW方式、スーパースカラー方式では
このような命令並べ替え手法を用いることにより高速な
並列実行が可能であるが、プログラム開発の際にソース
コードとの対応関係を考慮したデバッグを行う場合に問
題が生ずる。
In the VLIW method and the superscalar method, high-speed parallel execution is possible by using such an instruction rearranging method, but when debugging is performed in consideration of the correspondence with the source code at the time of program development. A problem arises.

【0008】即ち、上記のような命令並べ替え最適化を
行うと、これらの並列処理方式の1実行単位内にソース
プログラム上での複数の文(statement)に対
応する命令が振り分けられることがありうる。例えば最
大4命令同時実行のスーパースカラー計算機で、図2
(b)に示すように命令が並べられることがある。ここ
で命令1、2はソースプログラム(図2(a))上での
文1に対する命令であり、命令3、4は文2に対応する
命令である。このようなプログラムをデバッグする際
に、ユーザがソースプログラム上で文1を終了した段階
でプログラムを停止し実行状態を確認したいということ
が起こる。この場合計算機は並べ替えられた4命令を1
サイクルに同時実行してしまうので、余分な命令3、4
まで実行した段階で停止することになる。このため命令
3、4の内容によっては、メモリ状態やレジスタ内容が
本来の文1完了時点とは異なってしまい、デバッグが非
常に困難になる。同様の困難は文単位のステップ実行の
場合にも発生する。
In other words, if the above instruction rearrangement optimization is performed, the instructions corresponding to a plurality of statements on the source program may be distributed within one execution unit of these parallel processing methods. sell. For example, in a superscalar computer that simultaneously executes up to four instructions,
Instructions may be arranged as shown in (b). Here, the instructions 1 and 2 are instructions for the statement 1 in the source program (FIG. 2A), and the instructions 3 and 4 are instructions corresponding to the statement 2. When debugging such a program, the user sometimes wants to stop the program and confirm the execution state at the stage when the statement 1 is completed on the source program. In this case, the computer puts the four sorted instructions into one
The extra instructions 3, 4 are executed because they are executed simultaneously in the cycle.
It will stop at the stage when it has been executed. Therefore, depending on the contents of the instructions 3 and 4, the memory state and the register contents are different from the original statement 1 completion time, and debugging becomes very difficult. Similar difficulties occur in the case of step execution in sentence units.

【0009】また、デバッグ時には命令の並べ替え、並
列実行をやめて1サイクル当たり1命令のみの実行とす
ることも可能ではあるが、その場合計算機の持つ並列処
理能力は全く使用できず、特に実行時間の大きいプログ
ラムのデバッグでは、デバッグ作業自体の効率を著しく
低下することになる。
In debugging, it is possible to rearrange instructions and stop parallel execution so that only one instruction is executed per cycle. In that case, however, the parallel processing capacity of the computer cannot be used at all, and the execution time is particularly long. When debugging a large program, the efficiency of the debugging work itself will be significantly reduced.

【0010】このようにVLIW、スーパースカラー方
式など命令並列実行機能を持つ計算機でリストスケジュ
ーリング、ソフトウェアパイプライニングなどの命令並
べ替え手法を用いて並列処理を行う方法は、処理の高速
化の面では有効である反面、複数の命令が1サイクルで
同時実行されてしまうため、プログラム開発時のデバッ
グ作業時の操作性を考えると、ユーザが所望する実行単
位での実行停止、状態確認などを正しく行うことができ
ず、不都合を生じてしまう欠点があった。また、デバッ
グ時には1サイクル当たり1命令しか実行しないように
する方法では、デバッグの操作性は損なわれないが計算
機の並列処理能力が全く活かせず大規模プログラムでの
作業効率を著しく低下してしまう欠点があった。
As described above, the method of performing parallel processing by the instruction rearrangement method such as list scheduling and software pipelining in the computer having the instruction parallel execution function such as VLIW and superscalar method is effective in terms of speeding up the processing. On the other hand, since multiple instructions are executed simultaneously in one cycle, considering the operability during debugging during program development, it is necessary to correctly execute the execution in the execution unit desired by the user and check the status. However, there is a disadvantage that it causes inconvenience. Further, the method of executing only one instruction per cycle during debugging does not impair the operability of debugging, but the parallel processing capacity of the computer cannot be utilized at all, and the work efficiency of large-scale programs is significantly reduced. was there.

【0011】[0011]

【発明が解決しようとする課題】このようにVLIW、
スーパースカラー方式など命令並列実行機能を持つ計算
機で、リストスケジューリング、ソフトウェアパイプラ
イニングなどの命令並べ替え手法を用いて並列処理を行
う方法は、処理の高速化の面では有効である反面、プロ
グラム開発時のデバッグ作業時の操作性を考えると並列
実行される命令群が元のプログラム上でユーザが所望す
る実行停止点の前後の命令を実行してしまうことが起こ
る。このような命令群を実行後にプログラムを停止する
と、余分な命令を実行することになる。このためソース
プログラムの文単位などで実行を停止する場合、停止時
のメモリ、レジスタ等の状態が本来とは異なったものに
なり、デバッグ時操作性が著しく損なわれることにな
る。
Thus, VLIW,
On a computer that has an instruction parallel execution function such as the superscalar method, parallel processing using instruction rearrangement methods such as list scheduling and software pipelining is effective in terms of processing speed, but at the time of program development. Considering the operability at the time of debugging, the instruction group executed in parallel may execute instructions before and after the execution stop point desired by the user on the original program. If the program is stopped after executing such an instruction group, an extra instruction will be executed. For this reason, when the execution of the source program is stopped in units of statements, the states of the memory, registers, etc. at the time of the stop will be different from the original state, and the operability during debugging will be significantly impaired.

【0012】このような不具合を回避するため、デバッ
グ時に命令並べ替えを行わずソースプログラムと等価な
命令列を、命令の並列実行を抑止して1サイクルに1命
令のみを実行することが考えられる。しかしながらこの
方法では、計算機の持つ命令並列実行能力が全く使用で
きず、特に実行時間の長いプログラムではデバッグ作業
全体の効率を著しく低下することになる。
In order to avoid such a problem, it is conceivable to execute the instruction sequence equivalent to the source program without executing instruction rearrangement at the time of debugging and execute only one instruction in one cycle by suppressing parallel execution of instructions. . However, with this method, the instruction parallel execution capability of the computer cannot be used at all, and the efficiency of the entire debugging work is significantly reduced, especially for a program with a long execution time.

【0013】また、実際にデバッグ作業を行う場合、ユ
ーザが実行停止を希望する場所はデバッグ段階や、プロ
グラムの性質により変わってくる。デバッグ初期では文
単位での実行停止が必要でも、デバッグが進むにつれて
文集合(ブロック)単位、関数、サブルーチン単位など
ユーザのデバッグ単位は変化する。従って、特に大規模
なプログラムをデバッグする場合、ユーザが所望する、
あるレベルのデバッグ(実行停止)対象のために全プロ
グラムを一定の実行制約の元で実行させるのは、デバッ
グ効率の点で得策とはいえない。
When actually performing a debugging operation, the place where the user desires to stop the execution depends on the debugging stage and the nature of the program. Even if it is necessary to stop the execution in units of statements at the beginning of debugging, the debugging unit of the user such as a unit of statement (block), a unit of function, or a unit of subroutine changes as the debugging progresses. Therefore, especially when debugging a large-scale program,
It is not a good idea from the viewpoint of debugging efficiency to execute all programs under a certain execution constraint for a certain level of debugging (stopping execution).

【0014】本発明は、このような事情を考慮してなさ
れたものであり、その目的とするところは、複数の命令
を並列実行可能な計算機において、ユーザが自身のデバ
ッグ段階に応じて所望する実行停止点でプログラムを停
止した場合に元のプログラムの意味に合致したマシン状
態を保持でき、かつこの条件を満たす範囲内では計算機
の並列処理能力を活かした命令並列実行を行うことが可
能なコードにプログラムを変換するコード変換装置を提
供することにある。
The present invention has been made in consideration of such circumstances, and an object of the present invention is, in a computer capable of executing a plurality of instructions in parallel, desired by a user according to his / her debugging stage. Code that can hold the machine state that matches the meaning of the original program when the program is stopped at the execution stop point, and that can execute instruction parallel execution that utilizes the parallel processing capacity of the computer within the range that satisfies this condition It is to provide a code conversion device for converting a program into.

【0015】[0015]

【課題を解決するための手段】本発明は、ユーザの指定
によりプログラム上でデバッグ時に命令の実行を一時停
止できる箇所を設定する命令実行停止可能箇所設定部
と、設定された実行停止可能箇所において、その前後の
互いに異なる文に帰する命令が同時実行されないような
命令配置制約条件を満たすように命令配置の補正を行な
う命令配置補正部と、前記の命令配置制約条件を満たす
範囲内で並列最適化を行う最適化部とを具備し、ユーザ
が指定したプログラムのオブジェクトコードを出力する
ことを特徴とする。
According to the present invention, there is provided an instruction execution stoppable point setting section for setting a point at which instruction execution can be temporarily stopped during debugging on a program according to a user's designation, and an execution stoppable point set. , An instruction placement correction unit that corrects the instruction placement constraint so that instructions attributed to different sentences before and after are not executed at the same time, and parallel optimization within the range that satisfies the above instruction placement constraint conditions And an optimizing unit for performing optimization, and outputs the object code of the program designated by the user.

【0016】[0016]

【作用】本発明によれば、デバッグ時に命令実行停止が
される可能性のある箇所の前後の命令を1サイクルで同
時実行しないように命令スケジューリングが行われたオ
ブジェクトコードが得られるので、ユーザがその実行停
止可能箇所でプログラム実行を停止した場合は、元のプ
ログラムで指定されたプログラム状態を正しく観測する
ことが可能になり、従来行っていたソースレベルデバッ
グをVLIW、スーパースカラ方式計算機上で容易に行
うことができる。上記の実行停止可能箇所は、コード変
換を行わせるためにユーザが出す指示の中で、所望のデ
バッグ段階に相応しいものを指定することができる。
According to the present invention, an object code in which instruction scheduling is performed so that instructions before and after a portion where instruction execution may be stopped during debugging is not simultaneously executed in one cycle can be obtained. When the program execution is stopped at the place where execution can be stopped, the program state specified in the original program can be correctly observed, and the source level debugging that was conventionally performed can be performed easily on VLIW and superscalar computers. Can be done. Among the above-mentioned execution stoppable points, it is possible to specify an instruction suitable for a desired debug stage among instructions issued by the user for performing code conversion.

【0017】またユーザが実行停止可能箇所と指定しな
い部分については、通常のVLIW、スーパースカラ方
式計算機用コンパイラが行なう命令スケジューリング等
の最適化を行うため高速な実行が可能であるので、デバ
ッグ効率の良いオブジェクトコードに変換できる。
In addition, for a portion not designated by the user as an execution stoppable portion, high-speed execution is possible because optimization such as instruction scheduling performed by a normal VLIW or superscalar computer compiler is performed, so that debugging efficiency is improved. Can be converted into good object code.

【0018】[0018]

【実施例】以下、図面に基づいて本発明の一実施例につ
いて説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

【0019】図1は本発明の一実施例に係るコード変換
装置(コンパイラ)の構成を示す図である。本装置は、
指示入力部10、プログラム入力部11、デバッグ要求
解析部12、構文解析部13、デバッグ要求記録部1
4、命令実行停止可能箇所設定部15、命令配置補正部
16、最適化部17、コード生成部18より構成されて
いる。また、命令実行停止可能箇所設定部15は、デバ
ッグ情報入力部151、命令実行停止可能箇所決定部1
52より構成されている。
FIG. 1 is a diagram showing the configuration of a code conversion device (compiler) according to an embodiment of the present invention. This device
Instruction input unit 10, program input unit 11, debug request analysis unit 12, syntax analysis unit 13, debug request recording unit 1
4, an instruction execution stoppable point setting unit 15, an instruction placement correction unit 16, an optimization unit 17, and a code generation unit 18. The instruction execution stoppable point setting unit 15 includes a debug information input unit 151 and an instruction execution stoppable point determination unit 1.
It is composed of 52.

【0020】まず、指示入力部から「cc −gstm
t (プログラム名)」のような指示が出されると、プ
ログラム入力部11で読み込まれたソースプログラム
が、構文解析部13を経て中間テキストに変換されると
共に、デバッグ要求解析部12ではコンパイル対象とな
るプログラムに対するデバッグ要求があるかどうかを調
べる。デバッグ要求がある場合、デバッグ要求があるこ
とをデバッグ要求記録部14に記録する。また、デバッ
グオプションが設定されている場合には、その情報につ
いてもデバッグ要求記録部に記憶する。デバッグ要求
は、上記指示中では−gで表され、stmt(文単位)
がデバッグオプションに当たる。これ以外にも後述する
ようにblk(ブロック単位)、func(関数単位)
等の指定が可能である。ユーザは、このデバッグオプシ
ョンにより、後述する命令実行停止可能位置を指定する
ことになる。デバッグ要求がある場合には、デバッグ時
に使用するシンボリック情報の収集を行うことも必要で
あるが、これは従来と同様の方式を使用すれば良い。
First, from the instruction input section, "cc-gstm"
When an instruction such as "t (program name)" is issued, the source program read by the program input unit 11 is converted into an intermediate text through the syntax analysis unit 13, and the debug request analysis unit 12 determines that it is a compilation target. To see if there is a debug request for the program. When there is a debug request, the fact that there is a debug request is recorded in the debug request recording unit 14. If the debug option is set, that information is also stored in the debug request recording unit. The debug request is represented by -g in the above instruction, and stmt (statement unit)
Is the debug option. Other than this, as will be described later, blk (block unit), func (function unit)
Etc. can be specified. The user specifies the instruction execution stoppable position described later by this debug option. If there is a debug request, it is also necessary to collect the symbolic information used during debugging, but this can be done using the same method as the conventional one.

【0021】命令実行停止可能箇所設定部15はデバッ
グ要求記録部14を調べ、デバッグ要求が出ている時に
はデバッグ情報入力部151より、ユーザの指定した実
行停止可能箇所についての情報を収集する。ここでデバ
ッグ情報は、コンパイル時におけるデバッグオプション
スイッチ、同じくコンパイル時に指定されたデバッグ情
報ファイル、使用しているOS上のシェルでの環境変数
などを調べることにより得られる。得られたデバッグ情
報より、命令実行停止可能箇所決定部152が命令実行
停止可能箇所を決定する。
The instruction execution stoppable point setting section 15 checks the debug request recording section 14 and collects information about the execution stoppable point designated by the user from the debug information input section 151 when a debug request is issued. Here, the debug information can be obtained by examining a debug option switch at the time of compiling, a debug information file also specified at the time of compiling, environment variables in a shell on the OS being used, and the like. From the obtained debug information, the instruction execution stoppable point determination unit 152 determines the instruction execution stoppable point.

【0022】最適化部17は中間テキストを解析しVL
IW、スーパースカラプロセッサ用の各種の最適化処
理、すなわち、リストスケジューリングによる命令の並
べ変えや、ソフトウェアパイプライニング・ループ展開
等によるループ処理などが実行される。その際、最適化
処理を行なっても、設定された命令実行停止可能箇所が
所定の命令配置制約条件を満たす場合にのみ最適化処理
が行なわれるように制御を行なう。最適化処理を行なう
ことにより命令配置制約条件を損なうような最適化処理
は行なわれない。つまり、ユーザが文単位でデバッグし
たいという要求を出したときには、各文を構成する命令
が入れ子になってしまうような最適化は行わず、1文を
構成する命令は1かたまりとなるような範囲で最適化を
行う。
The optimization unit 17 analyzes the intermediate text and analyzes the VL.
Various optimization processes for the IW and superscalar processors, that is, instruction rearrangement by list scheduling, loop processing by software pipelining, loop expansion, etc. are executed. At this time, even if the optimization process is performed, control is performed so that the optimization process is performed only when the set instruction execution stoppable position satisfies a predetermined instruction placement constraint condition. By performing the optimizing process, the optimizing process that impairs the instruction placement constraint condition is not performed. In other words, when the user makes a request to debug in sentence units, the optimization that nests the commands that compose each sentence is not performed, and the commands that compose one sentence are one block. To optimize.

【0023】以上のモジュールを経て出力された中間テ
キストはコード生成部18により機械語に翻訳されオブ
ジェクトプログラムとして出力される。コード生成部で
は、命令配置補正部16は設定された実行停止可能箇所
を調べて、出力されるコードが所定の命令配置制約条件
を満たすように命令配置補正を行なう。具体的には、タ
ーゲットとするVLIW、スーパースカラ方式計算機の
並列度にしたがって決まるオブジェクトコードにおける
命令境界(例えば4命令同時実行可能な計算機の場合に
は4命令ずつの命令境界)に設定された命令実行停止可
能箇所が配置されるようにデバッグの単位同士の間にN
OPを挿入することにより補正を行なう。
The intermediate text output through the above modules is translated into a machine language by the code generator 18 and output as an object program. In the code generation unit, the instruction placement correction unit 16 examines the set execution-stoppable portion and performs instruction placement correction so that the output code satisfies a predetermined instruction placement constraint condition. Specifically, the instruction set in the instruction boundary in the object code determined according to the parallelism of the target VLIW and superscalar computer (for example, in the case of a computer capable of simultaneously executing four instructions, the instruction boundary is four instructions) N between debug units so that the execution-stoppable part is located
Correction is performed by inserting OP.

【0024】例えば図3(a)に示すC言語の関数につ
いて、ユーザの命令停止可能箇所設定に従ってコード生
成する場合を考える。対象とするプロセッサが4命令同
時実行可能である場合、もしユーザが文単位で実行を停
止させたい場合は、文の先頭の命令が4命令の境界の先
頭に来るように補正を行なう。具体的には、前の文の最
後の命令が4命令境界の境界部に配置された場合には補
正は行なわないが、途中に配置された場合、すなわち4
命令並びの1命令目や2命令目などに配置された場合、
図3(b)に見られるように残りの3命令目、4命令目
の部分にNOPを挿入することにより命令配置の補正を
行なう。そして、一つの文の最後はこのように補正され
ているが、その他の部分については命令のスケジューリ
ング等の並列最適化処理がなされたコードが出力される
ことになる。
For example, consider a case where a code is generated for the C language function shown in FIG. 3A in accordance with a user's instruction stoppable point setting. When the target processor is capable of executing four instructions simultaneously, if the user wants to stop the execution on a sentence-by-sentence basis, correction is performed so that the instruction at the beginning of the sentence comes at the beginning of the boundary of four instructions. Specifically, no correction is made when the last instruction of the previous sentence is placed at the boundary of the four-instruction boundary, but when it is placed in the middle, that is, when 4
If it is placed in the first or second instruction of the instruction sequence,
As shown in FIG. 3B, the instruction placement is corrected by inserting NOPs in the remaining third and fourth instructions. Then, although the end of one sentence is corrected in this way, the code for which parallel optimization processing such as instruction scheduling has been performed is output for the other portions.

【0025】また、デバッグの段階が進むなどしてユー
ザが文ではなく、ブロック単位で実行を停止させたい旨
を指示した場合には、ループの先頭や1ブロックの先頭
が4命令の境界に来るように補正されたコードが出力さ
れる。この時、ループ内部及びブロック内部については
並列最適化処理が行なわれる。同様に、関数・手続単位
で実行を停止させたい旨を指示すると、関数・手続の先
頭が4命令の境界に来るように補正され、関数・手続内
部は並列最適化されたコードが出力される。尚、文や関
数の最後が境界に来るように補正してもよい。
Further, when the user gives an instruction to stop the execution in block units instead of statements, as the debug stage progresses, the head of the loop or the head of one block comes to the boundary of four instructions. The corrected code is output. At this time, parallel optimization processing is performed inside the loop and inside the block. Similarly, if you specify that you want to stop execution in units of functions / procedures, the start of the function / procedure is corrected so that it is on the boundary of four instructions, and the code optimized in parallel is output inside the function / procedure. . It should be noted that the sentence or function may be corrected so that the end of the sentence or function comes to the boundary.

【0026】以上のように生成されたオブジェクトプロ
グラムを図示しない実行部で実行する際には、ユーザが
指定した命令実行停止可能箇所において実行停止がで
き、実行停止可能箇所に挟まれた部分は通常の並列実行
がされることになる。よって、この生成されたオブジェ
クトプログラムを通常のデバッガにかければ、並列実行
を含むプログラムでありながら、ユーザが実際にプログ
ラムを停止して実行状態を見たい点で実行停止ができ
る。
When the object program generated as described above is executed by the execution unit (not shown), the execution can be stopped at the instruction execution stoppable portion designated by the user, and the portion sandwiched between the execution stoppable portions is usually. Will be executed in parallel. Therefore, if the generated object program is applied to an ordinary debugger, the user can actually stop the program and stop the execution at the point where he / she wants to see the execution state, even though the program includes parallel execution.

【0027】[0027]

【発明の効果】かくして本発明によれば、ユーザは自分
の指定したデバッグ単位で実行停止ができ、元のプログ
ラムで指定されたプログラム状態を正しく観測できる。
その際には実行停止を指定しない場所については並列実
行がなされるのでより効率の良いデバッグ処理を行うこ
とが可能になる。
As described above, according to the present invention, the user can stop the execution in the debug unit designated by himself, and can correctly observe the program state designated by the original program.
In that case, parallel execution is performed in a place where execution stop is not designated, so that more efficient debug processing can be performed.

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

【図1】 本発明の1つの実施例に係るコード変換装置
(コンパイラ)の構成を示す図。
FIG. 1 is a diagram showing a configuration of a code conversion device (compiler) according to an embodiment of the present invention.

【図2】 (a)は本実施例に係るコンパイラの処理対
象となるC言語プログラムを示す図、(b)は(a)の
プログラムを従来の手法でコンパイルした1例を示す
図。
FIG. 2A is a diagram showing a C language program to be processed by the compiler according to the present embodiment, and FIG. 2B is a diagram showing an example in which the program of FIG.

【図3】 (a)は本実施例に係るコンパイラの処理対
象となるC言語プログラムを示す図、(b)は(a)の
プログラムを本発明の1実施例方式でコンパイルした結
果のアセンブラプログラムを示す図。
3A is a diagram showing a C language program to be processed by the compiler according to the present embodiment, and FIG. 3B is an assembler program obtained as a result of compiling the program of FIG. FIG.

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

10 指示入力部 11 プログラム入力部 12 デバッグ要求解析部 13 構文解析部 14 デバッグ要求記録部 15 命令実行停止可能箇所設定部 151 デバッグ情報入力部 152 命令実行停止可能箇所決定部 16 命令配置補正部 17 最適化部 18 コード生成部 10 instruction input unit 11 program input unit 12 debug request analysis unit 13 syntax analysis unit 14 debug request recording unit 15 instruction execution stoppable location setting unit 151 debug information input unit 152 instruction execution stoppable location determination unit 16 instruction placement correction unit 17 optimal Coder 18 Code generator

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 プログラムを複数の命令を同時実行可能
な電子計算機システムで実行するコードに変換するコー
ド変換装置において、 ユーザの指定により命令実行停止可能箇所を設定する手
段と、 設定された命令実行停止可能箇所において、その前後の
プログラム記述に帰する命令が同時に実行されないよう
な命令配置制約条件を満たすように命令配置を補正する
手段と、 設定された命令実行停止可能箇所が所定の命令配置制約
条件を満たすことを妨げない範囲で当該電子計算機シス
テムが複数の命令を同時に実行するコードを補正された
命令配置に従って生成する手段を備えたことを特徴とす
るコード変換装置。
1. A code conversion device for converting a program into a code to be executed by an electronic computer system capable of simultaneously executing a plurality of instructions, a means for setting a position where instruction execution can be stopped by user designation, and a set instruction execution. A means for correcting the instruction placement so that the instructions attributed to the program description before and after the haltable point are not executed at the same time, and the set instruction execution haltable point has a predetermined instruction placement constraint. A code conversion device comprising means for generating, according to a corrected instruction arrangement, a code for the electronic computer system to simultaneously execute a plurality of instructions within a range that does not prevent a condition from being satisfied.
JP4213135A 1992-08-11 1992-08-11 Code converter Pending JPH0659933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4213135A JPH0659933A (en) 1992-08-11 1992-08-11 Code converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4213135A JPH0659933A (en) 1992-08-11 1992-08-11 Code converter

Publications (1)

Publication Number Publication Date
JPH0659933A true JPH0659933A (en) 1994-03-04

Family

ID=16634159

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4213135A Pending JPH0659933A (en) 1992-08-11 1992-08-11 Code converter

Country Status (1)

Country Link
JP (1) JPH0659933A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007058731A (en) * 2005-08-26 2007-03-08 Matsushita Electric Ind Co Ltd Processor and debugging apparatus corresponding to parallel instruction execution
JP2011181100A (en) * 2011-05-19 2011-09-15 Panasonic Corp Processor and debugging apparatus corresponding to parallel instruction performance
US10023622B2 (en) 2008-04-14 2018-07-17 Alzinova Ab Method of immunization for reducing toxic damaged caused by oligomeric form of the amyloid-beta protein with stable amyloid beta monomers and oligomers

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007058731A (en) * 2005-08-26 2007-03-08 Matsushita Electric Ind Co Ltd Processor and debugging apparatus corresponding to parallel instruction execution
US10023622B2 (en) 2008-04-14 2018-07-17 Alzinova Ab Method of immunization for reducing toxic damaged caused by oligomeric form of the amyloid-beta protein with stable amyloid beta monomers and oligomers
JP2011181100A (en) * 2011-05-19 2011-09-15 Panasonic Corp Processor and debugging apparatus corresponding to parallel instruction performance

Similar Documents

Publication Publication Date Title
JP3663710B2 (en) Program generation method and processor interrupt control method
JP3032031B2 (en) Loop optimization method and apparatus
US5901308A (en) Software mechanism for reducing exceptions generated by speculatively scheduled instructions
JP3190773B2 (en) Compile processing method of language processing program
US5687375A (en) Debugging of High Performance Fortran programs with backup breakpoints
JP2921190B2 (en) Parallel execution method
Bala et al. Efficient instruction scheduling using finite state automata
US5812854A (en) Mechanism for integrating user-defined instructions with compiler-generated instructions and for optimizing the integrated instruction stream
JPH1097430A (en) Method and system for inserting assembly code routine into source code routine for optimization
JP2009524866A (en) System and method for parallel execution of programs
JP2818016B2 (en) Process parallel execution method and apparatus
US6751791B2 (en) Method of optimizing an MPI procedure by altering to a procedure other than the invoked MPI procedure portion or by altering the execution sequence
Yuan et al. STARPro—a new multithreaded direct execution platform for Esterel
JPH11167492A (en) Array summary analyzing method for loop containing skip-out sentence
JPH0659933A (en) Code converter
US7073169B2 (en) Compiler device with branch instruction inserting unit
Campbell et al. Refining and defining the program dependence web
JP2007226589A (en) Program conversion system
JPH04308934A (en) Electronic computer
JP2001255912A (en) Method for executing motion program
JP3956113B2 (en) Data processing apparatus and program
JP2956591B2 (en) Method and apparatus for parallelizing a loop having a conditional jump out of the loop
JP3551352B2 (en) Loop splitting method
JPH08115220A (en) Loop optimization method
JP2682206B2 (en) Optimization method of target program