JP5457104B2 - Cross compiler - Google Patents

Cross compiler Download PDF

Info

Publication number
JP5457104B2
JP5457104B2 JP2009188328A JP2009188328A JP5457104B2 JP 5457104 B2 JP5457104 B2 JP 5457104B2 JP 2009188328 A JP2009188328 A JP 2009188328A JP 2009188328 A JP2009188328 A JP 2009188328A JP 5457104 B2 JP5457104 B2 JP 5457104B2
Authority
JP
Japan
Prior art keywords
instruction
cpu
bus
register
sound source
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
JP2009188328A
Other languages
Japanese (ja)
Other versions
JP2011039376A (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.)
Kawai Musical Instrument Manufacturing Co Ltd
Original Assignee
Kawai Musical Instrument Manufacturing Co 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 Kawai Musical Instrument Manufacturing Co Ltd filed Critical Kawai Musical Instrument Manufacturing Co Ltd
Priority to JP2009188328A priority Critical patent/JP5457104B2/en
Publication of JP2011039376A publication Critical patent/JP2011039376A/en
Application granted granted Critical
Publication of JP5457104B2 publication Critical patent/JP5457104B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)

Description

本発明は、特定のターゲットシステム環境で動作することを目的とするオブジェクトプログラムを生成するクロスコンパイラに関する。   The present invention relates to a cross compiler for generating an object program intended to operate in a specific target system environment.

従来、記憶手段に記憶された波形データをアクセスする音源と、該記憶手段に記憶されたプログラム/データをアクセスするCPUとが共有し、且つ時分割交互に使用される共有バスを備えた電子学音発生器では、上記CPUのプログラム開発は、プログラム言語を単純に機械語命令に変換するように実施されていた。   Conventionally, an electronic circuit provided with a shared bus that is shared by a sound source that accesses waveform data stored in a storage means and a CPU that accesses a program / data stored in the storage means and is used alternately in a time-sharing manner. In the sound generator, the program development of the CPU has been performed so as to simply convert the program language into machine language instructions.

しかし、上記のようなプログラム開発がなされると、音源とCPUのアクセスタイミングを、プログラム実行時に分離する必要が生じ、該CPUがバスを使用しない命令が実行される場合でも、音源がバスを使用する間は、そのCPUの実行を待たねばならなくなるという問題があり、処理スピードが落ちる問題を生じていた。特にパイプライン処理が実行される場合は、その問題が顕著に反映される。   However, when the program is developed as described above, it is necessary to separate the access timing between the sound source and the CPU at the time of program execution, and the sound source uses the bus even when an instruction that does not use the bus is executed by the CPU. During this period, there is a problem that the CPU must wait for the execution of the CPU, resulting in a problem that the processing speed decreases. Especially when pipeline processing is executed, the problem is remarkably reflected.

本発明は、以上のような問題に鑑み創案されたもので、上記電子学音発生器環境で動作することを目的とするオブジェクトプログラムを生成するクロスコンパイラであって、上記環境下で動作し、そこに含まれるCPUの実行速度を上げることができる、クロスコンパイラを提供せんとするものである。   The present invention was devised in view of the above problems, and is a cross compiler for generating an object program intended to operate in the electronic sound generator environment, and operates in the environment. It is intended to provide a cross compiler that can increase the execution speed of the CPU included therein.

本発明の構成は、
少なくともプログラム及びデータを記憶する記憶手段と、該記憶手段に記憶された波形データをアクセスする音源と、該記憶手段に記憶されたプログラム及びデータをアクセスするCPUと、上記記憶手段が繋げられた共有バスと、該共有バスに対し上記音源とCPUが時分割交互にアクセスさせる制御を行うバスコントローラとを備えたターゲットシステム環境で動作することを目的とするオブジェクトプログラムを生成するクロスコンパイラであって、
前記CPUが共有バスを使用する命令を検出する第1の検出手段と、
該第1の検出手段が検出した命令が実行されるタイミングが、前記共有バスをCPUが使用するべきタイミングであるかどうかを検出する第2の検出手段と、
前記第1の検出手段の検出した、CPUが共有バスを使用する命令が、前記音源が共有バスを使用するべきタイミングに実行されることを、前記第2の検出手段により検出した場合に、該命令の前に前記CPUに対して、CPUが共有バスを使用して実行する命令の次の命令に交換可能か否かを判定する判定手段と、
その判定結果に基づき、次の命令に交換可能であれば、その命令に交換し、逆に次の命令に交換可能でなければ、共有バスを該CPUが次に使用するタイミングまで休止する命令を挿入するオペレーション手段とを備え、
上記共有バスを上記音源が使用するタイミングに、上記CPUが共有バス以外をアクセスするように動作するオブジェクトプログラムを生成することを基本的特徴としている。
The configuration of the present invention is as follows:
Storage means for storing at least a program and data, a sound source for accessing waveform data stored in the storage means, a CPU for accessing programs and data stored in the storage means, and a shared connection of the storage means A cross compiler that generates an object program intended to operate in a target system environment including a bus and a bus controller that controls the sound source and the CPU to alternately access the shared bus in a time-division manner,
First detection means for detecting an instruction for the CPU to use a shared bus;
Second detection means for detecting whether or not the timing at which the instruction detected by the first detection means is executed is a timing at which the CPU should use the shared bus;
When the second detection means detects that the instruction that the CPU uses the shared bus detected by the first detection means is executed at a timing when the sound source should use the shared bus, Determining means for determining whether or not the CPU can be replaced with an instruction next to an instruction executed by the CPU using a shared bus before the instruction;
Based on the determination result, if the instruction can be exchanged for the next instruction, the instruction is exchanged for the instruction. On the other hand, if the instruction cannot be exchanged for the next instruction, the instruction to pause the shared bus until the next use of the CPU is issued. An operation means for inserting,
The basic feature is that the CPU generates an object program that operates to access other than the shared bus at the timing when the sound source uses the shared bus.

上記構成によれば、前記第1の検出手段の検出した、CPUが共有バスを使用する命令が、前記音源が共有バスを使用するべきタイミングに実行されることを、前記第2の検出手段により検出した場合に、該命令の前に前記CPUに対して、CPUが共有バスを使用して実行する命令の次の命令に交換可能か否かが、判定手段により判定され、その判定結果において、次の命令に交換可能であれば、オペレーション手段によってその命令に交換され、逆に次の命令に交換可能でなければ、該オペレーション手段によって共有バスを該CPUが次に使用するタイミングまで休止する命令が挿入されるようになるため(コンパイラで生成されたオブジェクトプログラムが、CPUの共有バスアクセス命令と音源タイミングとがぶつかるサイクルを検出して交換可能な次の命令に交換され、或いは次の使用タイミングまでCPUのバス使用を休止する命令が出力されるため)、CPUがバスを使用しない命令が実行される場合にあっては、音源がバスを使用する間に、そのCPUは待つことなくその命令をそのまま実行でき、結果的に該CPUの実行速度を上げることができるようになる。   According to the above configuration, the second detection unit detects that the instruction for the CPU to use the shared bus detected by the first detection unit is executed at a timing at which the sound source should use the shared bus. When it is detected, it is determined by the determination means whether or not the CPU can be replaced with an instruction next to the instruction executed by the CPU using the shared bus before the instruction. In the determination result, If the instruction can be exchanged for the next instruction, the instruction is exchanged for the instruction by the operation means, and conversely, if the instruction cannot be exchanged for the next instruction, the operation means pauses the shared bus until the next use of the CPU. (The object program generated by the compiler has a cycle in which the shared bus access instruction of the CPU and the sound source timing collide with each other.) If the instruction that does not use the bus is executed, the instruction is issued to suspend the use of the CPU bus until the next use timing). While the sound source uses the bus, the CPU can execute the instruction as it is without waiting, and as a result, the execution speed of the CPU can be increased.

以上のような本発明の構成によれば、コンパイラで生成されたオブジェクトプログラムが、CPUの共有バスアクセス命令と音源タイミングとがぶつかるサイクルを検出して交換可能な次の命令に交換され、或いは次の使用タイミングまでCPUのバス使用を休止する命令が出力されるため、CPUがバスを使用しない命令が実行される場合にあっては、音源がバスを使用する間は、そのCPUは待つことなくその命令をそのまま実行でき、結果的に該CPUの実行速度を上げることができるようになるという優れた効果を奏し得る。   According to the configuration of the present invention as described above, the object program generated by the compiler is replaced with the next instruction that can be exchanged by detecting a cycle in which the shared bus access instruction of the CPU and the sound source timing collide, or Since the instruction to pause the use of the CPU bus is output until the use timing of the CPU, if the instruction that the CPU does not use the bus is executed, the CPU does not wait while the sound source uses the bus. The instruction can be executed as it is, and as a result, an excellent effect can be obtained that the execution speed of the CPU can be increased.

以下、本発明の実施の形態を、図1〜図19の図面を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to FIGS.

本実施例のクロスコンパイラは、電子鍵盤楽器という別のターゲットシステム環境で動作することを目的に、図1のようなプログラム開発環境で開発される、オブジェクトプログラムを生成するクロスコンパイラである。   The cross compiler of this embodiment is a cross compiler that generates an object program developed in a program development environment as shown in FIG. 1 for the purpose of operating in another target system environment called an electronic keyboard instrument.

まず、図1は、本発明のコンパイラを作成する別システムのワークステーションの機能ブロック図を示している。   First, FIG. 1 shows a functional block diagram of a workstation of another system for creating the compiler of the present invention.

本ワークステーションは、システムバス1000を介して、CPUブロック1004、ダイレクトメモリアクセスコントローラ1006、外部機器との接続を行うインターフェース1008、メモリブロック1010、ディスクI/Oユニット1012、ハードディスクドライブ1014が接続されており、また、上記インターフェース1008を介してI/Oバス1002にもつながっている。該I/Oバス1002は、さらにGPU1016の他、タイピングキーボードやマウス、外部デバイスにも接続されている。該GPU1016は、外部ディスプレイに当たるビデオモニタ1018の画面制御を行う。   The workstation is connected to a CPU block 1004, a direct memory access controller 1006, an interface 1008 for connecting to an external device, a memory block 1010, a disk I / O unit 1012, and a hard disk drive 1014 via a system bus 1000. Also connected to the I / O bus 1002 via the interface 1008. The I / O bus 1002 is further connected to a typing keyboard, a mouse, and an external device in addition to the GPU 1016. The GPU 1016 controls the screen of the video monitor 1018 that hits the external display.

ここでは、後述する電子鍵盤楽器で構成されるターゲットシステムのCPU10上に、後に述べる各機能部で構築される構成が生成されることになる、本クロスコンパイラにより生成されるオブジェクトプログラムの開発環境が提供されることになる。   Here, a development environment for an object program generated by the present cross compiler, in which a configuration constructed by each functional unit described later is generated on the CPU 10 of a target system configured by an electronic keyboard instrument to be described later. Will be provided.

図2は、上記コンパイラの処理フローを示すフローチャートである。まず、全ソースコードにわたって前処理がなされる(ステップS100)。前処理とは、実際のコンパイルに先立って行われる処理であり、例えばマクロを通常の命令に展開する、等のことをいう。   FIG. 2 is a flowchart showing the processing flow of the compiler. First, preprocessing is performed for all source codes (step S100). Pre-processing is processing that is performed prior to actual compilation. For example, a macro is expanded into a normal instruction.

そして全てのジャンプ命令(分岐)やサブルーチン呼出し命令などのラベルの抽出処理がなされる(ステップS102)。   Then, label extraction processing for all jump instructions (branch) and subroutine call instructions is performed (step S102).

これらの命令のコード化処理が行われ(ステップS104)、命令カウンタiを0とし(ステップS106)、以後ステップS122まで1命令ずつ処理が実行される。   These instructions are encoded (step S104), the instruction counter i is set to 0 (step S106), and thereafter, the process is executed one instruction at a time until step S122.

すなわち、CPU40が処理すべきi(0から全命令数−1までの順に)番目の命令が取得され(ステップS108)、それが後述する図5の第1検出部1により、同じく図4のエクスターナルバス40アクセスを要求しているか否かがチェックされる(ステップS110)。該命令がエクスターナルバス40アクセス要求をしていない場合(ステップS110;N)、後述するステップS120に移行する。   That is, the i-th instruction (in order from 0 to the total number of instructions −1) to be processed by the CPU 40 is acquired (step S108), and the first detection unit 1 in FIG. It is checked whether or not bus 40 access is requested (step S110). When the instruction does not make an external bus 40 access request (step S110; N), the process proceeds to step S120 described later.

反対にその命令がエクスターナルバス40アクセス要求をしていることが、第1検出部1により検出された場合(ステップS110;Y)、そのアドレスは8の倍数[8n(n=0、1、…)]か否かが、同じく後述する第2検出部2によって、チェックされる(ステップS112)。これは、CPU10は全体として1クロックで1命令を実行するが、8の倍数アドレスに置かれた命令が偶数クロックでCPU10にフェッチされ、その3クロック後(即ち奇数クロック)に、必要ならエクスターナルバス40をアクセスしようとするからであり、一方で該音源20は奇数クロックに、エクスターナルバス40をアクセスするからである。この2つのチェックによって、CPU10がアクセス違反しているか否かのチェックが行われているわけである。   On the contrary, when the first detection unit 1 detects that the instruction makes an external bus 40 access request (step S110; Y), the address is a multiple of 8 [8n (n = 0, 1,... ]] Is checked by the second detection unit 2 which will be described later (step S112). This is because the CPU 10 executes one instruction at one clock as a whole, but an instruction placed at a multiple of 8 is fetched by the CPU 10 at an even clock, and after three clocks (ie, an odd clock), if necessary, an external bus This is because the tone generator 20 accesses the external bus 40 to odd clocks. By these two checks, it is checked whether or not the CPU 10 has violated access.

8の倍数でない(命令長は4バイト固定長であるので、即ち8の倍数+4の)アドレスの場合(ステップS112;N)、後述するステップS120に移行する。   If the address is not a multiple of 8 (the instruction length is a fixed length of 4 bytes, that is, a multiple of 8 + 4) (step S112; N), the process proceeds to step S120 described later.

反対に8の倍数のアドレスの場合(ステップS112;Y)、同じく後述する判定部3によって、次に続く命令と交換可能か否かがチェックされる(ステップS114)。   On the other hand, when the address is a multiple of 8 (step S112; Y), the determination unit 3 which will be described later checks whether or not it can be exchanged with the next instruction (step S114).

次に続く命令と交換可能な場合(ステップS114;Y)、同じく後述するオペレーション部4によって、命令が交換される(ステップS116)。反対に次に続く命令と交換ができない場合(ステップS114;N)、後述するオペレーション部4によって、NOP命令(休止命令)がそのタイミングに挿入される(ステップS118)。   If it can be exchanged for the next command (step S114; Y), the command is exchanged by the operation unit 4 which will be described later (step S116). On the other hand, if it cannot be exchanged for the next instruction (step S114; N), a NOP instruction (pause instruction) is inserted at the timing by the operation unit 4 described later (step S118).

いずれのステップS116又はS118の後も、命令カウンタiをインクリースする(ステップS120)。   After any step S116 or S118, the instruction counter i is incremented (step S120).

命令カウンタiが全コード数に達したか否かがチェックされ(ステップS122)、達していない場合(ステップS122;N)は、前記ステップS106に復帰し、全ソースコードにわたって、以上の処理を繰り返す。   It is checked whether or not the instruction counter i has reached the total number of codes (step S122). If not reached (step S122; N), the process returns to step S106, and the above processing is repeated over all source codes. .

命令カウンタiが全コード数に達した場合(ステップS122;Y)、ラベル位置補正が行われる(ステップS124)。すなわち、該ラベル位置補正では、全てのジャンプ(分岐)命令及びサブルーチン呼出し命令の飛び先に当たるラベル(アドレス)を8の倍数に、飛び元にある命令のアドレスを8の倍数+4にする処理が行われることになる。飛び元にある命令のアドレスが8の倍数である場合はNOPを挿入して8の倍数+4になる様にする。この結果、コンパイラはターゲットに接続しないでも、全ての命令をアクセス違反が無いように配置することができるようになる。   When the instruction counter i reaches the total number of codes (step S122; Y), label position correction is performed (step S124). In other words, in the label position correction, a process is performed in which all jump (branch) instructions and subroutine call instruction jump labels (addresses) are multiples of 8, and the addresses of the instructions at the jump source are multiples of 8 +4. It will be. If the address of the instruction at the jump source is a multiple of 8, a NOP is inserted so that it becomes a multiple of 8 + 4. As a result, the compiler can arrange all instructions so that there is no access violation without connecting to the target.

以上でコンパイラの処理フローが終了する。   This completes the compiler processing flow.

図3は、上記ワークステーションを使用しながら、そこでクロスコンパイラを用いることで、ターゲットシステム環境である電子鍵盤楽器で動作することを目的とするオブジェクトプログラムの開発作業手順を示すフローチャートである。   FIG. 3 is a flowchart showing a procedure for developing an object program intended to operate on an electronic keyboard instrument as a target system environment by using a cross compiler while using the workstation.

まず、ワークステーションに備えられたエディタを起動して、上記図2で示したフローのソースコードが作成される(ステップS200)。又は、ステップS200では、既存のソースコードを修正してもいい。また同じくワークステーションに備えられたコンパイラを起動して、該コンパイラにより、作成されたソースコードがマシン語のターゲットプログラムに変換される(ステップS202)。   First, the editor provided in the workstation is activated, and the source code of the flow shown in FIG. 2 is created (step S200). Alternatively, in step S200, the existing source code may be corrected. Similarly, a compiler provided in the workstation is activated, and the generated source code is converted into a machine language target program by the compiler (step S202).

そして該プログラムにエラーがあるか否かがチェックされ(ステップS204)、エラーがあれば(ステップS204;Y)、上記ステップS200に復帰し、ソースコードの修正がなされる。   Then, it is checked whether or not there is an error in the program (step S204). If there is an error (step S204; Y), the process returns to step S200, and the source code is corrected.

反対にエラーがなければ(ステップS204;N)、ワークステーションのI/Oバス1002につながっている外部デバイス端子から、インターフェース1008及び後述する図4に示すターゲットシステムである電子鍵盤楽器に対して、同じくインターフェース66を通じて、作成されたターゲットプログラムが転送される(ステップS206)。上記電子鍵盤楽器で動作確認が行われ(ステップS208)、異常があるか無いかがチェックされる(ステップS210)。異常があれば(ステップS210;N)、上記ステップS200に復帰し、以上の処理を繰り返す。反対に異常がなければ(ステップS210;Y)、両インターフェース1008と66の接続を切り、ワークステーションをターゲットシステムの電子鍵盤楽器から切り離し、該電子鍵盤楽器を完成させる。   On the other hand, if there is no error (step S204; N), from the external device terminal connected to the I / O bus 1002 of the workstation, the interface 1008 and the electronic keyboard instrument which is the target system shown in FIG. Similarly, the created target program is transferred through the interface 66 (step S206). Operation confirmation is performed with the electronic keyboard instrument (step S208), and it is checked whether there is any abnormality (step S210). If there is an abnormality (step S210; N), the process returns to step S200 and the above processing is repeated. On the other hand, if there is no abnormality (step S210; Y), the interfaces 1008 and 66 are disconnected, the workstation is disconnected from the electronic keyboard instrument of the target system, and the electronic keyboard instrument is completed.

図4は、上記ターゲットシステムの電子鍵盤楽器の構成概要ブロック図である。該電子鍵盤楽器は、1つのLSI中に組み込まれたデータインターナルバス70を介して、CPU10(データの出入はこのバスを介して行われる)と、音源(ToneGenerator)20と、バスコントローラ30とがつながっており、さらに、命令インターナルバス60を介して、上記CPU10(命令の出入はこのバスを介して行われる)と、メモリコントローラ62とがつながっている。該メモリコントローラ62は、プログラムを記憶したフラッシュメモリ64に繋げられており、さらに、該フラッシュメモリ64は、上述のようにしてインターフェース66及びメモリコントローラ62を介してターゲットプログラムが記憶されている。上記CPU10は、電源ONと同時に、指示を出し、命令インターナルバス60及びメモリコントローラ62を介して、フラッシュメモリ64から、そこに記憶されたターゲットプログラムを読み出し、以後該ターゲットプログラムに従って、CPU10の処理がなされることになる。   FIG. 4 is a schematic block diagram of the configuration of the electronic keyboard instrument of the target system. The electronic keyboard instrument includes a CPU 10 (data input / output is performed via this bus), a sound generator (ToneGenerator) 20, a bus controller 30 via a data internal bus 70 incorporated in one LSI. Further, the CPU 10 (instructions are input / output via this bus) and the memory controller 62 are connected via an instruction internal bus 60. The memory controller 62 is connected to a flash memory 64 that stores a program, and the flash memory 64 stores a target program via the interface 66 and the memory controller 62 as described above. The CPU 10 issues an instruction at the same time as the power is turned on, reads out the target program stored in the flash memory 64 via the instruction internal bus 60 and the memory controller 62, and thereafter processes the CPU 10 according to the target program. Will be made.

このCPU10は、例えば24bitsのアドレス空間及び32bitsのデータバス幅を有しており、後述するように、5段のパイプライン処理が行われるRISC型CPUである。また上記メモリコントローラ62は、ターゲットシステムである電子鍵盤楽器からターゲットプログラムを転送する間、フラッシュメモリ64を上記ワークステーションに接続し、転送終了後はフラッシュメモリ64を、上記CPU10に接続する。   The CPU 10 is a RISC CPU that has, for example, a 24-bit address space and a 32-bit data bus width, and performs five-stage pipeline processing, as will be described later. The memory controller 62 connects the flash memory 64 to the workstation while transferring the target program from the electronic keyboard instrument as the target system, and connects the flash memory 64 to the CPU 10 after the transfer is completed.

他方、CPU10と音源20とは、バスコントローラ30を介して、上記LSIの外部にあるエクスターナルバス40につながっており、そのバスに繋げられている、データを記憶しているROM(ここでは音色データや様々なデータや係数などのテーブルが記憶されている)及びRAM(CPU10の演算結果が書き込まれる)50と、波形データを記憶しているメモリ52との間で、CPU10はプログラムやデータを、また音源20は、波形データを、時分割交互にアクセスする構成となっている。そのためこのエクスターナルバス40は、上記CPU10と音源20との共有バスとなっている。   On the other hand, the CPU 10 and the sound source 20 are connected to an external bus 40 outside the LSI via a bus controller 30 and are connected to the bus and store data ROM (here, timbre data). CPU 10 stores programs and data between a memory 50 storing waveform data and a RAM 50 (in which calculation results of the CPU 10 are written) 50 and a memory 52 storing waveform data. The sound source 20 is configured to access the waveform data alternately in a time division manner. Therefore, the external bus 40 is a shared bus between the CPU 10 and the sound source 20.

波形データの読み出しを行った音源20は、そこで楽音波形を生成し、上記のデータインターナルバス70につながったDSP22で主にディレイを中心とした音響効果が付加されて、LSI外部の後述する音響システムに出力される。該DSP22は、CPU10からの指示と、係数の出力により、音源20からの楽音波形に種々の音響効果を付加するが、ディレイ効果を付す場合は、LSI外部にあるDSPバス22bを介してつながっているディレイメモリ22aを使用しながら、該音響効果を楽音波形に付加することになる。   The sound source 20 from which the waveform data has been read out generates a musical sound waveform there, and the DSP 22 connected to the data internal bus 70 is added with an acoustic effect mainly centered on the delay, and the sound described later outside the LSI. Output to the system. The DSP 22 adds various acoustic effects to the musical sound waveform from the sound source 20 based on the instruction from the CPU 10 and the output of the coefficients. When the delay effect is added, the DSP 22 is connected via the DSP bus 22b outside the LSI. The sound effect is added to the musical sound waveform while using the delay memory 22a.

該DSP22から出力された楽音波形は、デジタルアナログコンバータ(DAC)24でアナログ信号に変換され、アンプ26で増幅されて、スピーカ28を介して外部に放音することになる。   The musical sound waveform output from the DSP 22 is converted into an analog signal by a digital / analog converter (DAC) 24, amplified by an amplifier 26, and emitted to the outside through a speaker 28.

さらに、LSIのデータインターナルバス70には、インターフェース72を介して、外部から例えばMIDIなどの演奏情報が取り込まれることになる。   Furthermore, performance information such as MIDI is taken into the LSI data internal bus 70 from the outside via the interface 72.

上述のように、ターゲットシステムである電子鍵盤楽器では、各種データ(計算結果を含む)を記憶する記憶手段たるROM/RAM50及び波形データメモリ52と、該波形データメモリ52に記憶された波形データをアクセスする音源20と、該ROM/RAM50に記憶されたデータをアクセスするCPU10と、上記記憶手段が繋げられた共有バスたるエクスターナルバス40と、該エクスターナルバス40に対し上記音源20とCPU10が時分割交互にアクセスさせる制御を行うバスコントローラ30とが備えられている。   As described above, in the electronic keyboard instrument as the target system, the ROM / RAM 50 and the waveform data memory 52 as storage means for storing various data (including calculation results), and the waveform data stored in the waveform data memory 52 are stored. The sound source 20 to be accessed, the CPU 10 that accesses data stored in the ROM / RAM 50, the external bus 40 that is a shared bus to which the storage means is connected, and the sound source 20 and the CPU 10 are time-shared with respect to the external bus 40. And a bus controller 30 that performs control to alternately access.

図5は、上記フラッシュメモリ64から読み出されたターゲットプログラムがCPU10によって実行された際に、該CPU10上に形成されることになる構成の機能ブロック図である。   FIG. 5 is a functional block diagram of a configuration that is formed on the CPU 10 when the target program read from the flash memory 64 is executed by the CPU 10.

該図面に示すように、ターゲットシステム環境である電子鍵盤楽器で動作することを目的として、上記ワークステーションにおいて、そこで使用されるクロスコンパイラによって、ソースプログラムが変換されて生成されるオブジェクトプログラムが、CPU10に読み出されて実行されることで、該CPU10が、全ての命令を入力してそのうちエクスターナルバス40を使用する命令を検出する第1検出部1(命令コードで検出が可能)と、該第1検出部1が検出した命令が実行されるタイミングが、該エクスターナルバス40をCPU10が使用するべきタイミングである(CPU10のバスアクセスタイミングが上述のステップS112のように奇数クロック)かどうかを検出する第2検出部2と、第1検出部1の検出した、CPU10がエクスターナルバス40を使用する命令が、前記音源20がエクスターナルバス40を使用するべきタイミング(音源20は奇数クロックの際にエクスターナルバス40をアクセスする)に実行されることを、第2検出部2により検出した場合に、該命令の前にCPU10に対して、CPU10がエクスターナルバス40を使用して実行する命令の次の命令に交換可能か否かを判定する判定部3と、その判定結果に基づき、次の命令に交換可能であれば、その命令に交換し、逆に次の命令に交換可能でなければ、エクスターナルバス40を該CPU10が次に使用するタイミングまで休止する命令を挿入するオペレーション部4とを上記電子鍵盤楽器のCPU10上に構築することになる。   As shown in the drawing, an object program generated by converting a source program by a cross compiler used in the workstation for the purpose of operating with an electronic keyboard instrument as a target system environment is a CPU 10. The first detection unit 1 (which can be detected by the instruction code) that detects all the instructions and uses the external bus 40 among them is input to the CPU 10. The timing at which the instruction detected by the 1 detector 1 is executed is the timing at which the CPU 10 should use the external bus 40 (the bus access timing of the CPU 10 is an odd clock as in step S112 described above). CPU detected by the second detector 2 and the first detector 1 The second detection unit is configured such that an instruction for 0 to use the external bus 40 is executed at a timing at which the sound source 20 should use the external bus 40 (the sound source 20 accesses the external bus 40 when the clock is an odd number). 2, a determination unit 3 that determines whether or not the CPU 10 can be replaced with an instruction next to an instruction executed by the CPU 10 using the external bus 40 before the instruction, and a result of the determination. If the instruction can be exchanged for the next instruction, the instruction is exchanged for the next instruction. On the other hand, if the instruction cannot be exchanged for the next instruction, the instruction to pause the external bus 40 until the next use of the CPU 10 is inserted. The operation unit 4 is constructed on the CPU 10 of the electronic keyboard instrument.

上述のように、CPU10と音源20とは、バスコントローラ30を介して、上記LSIの外部にあるエクスターナルバス40につながっており、そのバスに繋げられている、データを記憶しているROM及びRAM50と、波形データを記憶しているメモリ52との間で、CPU10は上記データなどを、また音源20は、波形データを、時分割交互にアクセスする(上述のように、CPU10は本来奇数アドレスタイミングの際にエクスターナルバス40をアクセスし、音源20は偶数アドレスタイミングの際にエクスターナルバス40をアクセスする)構成となっており、そのためこのエクスターナルバス40は、上記CPU10と音源20との共有バスとなっている。   As described above, the CPU 10 and the sound source 20 are connected to the external bus 40 outside the LSI via the bus controller 30, and the ROM and RAM 50 that are connected to the bus and store data. And the memory 52 storing the waveform data, the CPU 10 accesses the data and the like, and the sound source 20 alternately accesses the waveform data in a time division manner (as described above, the CPU 10 originally has an odd address timing). In this case, the external bus 40 is accessed and the sound source 20 accesses the external bus 40 at even address timing). Therefore, the external bus 40 is a shared bus between the CPU 10 and the sound source 20. ing.

音源20がエクスターナルバス40を使用するべきタイミングは、上述のように、奇数クロックの時であり、図2のフローチャートのステップS110〜ステップS118に示すと同様に、もしその際に、第1検出部1によって、CPU10がエクスターナルバス40を使用する命令が検出された場合、第2検出部2により、そのバスアクセスタイミングが奇数クロックか否か、即ち命令アドレスが8の倍数か否かが検出される。バスアクセスタイミングが奇数クロックの場合は、判定部3により、CPU10がエクスターナルバス40を使用しないで実行する命令の次の命令に交換可能か否かが判定される。そして、次の命令がエクスターナルバス40を使用せず、交換可能であれば、オペレーション部4により、次の命令に交換されてCPU10上でその命令の実行が行われる。反対に次の命令に交換可能でなければ、同じくオペレーション部4により、エクスターナルバス40を該CPU10が次に使用するタイミングまで休止するNOP命令が挿入される。   As described above, the timing at which the sound source 20 should use the external bus 40 is an odd-numbered clock. As shown in steps S110 to S118 of the flowchart of FIG. 1, when the CPU 10 detects an instruction using the external bus 40, the second detection unit 2 detects whether the bus access timing is an odd clock, that is, whether the instruction address is a multiple of 8. . When the bus access timing is an odd clock, the determination unit 3 determines whether or not the CPU 10 can be replaced with an instruction next to an instruction executed without using the external bus 40. If the next instruction can be exchanged without using the external bus 40, the operation unit 4 exchanges the next instruction with the next instruction, and the CPU 10 executes the instruction. On the other hand, if it is not possible to exchange the next instruction, the operation unit 4 inserts a NOP instruction that pauses until the CPU 10 uses the external bus 40 next time.

図6は、上記電子鍵盤楽器のCPU10の内部構成を示す機能ブロック図である。該CPU10は、上述のように、パイプライン処理が行われるRISC型のCPUであり、図5に示すような内部構成となっている。すなわち、本CPU10には、まずクロック生成部190があって、LSI上で用いられた動作クロック(MCK)を入力し、反転動作クロック(XMCK)を生成して、該反転動作クロック(XMCK)と上記動作クロック(MCK)をCPU10内部で用いる。   FIG. 6 is a functional block diagram showing an internal configuration of the CPU 10 of the electronic keyboard instrument. The CPU 10 is a RISC type CPU that performs pipeline processing as described above, and has an internal configuration as shown in FIG. That is, the CPU 10 has a clock generation unit 190, which receives an operation clock (MCK) used on the LSI, generates an inversion operation clock (XMCK), and outputs the inversion operation clock (XMCK). The operation clock (MCK) is used inside the CPU 10.

また図中PRはパイプラインレジスタ、p1〜p4は対応するパイプラインの段数であり、各段の処理結果を格納する。パイプラインの最終段(5段目)は処理が終了していて処理結果を格納する必要がないため、パイプラインレジスタを備えない。内部各部はパイプラインの各段を形成している。夫々は前段のパイプラインレジスタからデータを読み取り、動作クロック(MCK)の1サイクルの間に後述するような各部の動作を行って、対応するパイプラインレジスタPRにデータを記憶する。   In the figure, PR is a pipeline register, p1 to p4 are the number of corresponding pipeline stages, and the processing result of each stage is stored. The final stage (fifth stage) of the pipeline does not have a pipeline register because the processing is completed and it is not necessary to store the processing result. Each internal part forms each stage of the pipeline. Each reads data from the preceding pipeline register, performs the operation of each unit as will be described later during one cycle of the operation clock (MCK), and stores the data in the corresponding pipeline register PR.

詳述すると、該CPU10内には、ターゲットプログラムを入力する命令インターナルバス60につながる命令フェッチ部100があり、プログラムの命令フェッチ(InstructionFetch)が行われる。そして、パイプライン1のパイプラインレジスタ(PRp1)110にフェッチされた命令(Instruction)が一時的に記憶される。次のステージでその命令(Instruction)は、命令デコード部120に移行し、該命令デコード部120により、レジスタファイル192(後述する図7参照)が参照されて、該命令(Instruction)のデコードがなされる。そのデコード結果は、パイプライン2のパイプラインレジスタ(PRp2)130に一時的に記憶される。さらに次のステージでそのデコード結果は、演算部140に移行して、そこで演算がなされ、その演算結果は、パイプライン3のパイプラインレジスタ(PRp3)150に一時的に記憶される。   More specifically, in the CPU 10, there is an instruction fetch unit 100 connected to an instruction internal bus 60 for inputting a target program, and instruction fetch (InstructionFetch) of the program is performed. Then, the fetched instruction (Instruction) is temporarily stored in the pipeline register (PRp1) 110 of the pipeline 1. At the next stage, the instruction (Instruction) is transferred to the instruction decoding unit 120, and the instruction decoding unit 120 refers to a register file 192 (see FIG. 7 described later) to decode the instruction (Instruction). The The decoding result is temporarily stored in the pipeline register (PRp2) 130 of the pipeline 2. Further, in the next stage, the decoding result is transferred to the operation unit 140 where the operation is performed, and the operation result is temporarily stored in the pipeline register (PRp3) 150 of the pipeline 3.

そして、バスコントローラ30につながっているデータインターナルバス70に接続されたメモリアクセス部160に、次のステージで、バスコントローラ30を介し、エクスターナルバス40につながっているデータROM/RAM50にアクセスして、必要なデータをそこからロードしたり、或いは上記演算結果が出力(ライト)される。またその演算結果は、パイプライン3のパイプラインレジスタ(PRp3)170に一時的に記憶される。   Then, the memory access unit 160 connected to the data internal bus 70 connected to the bus controller 30 is accessed to the data ROM / RAM 50 connected to the external bus 40 via the bus controller 30 in the next stage. The necessary data is loaded from there, or the calculation result is output (written). The calculation result is temporarily stored in the pipeline register (PRp3) 170 of the pipeline 3.

さらに次のステージで、ライトバック部180により、レジスタファイル192(後述する図7のr0〜rfのレジスタ群を参照)に必要な参照データが書き込まれる。   Further, in the next stage, the write-back unit 180 writes reference data necessary for a register file 192 (refer to register groups r0 to rf in FIG. 7 described later).

以上の命令フェッチ、命令デコード、演算、メモリアクセス、ライトバックの各部は、並列的に動作することになる。   The above instruction fetch, instruction decode, operation, memory access, and write back units operate in parallel.

図7は、上記CPU10のレジスタファイル192のレジスタ構成を示している。r0〜reまで32ビット長構成の汎用レジスタであり、レジスタrfのみ、8ビットがステータスレジスタ、24ビットがデータを記憶するROM/RAM50中のデータRAMのスタックポインタである。   FIG. 7 shows a register configuration of the register file 192 of the CPU 10. This is a general-purpose register having a 32-bit length from r0 to re. Only the register rf is a status register, 8 bits is a stack pointer of the data RAM in the ROM / RAM 50 for storing data.

図8は、上記CPU10内部構成の命令フェッチ部100(と1段目のパイプラインのパイプラインレジスタPR110)の構成の概要図である。同図において、命令フェッチ部100は、命令ポインタIPと加算器104を有している。   FIG. 8 is a schematic diagram of the configuration of the instruction fetch unit 100 (and the pipeline register PR110 of the first stage pipeline) of the CPU 10 internal configuration. In the figure, an instruction fetch unit 100 has an instruction pointer IP and an adder 104.

24ビット幅のレジスタである命令ポインタIP102の値が、アドレスとして、命令インターナルバス60へ出力される。   The value of the instruction pointer IP102, which is a 24-bit wide register, is output to the instruction internal bus 60 as an address.

同時に命令ポインタIP102の値は、加算器104によって固定値4と加算され、1段目のパイプラインレジスタPR110のエリアNAに次期命令アドレス予測値NIEXとして格納される。命令アドレスは必ず4の倍数になるので、命令ポインタIP102は最下位2ビットを省略して22ビット幅としても良い。   At the same time, the value of the instruction pointer IP102 is added to the fixed value 4 by the adder 104, and stored as the next instruction address predicted value NIEX in the area NA of the first-stage pipeline register PR110. Since the instruction address is always a multiple of 4, the instruction pointer IP102 may be 22 bits wide by omitting the least significant 2 bits.

命令インターナルバス60のデータバスから現在の命令コードRICDを読み込み、1段目のパイプラインレジスタPR110のエリアICに格納する。   The current instruction code RICD is read from the data bus of the instruction internal bus 60 and stored in the area IC of the first-stage pipeline register PR110.

後述する図11のメモリアクセス部160から与えられる次期命令アドレスNIADを動作クロックMCKの1サイクルの最後に、上記命令ポインタIP102に上書きする。   The next instruction address NIAD given from the memory access unit 160 of FIG. 11 described later is overwritten on the instruction pointer IP102 at the end of one cycle of the operation clock MCK.

命令フェッチ部100は、以上の処理を動作クロックMCK毎に繰り返す。   The instruction fetch unit 100 repeats the above processing for each operation clock MCK.

図9は、命令デコード部120(と前後の1及び2段目のパイプラインのパイプラインレジスタPR110及び130)の構成の概要図である。同図において、命令デコード部120は、命令分離器ID121と、オペランド分離器OD122と、一時記憶レジスタX1(123)と、同じく一時記憶レジスタX2(124)と、セレクタS1(125)とを有している。   FIG. 9 is a schematic diagram of the configuration of the instruction decode unit 120 (and the pipeline registers PR110 and 130 of the first and second pipelines before and after). In the figure, the instruction decode unit 120 has an instruction separator ID 121, an operand separator OD122, a temporary storage register X1 (123), a temporary storage register X2 (124), and a selector S1 (125). ing.

1段目のパイプラインレジスタPR110のエリアNAにある次期命令アドレス予測値NIEXを、そのまま2段目のパイプラインレジスタPR130のエリアNAに、次期命令アドレス予測値NIEXとして格納する。   The next instruction address predicted value NIEX in the area NA of the first-stage pipeline register PR110 is stored as it is in the area NA of the second-stage pipeline register PR130 as the next instruction address predicted value NIEX.

1段目のパイプラインレジスタPR110のエリアICから、現在の命令コードRICDを読み出し、上記命令デコード部120の命令分離器ID121によって、命令種類ITYPとオペランドデータOPに分離すると共に、命令種類ITYPを2段目のパイプラインレジスタ130のエリアITに格納する。以下、分岐命令の場合、転送命令の場合、演算命令及びNOP命令の場合に分けて動作説明をする。   The current instruction code RICD is read from the area IC of the pipeline register PR110 at the first stage and separated into the instruction type ITYP and the operand data OP by the instruction separator ID 121 of the instruction decoding unit 120, and the instruction type ITYP is set to 2 It is stored in the area IT of the pipeline register 130 at the stage. Hereinafter, the operation will be described separately for a branch instruction, a transfer instruction, an arithmetic instruction, and a NOP instruction.

(分岐命令の場合)
オペランドデータOPをオペランド分離器OD122に入力し、命令種類ITYPを参照して第1オペランドポインタまたは即値O1を取り出して、2段目のパイプラインレジスタPR130のエリアO1に格納すると共に、第2オペランドポインタOPT2として固定値15を設定し、2段目のパイプラインレジスタPR130のエリアO2に格納する。
(For branch instructions)
Operand data OP is input to the operand separator OD122, the first operand pointer or immediate value O1 is retrieved by referring to the instruction type ITYP, stored in the area O1 of the second-stage pipeline register PR130, and the second operand pointer A fixed value 15 is set as OPT2 and stored in the area O2 of the second-stage pipeline register PR130.

第1オペランドポインタまたは即値O1は下位4ビットをレジスタファイル192に送出し、これに応じたレジスタの値V1を得て、動作クロックMCKの前半のサイクルの最後(動作クロックMCKのアップエッジ)のタイミングで、一時記憶レジスタX1(123)に格納する。   The first operand pointer or immediate value O1 sends the lower 4 bits to the register file 192, obtains the register value V1 corresponding thereto, and the timing of the end of the first half cycle of the operation clock MCK (up edge of the operation clock MCK). Then, it is stored in the temporary storage register X1 (123).

同時に第2オペランドポインタOPT2をレジスタファイル192に送出し、これに応じたレジスタの値V2を得て、動作クロックMCKの前半のサイクルの最後(動作クロックMCKのアップエッジ)のタイミングで、一時記憶レジスタX2(124)に格納する。   At the same time, the second operand pointer OPT2 is sent to the register file 192, the register value V2 corresponding to this is obtained, and the temporary storage register is obtained at the end of the first half of the operation clock MCK (up edge of the operation clock MCK). Store in X2 (124).

セレクタS1(125)は命令種類ITYPのIMビット(分岐命令ではビット30)を参照し、これが1の場合、第1オペランド値または即値(この場合は即値)24ビットを、そうでない場合は、V1を2段目のパイプラインレジスタPR130のエリアV1に、第1オペランド値OPV1として格納する。   The selector S1 (125) refers to the IM bit (bit 30 in the branch instruction) of the instruction type ITYP. If this is 1, the first operand value or immediate value (immediate value in this case) 24 bits, otherwise V1 Is stored as the first operand value OPV1 in the area V1 of the second-stage pipeline register PR130.

同時にV2を2段目のパイプラインレジスタPR130のエリアV2に、第2オペランド値OPV2として格納する。   At the same time, V2 is stored in the area V2 of the second-stage pipeline register PR130 as the second operand value OPV2.

(転送命令の場合)
オペランドデータOPをオペランド分離器OD122に入力し、命令種類ITYPを参照して、第1オペランドポインタまたは即値O1を取り出し、2段目のパイプラインレジスタPR130のエリアO1に格納すると共に、第2オペランドポインタOPT2を取り出し、2段目のパイプラインレジスタPR130のエリアO2に格納する。
(For transfer instructions)
The operand data OP is input to the operand separator OD122, the instruction type ITYP is referred to, the first operand pointer or immediate value O1 is taken out, stored in the area O1 of the second-stage pipeline register PR130, and the second operand pointer OPT2 is taken out and stored in the area O2 of the second-stage pipeline register PR130.

第1オペランドポインタまたは即値O1は下位4ビットをレジスタファイル192に送出し、これに応じたレジスタの値V1を得て、動作クロックMCKの前半のサイクルの最後(動作クロックMCKのアップエッジ)のタイミングで、一時記憶レジスタX1(123)に格納する。   The first operand pointer or immediate value O1 sends the lower 4 bits to the register file 192, obtains the register value V1 corresponding thereto, and the timing of the end of the first half cycle of the operation clock MCK (up edge of the operation clock MCK). Then, it is stored in the temporary storage register X1 (123).

同時に第2オペランドポインタOPT2をレジスタファイル192に送出し、これに応じたレジスタの値V2を得て、動作クロックMCKの前半のサイクルの最後(動作クロックMCKのアップエッジ)のタイミングで、一時記憶レジスタX2(124)に格納する。   At the same time, the second operand pointer OPT2 is sent to the register file 192, the register value V2 corresponding to this is obtained, and the temporary storage register is obtained at the end of the first half of the operation clock MCK (up edge of the operation clock MCK). Store in X2 (124).

セレクタS1(125)は命令種類ITYPのTRMD信号(ビット28−29)を参照し、これが0でない場合、第1オペランド値または即値(この場合は即値)24ビットを、0の場合は、V1を、2段目のパイプラインレジスタPR130のエリアV1に第1オペランド値OPV1として格納する。   The selector S1 (125) refers to the TRMD signal (bits 28 to 29) of the instruction type ITYP. If this is not 0, the first operand value or immediate value (immediate value in this case) 24 bits, and if 0, V1 is set. The first operand value OPV1 is stored in the area V1 of the second-stage pipeline register PR130.

同時にV2を2段目のパイプラインレジスタPR130のエリアV2に第2オペランド値OPV2として格納する。   At the same time, V2 is stored in the area V2 of the second-stage pipeline register PR130 as the second operand value OPV2.

(演算命令の場合)
オペランドデータOPをオペランド分離器OD122に入力し、命令種類ITYPを参照して、第1オペランドポインタO1を取り出し、2段目のパイプラインレジスタPR130のエリアO1に格納すると共に、第2オペランドポインタOPT2を取り出し、2段目のパイプラインレジスタPR130のエリアO2に格納する。
(In the case of operation instructions)
The operand data OP is input to the operand separator OD122, the instruction type ITYP is referred to, the first operand pointer O1 is fetched, stored in the area O1 of the second-stage pipeline register PR130, and the second operand pointer OPT2 is stored. The data is taken out and stored in the area O2 of the second-stage pipeline register PR130.

第1オペランドポインタO1を、レジスタファイル192に送出し、これに応じたレジスタの値V1を得て、動作クロックMCKの前半のサイクルの最後(動作クロックMCKのアップエッジ)のタイミングで、一時記憶レジスタX1(123)に格納する。   The first operand pointer O1 is sent to the register file 192, the register value V1 corresponding to this is obtained, and the temporary storage register is obtained at the end of the first half of the operation clock MCK (up edge of the operation clock MCK). Store in X1 (123).

同時に第2オペランドポインタOPT2を、レジスタファイル192に送出し、これに応じたレジスタの値V2を得て、動作クロックMCKの前半のサイクルの最後(動作クロックMCKのアップエッジ)のタイミングで、一時記憶レジスタX2(124)に格納する。   At the same time, the second operand pointer OPT2 is sent to the register file 192, the register value V2 corresponding to this is obtained, and temporarily stored at the end of the first half cycle of the operation clock MCK (up edge of the operation clock MCK). Store in the register X2 (124).

セレクタS1(125)は、常時V1を2段目のパイプラインレジスタPR130のエリアV1に、第1オペランド値OPV1として格納する。   The selector S1 (125) always stores V1 as the first operand value OPV1 in the area V1 of the second-stage pipeline register PR130.

同時にV2を2段目のパイプラインレジスタPR130のエリアV2に、第2オペランド値OPV2として格納する。   At the same time, V2 is stored in the area V2 of the second-stage pipeline register PR130 as the second operand value OPV2.

(NOP命令の場合)
転送命令と同様に動作するが、いずれの値も使用されない。
(NOP instruction)
Works like a transfer instruction, but no value is used.

命令デコード部120では、以上詳述した動作を、動作クロックMCKのサイクル毎に繰り返す。   The instruction decode unit 120 repeats the operation described above in detail for each cycle of the operation clock MCK.

図10は、演算部140(と前後の2及び3段目のパイプラインのパイプラインレジスタPR130及び150)の構成の概要図である。同図において、演算部140は、演算ユニットCU141を有している。   FIG. 10 is a schematic diagram of the configuration of the arithmetic unit 140 (and pipeline registers PR 130 and 150 in the second and third pipelines before and after). In the figure, the calculation unit 140 has a calculation unit CU141.

2段目のパイプラインレジスタPR130のエリアNAにある次期命令アドレス予測値NIEXを、そのまま3段目のパイプラインレジスタPR150のエリアNAに、次期命令アドレス予測値NIEXとして格納する。   The next instruction address predicted value NIEX in the area NA of the second-stage pipeline register PR130 is stored as it is in the area NA of the third-stage pipeline register PR150 as the next instruction address predicted value NIEX.

2段目のパイプラインレジスタPR130のエリアITにある命令種類ITYPを、そのまま3段目のパイプラインレジスタPR150のエリアITに、命令種類ITYPとして格納する。   The instruction type ITYP in the area IT of the second-stage pipeline register PR130 is stored as it is as the instruction type ITYP in the area IT of the third-stage pipeline register PR150.

2段目のパイプラインレジスタPR130のエリアO1にある第1オペランドポインタOPT1を、そのまま3段目のパイプラインレジスタPR150のエリアO1に、第1オペランドポインタOPT1として格納する。   The first operand pointer OPT1 in the area O1 of the second-stage pipeline register PR130 is stored as it is in the area O1 of the third-stage pipeline register PR150 as the first operand pointer OPT1.

2段目のパイプラインレジスタPR130のエリアO2にある第2オペランドポインタOPT2を、そのまま3段目のパイプラインレジスタPR150のエリアO2に、第2オペランドポインタOPT2として格納する。   The second operand pointer OPT2 in the area O2 of the second-stage pipeline register PR130 is stored as it is as the second operand pointer OPT2 in the area O2 of the third-stage pipeline register PR150.

2段目のパイプラインレジスタPR130のエリアV2にある第2オペランド値OPV2を、そのまま3段目のパイプラインレジスタPR150のエリアV2に、第2オペランド値OPV2として格納する。   The second operand value OPV2 in the area V2 of the second-stage pipeline register PR130 is stored as it is in the area V2 of the third-stage pipeline register PR150 as the second operand value OPV2.

2段目のパイプラインレジスタPR130のエリアV1及びエリアV2にある第1オペランド値OPV1及び第2オペランド値OPV2を、演算ユニットCU141に入力する。   The first operand value OPV1 and the second operand value OPV2 in the areas V1 and V2 of the second-stage pipeline register PR130 are input to the arithmetic unit CU141.

以下、分岐命令の場合(ジャンプ命令の場合とコール/リターン命令の場合)、転送命令の場合、演算命令及びNOP命令の場合に分けて動作説明をする。   Hereinafter, the operation will be described separately for a branch instruction (a jump instruction and a call / return instruction), a transfer instruction, and an arithmetic instruction and a NOP instruction.

(分岐命令:ジャンプ命令の場合)
第1オペランド値OPV1を、そのまま演算結果CRとして出力する。
(Branch instruction: Jump instruction)
The first operand value OPV1 is output as it is as the operation result CR.

第2オペランド値OPV2の上位4ビットを、そのまま演算ステータスSTとして出力する。   The upper 4 bits of the second operand value OPV2 are output as they are as the operation status ST.

演算結果CRを、3段目のパイプラインレジスタPR150のエリアCRに演算結果CRSLとして格納すると共に、演算ステータスSTを、3段目のパイプラインレジスタPR150のエリアSTに、演算ステータスCRSTとして格納する。   The calculation result CR is stored as the calculation result CRSL in the area CR of the third-stage pipeline register PR150, and the calculation status ST is stored as the calculation status CRST in the area ST of the third-stage pipeline register PR150.

(分岐命令:コール/リターン命令の場合)
第2オペランド値OPV2の下位24ビットに、−4(コール)又は+4(リターン)を演算し、演算結果の下位24ビットを、演算結果CRとして出力する。
(For branch instructions: call / return instructions)
-4 (call) or +4 (return) is calculated on the lower 24 bits of the second operand value OPV2, and the lower 24 bits of the operation result are output as the operation result CR.

第2オペランド値OPV2の上位4ビットを、そのまま演算ステータスSTとして出力する。   The upper 4 bits of the second operand value OPV2 are output as they are as the operation status ST.

演算結果CRを、3段目のパイプラインレジスタPR150のエリアCRに演算結果CRSLとして格納すると共に、演算ステータスSTを、3段目のパイプラインレジスタPR150のエリアSTに、演算ステータスCRSTとして格納する。   The calculation result CR is stored as the calculation result CRSL in the area CR of the third-stage pipeline register PR150, and the calculation status ST is stored as the calculation status CRST in the area ST of the third-stage pipeline register PR150.

(転送命令の場合)
第1オペランド値OPV1を、そのまま演算結果CRとして出力する。
(For transfer instructions)
The first operand value OPV1 is output as it is as the operation result CR.

演算ステータスST出力は、不定で構わない。   The calculation status ST output may be indefinite.

演算結果CRを、3段目のパイプラインレジスタPR150のエリアCRに演算結果CRSLとして格納すると共に、演算ステータスSTを、3段目のパイプラインレジスタPR150のエリアSTに、演算ステータスCRSTとして格納する。   The calculation result CR is stored as the calculation result CRSL in the area CR of the third-stage pipeline register PR150, and the calculation status ST is stored as the calculation status CRST in the area ST of the third-stage pipeline register PR150.

(演算命令の場合)
第1オペランド値OPV1と第2オペランド値OPV2を、命令種類ITYPに従って演算し、その演算結果をCRとして出力する。
(In the case of operation instructions)
The first operand value OPV1 and the second operand value OPV2 are calculated according to the instruction type ITYP, and the calculation result is output as CR.

演算に応じて変化した演算ステータスSTを、出力する。   The calculation status ST changed according to the calculation is output.

演算結果CRを、3段目のパイプラインレジスタPR150のエリアCRに演算結果CRSLとして格納すると共に、演算ステータスSTを、3段目のパイプラインレジスタPR150のエリアSTに、演算ステータスCRSTとして格納する。   The calculation result CR is stored as the calculation result CRSL in the area CR of the third-stage pipeline register PR150, and the calculation status ST is stored as the calculation status CRST in the area ST of the third-stage pipeline register PR150.

(NOP命令の場合)
上記転送命令と同様に動作するが、値は結局使用されない。
(NOP instruction)
Works like the transfer instruction above, but the value is not used after all.

演算結果CRを、3段目のパイプラインレジスタPR150のエリアCRに演算結果CRSLとして格納すると共に、演算ステータスSTを、3段目のパイプラインレジスタPR150のエリアSTに、演算ステータスCRSTとして格納する。   The calculation result CR is stored as the calculation result CRSL in the area CR of the third-stage pipeline register PR150, and the calculation status ST is stored as the calculation status CRST in the area ST of the third-stage pipeline register PR150.

上記演算部140では、以上詳述した動作を、動作クロックMCKのサイクル毎に繰り返す。   The arithmetic unit 140 repeats the operation described above in detail for each cycle of the operation clock MCK.

図11は、メモリアクセス部160(と前後の3及び4段目のパイプラインのパイプラインレジスタPR150及び170)の構成の概要図である。同図において、メモリアクセス部160は、アドレスゲートAG161と、条件識別器DM162と、セレクタS2(163)と、セレクタS3(164)と、バストランシーバTR165とを有している。   FIG. 11 is a schematic diagram of a configuration of the memory access unit 160 (and pipeline registers PR150 and 170 of the third and fourth pipelines before and after). In the figure, the memory access unit 160 includes an address gate AG161, a condition discriminator DM162, a selector S2 (163), a selector S3 (164), and a bus transceiver TR165.

3段目のパイプラインレジスタPR150のエリアITにある命令種類ITYPを、そのまま4段目のパイプラインレジスタPR170のエリアITに、命令種類ITYPとして格納する。   The instruction type ITYP in the area IT of the third-stage pipeline register PR150 is stored as it is in the area IT of the fourth-stage pipeline register PR170 as the instruction type ITYP.

3段目のパイプラインレジスタPR150のエリアO1にある第1オペランドポインタOPT1を、そのまま4段目のパイプラインレジスタPR170のエリアO1に、第1オペランドポインタOPT1として格納する。   The first operand pointer OPT1 in the area O1 of the third-stage pipeline register PR150 is stored as it is in the area O1 of the fourth-stage pipeline register PR170 as the first operand pointer OPT1.

3段目のパイプラインレジスタPR150のエリアO2にある第2オペランドポインタOPT2を、そのまま4段目のパイプラインレジスタPR170のエリアO2に、第2オペランドポインタOPT2として格納する。   The second operand pointer OPT2 in the area O2 of the third-stage pipeline register PR150 is stored as it is as the second operand pointer OPT2 in the area O2 of the fourth-stage pipeline register PR170.

以下、分岐命令の場合(ジャンプ命令の場合とコール/リターン命令の場合)、転送命令の場合(レジスタ間転送以外の場合とレジスタ間転送の場合)、演算命令及びNOP命令の場合に分けて動作説明をする。   The following operations are divided into branch instructions (jump instructions and call / return instructions), transfer instructions (other than register-to-register transfers and register-to-register transfers), arithmetic instructions and NOP instructions. Explain.

(分岐命令:ジャンプ命令の場合)
命令種類ITYPにより、アドレスゲートAG161を閉鎖して、データインターナルバス70に接続しない。
(Branch instruction: Jump instruction)
The address gate AG161 is closed by the instruction type ITYP and is not connected to the data internal bus 70.

条件識別器DM162は命令種類ITYPと演算ステータスCRSTを参照し、分岐する場合(無条件ジャンプの場合、又は条件付ジャンプで条件が成立している場合)に1を、分岐しない場合に0を、セレクタS2(163)に出力し、該セレクタS2(163)は条件識別器DM162が1の出力時に演算結果CRSLを、1の出力時に次期命令アドレス予測値NIEXを、セレクタS3(164)に出力するが、ジャンプ命令なので、セレクタS2(163)出力が選択されて、次期命令アドレスNIADとして、図8の命令フェッチ部100に出力する。   The condition identifier DM162 refers to the instruction type ITYP and the operation status CRST, and when branching (when unconditional jump or when a condition is satisfied by conditional jump), 1 is set, and when not branching, 0 is set. The selector S2 (163) outputs the calculation result CRSL to the selector S3 (164) when the condition discriminator DM162 outputs 1, and the next instruction address predicted value NIEX to the selector S3 (164). Is a jump instruction, the selector S2 (163) output is selected and output to the instruction fetch unit 100 of FIG. 8 as the next instruction address NIAD.

3段目のパイプラインレジスタPR150のエリアCRにある演算結果CRSLを、そのまま4段目のパイプラインレジスタPR170のエリアCRに、演算結果CRSLとして格納する。   The calculation result CRSL in the area CR of the third-stage pipeline register PR150 is stored as the calculation result CRSL in the area CR of the fourth-stage pipeline register PR170.

3段目のパイプラインレジスタPR150のエリアSTにある演算ステータスCRSTを、そのまま4段目のパイプラインレジスタPR170のエリアSTに、演算ステータスCRSTとして格納する。   The operation status CRST in the area ST of the third-stage pipeline register PR150 is stored as it is in the area ST of the fourth-stage pipeline register PR170 as the operation status CRST.

命令種類ITYPにより、バストランシーバTR165を閉鎖して、データインターナルバス70に接続しない。   By the instruction type ITYP, the bus transceiver TR165 is closed and not connected to the data internal bus 70.

(分岐命令:コール/リターン命令の場合)
命令種類ITYPにより、アドレスゲートAG161を開いて、データインターナルバス70に、第2オペランド値OPV2を出力する。
(For branch instructions: call / return instructions)
The address gate AG161 is opened according to the instruction type ITYP, and the second operand value OPV2 is output to the data internal bus 70.

命令種類ITYPにより、セレクタS3(164)は、トランシーバTR165出力が選択されて、次期命令アドレスNIADとして図8の命令フェッチ部100に出力する。 3段目のパイプラインレジスタPR150のエリアCRにある演算結果CRSLを、そのまま4段目のパイプラインレジスタPR170のエリアCRに、演算結果CRSLとして格納する。   Depending on the instruction type ITYP, the selector S3 (164) selects the output of the transceiver TR165 and outputs it to the instruction fetch unit 100 of FIG. 8 as the next instruction address NIAD. The calculation result CRSL in the area CR of the third-stage pipeline register PR150 is stored as the calculation result CRSL in the area CR of the fourth-stage pipeline register PR170.

3段目のパイプラインレジスタPR150のエリアSTにある演算ステータスCRSTを、そのまま4段目のパイプラインレジスタPR170のエリアSTに、演算ステータスCRSTとして格納する。   The operation status CRST in the area ST of the third-stage pipeline register PR150 is stored as it is in the area ST of the fourth-stage pipeline register PR170 as the operation status CRST.

命令種類ITYPにより、バストランシーバTR165を読取で開き、セレクタS3(164)に出力すると共に、4段目のパイプラインレジスタPR170のエリアLDに、ロードデータLDATとして格納する。   In response to the instruction type ITYP, the bus transceiver TR165 is opened by reading and output to the selector S3 (164), and is stored as load data LDAT in the area LD of the pipeline register PR170 at the fourth stage.

(転送命令:レジスタ間転送以外の場合)
命令種類ITYPによりアドレスゲートAG161を開いて、データインターナルバス70に、演算結果CRSLを出力する。
(For transfer instructions other than register-to-register transfers)
The address gate AG161 is opened according to the instruction type ITYP, and the operation result CRSL is output to the data internal bus 70.

命令種類ITYPと条件識別器DM162によりセレクタS2(163)/S2(164)は、次期命令アドレス予測値NIEXが選択されて、次期命令アドレスNIADとして、図8の命令フェッチ部100に出力する。   The instruction type ITYP and the condition discriminator DM162 cause the selectors S2 (163) / S2 (164) to select the next instruction address predicted value NIEX and output it to the instruction fetch unit 100 in FIG. 8 as the next instruction address NIAD.

3段目のパイプラインレジスタPR150のエリアCRにある演算結果CRSLを、そのまま4段目のパイプラインレジスタPR170のエリアCRに、演算結果CRSLとして格納する。   The calculation result CRSL in the area CR of the third-stage pipeline register PR150 is stored as the calculation result CRSL in the area CR of the fourth-stage pipeline register PR170.

3段目のパイプラインレジスタPR150のエリアSTにある演算ステータスCRSTを、そのまま4段目のパイプラインレジスタPR170のエリアSTに、演算ステータスCRSTとして格納する。   The operation status CRST in the area ST of the third-stage pipeline register PR150 is stored as it is in the area ST of the fourth-stage pipeline register PR170 as the operation status CRST.

ロードデータ(ld)命令の場合、命令種類ITYPにより、バストランシーバTR165を読取で開き、4段目のパイプラインレジスタPR170のエリアLDにロードデータLDATとして格納する。ロードステータス(st)命令の場合、命令種類ITYPにより、バストランシーバTR165をを書込で開き、第2オペランド値OPV2を出力する。   In the case of a load data (ld) instruction, the bus transceiver TR165 is read by the instruction type ITYP, and stored as load data LDAT in the area LD of the pipeline register PR170 at the fourth stage. In the case of the load status (st) instruction, the bus transceiver TR165 is opened by writing according to the instruction type ITYP, and the second operand value OPV2 is output.

(転送命令:レジスタ間転送の場合)
命令種類ITYPにより、アドレスゲートAG161を閉鎖して、データインターナルバス70に接続しない。
(Transfer instruction: Transfer between registers)
The address gate AG161 is closed by the instruction type ITYP and is not connected to the data internal bus 70.

命令種類ITYPと条件識別器DM162によりセレクタS2(163)/S3(164)は、次期命令アドレス予測値NIEXが選択されて、次期命令アドレスNIADとして、図8の命令フェッチ部100に出力する。   The instruction type ITYP and the condition discriminator DM162 cause the selectors S2 (163) / S3 (164) to select the next instruction address predicted value NIEX and output it to the instruction fetch unit 100 in FIG. 8 as the next instruction address NIAD.

3段目のパイプラインレジスタPR150のエリアCRにある演算結果CRSLを、そのまま4段目のパイプラインレジスタPR170のエリアCRに、演算結果CRSLとして格納する。   The calculation result CRSL in the area CR of the third-stage pipeline register PR150 is stored as the calculation result CRSL in the area CR of the fourth-stage pipeline register PR170.

3段目のパイプラインレジスタPR150のエリアSTにある演算ステータスCRSTを、そのまま4段目のパイプラインレジスタPR170のエリアSTに、演算ステータスCRSTとして格納する。   The operation status CRST in the area ST of the third-stage pipeline register PR150 is stored as it is in the area ST of the fourth-stage pipeline register PR170 as the operation status CRST.

命令種類ITYPにより、バストランシーバTR165を閉鎖して、データインターナルバス70に接続しない。   By the instruction type ITYP, the bus transceiver TR165 is closed and not connected to the data internal bus 70.

(演算命令)
命令種類ITYPにより、アドレスゲートAG161を閉鎖して、データインターナルバス70に接続しない。
(Calculation instruction)
The address gate AG161 is closed by the instruction type ITYP and is not connected to the data internal bus 70.

命令種類ITYPにより、セレクタS3(164)は、トランシーバTR165出力が選択されて、次期命令アドレスNIADとして、図8の命令フェッチ部100に出力する。   Depending on the instruction type ITYP, the selector TR3 (164) selects the output of the transceiver TR165 and outputs it to the instruction fetch unit 100 in FIG. 8 as the next instruction address NIAD.

3段目のパイプラインレジスタPR150のエリアCRにある演算結果CRSLを、そのまま4段目のパイプラインレジスタPR170のエリアCRに、演算結果CRSLとして格納する。   The calculation result CRSL in the area CR of the third-stage pipeline register PR150 is stored as the calculation result CRSL in the area CR of the fourth-stage pipeline register PR170.

3段目のパイプラインレジスタPR150のエリアSTにある演算ステータスCRSTを、そのまま4段目のパイプラインレジスタPR170のエリアSTに、演算ステータスCRSTとして格納する。   The operation status CRST in the area ST of the third-stage pipeline register PR150 is stored as it is in the area ST of the fourth-stage pipeline register PR170 as the operation status CRST.

命令種類ITYPにより、バストランシーバTR165を閉鎖して、データインターナルバス70に接続しない。   By the instruction type ITYP, the bus transceiver TR165 is closed and not connected to the data internal bus 70.

(NOP命令)
上記演算命令と同様に動作するが、値は結局使用されない。
(NOP instruction)
Operates in the same way as the above arithmetic instruction, but the value is not used after all.

上記メモリアクセス部160では、以上詳述した動作を、動作クロックMCKのサイクル毎に繰り返す。   The memory access unit 160 repeats the operation described above in detail for each cycle of the operation clock MCK.

図12は、ライトバック部180(と前の4段目のパイプラインのパイプラインレジスタPR170)の構成の概要図である。同図において、ライトバック部180は、セレクタS4(181)及びセレクタS5(182)を有している。   FIG. 12 is a schematic diagram of the configuration of the write-back unit 180 (and the pipeline register PR170 of the previous fourth-stage pipeline). In the figure, the write back unit 180 has a selector S4 (181) and a selector S5 (182).

ここで、レジスタファイル192へのアクセスは、動作クロックMCKの後半サイクルに行うので、命令デコード部100のアクセスとはぶつからない。   Here, since the access to the register file 192 is performed in the second half cycle of the operation clock MCK, it does not collide with the access of the instruction decoding unit 100.

以下、分岐命令の場合(ジャンプ命令の場合とコール/リターン命令の場合)、転送命令の場合[ロードデータ(ld)命令でレジスタ間転送以外の場合とロードデータ(ld)命令でレジスタ間転送の場合、及びロードステータス(st)命令の転送命令の場合]、演算命令及びNOP命令の場合に分けて、ライトバック部180の動作説明をする。   Hereinafter, in the case of branch instructions (in the case of jump instructions and call / return instructions), in the case of transfer instructions [in cases other than register-to-register transfer with load data (ld) instruction and between registers with load data (ld) instruction And the case of a transfer instruction of a load status (st) instruction], the operation of the write back unit 180 will be described separately for an arithmetic instruction and a NOP instruction.

(分岐命令:ジャンプ命令の場合)
セレクタS4181は、レジスタファイル192に第1オペランドポインタOPT1/第2オペランドポインタOPT2のいずれの信号も送らず、レジスタファイル192のどのレジスタも選択しない。
(Branch instruction: Jump instruction)
The selector S4181 does not send any signal of the first operand pointer OPT1 / second operand pointer OPT2 to the register file 192, and does not select any register of the register file 192.

セレクタS5182は、レジストデータとして、演算結果CRSLとロードデータLDATのいずれを選択していても構わないが、ポインタ信号が送出されていないので、何も書き込まれない。   The selector S5182 may select either the operation result CRSL or the load data LDAT as the registration data, but nothing is written because no pointer signal is transmitted.

ステータス(図7のレジスタrfの上位4ビット)は書き換わらない。   The status (the upper 4 bits of the register rf in FIG. 7) is not rewritten.

分岐命令(コール/リターン命令)の場合
セレクタS4(181)は、レジスタファイル192にポインタ信号として、第1オペランドポインタOPT1(レジスタrf=スタックポインタをポイントしている)を送出する。
In the case of a branch instruction (call / return instruction) The selector S4 (181) sends a first operand pointer OPT1 (register rf = pointing to the stack pointer) as a pointer signal to the register file 192.

セレクタS5(182)は、レジストデータとして、演算結果CRSLを選択し、レジスタファイル192に書込データとして送出する。   The selector S5 (182) selects the calculation result CRSL as the registration data and sends it to the register file 192 as write data.

ステータス(図7のレジスタrfの上位4ビット)は書き換わらない。   The status (the upper 4 bits of the register rf in FIG. 7) is not rewritten.

転送命令[ロードデータ(ld)命令でレジスタ間転送以外]の場合
セレクタS4(181)は、レジスタファイル192にポインタ信号として、第2オペランドポインタOPT2を送出する。
In the case of a transfer instruction [other than register-to-register transfer by load data (ld) instruction] The selector S4 (181) sends the second operand pointer OPT2 as a pointer signal to the register file 192.

セレクタS5(182)は、レジストデータとして、ロードデータLDATを選択し、レジスタファイル192に書込データとして送出する。   The selector S5 (182) selects the load data LDAT as the registration data and sends it to the register file 192 as write data.

ステータス(図7のレジスタrfの上位4ビット)は書き換わらない。   The status (the upper 4 bits of the register rf in FIG. 7) is not rewritten.

転送命令[ロードデータ(ld)命令でレジスタ間転送]の場合
セレクタS4(181)は、レジスタファイル192にポインタ信号として、第2オペランドポインタOPT2を送出する。
In the case of a transfer instruction [transfer between registers by load data (ld) instruction] The selector S4 (181) sends the second operand pointer OPT2 to the register file 192 as a pointer signal.

セレクタS5(182)は、レジストデータとして、演算結果CRSLを選択し、レジスタファイル192に書込データとして送出する。   The selector S5 (182) selects the calculation result CRSL as the registration data and sends it to the register file 192 as write data.

ステータス(図7のレジスタrfの上位4ビット)は書き換わらない。   The status (the upper 4 bits of the register rf in FIG. 7) is not rewritten.

転送命令[ロードステータス(st)命令]の場合
セレクタS4(181)は、レジスタファイル192に第1オペランドポインタOPT1/第2オペランドポインタOPT2のいずれの信号も送らず、レジスタファイル192のどのレジスタも選択しない。
In the case of a transfer instruction [load status (st) instruction] The selector S4 (181) does not send any signal of the first operand pointer OPT1 / second operand pointer OPT2 to the register file 192, and selects any register of the register file 192. do not do.

セレクタS5(182)は、レジストデータとして、演算結果CRSLとロードデータLDATのいずれを選択していても構わないが、ポインタ信号が送出されていないので、何も書き込まれない。   The selector S5 (182) may select either the operation result CRSL or the load data LDAT as the registration data, but nothing is written because no pointer signal is transmitted.

ステータス(図7のレジスタrfの上位4ビット)は書き換わらない。   The status (the upper 4 bits of the register rf in FIG. 7) is not rewritten.

(演算命令の場合)
セレクタS4(181)は、レジスタファイル192にポインタ信号として、第2オペランドポインタOPT2を送出する。
(In the case of operation instructions)
The selector S4 (181) sends the second operand pointer OPT2 as a pointer signal to the register file 192.

セレクタS5(182)は、レジストデータとして演算結果CRSLを選択し、レジスタファイル192に書込データとして送出する。   The selector S5 (182) selects the calculation result CRSL as the registration data and sends it to the register file 192 as write data.

ステータス(図7のレジスタrfの上位4ビット)のうち、演算によって変化のあったビットを、演算ステータスCRSTに応じて書換える。   Of the statuses (the upper 4 bits of the register rf in FIG. 7), the bits that have been changed by the operation are rewritten according to the operation status CRST.

(NOP命令の場合)
セレクタS4(181)は、レジスタファイル192に第1オペランドポインタOPT1/第2オペランドポインタOPT2のいずれの信号も送らず、レジスタファイル192のどのレジスタも選択しない。
(NOP instruction)
The selector S4 (181) does not send any signal of the first operand pointer OPT1 / second operand pointer OPT2 to the register file 192, and does not select any register of the register file 192.

セレクタS5(182)は、レジストデータとして演算結果CRSLとロードデータLDATのいずれを選択していても構わないが、ポインタ信号が送出されていないので、何も書き込まれない。   The selector S5 (182) may select either the operation result CRSL or the load data LDAT as the registration data, but nothing is written because no pointer signal is transmitted.

ステータス(図7のレジスタrfの上位4ビット)は書き換わらない。   The status (the upper 4 bits of the register rf in FIG. 7) is not rewritten.

上記ライトバック部180では、以上詳述した動作を、動作クロックMCKのサイクル毎に繰り返す。   The write back unit 180 repeats the operation described above in detail for each cycle of the operation clock MCK.

図13は、ターゲットシステムたる電子鍵盤楽器におけるCPU10で、ターゲットプログラムが実行された場合の、該プログラムの処理フローが実行された際のメインフローを示すフローチャートである。   FIG. 13 is a flowchart showing a main flow when the processing flow of the target program is executed by the CPU 10 in the electronic keyboard instrument as the target system.

まず、電子鍵盤楽器全体の初期化が実行される(ステップS300)。そして電子鍵盤楽器としての何かイベントがあるか(例えば押鍵イベント、パネルイベント、MIDIイベントなど)否かがチェックされる(ステップS302)。   First, initialization of the entire electronic keyboard instrument is executed (step S300). Then, it is checked whether there is any event as an electronic keyboard instrument (for example, a key pressing event, a panel event, a MIDI event, etc.) (step S302).

そのようなイベントがなければ(ステップS302;N)、後述するステップS306に移行する。逆にイベントがあれば(ステップS302;Y)、図14に示すイベント処理が行われる(ステップS304)。   If there is no such event (step S302; N), the process proceeds to step S306 described later. Conversely, if there is an event (step S302; Y), the event processing shown in FIG. 14 is performed (step S304).

その後図15に示す非イベント処理がなされる(ステップS306)。   Thereafter, non-event processing shown in FIG. 15 is performed (step S306).

図14は、上記図13におけるステップS304のイベント処理の処理フローを示すフローチャートである。   FIG. 14 is a flowchart showing the process flow of the event process in step S304 in FIG.

まず、押鍵イベントがあるか否かがチェックされ(ステップS400)、押鍵イベントがあれば(ステップS400;Y)、押鍵処理が実行される(ステップS402)。   First, it is checked whether or not there is a key pressing event (step S400). If there is a key pressing event (step S400; Y), a key pressing process is executed (step S402).

押鍵イベントがなければ(ステップS400;N)、パネルイベントがあるか否かがチェックされ(ステップS404)、パネルイベントがあれば(ステップS404;Y)、パネル処理が実行される(ステップS406)。   If there is no key pressing event (step S400; N), it is checked whether there is a panel event (step S404). If there is a panel event (step S404; Y), panel processing is executed (step S406). .

パネルイベントがなければ(ステップS404;N)、MIDIイベントがあるか否かがチェックされ(ステップS408)、MIDIイベントがあれば(ステップS408;Y)、MIDIイベント処理が実行される(ステップS410)。   If there is no panel event (step S404; N), it is checked whether there is a MIDI event (step S408). If there is a MIDI event (step S408; Y), MIDI event processing is executed (step S410). .

MIDIイベントがなければ(ステップS410;N)、その他のイベント処理がなされる(ステップS412)。その後メインフローに復帰する。   If there is no MIDI event (step S410; N), other event processing is performed (step S412). Then return to the main flow.

図15は、上記図13におけるステップS306の非イベント処理の処理フローを示すフローチャートである。   FIG. 15 is a flowchart showing the process flow of the non-event process in step S306 in FIG.

まず経過時間の取得処理がなされる(ステップS500)。これは後述するインターバルタイマのTをリセットして、後述する発信器LFOのUpDateを歩進を進めるため経過時間が分かる必要があるからである。   First, an elapsed time acquisition process is performed (step S500). This is because it is necessary to know the elapsed time in order to reset the T of the interval timer described later and advance the UpDate of the transmitter LFO described later.

次にエンベロープEVフェーズ処理がなされる(ステップS502)。これはCPU10から音源20にエンベロープのフェーズが到達したことを知らせ、次のフェーズに進むために必要であるからである。   Next, envelope EV phase processing is performed (step S502). This is because it is necessary for the CPU 10 to notify the sound source 20 that the envelope phase has arrived and to proceed to the next phase.

さらに発信器LFOの歩進、すなわちLFOのUpDate処理が実行される(ステップS504)。すなわち、LFOモジュールの値を更新する処理がなされる。   Further, the step of the transmitter LFO, that is, the LFO UpDate process is executed (step S504). That is, processing for updating the value of the LFO module is performed.

そうして自動演奏処理がなされる(ステップS506)。この処理後再び図13のステップS302に復帰する。   Thus, automatic performance processing is performed (step S506). After this processing, the process returns to step S302 in FIG.

図16は、インターバルタイマ割り込み処理の処理フローを示すフローチャートである。これは、単に時間Tをインクリメントする(ステップS600)だけである。   FIG. 16 is a flowchart showing a processing flow of interval timer interrupt processing. This is simply an increment of time T (step S600).

図17は、MIDIやUSBなどのシリアルインターフェースからの受信割り込み処理の処理フローを示すフローチャートである。   FIG. 17 is a flowchart showing a processing flow of reception interrupt processing from a serial interface such as MIDI or USB.

これらのシリアルの受信RC割込は、先ずバッファへ格納される(ステップS700)。そして、コマンドが完成したか否かがチェックされる(ステップS702)。コマンドが完成していなければ(ステップS702;N)、この処理フローは終了する。   These serial reception RC interrupts are first stored in the buffer (step S700). Then, it is checked whether or not the command is completed (step S702). If the command is not completed (step S702; N), this processing flow ends.

反対にコマンドが完成していれば(ステップS702;Y)、イベントの発生処理がなされ(ステップS704)、その後上記バッファのクリア処理がなされる(ステップS706)。   On the contrary, if the command is completed (step S702; Y), an event generation process is performed (step S704), and then the buffer clear process is performed (step S706).

図18は、CPU10と音源20及びインターナルバス・エクスターナルバスの動作タイミングを示すタイミングチャートである。   FIG. 18 is a timing chart showing operation timings of the CPU 10, the sound source 20, and the internal bus / external bus.

動作クロックMCKを反転させて反転動作クロックXMCKを作り、また動作クロックMCKを2分周してCK1を作る。該CK1は、エクスターナルバスの使用状況を表すことになる。すなわちCK1が真の時音源20が、偽の時CPU10がエクスターナルバスへアクセスできる状態になることを示している。   The operation clock MCK is inverted to generate an inverted operation clock XMCK, and the operation clock MCK is divided by two to generate CK1. The CK1 represents the usage status of the external bus. That is, when the CK1 is true, the sound source 20 is in a state where the CPU 10 can access the external bus when the CK1 is false.

このCK1と動作クロックMCKにより、音源クロックCKTGが作成される。該音源クロックCKTGがダウンエッヂから音源20が作動する。   A sound source clock CKTG is generated from the CK1 and the operation clock MCK. The sound source 20 operates from the down edge of the sound source clock CKTG.

またCPU10のI/Eは、CPU10がインターナルバス或いはエクスターナルバスのいずれでもアクセスすることを示し、同INT.はインターナルバスへアクセスすることを示す。他方音源20の(NC)はNotConnectで接続されないことを示し、ACTVは音源20から楽音波形が出力されることを示す。   In addition, the I / E of the CPU 10 indicates that the CPU 10 can access either the internal bus or the external bus. Indicates access to the internal bus. On the other hand, (NC) of the sound source 20 indicates that it is not connected by NotConnect, and ACTV indicates that a musical sound waveform is output from the sound source 20.

同図に示すように、CK1が偽であるとき、CPU10は、インターナルバス或いはエクスターナルバスのいずれでもアクセスするが、CK1が真であるとき、インターナルバスのみにアクセスする。一方、CK1が真であり、且つ音源クロックCKTGダウンエッヂの時に、音源20は、アクティブになり、CK1が偽に変わるまでアクティブのままになる。CK1が偽になると同時に、音源20は楽音波形の読み出しを止める。   As shown in the figure, when CK1 is false, the CPU 10 accesses either the internal bus or the external bus, but when CK1 is true, it accesses only the internal bus. On the other hand, when CK1 is true and the sound source clock CKTG is down edge, the sound source 20 becomes active and remains active until CK1 changes to false. At the same time as CK1 becomes false, the sound source 20 stops reading the musical sound waveform.

図19は、上記CPU10がパイプライン処理を行った際の種々の動作タイミングを示すタイミングチャートである。   FIG. 19 is a timing chart showing various operation timings when the CPU 10 performs pipeline processing.

このタイミングチャートでは、システムサイクル(図では0〜8が示されている)中に以下のような動作タイミングとなる。尚、動作クロックMCK、CK1、CPU10及び音源20の動作タイミングは、図18の場合と同じになるので、ここではその説明を省略する。   In this timing chart, the operation timing is as follows during a system cycle (0 to 8 are shown in the figure). Note that the operation timings of the operation clocks MCK, CK1, CPU 10, and sound source 20 are the same as those in FIG.

システムサイクル0の時、1段目のパイプラインには、その命令フェッチ部100に、上記プログラムフラッシュメモリ64から、命令IC−0がフェッチ(IF)される。   In the system cycle 0, the instruction IC-0 is fetched (IF) from the program flash memory 64 to the instruction fetch unit 100 in the first-stage pipeline.

システムサイクル1の時、2段目のパイプラインには、その命令デコード部120で、先にフェッチされた命令のデコード処理とレジスタオペランドフェッチ(RF)がなされる。同時に、1段目のパイプラインでは、命令フェッチ部100に、上記プログラムフラッシュメモリ64から、命令IC−1がフェッチ(IF)される。   At the time of system cycle 1, the instruction decode unit 120 performs decode processing of the previously fetched instruction and register operand fetch (RF) in the second-stage pipeline. At the same time, in the first-stage pipeline, the instruction IC-1 is fetched (IF) from the program flash memory 64 to the instruction fetch unit 100.

システムサイクル2の時、3段目のパイプラインでは、その演算部140で、命令実行(EX)がなされ、2段目のパイプラインでは、その命令デコード部120で、先にフェッチされた命令のデコード処理とレジスタオペランドフェッチ(RF)がなされる。同時に、1段目のパイプラインでは、命令フェッチ部100に、上記プログラムフラッシュメモリ64から、命令IC−2がフェッチ(IF)される。   In the system cycle 2, in the third-stage pipeline, the instruction execution (EX) is performed by the arithmetic unit 140, and in the second-stage pipeline, the instruction fetch unit 120 Decoding processing and register operand fetch (RF) are performed. At the same time, in the first stage pipeline, the instruction IC-2 is fetched (IF) from the program flash memory 64 to the instruction fetch unit 100.

システムサイクル3の時、4段目のパイプラインでは、そのメモリアクセス部170でデータインターナルバス70へのメモリアクセス(MA)がなされ、3段目のパイプラインでは、その演算部140で、命令実行(EX)がなされる。2段目のパイプラインでは、その命令デコード部120で、先にフェッチされた命令のデコード処理とレジスタオペランドフェッチ(RF)がなされる。同時に、1段目のパイプラインでは、命令フェッチ部100に、上記プログラムフラッシュメモリ64から、命令IC−3がフェッチ(IF)される。   In system cycle 3, in the fourth stage pipeline, the memory access unit 170 performs memory access (MA) to the data internal bus 70, and in the third stage pipeline, the arithmetic unit 140 Execution (EX) is performed. In the second-stage pipeline, the instruction decoding unit 120 performs a decoding process on the previously fetched instruction and a register operand fetch (RF). At the same time, in the first stage pipeline, the instruction IC-3 is fetched (IF) from the program flash memory 64 to the instruction fetch unit 100.

システムサイクル4の時、5段目のパイプラインでは、そのライトバック部180でレジスタファイル192へのライトバック処理(WB)がなされ、命令IC−0の処理が終了する。また4段目のパイプラインでは、そのメモリアクセス部170でデータインターナルバス70へのメモリアクセス(MA)がなされ、3段目のパイプラインでは、その演算部140で、命令実行(EX)がなされる。2段目のパイプラインでは、その命令デコード部120で、先にフェッチされた命令のデコード処理とレジスタオペランドフェッチ(RF)がなされる。同時に、1段目のパイプラインでは、命令フェッチ部100に、上記プログラムフラッシュメモリ64から、命令IC−4がフェッチ(IF)される。   In the system cycle 4, in the fifth-stage pipeline, the write-back processing (WB) to the register file 192 is performed by the write-back unit 180, and the processing of the instruction IC-0 is completed. In the fourth stage pipeline, the memory access unit 170 performs memory access (MA) to the data internal bus 70, and in the third stage pipeline, the operation unit 140 performs instruction execution (EX). Made. In the second-stage pipeline, the instruction decoding unit 120 performs a decoding process on the previously fetched instruction and a register operand fetch (RF). At the same time, in the first stage pipeline, the instruction IC-4 is fetched (IF) from the program flash memory 64 to the instruction fetch unit 100.

システムサイクル5の時、5段目のパイプラインでは、そのライトバック部180でレジスタファイル192へのライトバック処理(WB)がなされ、命令IC−1の処理が終了する。また4段目のパイプラインでは、そのメモリアクセス部170でデータインターナルバス70又はエクスターナルバス40へのメモリアクセス(MA)がなされ、3段目のパイプラインでは、その演算部140で、命令実行(EX)がなされる。2段目のパイプラインでは、その命令デコード部120で、先にフェッチされた命令のデコード処理とレジスタオペランドフェッチ(RF)がなされる。同時に、1段目のパイプラインでは、命令フェッチ部100に、上記プログラムフラッシュメモリ64から、命令IC−5(記載せず)がフェッチ(IF)される。以下順次命令が実行される。   In the system cycle 5, in the fifth-stage pipeline, the write-back processing (WB) to the register file 192 is performed by the write-back unit 180, and the processing of the instruction IC-1 is completed. In the fourth stage pipeline, the memory access unit 170 performs memory access (MA) to the data internal bus 70 or the external bus 40, and in the third stage pipeline, the arithmetic unit 140 executes instructions. (EX) is made. In the second-stage pipeline, the instruction decoding unit 120 performs a decoding process on the previously fetched instruction and a register operand fetch (RF). At the same time, in the first stage pipeline, the instruction IC-5 (not shown) is fetched (IF) from the program flash memory 64 to the instruction fetch unit 100. Thereafter, instructions are sequentially executed.

同図の一番下段に示したタイミングチャートが示しているものは、CPU10の命令が、エクスターナルバス40の使用をするか否かを示しており、システムサイクル0〜2までは、エクスターナルバス40を使用をしておらず、ハイインピーダンスになって状態が不定となっている。その後システムサイクル3から以降は、CPU10の命令が、エクスターナルバス40及びデータインターナルバス70を交互に使用している。但し、エクスターナルバス40を使用するタイミングでデータインターナルバス70を使用するのは許可される。このため、このような動作をするアドレスと命令の組み合わせをコンパイラは別段排除しない。   The timing chart shown at the bottom of the figure shows whether or not the instruction of the CPU 10 uses the external bus 40, and the external bus 40 is not used until the system cycles 0 to 2. It is not in use and is in a high-impedance state. Thereafter, from the system cycle 3 onward, the instruction of the CPU 10 uses the external bus 40 and the data internal bus 70 alternately. However, it is allowed to use the data internal bus 70 at the timing of using the external bus 40. Therefore, the compiler does not exclude combinations of addresses and instructions that perform such operations.

以上詳述した本実施例構成によれば、本発明のクロスコンパイラで生成されたオブジェクトプログラムが、CPU10のエクスターナルバス40アクセス命令と音源タイミングとがぶつかるサイクルを検出して交換可能な次の命令に交換され、或いは次の使用タイミングまでCPU10のエクスターナルバス40使用を休止する命令が出力されるため、CPU10がエクスターナルバス40を使用しない命令が実行される場合にあっては、音源20がエクスターナルバス40を使用する間は、そのCPU10は待つことなくその命令をそのまま実行でき、結果的に該CPU10の実行速度を上げることができるようになるという優れた効果を奏し得る。   According to the configuration of the embodiment described in detail above, the object program generated by the cross compiler of the present invention detects the cycle in which the external bus 40 access instruction of the CPU 10 and the sound source timing collide with each other and can be replaced with the next instruction. Since the instruction for stopping the use of the external bus 40 of the CPU 10 is output until the next use timing, the sound source 20 is connected to the external bus 40 when the instruction that the CPU 10 does not use the external bus 40 is executed. While using the CPU 10, the CPU 10 can execute the instruction as it is without waiting, and as a result, the CPU 10 can increase the execution speed.

すなわち、第1検出部1の検出した、CPU10がエクスターナルバス40を使用する命令が、上記音源20がエクスターナルバス40を使用するべきタイミングに実行されることを、上記第2検出部2により検出した場合に、該命令の前に前記CPU10に対して、CPU10がエクスターナルバス40を使用して実行する命令の次の命令に交換可能か否かが、判定部3により判定され、その判定結果において、次の命令に交換可能であれば、オペレーション部4によってその命令に交換され、逆に次の命令に交換可能でなければ、該オペレーション部4によって、エクスターナルバス40を該CPU10が次に使用するタイミングまで休止する命令が挿入されるようになるため(コンパイラで生成されたオブジェクトプログラムが、CPU10のエクスターナルバス40アクセス命令と音源タイミングとがぶつかるサイクルを検出して交換可能な次の命令に交換され、或いは次の使用タイミングまでCPU10のエクスターナルバス40使用を休止する命令が出力されるため)、CPU10がエクスターナルバス40を使用しない命令が実行される場合にあっては、音源20がエクスターナルバス40を使用する間に、そのCPU10は待つことなくその命令をそのまま実行でき、結果的に該CPU10の実行速度を上げることができるようになる。   That is, the second detection unit 2 detects that the instruction that the CPU 10 uses the external bus 40 detected by the first detection unit 1 is executed at a timing when the sound source 20 should use the external bus 40. In this case, before the instruction, the determination unit 3 determines whether or not the CPU 10 can be replaced with an instruction next to an instruction executed by the CPU 10 using the external bus 40. In the determination result, If it can be exchanged for the next instruction, it is exchanged for that instruction by the operation unit 4, and conversely, if it is not exchangeable for the next instruction, the operation unit 4 will use the external bus 40 next time by the CPU 10 Instruction that pauses until the object program is inserted (the object program generated by the compiler This is because a cycle in which the 10 external bus 40 access instructions and the sound source timing collide is detected and exchanged with the next exchangeable instruction, or an instruction to stop using the external bus 40 of the CPU 10 is output until the next use timing) When the instruction that the CPU 10 does not use the external bus 40 is executed, the CPU 10 can execute the instruction as it is without waiting while the sound source 20 uses the external bus 40. As a result, the CPU 10 The execution speed of can be increased.

尚、本発明のコンパイラは、上述の図示例にのみ限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。   The compiler according to the present invention is not limited to the illustrated example described above, and it is needless to say that various changes can be made without departing from the gist of the present invention.

本発明のクロスコンパイラは、電子楽器に広く適用できることは言うまでもない。   It goes without saying that the cross compiler of the present invention can be widely applied to electronic musical instruments.

電子鍵盤楽器という別のターゲットシステム環境で動作することを目的に、オブジェクトプログラムを生成するクロスコンパイラが用いられるプログラム開発環境を示すワークステーションの機能ブロック図である。It is a functional block diagram of a workstation showing a program development environment in which a cross compiler for generating an object program is used for the purpose of operating in another target system environment called an electronic keyboard instrument. クロスコンパイラの処理フローを示すフローチャートである。It is a flowchart which shows the processing flow of a cross compiler. 電子鍵盤楽器で動作することを目的とするオブジェクトプログラムの開発作業手順を示すフローチャートである。It is a flowchart which shows the development work procedure of the object program aiming to operate | move with an electronic keyboard instrument. 電子鍵盤楽器の構成概要ブロック図である。It is an outline block diagram of composition of an electronic keyboard instrument. ターゲットプログラムがCPU10によって実行された際に、該CPU10上に形成されることになる構成の機能ブロック図である。FIG. 3 is a functional block diagram of a configuration that is formed on a CPU 10 when a target program is executed by the CPU 10. 電子鍵盤楽器のCPU10の内部構成を示す機能ブロック図である。It is a functional block diagram which shows the internal structure of CPU10 of an electronic keyboard instrument. CPU10のレジスタファイル192のレジスタ構成を示す説明図である。3 is an explanatory diagram illustrating a register configuration of a register file 192 of a CPU 10. FIG. CPU10内部構成の命令フェッチ部100の構成の概要図である。It is a schematic diagram of the structure of the instruction fetch part 100 of CPU10 internal structure. 命令デコード部120の構成の概要図である。3 is a schematic diagram of a configuration of an instruction decoding unit 120. FIG. 演算部140の構成の概要図である。3 is a schematic diagram of a configuration of a calculation unit 140. FIG. メモリアクセス部160の構成の概要図である。3 is a schematic diagram of a configuration of a memory access unit 160. FIG. ライトバック部180の構成の概要図である。3 is a schematic diagram of a configuration of a write back unit 180. FIG. 電子鍵盤楽器におけるCPU10で、ターゲットプログラムが実行された場合の、該プログラムの処理フローが実行された際のメインフローを示すフローチャートである。It is a flowchart which shows the main flow at the time of the process flow of this program being performed when the target program is performed by CPU10 in an electronic keyboard instrument. 図13におけるステップS304のイベント処理の処理フローを示すフローチャートである。It is a flowchart which shows the processing flow of the event process of step S304 in FIG. 図13におけるステップS306の非イベント処理の処理フローを示すフローチャートである。It is a flowchart which shows the processing flow of the non-event process of step S306 in FIG. インターバルタイマ割り込み処理の処理フローを示すフローチャートである。It is a flowchart which shows the processing flow of an interval timer interruption process. シリアルインターフェースからの受信割り込み処理の処理フローを示すフローチャートである。It is a flowchart which shows the processing flow of the reception interruption process from a serial interface. CPU10と音源20及びインターナルバス・エクスターナルバスの動作タイミングを示すタイミングチャートである。It is a timing chart which shows the operation timing of CPU10, the sound source 20, and an internal bus and an external bus. CPU10がパイプライン処理を行った際の種々の動作タイミングを示すタイミングチャートである。It is a timing chart which shows various operation timings when CPU10 performs a pipeline process.

1 第1検出部
2 第2検出部
3 判定部
4 オペレーション部
10 CPU
20 音源
22 DSP
22a DSPメモリ
22b DSPバス
24 DAC
26 アンプ
28 スピーカ
30 バスコントローラ
40 エクスターナルバス
50 データROM/RAM
52 波形データメモリ
60 命令インターナルバス
62 メモリコントローラ
64 フラッシュメモリ
66 インターフェース
70 データインターナルバス
72 インターフェース
100 命令フェッチ部
102 命令ポインタIP
104 加算器
110、130、150、170 パイプラインレジスタ
120 命令デコード部
121 命令分離器ID
122 オペランド分離器OD
123 一時記憶レジスタX1
124 一時記憶レジスタX2
125 セレクタS1
140 演算部
141 演算ユニットCU
160 メモリアクセス部
161 アドレスゲートAG
162 条件識別器DM
163 セレクタS2
164 セレクタS3
165 バストランシーバTR
180 ライトバック部
181 セレクタS4
182 セレクタS5
190 クロック生成部
192 レジスタファイル
1000 システムバス
1002 I/Oバス
1004 CPUブロック
1006 DMA
1008 インターフェース
1010 メモリブロック
1012 ディスクI/Oユニット
1014 ハードディスクドライブ
1016 GPU
1018 ビデオモニタ
DESCRIPTION OF SYMBOLS 1 1st detection part 2 2nd detection part 3 Judgment part 4 Operation part 10 CPU
20 sound source 22 DSP
22a DSP memory 22b DSP bus 24 DAC
26 Amplifier 28 Speaker 30 Bus controller 40 External bus 50 Data ROM / RAM
52 Waveform Data Memory 60 Instruction Internal Bus 62 Memory Controller 64 Flash Memory 66 Interface 70 Data Internal Bus 72 Interface 100 Instruction Fetch Unit 102 Instruction Pointer IP
104 Adder 110, 130, 150, 170 Pipeline register 120 Instruction decode unit 121 Instruction separator ID
122 Operand separator OD
123 Temporary storage register X1
124 Temporary storage register X2
125 selector S1
140 Arithmetic Unit 141 Arithmetic Unit CU
160 Memory Access Unit 161 Address Gate AG
162 Condition identifier DM
163 Selector S2
164 Selector S3
165 Bus transceiver TR
180 Write-back unit 181 Selector S4
182 Selector S5
190 Clock generation unit 192 Register file 1000 System bus 1002 I / O bus 1004 CPU block 1006 DMA
1008 Interface 1010 Memory block 1012 Disk I / O unit 1014 Hard disk drive 1016 GPU
1018 Video monitor

Claims (1)

少なくともプログラム及びデータを記憶する記憶手段と、該記憶手段に記憶された波形データをアクセスする音源と、該記憶手段に記憶されたプログラム及びデータをアクセスするCPUと、上記記憶手段が繋げられた共有バスと、該共有バスに対し上記音源とCPUが時分割交互にアクセスさせる制御を行うバスコントローラとを備えたターゲットシステム環境で動作することを目的とするオブジェクトプログラムを生成するクロスコンパイラであって、
前記CPUが共有バスを使用する命令を検出する第1の検出手段と、
該第1の検出手段が検出した命令が実行されるタイミングが、前記共有バスをCPUが使用するべきタイミングであるかどうかを検出する第2の検出手段と、
前記第1の検出手段の検出した、CPUが共有バスを使用する命令が、前記音源が共有バスを使用するべきタイミングに実行されることを、前記第2の検出手段により検出した場合に、該命令の前に前記CPUに対して、CPUが共有バスを使用して実行する命令の次の命令に交換可能か否かを判定する判定手段と、
その判定結果に基づき、次の命令に交換可能であれば、その命令に交換し、逆に次の命令に交換可能でなければ、共有バスを該CPUが次に使用するタイミングまで休止する命令を挿入するオペレーション手段とを備え、
上記共有バスを上記音源が使用するタイミングに、上記CPUが共有バス以外をアクセスするように動作するオブジェクトプログラムを生成することを特徴とするクロスコンパイラ。
Storage means for storing at least a program and data, a sound source for accessing waveform data stored in the storage means, a CPU for accessing programs and data stored in the storage means, and a shared connection of the storage means A cross compiler that generates an object program intended to operate in a target system environment including a bus and a bus controller that controls the sound source and the CPU to alternately access the shared bus in a time-division manner,
First detection means for detecting an instruction for the CPU to use a shared bus;
Second detection means for detecting whether or not the timing at which the instruction detected by the first detection means is executed is a timing at which the CPU should use the shared bus;
When the second detection means detects that the instruction that the CPU uses the shared bus detected by the first detection means is executed at a timing when the sound source should use the shared bus, Determining means for determining whether or not the CPU can be replaced with an instruction next to an instruction executed by the CPU using a shared bus before the instruction;
Based on the determination result, if the instruction can be exchanged for the next instruction, the instruction is exchanged for the instruction. On the other hand, if the instruction cannot be exchanged for the next instruction, the instruction to pause the shared bus until the next use of the CPU is issued. An operation means for inserting,
A cross compiler that generates an object program that operates so that the CPU accesses a bus other than the shared bus at a timing when the sound source uses the shared bus.
JP2009188328A 2009-08-17 2009-08-17 Cross compiler Expired - Fee Related JP5457104B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009188328A JP5457104B2 (en) 2009-08-17 2009-08-17 Cross compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009188328A JP5457104B2 (en) 2009-08-17 2009-08-17 Cross compiler

Publications (2)

Publication Number Publication Date
JP2011039376A JP2011039376A (en) 2011-02-24
JP5457104B2 true JP5457104B2 (en) 2014-04-02

Family

ID=43767202

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009188328A Expired - Fee Related JP5457104B2 (en) 2009-08-17 2009-08-17 Cross compiler

Country Status (1)

Country Link
JP (1) JP5457104B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2546098B2 (en) * 1992-01-08 1996-10-23 ヤマハ株式会社 Electronic musical instrument
JP2004287919A (en) * 2003-03-24 2004-10-14 Mitsubishi Electric Corp Arithmetic unit, controller, processor, arithmetic method, and arithmetic program

Also Published As

Publication number Publication date
JP2011039376A (en) 2011-02-24

Similar Documents

Publication Publication Date Title
JP2746549B2 (en) Computer system and operation method thereof
KR101019224B1 (en) Data speculation based on addressing patterns identifying dual-purpose register
JP5699554B2 (en) Vector processing circuit, instruction issue control method, and processor system
TWI541658B (en) Data processing apparatus and semiconductor integrated circuit device
US7478228B2 (en) Apparatus for generating return address predictions for implicit and explicit subroutine calls
KR20050013544A (en) System and method for linking speculative results of load operations to register values
US5812809A (en) Data processing system capable of execution of plural instructions in parallel
US6981131B2 (en) Early condition code evaluation at pipeline stages generating pass signals for controlling coprocessor pipeline executing same conditional instruction
US5313644A (en) System having status update controller for determining which one of parallel operation results of execution units is allowed to set conditions of shared processor status word
KR20040111566A (en) System and method for using speculative source operands in order to bypass load/store operations
JP2006331201A (en) Instruction execution device, debugging method, debugging device and debugging program
JP2001034471A (en) Vliw system processor
JPH07120278B2 (en) Data processing device
JP2008530712A (en) Method and apparatus for managing a return stack
US5461715A (en) Data processor capable of execution of plural instructions in parallel
JP5457104B2 (en) Cross compiler
US7831806B2 (en) Determining target addresses for instruction flow changing instructions in a data processing apparatus
JP2008299729A (en) Processor
US20050154859A1 (en) Branch prediction in a data processing apparatus
JP2008071061A (en) Information processor
US6789185B1 (en) Instruction control apparatus and method using micro program
US5745723A (en) Data processing system capable of execution of plural instructions in parallel
US20070043930A1 (en) Performance of a data processing apparatus
JP3295803B2 (en) Processor method Performance measurement method
JPH06131180A (en) Instruction processing system and instruction processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120620

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131129

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140109

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees