JP2006202265A - Microcomputer - Google Patents
Microcomputer Download PDFInfo
- Publication number
- JP2006202265A JP2006202265A JP2005331739A JP2005331739A JP2006202265A JP 2006202265 A JP2006202265 A JP 2006202265A JP 2005331739 A JP2005331739 A JP 2005331739A JP 2005331739 A JP2005331739 A JP 2005331739A JP 2006202265 A JP2006202265 A JP 2006202265A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- cpu
- address
- microcomputer
- executed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
本発明は、複数のタスクを時分割並行的に実施可能であると共に、それらの内少なくとも1つのタスクが、命令アドレスの増分が一定となるように固定ループ化されたプログラムが記述される特定タスクとなっているマイクロコンピュータに関する。 The present invention can execute a plurality of tasks in a time-sharing manner in parallel, and at least one of them is a specific task in which a fixed loop program is written so that the instruction address increment is constant. It relates to the microcomputer which becomes.
特許文献1には、図5に示す構成のマイクロコンピュータが開示されている。このマイクロコンピュータは、CPU11と、ROMにより構成されたプログラムメモリ12と、RAMにより構成されたデータメモリ13と、I/Oブロック14(入出力ピン)と、後述するCPU切替信号(クロック信号)を発生するタイミングジェネレータ(図示せず)と、データを送受信するデータバス15と、アドレス信号を送受信するアドレスバス16と、リード信号とライト信号をそれぞれ送受信するコントロールバス17,18とを備えている。
上記CPU11は、例えば、2種類のタスク(Lタスク,Aタスク)を時分割で並行にパイプライン処理するため2つのアドレスレジスタ19,20と2つの演算レジスタ21,22を備え、これらアドレスレジスタ19,20と演算レジスタ21,22をCPU切替信号により交互に切り替えることで、見掛上、2つのCPUを交互に切り替えて動作させるように機能する。
The
この場合、一方のアドレスレジスタ19と演算レジスタ21がCPU0用(Lタスク用)のレジスタとなり、他方のアドレスレジスタ20と演算レジスタ22がCPU1用(Aタスク用)のレジスタとなる。これらアドレスレジスタ19,20の切替えに応じてプログラムカウンタ23の値(次にフェッチする命令のアドレス)が更新され、このプログラムカウンタ23からCPU0用(Lタスク用)とCPU1用(Aタスク用)のアドレス信号が交互にプログラムメモリ12に出力される。
また、CPU11内には、プログラムメモリ12から読み込まれた命令の属するタスクの種類を判別してそのエラーを検出するエラー検出回路24と、このエラー検出回路24を通過した命令をデコード(解読)する命令デコーダ・命令シーケンサ25が設けられ、この命令デコーダ・命令シーケンサ25によりデコードした命令の内容に応じて、演算器26(ALU)で演算レジスタ21,22を用いて演算したり、リード信号又はライト信号をコントロールバス17,18に出力するようになっている。
In this case, one
In the
一方、プログラムメモリ12内には、CPU0用(Lタスク用)のプログラム領域27と、CPU1用(Aタスク用)のプログラム領域28と、テーブル即値データ領域29とが設けられている。この場合、CPU0用のプログラム領域27に格納されたLタスクは、プログラム暴走に至る危険性のある分岐命令が禁止されて固定ループ化されたプログラムで構成されている。これにより、Lタスクのプログラムの実行時には0番地から実行を開始し、1番地,2番地,3番地,…と順々に命令を実行していき、その後、所定番地まで行くと、プログラムカウンタ23がオーバーフローして0番地に戻り、以後、上述した番地順の命令実行を繰り返すようになる。また、このLタスクの命令が全て1ワードに固定されている。
On the other hand, in the program memory 12, a
Lタスクは、シーケンス制御の処理を行うのに適し、そのプログラム中に、Aタスクの暴走監視用のルーチンと、システムのフェイルセーフを成立させるためのバックアップシーケンス用のルーチンが含まれている。更に、このLタスクは、固定ループ動作によるタイマとしての機能も備え、例えばインクリメント命令又はデクリメント命令を実行させてそのカウント値が所定の設定値に達したときに、Aタスクの処理に割込みを発生させることでタイマ割込みと等価な定時間処理が可能となっている。
一方、Aタスクは、Lタスクで禁止されている分岐命令も許容されており、例えば複雑な解析処理・数値処理に適している。このAタスクについても、Lタスクと同じく、命令が全て1ワード命令に固定されている。このAタスクとLタスクは、1ワード内にオペコードとオペランド(アドレス)の両方が割り付けられている。
The L task is suitable for performing sequence control processing, and the program includes a routine for monitoring runaway of the A task and a routine for backup sequence for establishing system fail-safety. Furthermore, this L task also has a function as a timer by a fixed loop operation. For example, when an increment instruction or a decrement instruction is executed and the count value reaches a predetermined set value, an interrupt is generated in the processing of the A task. This makes it possible to perform fixed-time processing equivalent to timer interrupts.
On the other hand, for the A task, branch instructions prohibited by the L task are also permitted, and are suitable for, for example, complex analysis processing and numerical processing. As for the A task, as in the L task, all instructions are fixed to a one-word instruction. In the A task and the L task, both an operation code and an operand (address) are allocated in one word.
次に、上記構成のマイクロコンピュータが採用しているパイプライン制御方式について図6に基づいて説明する。このパイプラインは、例えば、命令フェッチ,命令デコード,命令実行の各ステージからなる3段のパイプラインとして構成され、全命令がこの3段のパイプラインで遅滞なく処理できるように設計されている。各ステージはそれぞれ1サイクルで実行され、3サイクルで1命令を実行するようになっているが、3段のパイプラインにより3つの命令を並行処理することで、見掛上、1命令を1サイクルで実行するのと等価となっている。 Next, a pipeline control system employed by the microcomputer having the above configuration will be described with reference to FIG. This pipeline is configured as, for example, a three-stage pipeline including instruction fetch, instruction decode, and instruction execution stages, and is designed so that all instructions can be processed without delay in the three-stage pipeline. Each stage is executed in one cycle, and one instruction is executed in three cycles, but apparently one instruction is processed in one cycle by processing three instructions in parallel by a three-stage pipeline. Is equivalent to running
1サイクル(各ステージ)の時間は、CPU切替信号(クロック信号)により規定されている。このCPU切替信号は、ローレベルの時間TLoとハイレベルの時間THiとが同一であり、ローレベル期間でCPU0(Lタスク)の命令フェッチを行い、ハイレベル期間でCPU1(Aタスク)の命令フェッチを行うことにより、CPU0(Lタスク)とCPU1(Aタスク)の両プログラムを1:1の時分割比で並行にパイプライン処理するようになっている。
更に、CPU1がAタスクのプログラムに含まれる分岐命令をフェッチしたときには、当該分岐命令が含まれるAタスクの次の命令フェッチステージで分岐先アドレスの命令をフェッチするために、命令デコードステージで分岐先アドレスをセットするように構成されている。図6では、パイプライン処理中において、CPU1の(Y+1)番地の命令がYY番地への分岐命令(JMP)である場合の処理タイミングが示されている。
The time for one cycle (each stage) is defined by a CPU switching signal (clock signal). This CPU switching signal has the same low-level time TLo and high-level time THi, and CPU0 (L task) instruction fetch is performed during the low level period, and CPU1 (A task) instruction fetch is performed during the high level period. By doing this, both the CPU0 (L task) and CPU1 (A task) programs are pipelined in parallel at a time division ratio of 1: 1.
Further, when the
CPU11は、プログラムカウンタ23に異なる命令アドレスを順次セットするための複数のアドレスレジスタと19,20と、命令デコーダ・命令シーケンサ25によってデコードされた命令を、演算器26に順次セットするための複数の演算レジスタ21,22とを備え、前記複数のアドレスレジスタ19,20及び複数の演算レジスタ21,22を順次切替えることで、プログラムメモリ12に記憶されている複数のプログラム27,28をパイプライン処理可能に構成されている。
特許文献1のマイクロコンピュータにおいては、上述したように、Lタスクでは分岐命令の実行を禁止(即ち、プログラム中における分岐命令の記述を禁止)しているので、プログラムカウンタ23の値は常に「1」ずつ増加するようになっており(この場合、1命令のバイト数にかかわらずそのように設定されている)、Aタスク側の暴走監視処理やプログラムカウンタ23のカウンタ値を利用したタイマ機能を実現することが可能となっている。
しかしながら、Lタスク側には、分岐命令の禁止という制約が加えられているため分岐処理が実行できず、例えば、所定の条件判断を行った結果に応じて所定の演算処理の実行可否を選択するような条件付制御フローを実現することができないという問題があった。
In the microcomputer of
However, on the L task side, the restriction that the branch instruction is prohibited is added, so that the branch process cannot be executed. For example, whether or not to execute the predetermined arithmetic process is selected according to the result of the predetermined condition determination. There is a problem that such a conditional control flow cannot be realized.
本発明は上記事情に鑑みてなされたものであり、その目的は、時分割並行処理される複数のタスクのうち少なくとも1つが特定タスクとして記述される場合でも、その特定タスク中における条件付制御フローの実行を可能としたマイクロコンピュータを提供することにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a conditional control flow in a specific task even when at least one of a plurality of tasks that are processed in time-division parallel processing is described as the specific task. It is to provide a microcomputer that can execute the above.
請求項1記載のマイクロコンピュータによれば、CPUは、特定タスクに記述されている条件判断命令を実行した結果、当該命令以降に記述されている命令の実行が不要となる場合でも、見かけ上はその実行不要な命令を実行するので、特定タスクを実行した場合のプログラムカウンタの値は当該命令の実行を要する場合と同様に増加し、また、当該命令を実行した場合と同様の処理時間が経過する。しかし、当該命令の実行結果をCPU又は周辺回路に反映させることは禁止されるので、実質的には命令を実行しない場合と同じ状態になる。
従って、条件判断命令の判断結果によらず、命令アドレスの増分値は一定になると共に命令の実行時間も同一となるので、特定タスクにおいても、処理時間の等時性を維持した上で条件分岐処理が可能となり、プログラムをより多様に記述することができる。
According to the microcomputer of
Therefore, the increment value of the instruction address is constant and the execution time of the instruction is the same regardless of the determination result of the condition determination instruction. Therefore, even in a specific task, conditional branching is performed while maintaining isochronism of processing time. Processing becomes possible, and programs can be described in more various ways.
請求項2記載のマイクロコンピュータによれば、CPUは、実行不要となる命令がロード命令である場合は、そのロード命令を実行して読み出したデータを内部レジスタに書込みすることを禁止するので、ロード命令の実行結果がCPUに反映されることはなく、実質的にロード命令を実行しない場合と同じ状態を維持することができる。
According to the microcomputer of
請求項3記載のマイクロコンピュータによれば、CPUは、実行が不要となる命令がロード命令である場合は、当該ロード命令を実行して読み出したデータを内部レジスタに対して書込む際に、前記データを前記内部レジスタのデータ値に変換して当該内部レジスタに上書きする。従って、請求項2と同様に、ロード命令の実行結果がCPUに反映されることはなく、実質的にロード命令を実行しない場合と同じ状態を維持することができる。 According to the microcomputer of claim 3, when the instruction that does not need to be executed is a load instruction, the CPU executes the load instruction and writes the read data to the internal register. Data is converted into the data value of the internal register and overwritten on the internal register. Therefore, similarly to the second aspect, the execution result of the load instruction is not reflected on the CPU, and the same state as when the load instruction is not executed can be maintained.
請求項4記載のマイクロコンピュータによれば、CPUは、実行不要となる命令が演算命令である場合は、その演算命令を実行した結果のデータを内部レジスタに書込みすることを禁止するので、演算命令の実行結果がCPUに反映されることはなく、実質的に演算命令を実行しない場合と同じ状態を維持することができる。
According to the microcomputer of
請求項5記載のマイクロコンピュータによれば、CPUは、実行が不要となる命令が演算命令である場合は、当該演算命令を実行した結果であるデータを内部レジスタに対して書込む際に、前記データを前記内部レジスタのデータ値に変換して当該内部レジスタに上書きする。従って、請求項4と同様に、演算命令の実行結果がCPUに反映されることはなく、実質的に演算命令を実行しない場合と同じ状態を維持することができる。 According to the microcomputer of claim 5, when the instruction that does not need to be executed is an arithmetic instruction, the CPU writes the data that is the result of executing the arithmetic instruction to the internal register. Data is converted into the data value of the internal register and overwritten on the internal register. Therefore, similarly to the fourth aspect, the execution result of the arithmetic instruction is not reflected on the CPU, and the same state as when the arithmetic instruction is not executed can be maintained.
請求項6記載のマイクロコンピュータによれば、CPUは、実行不要となる命令がストア命令である場合は、そのストア命令のオペランドアドレスを、実際にはデータの書き込み対象が存在しないダミーアドレスに変換して出力する。そして、CPUの外部回路は、ダミーアドレスによるアクセスに対してアクノリッジ信号を返すので、バスエラーが発生することはなく、且つ、ストア命令の実行結果が外部回路に反映されることはない。従って、実質的にストア命令を実行しない場合と同じ状態を維持することができる。 According to another aspect of the microcomputer of the present invention, when the instruction that does not need to be executed is a store instruction, the CPU converts the operand address of the store instruction into a dummy address that does not actually have a data write target. Output. Since the external circuit of the CPU returns an acknowledge signal in response to the access by the dummy address, a bus error does not occur and the execution result of the store instruction is not reflected in the external circuit. Therefore, the same state as when the store instruction is not executed can be maintained.
請求項7記載のマイクロコンピュータによれば、CPUは、ストア命令のオペランドアドレスをダミーアドレスに変換する場合には、そのオペランドアドレスの下位ビット側を所定ビット数だけ全て「1」に変換する。即ち、前記オペランドアドレスが書き込み対象とする周辺回路に割り当てられているアドレス領域内において、当該領域の先頭から所定部分までが書き込み対象となり、それ以降をダミーアドレスに応答する部分に割り当てておく。すると、オペランドアドレスの上位ビットをそのまま維持することで前記アドレス領域内へのアクセスを確保し、残りの下位ビット側を全て「1」に変換すれば、CPUを、前記アドレス領域の後尾側に配置されるダミーアドレス領域にアクセスさせることができる。 According to the microcomputer of the seventh aspect, when converting the operand address of the store instruction into a dummy address, the CPU converts all the lower bits of the operand address into “1” by a predetermined number of bits. That is, in the address area assigned to the peripheral circuit to which the operand address is to be written, the beginning of the area to the predetermined part is to be written, and the rest is assigned to the part responding to the dummy address. Then, access to the address area is secured by maintaining the upper bits of the operand address as it is, and if all the remaining lower bits are converted to “1”, the CPU is arranged at the tail side of the address area. The dummy address area to be accessed can be accessed.
請求項8記載のマイクロコンピュータによれば、CPUは、ストア命令のオペランドアドレスをダミーアドレスに変換する場合には、オペランドアドレスに所定のアドレス値を加算するので、請求項7と同様に、CPUを、前記アドレス領域の後尾側に配置されるダミーアドレス領域にアクセスさせることができる。 According to the microcomputer of claim 8, when the CPU converts the operand address of the store instruction into a dummy address, the CPU adds a predetermined address value to the operand address. The dummy address area arranged on the rear side of the address area can be accessed.
以下、本発明の一実施例について図1乃至図4を参照して説明する。図1は、本発明のマイクロコンピュータ31におけるCPU32の構成を示す機能ブロック図である。尚、CPU32の基本的な構成は図5に示すCPU11と同様であるが、図1では、図示の都合上、本発明の要旨にかかる部分のみを抽出して示している。CPU32において新規な構成部分は、主としてスキップ判別回路33を設けた点にある。尚、本実施例では、CPU32は2バイト命令にアクセスするものとして、プログラムカウンタ23の増分値は「2」となっている。
An embodiment of the present invention will be described below with reference to FIGS. FIG. 1 is a functional block diagram showing the configuration of the
スキップ判別回路33には、プログラムカウンタ23より出力される命令アドレスと、CPU切替信号と、命令デコーダ・命令シーケンサ(以下、単に命令デコーダと称す)25より出力される分岐命令信号及びロード/ストア信号とが与えられている。命令デコーダ25は、デコードした命令が分岐命令(条件付分岐命令を含む)であり、且つその分岐判断が成立して演算器26からの条件判定結果信号がアクティブになると分岐命令信号を出力するように構成されている。この信号は、分岐命令で指定される分岐(ステップ)数だけアクティブ(ハイ)期間が確保される。
また、命令デコーダ25は、デコードした命令がロード命令又は演算命令である場合はロード/ストア信号をロウレベルに変化させ、デコードした命令がストア命令である場合はロード/ストア信号をハイレベルに変化させるようになっている(それ以外の命令の場合は、信号レベルを維持する)。
The
The
スキップ判別回路33は、CPU切替信号がロウレベルでありCPU0によるLタスク(特定タスク)の処理期間であることを示す場合に、命令レジスタ34を介してフェッチされた命令を命令デコーダ25がデコードした結果が分岐命令であり、且つ分岐判断が成立した場合に分岐命令信号を出力すると、その信号をスキップ信号として認識する。その場合、スキップ判別回路33は、分岐の実行条件が成立しなかった場合に実行する命令がロード命令又は演算命令である場合は、プログラムカウンタ23及び(汎用)レジスタ35に対して所定の期間書込み禁止信号を出力するように構成されている。
The result of the
また、スキップ判別回路33は、スキップ信号を認識している際に、分岐の実行条件が成立しなかった場合に実行する命令がストア命令である場合は、プログラムカウンタ23及びレジスタ35に対して同様に書込み禁止信号を出力すると共に、アドレスバス/ロードストアユニット36に対してダミーアドレス切替え信号を出力する。そして、アドレスバス/ロードストアユニット36は、ダミーアドレス切替え信号が与えられた場合、その時点で自身に格納されているストア命令のオペランドアドレスの下位側ビットを所定ビット数だけ全て「1」に変換するようになっている。例えば、アドレスが16ビットであり、図2に示す周辺回路38のアクセスアドレスが「0x4×××」である場合、そのアドレスは、周辺回路38のアドレス領域の末尾である「0x4FFF」となるように変換される。
レジスタ35は、書込み禁止信号がアクティブである期間は、ロード命令が実行された結果ロードストアユニット36を介して周辺回路より得られたデータが格納されないように構成されている。また、演算器26が演算命令を実行した結果得られたデータについても、同様に格納が禁止される。
Further, when the
The
図2は、マイクロコンピュータ31全体の構成を概略的に示す機能ブロック図である。CPU32には、アドレスバス15及びデータバス16を介してデータメモリ13としてのROM36,RAM37や、I/Oブロック14としての周辺回路38,39(周辺1,2)がバスステートコントローラ(BSC,外部回路,周辺回路)40を介して接続されている。BSC40は、CPU32がアクセススピードが遅い周辺回路38,39に対してアクセスを行った場合、ウエイトサイクルを挿入するなどのサイクル調整を行うと共に、CPU32に対してアクノリッジ信号を返すようになっている。
FIG. 2 is a functional block diagram schematically showing the overall configuration of the
また、周辺回路38,39においては、夫々に割り付けられているアドレス領域が、データの書き込みが行われる内部レジスタなどの領域に、実際にはデータの書き込みが行われることはないダミーアドレス領域を末部に加えて設定されている。そして、BSC40は、CPU32がこのダミーアドレス領域にアクセスを行った場合もアクノリッジ信号を返すように構成されている。
尚、CPU32が周辺回路38,39にアクセスを行う場合にBSC40がウエイトサイクルを挿入すれば、CPU32のパイプライン処理における命令実行ステージが遅延することになる。しかし、そのような情報はプログラムの記述時に予め把握することができるので、CPU32がLタスク中で実行に遅延が生じるアクセスを行う場合には、プログラムカウンタ23の増分値に遅延分の重みを持たせるように計算処理を行う。
In the
If the
次に、本実施例の作用について図3及び図4も参照して説明する。図3(a)は、本実施例におけるマイクロコンピュータ31がLタスクを実行する場合における処理の流れの一例を示すものである。本実施例では、Lタスクにおいても条件付き分岐命令と等価な処理を実現可能としている。
例えば、図3(b)は従来のLタスクの処理の流れを示しており、分岐命令の実行は禁止され、処理ステップ(1)から処理ステップ(5)までを順次実行してプログラムカウンタ23がオーバーフローすると、プログラムカウンタ23は初期値の「0」番地に戻り、また、処理ステップ(1)から(5)までを繰り返し実行するように固定ループ化されている。尚、これらはCPUによって実行される多数の命令を例示的に示したものであるから、処理ステップ数と命令アドレスの増分とは一致していない。
Next, the operation of this embodiment will be described with reference to FIGS. FIG. 3A shows an example of the flow of processing when the
For example, FIG. 3B shows the flow of processing of a conventional L task, execution of branch instructions is prohibited, and processing steps (1) to (5) are executed sequentially, and the
これに対して、本実施例のLタスクでは、処理ステップ(5)に替えて処理ステップ(1)と処理ステップ(2)との間に「判定」ステップが挿入されている。その条件判定の結果が真(T)である場合は処理ステップ(2),(3)を実行し、条件判定の結果が偽(F)である場合は処理ステップ(2),(3)の実行をスキップ(A,B)して処理ステップ(4)を実行する。
ただし、Lタスクにおいては、プログラムカウンタ23の増分値が一定であることと、処理時間の等時性とが保証される必要がある。即ち、これらが「判定」ステップの結果に応じて変動することがあってはならない。そこで、本実施例では、処理ステップ(2),(3)に替わるスキップ処理A,Bを、図4に示すように実行する。
On the other hand, in the L task of this embodiment, a “determination” step is inserted between the processing step (1) and the processing step (2) instead of the processing step (5). When the result of the condition determination is true (T), the processing steps (2) and (3) are executed. When the result of the condition determination is false (F), the processing steps (2) and (3) are executed. Execution is skipped (A, B) and processing step (4) is executed.
However, in the L task, it is necessary to guarantee that the increment value of the
図4は、図3(a)のフローチャートに応じて処理を実行した場合のタイミングチャートを示すものであり、(a)は判定ステップの結果が「真」であった場合、(b)は判定ステップの結果が「偽」であった場合に対応する。尚、処理ステップ(2)は周辺回路38または39に対するロード命令であり、処理ステップ(3)は周辺回路38または39に対するストア命令であるものとする。そして、CPU32がそれらの命令に応じて実行するリードアクセス,ライトアクセスには、BSC40によって例えば2サイクル分のウエイトサイクルが挿入され、処理ステップ(2),(3)の実行には3サイクルを要するようになっている。
FIG. 4 shows a timing chart when processing is executed in accordance with the flowchart of FIG. 3A. FIG. 4A shows a case where the result of the determination step is “true”, and FIG. This corresponds to the case where the result of the step is “false”. Processing step (2) is a load instruction for the
図4(b)に示すように、スキップAの場合、CPU32は(a)のケースと同様に処理(2)のロード命令をフェッチ,デコード,実行する。但し、ロード命令をデコードした段階で、レジスタ35にはスキップ判別回路33から書込み禁止信号が出力される(ハイアクティブ)。その結果、リードサイクルを実行し、アドレスバス/ロードストアユニット36を介して読み出されたデータは、レジスタ35には書き込まれることはない。従って、リードサイクルの実行結果はCPU32の内部に反映されず、実質的にはロード命令を実行していない状態に等しくなる。
尚、処理(2)における命令が演算命令であった場合もロード命令のケースと同様に処理され、CPU32は演算器26において演算命令を実行するが、その実行結果がレジスタ35に書き込まれることはない。
As shown in FIG. 4B, in the case of skip A, the
When the instruction in the process (2) is an arithmetic instruction, it is processed in the same manner as in the case of the load instruction, and the
また、スキップBの場合、CPU32はやはり(a)のケースと同様に処理(3)のストア命令をフェッチ,デコード,実行するが、ストア命令をデコードした場合も、アドレスバス/ロードストアユニット36にはスキップ判別回路33から書込み禁止信号が出力される。その結果、ライトサイクルを実行した場合にアドレスバス15に出力されるアドレスは、周辺回路38又は39のダミーアドレス領域に変換される。従って、周辺回路38又は39に対してはデータが書き込まれることはなく、実質的にストア命令を実行していない状態に等しくなる。
In the case of skip B, the
以上のように本実施例によれば、CPU32は、Lタスクに記述されている条件判断命令を実行した結果、当該命令以降に記述されている命令の実行が不要となる場合でも、見かけ上はその実行不要な命令を実行する。従って、Lタスクを実行した場合のプログラムカウンタ23の値は当該命令の実行を要する場合と同様に増加し、当該命令を実行した場合と同様の時間が経過するが、当該命令の実行結果をCPU32自身又は周辺回路38又は39に反映させることは禁止されるので、実質的には命令を実行しない場合と同じ状態になる。
従って、分岐命令を実行した場合と同様の結果が得られることになる。そして、条件判断命令の判断結果によらず、命令アドレスの増分値は一定になると共に命令の実行時間も同一となるので、Lタスクにおいても、処理時間の等時性を維持した上で条件分岐処理が可能となり、プログラムをより多様に記述することができる。
As described above, according to the present embodiment, the
Therefore, the same result as that obtained when the branch instruction is executed is obtained. Since the increment value of the instruction address is constant and the execution time of the instruction is the same regardless of the determination result of the condition determination instruction, conditional branching is performed while maintaining isochronism of processing time even in the L task. Processing becomes possible, and programs can be described in more various ways.
また、CPU32は、実行不要となる命令がロード命令である場合は、そのロード命令を実行して読み出したデータを内部レジスタ35に書込むことを禁止するので、ロード命令の実行結果がCPU32に反映されることはなく、実質的にロード命令を実行しない場合と同じ状態を維持することができる。また、実行不要となる命令が演算命令である場合も同様である。
また、CPU32は、実行不要となる命令がストア命令である場合は、そのストア命令のオペランドアドレスを、実際にはデータの書き込み対象が存在しないダミーアドレスに変換して出力し、BSC40は、そのアクセスに対してアクノリッジ信号を返すので、バスエラーが発生することはなく、ストア命令の実行結果が周辺回路38,39に反映されることはない。従って、実質的にストア命令を実行しない場合と同じ状態を維持することができる。
In addition, when the instruction that does not need to be executed is a load instruction, the
In addition, when the instruction that does not need to be executed is a store instruction, the
また、CPU32は、ストア命令のオペランドアドレスをダミーアドレスに変換する場合には、そのオペランドアドレスの下位ビット側を所定ビット数だけ全て「1」に変換するので、オペランドアドレスの上位ビットをそのまま維持することで周辺回路38又は39のアドレス領域内へのアクセスを確保し、そのアドレス領域の後尾側に配置されるダミーアドレス領域にアクセスさせることができる。
Further, when converting the operand address of the store instruction into a dummy address, the
本発明は上記し又は図面に記載した実施例にのみ限定されるものではなく、以下のような変形が可能である。
CPU32がオペランドアドレスをダミーアドレスに変換する場合には、オペランドアドレスに所定のアドレス値を加算するように構成しても良い。また、ダミーアドレスは、アクセス対象毎に設定する必要はなく、1つの共通領域を設定しても良い。
BSC40は、必要に応じて設ければ良い。
CPUが並行処理するタスクの数は、「3」以上であっても良い。
特定タスクにおける命令アドレスの増分値は「1」又は「4」などでも良い。
The present invention is not limited to the embodiments described above or shown in the drawings, and the following modifications are possible.
When the
The
The number of tasks processed in parallel by the CPU may be “3” or more.
The increment value of the instruction address in the specific task may be “1” or “4”.
分岐命令信号は、命令デコーダ25が出力するものに限らず、演算器26やスキップ判別回路33で生成出力するようにしても良い。
上記実施例では、書込み禁止信号がアクティブである期間にロード命令又は演算命令が実行されると、その実行結果データをレジスタ35に格納することを禁止したが、格納を禁止することに替えて、命令の実行結果として得られたデータを、その時点でレジスタ35に格納されているデータ値に変換して上書きするようにしても良い。斯様に構成した場合も、命令の実行結果がCPU32に反映されることはないので、実質的にロード命令,演算命令を実行しない場合と同じ状態を維持することができる。
命令長については、例えば1ワード長と2ワード長というように、2種類以上あっても良い。
The branch instruction signal is not limited to the one output by the
In the above embodiment, when the load instruction or the operation instruction is executed during the period in which the write prohibition signal is active, the execution result data is prohibited from being stored in the
There may be two or more types of instruction lengths, for example, 1 word length and 2 word length.
図面中、23はプログラムカウンタ、31はマイクロコンピュータ、32はCPU、33はスキップ判別回路、35はレジスタ、38,39は周辺回路、40はBSC(外部回路,周辺回路)を示す。 In the drawing, 23 is a program counter, 31 is a microcomputer, 32 is a CPU, 33 is a skip discrimination circuit, 35 is a register, 38 and 39 are peripheral circuits, and 40 is a BSC (external circuit, peripheral circuit).
Claims (8)
CPUが前記特定タスクに記述されている条件判断命令を実行した結果、当該命令以降に記述されている命令の実行が不要となる場合は、前記命令の実行結果を前記CPU又はその周辺回路に反映させることを禁止するように構成されていることを特徴とするマイクロコンピュータ。 A plurality of tasks can be executed in a time-sharing manner, and at least one of them is a specific task in which a fixed loop program is described so that the instruction address increment is constant. ,
If the CPU executes the condition determination instruction described in the specific task and the execution of the instruction described after the instruction becomes unnecessary, the execution result of the instruction is reflected in the CPU or its peripheral circuit. A microcomputer characterized in that it is prohibited from being allowed to occur.
前記CPUの外部回路は、前記ダミーアドレスによるアクセスに対してアクノリッジ信号を返すように構成されていることを特徴とする請求項1乃至5の何れかに記載のマイクロコンピュータ。 When the instruction that does not need to be executed is a store instruction, the CPU converts the operand address of the store instruction into a dummy address that does not actually have a data write target, and outputs the dummy address.
6. The microcomputer according to claim 1, wherein an external circuit of the CPU is configured to return an acknowledge signal in response to access by the dummy address.
7. The microcomputer according to claim 6, wherein when the operand address of the store instruction is converted into the dummy address, the CPU adds a predetermined address value to the operand address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005331739A JP4702004B2 (en) | 2004-12-21 | 2005-11-16 | Microcomputer |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004368777 | 2004-12-21 | ||
JP2004368777 | 2004-12-21 | ||
JP2005331739A JP4702004B2 (en) | 2004-12-21 | 2005-11-16 | Microcomputer |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006202265A true JP2006202265A (en) | 2006-08-03 |
JP4702004B2 JP4702004B2 (en) | 2011-06-15 |
Family
ID=36960180
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005331739A Expired - Fee Related JP4702004B2 (en) | 2004-12-21 | 2005-11-16 | Microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4702004B2 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06250857A (en) * | 1993-02-26 | 1994-09-09 | Nippondenso Co Ltd | Microcomputer |
JPH07123094A (en) * | 1993-10-21 | 1995-05-12 | Hitachi Ltd | Buffer control circuit |
JPH07175650A (en) * | 1993-12-17 | 1995-07-14 | Toshiba Corp | Arithmetic processor |
WO2004053685A1 (en) * | 2002-12-12 | 2004-06-24 | Arm Limited | Instruction timing control within a data processing system |
-
2005
- 2005-11-16 JP JP2005331739A patent/JP4702004B2/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06250857A (en) * | 1993-02-26 | 1994-09-09 | Nippondenso Co Ltd | Microcomputer |
JPH07123094A (en) * | 1993-10-21 | 1995-05-12 | Hitachi Ltd | Buffer control circuit |
JPH07175650A (en) * | 1993-12-17 | 1995-07-14 | Toshiba Corp | Arithmetic processor |
WO2004053685A1 (en) * | 2002-12-12 | 2004-06-24 | Arm Limited | Instruction timing control within a data processing system |
JP2006510127A (en) * | 2002-12-12 | 2006-03-23 | エイアールエム リミテッド | Instruction timing control in data processor |
Also Published As
Publication number | Publication date |
---|---|
JP4702004B2 (en) | 2011-06-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2810068B2 (en) | Processor system, computer system, and instruction processing method | |
JPH03129433A (en) | Device and method for parallel processing | |
JP3242508B2 (en) | Microcomputer | |
JP2620511B2 (en) | Data processor | |
US8127183B2 (en) | Microcomputer system | |
JPH0527971A (en) | Information processor | |
EP1770507A2 (en) | Pipeline processing based on RISC architecture | |
US20060095746A1 (en) | Branch predictor, processor and branch prediction method | |
US20050149931A1 (en) | Multithread processor architecture for triggered thread switching without any cycle time loss, and without any switching program command | |
JP2004192021A (en) | Microprocessor | |
JP4889235B2 (en) | Program control processor | |
JP4702004B2 (en) | Microcomputer | |
US6425047B1 (en) | Process containing address decoders suited to improvements in clock speed | |
EP0573071A2 (en) | A microprocessor | |
JPH06214785A (en) | Microprocessor | |
JP5012562B2 (en) | Microcomputer | |
JP3199035B2 (en) | Processor and execution control method thereof | |
JP2636821B2 (en) | Parallel processing unit | |
JP2503223B2 (en) | Prior control method | |
JP3461887B2 (en) | Variable length pipeline controller | |
JP3147884B2 (en) | Storage device and information processing device | |
JP3102399B2 (en) | Data processing apparatus and method | |
JP2927281B2 (en) | Parallel processing unit | |
JP2785820B2 (en) | Parallel processing unit | |
JPH06250856A (en) | Microcomputer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080109 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20101013 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20101019 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101126 |
|
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: 20110208 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110221 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 4702004 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |