JP2721610B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP2721610B2
JP2721610B2 JP602292A JP602292A JP2721610B2 JP 2721610 B2 JP2721610 B2 JP 2721610B2 JP 602292 A JP602292 A JP 602292A JP 602292 A JP602292 A JP 602292A JP 2721610 B2 JP2721610 B2 JP 2721610B2
Authority
JP
Japan
Prior art keywords
instruction
address
memory
data memory
data
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 - Lifetime
Application number
JP602292A
Other languages
Japanese (ja)
Other versions
JPH05189014A (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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP602292A priority Critical patent/JP2721610B2/en
Publication of JPH05189014A publication Critical patent/JPH05189014A/en
Application granted granted Critical
Publication of JP2721610B2 publication Critical patent/JP2721610B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Programmable Controllers (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、パイプライン処理が可
能なプロセッサを備えるプログラマブルコントローラに
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller having a processor capable of pipeline processing.

【0002】[0002]

【従来の技術】従来より、プログラマブルコントローラ
の処理速度を向上させることなどを目的として、図3に
示すように、従来から用いられている汎用のメインプロ
セッサ11と並行動作する命令実行専用のコプロセッサ
21を設けることが提案されている。コプロセッサ21
としては、処理の高速化を図るために、縮小命令セット
プロセッサ(RISCプロセッサ)を用いることが考え
られている。この場合、ユーザ等により設計されてソー
スプログラムメモリ12に格納されたシーケンスプログ
ラムのソースコードは、コンパイルされて縮小命令に変
換された後にオブジェクトプログラムメモリ22に格納
され、基本命令や応用命令はオブジェクトプログラムメ
モリ22に格納された縮小命令よりなるオブジェクトコ
ードに基づいてコプロセッサ21で実行される。ソース
コードのコンパイルは、システムメモリ13に格納され
たコンパイラを用いてメインプロセッサ11によって行
われる。また、メインプロセッサ11は、シーケンスプ
ログラムの命令の実行には用いられず、ソースコードの
コンパイルのほか、インタフェース14を通して行われ
る周辺装置の制御や通信の制御に用いられる。メインプ
ロセッサ11とコプロセッサ21との間の通信はバスコ
ントローラ15を介して行われる。ここに、メインプロ
セッサ11のデータバスは16ビットであり、コプロセ
ッサ21のデータバスは、オブジェクトプログラムメモ
リ22との間では32ビット、データメモリ23との間
では16ビットになっている。バスコントローラ15
は、メインプロセッサ11の16ビットのデータバスと
コプロセッサ21の32ビットのデータバスとを結合す
る機能を有している。コプロセッサ21の内部処理は3
2ビットで行われるから、RISCプロセッサであるこ
ととあいまって命令をメインプロセッサ11よりも高速
に実行できるのである。
2. Description of the Related Art Conventionally, as shown in FIG. 3, for the purpose of improving the processing speed of a programmable controller, a coprocessor dedicated to instruction execution which operates in parallel with a conventional general-purpose main processor 11 is used. It has been proposed to provide 21. Coprocessor 21
In order to speed up the processing, it has been considered to use a reduced instruction set processor (RISC processor). In this case, the source code of the sequence program designed by the user or the like and stored in the source program memory 12 is compiled and converted into a reduced instruction, and then stored in the object program memory 22. The processing is executed by the coprocessor 21 based on the object code including the reduction instruction stored in the memory 22. Compilation of the source code is performed by the main processor 11 using a compiler stored in the system memory 13. The main processor 11 is not used for executing the instructions of the sequence program, but is used for compiling the source code and for controlling peripheral devices and communication performed through the interface 14. Communication between the main processor 11 and the coprocessor 21 is performed via the bus controller 15. Here, the data bus of the main processor 11 has 16 bits, and the data bus of the coprocessor 21 has 32 bits with the object program memory 22 and 16 bits with the data memory 23. Bus controller 15
Has a function of connecting the 16-bit data bus of the main processor 11 and the 32-bit data bus of the coprocessor 21. The internal processing of the coprocessor 21 is 3
The instruction is executed in two bits, so that the instruction can be executed faster than the main processor 11 in combination with the RISC processor.

【0003】ソースコードとオブジェクトコードとの関
係は、図4のようになる。たとえば、ソースコードでは
3命令であって、各命令のワード数が2、4、4である
とき、縮小命令を用いたオブジェクトコードのワード数
は、ソースコードの各命令に対して、たとえば、3、
7、5などとなる。オブジェクトコードでは、1ワード
が1命令に対応するのであって、上述した例では、ソー
スコードで2ワードを用いる1命令が、オブジェクトコ
ードでは3命令などとなっている。
[0003] The relationship between the source code and the object code is as shown in FIG. For example, when the source code has three instructions and the number of words in each instruction is 2, 4, and 4, the number of words in the object code using the reduced instruction is, for example, 3 for each instruction in the source code. ,
7, 5, etc. In the object code, one word corresponds to one instruction. In the above example, one instruction using two words in the source code is three instructions in the object code.

【0004】[0004]

【発明が解決しようとする課題】ところで、コプロセッ
サ21の命令セットには入力の立ち上がりや立ち下がり
を検出する微分命令と称するものが用意されている。ま
た、微分命令は、スキャン毎ではなく1スキャンのみ微
分処理を行う形式が普通である。いま、オブジェクトプ
ログラムが図5(a)のようなものであるとする。ここ
では、入力の立ち上がりを1回だけ検出する微分命令D
Fを用いている。入力X0がオフからオンに立ち上がる
と、出力Y30がオンになるのである。この処理は1ス
キャンだけ行われる。このような処理を行うには、前ス
キャンの入力X0の値を保持しておくことが必要であ
る。すなわち、微分命令DFを1スキャンのみで実行す
るためには、入力X0がオフからオンに一旦立ち上がる
と、以後は入力X0がオンに保たれるようにすることが
必要であって、入力X0を次スキャン以降ではオンに保
つことによって、微分命令DFで立ち上がりが検出され
ないようにするのである。このように入力X0のオン・
オフの状態を保持するために、図5(b)のように、オ
ブジェクトプログラムメモリ22と同じアドレスを有
し、各メモリセルが1ビットであるデータメモリ23を
設けることが考えられている。
By the way, the instruction set of the coprocessor 21 is provided with what is called a differential instruction for detecting the rise or fall of the input. In general, the differential instruction is of a type that performs differential processing only for one scan, not for each scan. Now, it is assumed that the object program is as shown in FIG. Here, the differential instruction D that detects the rising of the input only once
F is used. When the input X0 rises from off to on, the output Y30 turns on. This process is performed only for one scan. To perform such processing, it is necessary to hold the value of the input X0 of the previous scan. That is, in order to execute the differential instruction DF in only one scan, once the input X0 rises from off to on, it is necessary to keep the input X0 on thereafter. By keeping it on after the next scan, the rise is not detected by the differential instruction DF. Thus, the input X0 is turned on.
In order to maintain the off state, it is considered to provide a data memory 23 having the same address as the object program memory 22 and each memory cell being 1 bit as shown in FIG. 5B.

【0005】たとえば、図5(a)のラダー図に対応し
て図5(b)に示すように、オブジェクトプログラムメ
モリ22のアドレス0に入力X0を取込む命令、アドレ
ス1に入力X0とデータメモリ23に保持されている値
との比較により立ち上がりの有無を検出する命令、アド
レス2に出力Y30を出す命令が格納されているものと
する。アドレス0の命令を実行して入力X0がオフから
オンに立ち上がると、アドレス1ではデータメモリ23
のアドレス1に格納されている前スキャンの入力X0
(初期状態では入力X0はオフである)とアドレス0の
実行により得た入力X0とを比較して立ち上がりを検出
し、加算演算を実行する。その後、出力Y30を得るの
である。ここで、入力X0が一旦オンになると、以後は
データメモリ23のアドレス1はオンに保たれるから、
アドレス0で取り込んだ入力X0がオンであってもアド
レス1で加算演算は行われることがないのである。
For example, as shown in FIG. 5B corresponding to the ladder diagram of FIG. 5A, an instruction to take input X0 at address 0 of object program memory 22, and input X0 and data memory at address 1 It is assumed that an instruction for detecting the presence or absence of a rise by comparison with the value held in 23 and an instruction for outputting an output Y30 at address 2 are stored. When the instruction at address 0 is executed and the input X0 rises from off to on, at address 1, the data memory 23
Input X0 of the previous scan stored at address 1 of
(In the initial state, the input X0 is off.) And the input X0 obtained by executing the address 0 is detected to detect a rise, and an addition operation is performed. Thereafter, the output Y30 is obtained. Here, once the input X0 is turned on, since the address 1 of the data memory 23 is kept on thereafter,
Even if the input X0 fetched at the address 0 is on, the addition operation is not performed at the address 1.

【0006】一方、コプロセッサ21では、図6に示す
ように、パイプライン処理を行うことによって実行速度
の向上を図っている。すなわち、コプロセッサ21にお
いて命令を実行する際には、オブジェクトプログラムメ
モリ22から命令を1つずつフェッチする命令フェッチ
サイクルIF、フェッチした命令をデコードするデコー
ドサイクルDEC、デコードした命令を実行する実行サ
イクルEXEの3段階を要するのが普通であり、1つの
命令のデコードの間に次命令のフェッチを行う動作を繰
り返すことによって全体としての命令の実行時間を短縮
することが考えられている。ここに、命令フェッチサイ
クルIF、デコードサイクルDEC、実行サイクルEX
Eはそれぞれ1マシンサイクルであり、1マシンサイク
ルはたとえばクロック信号の3周期分(6フェーズ)に
規定される。
On the other hand, as shown in FIG. 6, the execution speed of the coprocessor 21 is improved by performing pipeline processing. That is, when executing instructions in the coprocessor 21, an instruction fetch cycle IF for fetching instructions one by one from the object program memory 22, a decode cycle DEC for decoding fetched instructions, and an execution cycle EXE for executing decoded instructions Usually, it is necessary to reduce the execution time of the instruction by repeating the operation of fetching the next instruction during the decoding of one instruction. Here, instruction fetch cycle IF, decode cycle DEC, execution cycle EX
E is one machine cycle, and one machine cycle is defined, for example, for three cycles (six phases) of a clock signal.

【0007】コプロセッサ21は、1ビットの命令であ
る基本命令を実行するビット処理部を備え、ビット処理
部は演算処理が施される1ビットのデータを保持するア
キュムレータであるビットアキュムレータを備える。図
5(b)のオブジェクトプログラムにおいてアドレス
(0)で取り込んだ入力X0がオンであったとすると、
ビットアキュムレータに1が格納される。次に、アドレ
ス(1)で微分命令DFがフェッチされると、同時にデ
ータメモリ23の同じアドレスのデータが読み出され
る。データメモリ23には前スキャンの入力X0が格納
されている。たとえば、初期状態で入力X0がオフ(=
「0」)であったとすると、データメモリ23の値は
「0」である。微分命令DFの実行サイクルでは、デー
タメモリ23から読み出した値をビットアキュムレータ
の値と比較する。ここで、データメモリ23から読み出
した値が「0」、ビットアキュムレータの値が「1」で
あるとすれば、入力X0が立ち上がったことになるか
ら、条件が満たされて微分命令DFが実行され、さらに
次命令OT Y30が実行されるのである。ここにおい
て、微分命令DFを実行したときに、データメモリ23
のアドレス(1)に「1」を書き込んでおけば、次スキ
ャン以降は、入力X0の立ち上がりが検出されないこと
になり、1スキャンのみの立ち上がり検出が行えること
になる。
The coprocessor 21 has a bit processing unit for executing a basic instruction which is a 1-bit instruction, and the bit processing unit has a bit accumulator which is an accumulator for holding 1-bit data to be subjected to arithmetic processing. If the input X0 fetched at the address (0) in the object program of FIG.
1 is stored in the bit accumulator. Next, when the differential instruction DF is fetched at the address (1), data at the same address in the data memory 23 is read at the same time. The data memory 23 stores the input X0 of the previous scan. For example, the input X0 is turned off (=
If "0"), the value of the data memory 23 is "0". In the execution cycle of the differential instruction DF, the value read from the data memory 23 is compared with the value of the bit accumulator. Here, if the value read from the data memory 23 is “0” and the value of the bit accumulator is “1”, the input X0 has risen, so that the condition is satisfied and the differentiation instruction DF is executed. , And the next instruction OTY30 is executed. Here, when the differential instruction DF is executed, the data memory 23
If "1" is written to the address (1), the rising edge of the input X0 is not detected after the next scan, and the rising edge of only one scan can be detected.

【0008】ところで、コプロセッサ21では、1マシ
ンサイクルごとにアドレスがインクリメントされるので
あって、アドレスが(1)であるときに命令ST X0
がデコードされ、微分命令DFがフェッチされる。さら
に、アドレスが(2)になると、命令ST X0の実
行、微分命令FDのデコード、命令OT Y30のフェ
ッチが行われる。このようにパイプライン処理を行って
いるから、アドレスが(2)であるマシンサイクルにお
いて微分命令DFであることが識別されるのであって、
微分命令DFに対応してデータメモリ23のアドレス
(1)にデータを書き込まなければならないにもかかわ
らず、指定アドレスがすでに(2)になっており、アド
レス(1)にデータを書き込むことができないという問
題がある。すなわち、上述したようなメモリ構成でパイ
プライン処理を行うようにすると、パルス型応用命令の
処理ができないという問題が生じる。
In the coprocessor 21, the address is incremented every machine cycle. When the address is (1), the instruction ST X0
Is decoded, and the differential instruction DF is fetched. Further, when the address becomes (2), execution of the instruction ST X0, decoding of the differential instruction FD, and fetching of the instruction OT Y30 are performed. Since the pipeline processing is performed as described above, the differential instruction DF is identified in the machine cycle whose address is (2).
Although data must be written to the address (1) of the data memory 23 in response to the differentiation instruction DF, the designated address has already been (2), and data cannot be written to the address (1). There is a problem. That is, if the pipeline processing is performed with the above-described memory configuration, there is a problem that the pulse-type application instruction cannot be processed.

【0009】この問題を解決するには、オブジェクトプ
ログラムメモリ22とデータメモリ23とのアドレスを
各別に管理することも考えられるが、アドレスの管理が
複雑になってハードウェアが複雑化するという問題があ
る。また、微分命令についてはメインプロセッサ11に
実行を移すことも考えられているが、コプロセッサ21
による処理速度の向上という効果が半減することにな
る。
In order to solve this problem, it is conceivable to separately manage the addresses of the object program memory 22 and the data memory 23. However, there is a problem that the management of the addresses becomes complicated and the hardware becomes complicated. is there. It is also considered that the execution of the differential instruction is transferred to the main processor 11.
The effect of improving the processing speed by half.

【0010】本発明は上記問題点の解決を目的とするも
のであり、オブジェクトプログラムメモリとデータメモ
リとのアドレスを共通化してアドレス管理を容易にしな
がらも、パイプライン処理を不都合なく行えるようにし
たプログラマブルコントローラを提供しようとするもの
である。
SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned problems, and to simplify the address processing by sharing the addresses of the object program memory and the data memory, and to perform the pipeline processing without any inconvenience. It is intended to provide a programmable controller.

【0011】[0011]

【課題を解決するための手段】本発明では、上記目的を
達成するために、シーケンスプログラムを格納したプロ
グラムメモリと、プログラムメモリと同じアドレスを有
した各1ビットのメモリセルを有するデータメモリと、
プログラムメモリおよびデータメモリのアドレスを指定
するアドレス発生器と、アドレス発生器により指定され
たアドレスに格納されている命令をプログラムメモリか
らフェッチする命令レジスタと、命令レジスタに格納さ
れた命令をデコードする命令デコーダと、デコードされ
た命令を実行する演算部と、1つの命令のフェッチとデ
コードと実行とを順に行うとともにデコードから実行ま
での間に次命令をフェッチするようにパイプライン制御
を行うコントローラとを備えたプログラマブルコントロ
ーラにおいて、コントローラは、命令デコーダでデコー
ドした命令が微分命令であるときに、アドレス発生器に
よる指定アドレスをデクリメントさせるとともに、命令
レジスタへの次命令のフェッチを中断させて微分命令に
要するデータをデータメモリに書込み、その後、次命令
のフェッチを再開させるのである。
According to the present invention, to achieve the above object, a program memory storing a sequence program, a data memory having 1-bit memory cells each having the same address as the program memory, and
An address generator that specifies the addresses of the program memory and the data memory; an instruction register that fetches the instruction stored at the address specified by the address generator from the program memory; and an instruction that decodes the instruction stored in the instruction register A decoder, an operation unit for executing the decoded instruction, and a controller for performing fetch, decoding, and execution of one instruction in order and performing pipeline control so as to fetch the next instruction from decoding to execution. In the programmable controller provided, when the instruction decoded by the instruction decoder is a differentiation instruction, the controller decrements the designated address by the address generator and interrupts the fetch of the next instruction to the instruction register to perform the differentiation instruction. Data Write to the data memory, then, it is to resume the fetch of the next instruction.

【0012】[0012]

【作用】上記構成によれば、プログラムメモリとデータ
メモリとがアドレスを共有している構成において、パイ
プライン処理を行う際に、微分命令であると識別される
と、指定アドレスをデクリメントさせるとともに、次命
令のフェッチを中断させて微分命令に要するデータをデ
ータメモリに書込み、その後、次命令のフェッチを再開
させるので、微分命令の実行の際に、パイプライン処理
を一時的に中断してデータメモリへの所要データの書込
みなどを行うことができ、プログラムメモリとデータメ
モリとでアドレスを共用した簡単なハードウェアを用い
ながらも、コプロセッサの内部のみで処理を行うことが
でき、高速な処理が可能になるのである。
According to the above configuration, in a configuration in which the program memory and the data memory share an address, when a differential instruction is identified during pipeline processing, the designated address is decremented. Since the fetch of the next instruction is interrupted and the data required for the differential instruction is written to the data memory, and then the fetch of the next instruction is resumed, the pipeline processing is temporarily interrupted during the execution of the differential instruction and the data memory is stopped. The required data can be written to the memory, and the processing can be performed only inside the coprocessor, while using simple hardware sharing the address between the program memory and the data memory. It becomes possible.

【0013】[0013]

【実施例】図1はコプロセッサ21の内部の要部構成を
示す。クロックジェネレータ31は、内部回路の同期を
とるようにクロック信号を発生する。クロック信号に
は、マシンサイクルに同期する通常の同期クロックsclk
のほか、命令をフェッチするタイミングを与えるフェッ
チクロックfclk、オブジェクトプログラムメモリ22お
よびデータメモリ23の読込タイミングを設定するリー
ドクロックrclk、データメモリ23への書込タイミング
を設定するライトクロックwclk、後述するプログラムカ
ウンタ41への書換クロックcclkがある。
FIG. 1 shows the structure of the main part of a coprocessor 21. Clock generator 31 generates a clock signal so as to synchronize internal circuits. The clock signal includes a normal synchronous clock sclk synchronized with the machine cycle.
A fetch clock fclk for giving a timing for fetching an instruction, a read clock rclk for setting a read timing for the object program memory 22 and the data memory 23, a write clock wclk for setting a write timing for the data memory 23, and a program to be described later. There is a rewrite clock cclk to the counter 41.

【0014】命令は、フェッチクロックfclkに同期して
命令レジスタ32に読み込まれる。また、次命令が命令
レジスタ32に読み込まれると同時に、前命令は命令デ
コーダ33に入力されてデコードされる。すなわち、フ
ェッチクロックfclkは、各マシンサイクルごとに1つず
つ発生するのである。命令デコーダ33において微分命
令であると判定されるとパルスが発生する。このパルス
は、コプロセッサ21の内部動作を制御するコントロー
ラ34に入力されると同時にカウンタ36に入力され、
カウンタ36を動作可能にする。カウンタ36は動作可
能な状態では、同期クロックsclkをカウントするから、
結果的に、カウンタ36の出力値は微分命令の合計個数
に相当することになる。このカウンタ36の出力はコン
トローラ34に入力される。
The instruction is read into the instruction register 32 in synchronization with the fetch clock fclk. At the same time that the next instruction is read into the instruction register 32, the previous instruction is input to the instruction decoder 33 and decoded. That is, one fetch clock fclk is generated for each machine cycle. When the instruction decoder 33 determines that the instruction is a differential instruction, a pulse is generated. This pulse is input to a controller 34 that controls the internal operation of the coprocessor 21 and is input to a counter 36 at the same time.
The counter 36 is enabled. Since the counter 36 counts the synchronous clock sclk in an operable state,
As a result, the output value of the counter 36 corresponds to the total number of differential instructions. The output of the counter 36 is input to the controller 34.

【0015】コントローラ34は、データメモリ23の
値を取り込むビットメモリレジスタ37の値を読み込む
ことができ、またビットアキュムレータ(図示せず)に
対して信号wb,rb を授受することによって、ビットアキ
ュムレータのデータを読み出したり、ビットアキュムレ
ータにデータを書き込んだりすることができる。さら
に、コントローラ34はクロックジェネレータ31を制
御して、フェッチクロックfclkやライトクロックwclkの
出力タイミングを制御するための、フェッチイネーブル
信号fe、ライトイネーブル信号weを出力する。コントロ
ーラ34からは、プログラムカウンタ41の出力値をイ
ンクリメントするかデクリメントするかを選択するため
の増減信号indeも出力される。
The controller 34 can read the value of the bit memory register 37 which takes in the value of the data memory 23, and sends and receives signals wb and rb to and from a bit accumulator (not shown). Data can be read and data can be written to the bit accumulator. Further, the controller 34 controls the clock generator 31 to output a fetch enable signal fe and a write enable signal we for controlling the output timing of the fetch clock fclk and the write clock wclk. The controller 34 also outputs an increase / decrease signal inde for selecting whether to increment or decrement the output value of the program counter 41.

【0016】プログラムカウンタ41の出力値は、オブ
ジェクトプログラムメモリ22およびデータメモリ23
のアドレスを指定するのであって、プログラムカウンタ
41の出力端には、出力値をインクリメントするインク
リメンタ43と、出力値をデクリメントするデクリメン
タ44とが接続される。インクリメンタ43とデクリメ
ンタ45との出力はマルチプレクサであるセレクタ42
に入力され、セレクタ42に増減信号indeが入力される
ことによって、プログラムカウンタ41の出力値をイン
クリメントするかデクリメントするかが選択される。す
なわち、プログラムカウンタ41の出力値を増減して指
定アドレスを増減できるのである。
The output value of the program counter 41 is stored in the object program memory 22 and the data memory 23.
The increment terminal 43 for incrementing the output value and the decrementer 44 for decrementing the output value are connected to the output terminal of the program counter 41. The outputs of the incrementer 43 and the decrementer 45 are output from a selector 42 which is a multiplexer.
, And the increase / decrease signal inde is input to the selector 42, thereby selecting whether to increment or decrement the output value of the program counter 41. That is, the designated address can be increased or decreased by increasing or decreasing the output value of the program counter 41.

【0017】以下に、図5の命令を実行する場合を例示
して動作を説明する。ここで説明を容易にするために、
図2に示すように、各マシンサイクルに対して第1サイ
クルから順に1〜7の数字を付すことにする。第1サイ
クルおよび第2サイクルは従来と同様になる。第2サイ
クルでは、アドレス(1)が指定されているから、微分
命令DFがフェッチされるとともに、ビットメモリレジ
スタ37にデータメモリ23のアドレス(1)のデータ
が取り込まれる。第3サイクルでは、命令STX0が実
行され、同時に微分命令DFがデコードされる。ここ
に、微分命令DFのデコードは第3サイクルの前半で行
われる。また、微分命令DFのデコードによってカウン
タ36が動作可能になり、カウンタ36によって同期ク
ロックsclkが計数される。コントローラ34では命令デ
コーダ33の出力およびカウンタ36の出力を受けて、
図2(c)のように増減信号をインクリメントからデク
リメントに立ち下げ、プログラムカウンタ41の出力値
をデクリメントするように要求する。また、図2(e)
のようにフェッチイネーブル信号feを命令のフェッチを
禁止するように立ち下げる。このとき同時に、命令ST
X0が実行され、図2(f)のように、入力X0がビ
ットアキュムレータに書込信号wbによって書き込まれ
る。
The operation will be described below with reference to the case of executing the instruction shown in FIG. Here, for ease of explanation,
As shown in FIG. 2, numbers 1 to 7 are assigned to each machine cycle in order from the first cycle. The first cycle and the second cycle are the same as the conventional one. In the second cycle, since the address (1) is specified, the differential instruction DF is fetched, and the data of the address (1) in the data memory 23 is taken into the bit memory register 37. In the third cycle, the instruction STX0 is executed, and at the same time, the differential instruction DF is decoded. Here, the decoding of the differential instruction DF is performed in the first half of the third cycle. The counter 36 becomes operable by decoding the differential instruction DF, and the counter 36 counts the synchronous clock sclk. The controller 34 receives the output of the instruction decoder 33 and the output of the counter 36,
As shown in FIG. 2C, the increase / decrease signal falls from the increment to the decrement, and a request is made to decrement the output value of the program counter 41. FIG. 2 (e)
The fetch enable signal fe falls so as to inhibit the fetch of the instruction. At this time, the instruction ST
X0 is executed, and the input X0 is written to the bit accumulator by the write signal wb as shown in FIG.

【0018】第3サイクルにおいてプログラムカウンタ
41の出力値をデクリメントするように増減信号による
要求が出されるから、第4サイクルでは図2(b)のよ
うにプログラムカウンタの出力値であるアドレスは
(1)に戻ることになる。ここで、フェッチイネーブル
信号feがフェッチを禁止しているから、第4サイクルで
は次命令OT Y30はフェッチされず、微分命令DF
の実行のみがなされる。また、第4サイクルの開始時に
はライトイネーブル信号weが立ち上がってビットアキュ
ムレータに格納された値(すなわち、現在のスキャンに
おけるX0の値)がデータメモリ23に書き込まれるの
である。第4サイクルでは命令デコーダ33からコント
ローラ34への入力がないから増減信号indeはインクリ
メント側に復帰する。
In the third cycle, a request by the increase / decrease signal is issued to decrement the output value of the program counter 41. Therefore, in the fourth cycle, the address which is the output value of the program counter is (1) as shown in FIG. ). Here, since the fetch enable signal fe inhibits the fetch, the next instruction OTY30 is not fetched in the fourth cycle, and the differential instruction DF
Is performed only. At the start of the fourth cycle, the write enable signal we rises and the value stored in the bit accumulator (that is, the value of X0 in the current scan) is written to the data memory 23. In the fourth cycle, since there is no input from the instruction decoder 33 to the controller 34, the increase / decrease signal inde returns to the increment side.

【0019】第5サイクルになると、プログラムカウン
タ41の出力値はインクリメントされてアドレス(2)
が指定され、第5サイクルの後半部でフェッチイネーブ
ル信号feが立ち上がって命令OT Y30がフェッチさ
れることになる。第5サイクルでは微分命令DFが実行
されるのであって、ビットアキュムレータの値と第2サ
イクルでビットメモリレジスタ37に格納された値とが
比較され、ビットメモリレジスタ37に格納された値が
「0」、ビットアキュムレータに格納された値が1であ
ると、立ち上がりの条件を満たすからビットアキュムレ
ータを「1」にセットする。ただし、ここではビットア
キュムレータはすでに「1」になっている。以後は通常
のパイプライン制御に復帰する。第6サイクルでは、ビ
ットアキュムレータが「1」になっていればメモリへの
書込を行うが、アキュムレータが「0」であれば無動作
になる。
At the fifth cycle, the output value of the program counter 41 is incremented to the address (2).
Is specified, the fetch enable signal fe rises in the second half of the fifth cycle, and the instruction OTY30 is fetched. Since the differential instruction DF is executed in the fifth cycle, the value of the bit accumulator is compared with the value stored in the bit memory register 37 in the second cycle, and the value stored in the bit memory register 37 is set to "0". If the value stored in the bit accumulator is 1, the rising condition is satisfied and the bit accumulator is set to "1". However, here, the bit accumulator is already "1". Thereafter, the control returns to the normal pipeline control. In the sixth cycle, writing to the memory is performed if the bit accumulator is “1”, but no operation is performed if the accumulator is “0”.

【0020】以上説明したようにパイプライン制御の乱
れを最小限に抑えてコプロセッサ21内で命令実行の処
理を継続しているので、データメモリ23のアドレスを
オブジェクトコードメモリ22と共有していることとあ
いまって、ハードウェアを比較的簡単にすることがで
き、また、高速な処理が可能になるのである。
As described above, since the instruction execution processing is continued in the coprocessor 21 with the disturbance of the pipeline control being minimized, the address of the data memory 23 is shared with the object code memory 22. In combination with this, the hardware can be relatively simple and high-speed processing is possible.

【0021】[0021]

【発明の効果】本発明は上述のように、プログラムメモ
リとデータメモリとがアドレスを共有している構成にお
いて、パイプライン処理を行う際に、微分命令であると
識別されると、指定アドレスをデクリメントさせるとと
もに、次命令のフェッチを中断させて微分命令に要する
データをデータメモリに書込み、その後、次命令のフェ
ッチを再開させるので、微分命令の実行の際に、パイプ
ライン処理を一時的に中断してデータメモリへの所要デ
ータの書込みなどを行うことができ、プログラムメモリ
とデータメモリとでアドレスを共用した簡単なハードウ
ェアを用いながらも、コプロセッサの内部のみで処理を
行うことができ、高速な処理が可能になるという効果が
ある。
According to the present invention, as described above, in a configuration in which the program memory and the data memory share an address, when a differential instruction is identified during pipeline processing, a designated address is assigned. While decrementing, the fetch of the next instruction is interrupted, the data required for the differential instruction is written to the data memory, and then the fetch of the next instruction is resumed, so the pipeline processing is temporarily interrupted when the differential instruction is executed Required data can be written to the data memory, and the processing can be performed only inside the coprocessor while using simple hardware in which the address is shared between the program memory and the data memory. There is an effect that high-speed processing becomes possible.

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

【図1】実施例を示す要部ブロック図である。FIG. 1 is a main block diagram showing an embodiment.

【図2】実施例の動作説明図である。FIG. 2 is an operation explanatory diagram of the embodiment.

【図3】本発明に係るプログラマブルコントローラのブ
ロック図である。
FIG. 3 is a block diagram of a programmable controller according to the present invention.

【図4】本発明に係るプログラマブルコントローラでの
ソースコードとオブジェクトコードとの関係の例を示す
説明図である。
FIG. 4 is an explanatory diagram showing an example of a relationship between a source code and an object code in the programmable controller according to the present invention.

【図5】(a)はラダー図により表現した命令の一部を
示し、(b)はメモリの構成を示す説明図である。
5A is a diagram illustrating a part of an instruction represented by a ladder diagram, and FIG. 5B is an explanatory diagram illustrating a configuration of a memory.

【図6】従来の動作を示す動作説明図である。FIG. 6 is an operation explanatory view showing a conventional operation.

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

31 クロックジェネレータ 32 命令レジスタ 33 命令デコーダ 34 コントローラ 41 プログラムカウンタ 42 セレクタ 43 インクリメンタ 44 デクリメンタ 31 clock generator 32 instruction register 33 instruction decoder 34 controller 41 program counter 42 selector 43 incrementer 44 decrementer

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 シーケンスプログラムを格納したプログ
ラムメモリと、プログラムメモリと同じアドレスを有し
た各1ビットのメモリセルを有するデータメモリと、プ
ログラムメモリおよびデータメモリのアドレスを指定す
るアドレス発生器と、アドレス発生器により指定された
アドレスに格納されている命令をプログラムメモリから
フェッチする命令レジスタと、命令レジスタに格納され
た命令をデコードする命令デコーダと、デコードされた
命令を実行する演算部と、1つの命令のフェッチとデコ
ードと実行とを順に行うとともにデコードから実行まで
の間に次命令をフェッチするようにパイプライン制御を
行うコントローラとを備えたプログラマブルコントロー
ラにおいて、コントローラは、命令デコーダでデコード
した命令が微分命令であるときに、アドレス発生器によ
る指定アドレスをデクリメントさせるとともに、命令レ
ジスタへの次命令のフェッチを中断させて微分命令に要
するデータをデータメモリに書込み、その後、次命令の
フェッチを再開させることを特徴とするプログラマブル
コントローラ。
1. A program memory storing a sequence program, a data memory having 1-bit memory cells having the same address as the program memory, an address generator designating addresses of the program memory and the data memory, and an address An instruction register for fetching the instruction stored at the address specified by the generator from the program memory, an instruction decoder for decoding the instruction stored in the instruction register, an operation unit for executing the decoded instruction, A controller that sequentially fetches, decodes, and executes instructions and performs a pipeline control so that the next instruction is fetched between decoding and execution. Differentiation instruction , Decrement the designated address by the address generator, interrupt the fetch of the next instruction to the instruction register, write the data required for the differential instruction to the data memory, and then resume the fetch of the next instruction. Features a programmable controller.
JP602292A 1992-01-16 1992-01-16 Programmable controller Expired - Lifetime JP2721610B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP602292A JP2721610B2 (en) 1992-01-16 1992-01-16 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP602292A JP2721610B2 (en) 1992-01-16 1992-01-16 Programmable controller

Publications (2)

Publication Number Publication Date
JPH05189014A JPH05189014A (en) 1993-07-30
JP2721610B2 true JP2721610B2 (en) 1998-03-04

Family

ID=11627065

Family Applications (1)

Application Number Title Priority Date Filing Date
JP602292A Expired - Lifetime JP2721610B2 (en) 1992-01-16 1992-01-16 Programmable controller

Country Status (1)

Country Link
JP (1) JP2721610B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008129667A (en) * 2006-11-17 2008-06-05 Meidensha Corp Programmable controller

Also Published As

Publication number Publication date
JPH05189014A (en) 1993-07-30

Similar Documents

Publication Publication Date Title
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
US7346760B2 (en) Data processing apparatus of high speed process using memory of low speed and low power consumption
JPH02130634A (en) Device and method for processing data
EP0240606B1 (en) Pipe-line processing system and microprocessor using the system
KR100321745B1 (en) A micro controller unit for external memory access
EP0279953A2 (en) Computer system having mixed macrocode and microcode instruction execution
JP2721610B2 (en) Programmable controller
JP2721611B2 (en) Programmable controller
JP2003233509A (en) Digital signal processor
US6425047B1 (en) Process containing address decoders suited to improvements in clock speed
EP0573071A2 (en) A microprocessor
JP3699796B2 (en) Processor
JP3954159B2 (en) Synchronous RAM access control circuit, data processor and control method thereof
JP2000284962A (en) Microcomputer
US5734855A (en) Processor with pipeline processing function having read buffer register and latch for storing register information where the result of external access type instruction is stored
JP2001014161A (en) Programmable controller
JP7384374B2 (en) central processing unit
US20040103267A1 (en) Data processor having cache memory
JPS6242301B2 (en)
EP0332849B1 (en) Sequence controller for controlling next operating state with a short delay
JP3366235B2 (en) Data read control device
JP2002268876A (en) Pipeline processing method and information processor
JP3239042B2 (en) Microcomputer
JPH08161222A (en) Processor and program preparation method therefor
JPH08106383A (en) Arithmetic processor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19971104

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081121

Year of fee payment: 11

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081121

Year of fee payment: 11

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091121

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091121

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101121

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111121

Year of fee payment: 14

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111121

Year of fee payment: 14

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111121

Year of fee payment: 14

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121121

Year of fee payment: 15

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121121

Year of fee payment: 15