JP2015210628A - Programmable controller in which no external memory access for calculated data reading occur - Google Patents

Programmable controller in which no external memory access for calculated data reading occur Download PDF

Info

Publication number
JP2015210628A
JP2015210628A JP2014091226A JP2014091226A JP2015210628A JP 2015210628 A JP2015210628 A JP 2015210628A JP 2014091226 A JP2014091226 A JP 2014091226A JP 2014091226 A JP2014091226 A JP 2014091226A JP 2015210628 A JP2015210628 A JP 2015210628A
Authority
JP
Japan
Prior art keywords
processor
instruction
code
programmable controller
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014091226A
Other languages
Japanese (ja)
Other versions
JP6294142B2 (en
Inventor
基好 宮地
Motoyoshi Miyachi
基好 宮地
靖司 野本
Yasushi Nomoto
靖司 野本
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.)
Fanuc Corp
Original Assignee
Fanuc Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fanuc Corp filed Critical Fanuc Corp
Priority to JP2014091226A priority Critical patent/JP6294142B2/en
Publication of JP2015210628A publication Critical patent/JP2015210628A/en
Application granted granted Critical
Publication of JP6294142B2 publication Critical patent/JP6294142B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a programmable controller for shortening the execution time of an instruction with a hardware configuration where the reading of calculated data at a low access speed does not occur between different processors.SOLUTION: A programmable controller 100 for executing a sequence program includes: a first processor 10 for executing a predetermined first instruction; a second processor 20 for executing a second instruction which is not executable by the first processor; an instruction decoder 16 incorporated in the first processor 10 for decoding an instruction to be processed by the second processor 20 included in an instruction code configuring a sequence program and a code generator 17 incorporated in the first processor 10, and incorporated with a memory access circuit for performing the reading of a memory for acquiring calculated data necessary for the second processor 20 to execute the instruction from the address information of the calculated data.

Description

本発明は、プログラマブルコントローラに関し、特にプロセッサによる被演算データ読み出しのための外部メモリアクセスが発生しないプログラマブルコントローラに関する。   The present invention relates to a programmable controller, and more particularly to a programmable controller that does not generate an external memory access for reading operation data by a processor.

プログラマブルコントローラにおいて、シーケンスプログラムの処理は、1ビットのデータに対する演算処理に特化した専用プロセッサ(ASIC)、および、1バイト以上のデータを扱う複雑な命令を実行する汎用プロセッサ(CPU)から構成されるハードウェアにより実行されることが多い(例えば、特許文献1参照)。   In the programmable controller, the sequence program processing is composed of a dedicated processor (ASIC) specialized for arithmetic processing on 1-bit data and a general-purpose processor (CPU) for executing complex instructions that handle data of 1 byte or more. It is often executed by hardware (see, for example, Patent Document 1).

特開2009−116445号公報JP 2009-116445 A

従来技術にあるような2つのプロセッサから構成されるハードウェアにおいても演算データを格納するメモリは1つであり、このメモリは一方のプロセッサから高速にアクセスすることができるが、もう一方のプロセッサによるアクセススピードは遅く、これが命令の実行スピードを遅くする原因となっている。   In the hardware composed of two processors as in the prior art, there is only one memory for storing operation data, and this memory can be accessed at high speed from one processor, but it depends on the other processor. The access speed is slow, which causes the instruction execution speed to slow down.

例えば、図3のような構成のプログラマブルコントローラの場合、演算データ格納用メモリは専用プロセッサに内蔵されているため、専用プロセッサの演算処理回路からは高速にアクセスすることができるが、汎用プロセッサと演算データ格納用メモリは外部バスにより接続されているため、汎用プロセッサによる演算格納用メモリへのアクセスは、専用プロセッサの演算データ格納用メモリへのアクセスよりもアクセススピードが遅くなる。   For example, in the case of a programmable controller configured as shown in FIG. 3, the arithmetic data storage memory is built in the dedicated processor, so that it can be accessed at high speed from the arithmetic processing circuit of the dedicated processor. Since the data storage memory is connected by an external bus, access to the operation storage memory by the general-purpose processor is slower than access to the operation data storage memory of the dedicated processor.

従来技術にみられる課題を解決する一手法として、シーケンスプログラムを汎用プロセッサのみで実行する(汎用プロセッサ内臓データキャッシュを利用する)構成が考えられる。この構成を用いる場合、シーケンスプログラムの処理では、1ビットデータの演算処理、被演算データ読み出し・演算結果データ書き込みのためのメモリのアラインメント境界に跨るワード・ロングワードアクセスを行う。このため、シーケンスプログラム処理用の汎用プロセッサとしては以下の条件を満たすものを選定しなければならなくなる。
条件1:1ビットデータの演算処理を汎用プロセッサで実行するためにリード・モディファイ・ライトをアトミックに実行する手段を有すること。
条件2:メモリのアラインメント境界に跨るワード・ロングワードアクセス時のデータのコヒーレンシ(整合性)を保つために、2回のメモリアクセスをアトミックに実行する手段を有すること。
As a technique for solving the problems found in the prior art, a configuration in which a sequence program is executed only by a general-purpose processor (using a general-purpose processor built-in data cache) can be considered. In the case of using this configuration, in the sequence program processing, word / longword access is performed across the alignment boundary of the memory for 1-bit data operation processing, operation data read / operation result data write. For this reason, it is necessary to select a general-purpose processor for sequence program processing that satisfies the following conditions.
Condition 1: A means for executing read-modify-write atomically in order to execute arithmetic processing of 1-bit data by a general-purpose processor.
Condition 2: In order to maintain the coherency (consistency) of data at the time of word / longword access across the memory alignment boundary, it has means for executing two memory accesses atomically.

また、課題を解決する別の手法として、使用頻度の高い一部の機能命令の処理を専用プロセッサ(ASIC)で実行するように構成することも考えられる。しかしながら、このような構成を設けるためには複雑な機能命令の処理回路を専用プロセッサ(ASIC)に組み込む必要があるため、ASICの開発・評価のために多くの時間・費用を要する。   Further, as another technique for solving the problem, it may be configured to execute processing of a part of frequently used function instructions by an exclusive processor (ASIC). However, in order to provide such a configuration, it is necessary to incorporate a processing circuit for complex functional instructions into an exclusive processor (ASIC), so that much time and cost are required for development and evaluation of the ASIC.

そこで、本発明の目的は、異なるプロセッサ間でアクセススピードの遅い被演算データの読み出しが発生しないハードウェア構成にすることにより、命令の実行時間を短縮するプログラマブルコントローラを提供することである。   Accordingly, an object of the present invention is to provide a programmable controller that shortens the execution time of an instruction by adopting a hardware configuration that does not cause reading of operation data having a low access speed between different processors.

本願請求項1に係る発明は、シーケンスプログラムを実行するプログラマブルコントローラにおいて、所定の第1の命令を実行する第1のプロセッサと、前記第1のプロセッサで実行できない第2の命令を実行する第2のプロセッサとを有し、前記第1のプロセッサは、前記第1の命令および前記第2の命令の実行時に用いられる被演算データを格納するメモリと、前記シーケンスプログラムを構成する命令コードに含まれる前記第2のプロセッサが処理する命令に関する情報をデコードするデコード回路と、前記メモリから前記被演算データを、前記デコード回路によりデコードされた被演算データのアドレス情報に基づいて読み出すメモリアクセス回路を内蔵するコードジェネレータとを有する、ことを特徴とするプログラマブルコントローラである。   According to the first aspect of the present invention, in a programmable controller that executes a sequence program, a first processor that executes a predetermined first instruction, and a second instruction that executes a second instruction that cannot be executed by the first processor The first processor is included in a memory for storing operation data used when executing the first instruction and the second instruction, and an instruction code constituting the sequence program. A decoding circuit that decodes information related to an instruction processed by the second processor and a memory access circuit that reads out the operation data from the memory based on address information of the operation data decoded by the decoding circuit are incorporated. A programmable controller having a code generator It is over La.

本願請求項2に係る発明は、前記コードジェネレータは、前記第2のプロセッサが処理する命令を実行するための関数が格納されているメモリ上のアドレスを算出するアドレス変換回路を有する、ことを特徴とする請求項1に記載のプログラマブルコントローラである。   The invention according to claim 2 of the present application is characterized in that the code generator includes an address conversion circuit that calculates an address on a memory in which a function for executing an instruction processed by the second processor is stored. The programmable controller according to claim 1.

本願請求項3に係る発明は、前記コードジェネレータは、前記被演算データと前記第2のプロセッサのロード命令コードを組み合わせて、前記第2のプロセッサが前記被演算データを前記第2のプロセッサの汎用レジスタにロードするロード命令を生成する、ことを特徴とする請求項1に記載のプログラマブルコントローラである。   According to a third aspect of the present invention, the code generator combines the operation data and the load instruction code of the second processor, and the second processor uses the operation data as the general-purpose of the second processor. The programmable controller according to claim 1, wherein a load instruction to be loaded into a register is generated.

本願請求項4に係る発明は、前記コードジェネレータは、関数が格納されているメモリ上のアドレスデータと前記第2のプロセッサの分岐命令コードを組み合わせて、前記第2のプロセッサが実行するべき命令に該当する関数に分岐するための分岐命令を生成する、
ことを特徴とする請求項1に記載のプログラマブルコントローラである。
In the invention according to claim 4 of the present application, the code generator combines an address data on a memory storing a function and a branch instruction code of the second processor, and generates an instruction to be executed by the second processor. Generate a branch instruction to branch to the corresponding function,
The programmable controller according to claim 1.

本願請求項5に係る発明は、前記コードジェネレータは、前記第2のプロセッサがシーケンスプログラムを実行するのに必要な前記第2のプロセッサが実行できる前記第2の命令の命令コードを生成し、この命令コードを前記第2のプロセッサが読みだすことができるバッファメモリに転送する、ことを特徴とする請求項1に記載のプログラマブルコントローラである。   In the invention according to claim 5 of the present application, the code generator generates an instruction code of the second instruction that can be executed by the second processor, which is necessary for the second processor to execute a sequence program. 2. The programmable controller according to claim 1, wherein the instruction code is transferred to a buffer memory that can be read by the second processor.

本願請求項6に係る発明は、前記コードジェネレータは、シーケンスプログラムから前記第2のプロセッサが実行するべき前記第2の命令をフェッチした時以外は、前記第2のプロセッサのNOP(No Operation)コードを生成し、この命令コードを前記第2のプロセッサが読みだすことができるバッファメモリに転送する、ことを特徴とする請求項1に記載のプログラマブルコントローラである。   The invention according to claim 6 of the present application is such that the code generator fetches the second instruction to be executed by the second processor from a sequence program, except for the NOP (No Operation) code of the second processor. The programmable controller according to claim 1, wherein the instruction code is transferred to a buffer memory that can be read by the second processor.

本願請求項7に係る発明は、前記バッファメモリは、前記コードジェネレータで生成したコードを第2のプロセッサから見てメモリ空間に配置されているように見える、ことを特徴とする前記請求項5または6に記載のプログラマブルコントローラである。   The invention according to claim 7 of the present application is characterized in that the buffer memory seems to be arranged in a memory space when the code generated by the code generator is viewed from a second processor. 6. The programmable controller according to 6.

本発明により、専用プロセッサ(ASIC)と汎用プロセッサ(CPU)のそれぞれの利点を生かしたまま、シーケンスプログラムで使用する汎用プロセッサが実行するべき命令の処理時間が確実に短縮することを可能とするプログラマブルコントローラを提供することができる。   According to the present invention, it is possible to reliably reduce the processing time of instructions to be executed by a general-purpose processor used in a sequence program, while taking advantage of the advantages of a dedicated processor (ASIC) and a general-purpose processor (CPU). A controller can be provided.

本発明に基づくプログラマブルコントローラのブロック図である。It is a block diagram of the programmable controller based on this invention. バッファ15の内容の一例を示す図である。5 is a diagram illustrating an example of contents of a buffer 15. FIG. 従来技術に基づくプログラマブルコントローラのブロック図である。It is a block diagram of the programmable controller based on a prior art.

以下、本発明のプログラマブルコントローラの一実施形態について図面とともに説明する。   Hereinafter, an embodiment of a programmable controller of the present invention will be described with reference to the drawings.

図1は、本発明のプログラマブルコントローラの概略ブロック図である。
プログラマブルコントローラ100は、専用プロセッサ10、汎用プロセッサ20、および、メインメモリ30、バス40、バス50を備えている。
FIG. 1 is a schematic block diagram of a programmable controller of the present invention.
The programmable controller 100 includes a dedicated processor 10, a general-purpose processor 20, a main memory 30, a bus 40, and a bus 50.

専用プロセッサ10は、演算処理回路11、演算データ格納用メモリ12、調停回路13、I/F14、バッファ15、インストラクションデコーダ16、コードジェネレータ17、バッファ18を備えている。演算処理回路11は、専用プロセッサが実行するべき命令、例えば1ビットデータに対する演算処理などを行う回路である。演算データ格納用メモリ12は、演算処理の対象となる被演算データを格納している。調停回路13は、演算データ格納用メモリ12への書き込み読み出しを制御している。I/F14は、専用プロセッサ10がメインメモリ30からシーケンスプログラムコードを取り出す時、および汎用プロセッサ20からの演算結果を受け取る時に用いられるインタフェース回路である。バッファ15は、コードジェネレータ17が生成したロード・分岐命令を汎用プロセッサ20に転送する際に用いられるバッファメモリであり、バッファ15の本体は例えば数段のFIFOにより構成されている。インストラクションデコーダ16は、メインメモリ30から取り出した命令をデコードする機能を有する。コードジェネレータ17は、汎用プロセッサ20が実行するべきコードがフェッチされた時に汎用プロセッサ20が実行するロード・分岐命令を生成して汎用プロセッサ20に転送する機能を有する。バッファ18は、汎用プロセッサ20が命令を実行した結果を演算データ格納用メモリ12に書き込む際にライトバッファとして用いられる。   The dedicated processor 10 includes an arithmetic processing circuit 11, an arithmetic data storage memory 12, an arbitration circuit 13, an I / F 14, a buffer 15, an instruction decoder 16, a code generator 17, and a buffer 18. The arithmetic processing circuit 11 is a circuit that performs arithmetic processing on an instruction to be executed by a dedicated processor, for example, 1-bit data. The calculation data storage memory 12 stores calculation target data to be subjected to calculation processing. The arbitration circuit 13 controls writing / reading to / from the arithmetic data storage memory 12. The I / F 14 is an interface circuit that is used when the dedicated processor 10 takes out the sequence program code from the main memory 30 and receives an operation result from the general-purpose processor 20. The buffer 15 is a buffer memory used when the load / branch instruction generated by the code generator 17 is transferred to the general-purpose processor 20, and the main body of the buffer 15 is composed of, for example, several stages of FIFOs. The instruction decoder 16 has a function of decoding an instruction fetched from the main memory 30. The code generator 17 has a function of generating a load / branch instruction to be executed by the general-purpose processor 20 and transferring the code to the general-purpose processor 20 when a code to be executed by the general-purpose processor 20 is fetched. The buffer 18 is used as a write buffer when the result of the instruction executed by the general-purpose processor 20 is written in the arithmetic data storage memory 12.

汎用プロセッサ20は、専用プロセッサが実行できない命令であって汎用プロセッサが実行するべき命令(以下、機能命令と呼ぶ)を実行する。本実施形態では、汎用プロセッサ20は専用プロセッサと2つのバスを介して接続されている。1つはPCI−Expressなどにより実現されるバス40である。バス40は、バッファ15と接続されており、汎用プロセッサ20が機能命令をバッファ15から読みだすために用いられる。もう一つはバス50であり、汎用プロセッサ20が、メインメモリからの機能命令関数コードを読み出す際、および機能命令を実行した結果を専用プロセッサ10のバッファ18に書き込む際に用いる。   The general-purpose processor 20 executes an instruction that cannot be executed by the dedicated processor and that should be executed by the general-purpose processor (hereinafter referred to as a function instruction). In this embodiment, the general-purpose processor 20 is connected to a dedicated processor via two buses. One is a bus 40 realized by PCI-Express or the like. The bus 40 is connected to the buffer 15, and is used by the general-purpose processor 20 to read a function instruction from the buffer 15. The other is a bus 50, which is used when the general-purpose processor 20 reads a function instruction function code from the main memory and writes a result of executing the function instruction into the buffer 18 of the dedicated processor 10.

メインメモリ30は、専用プロセッサ10によって実行されるシーケンスプログラムコードと、汎用プロセッサ20により実行される機能命令関数コードを記憶している。本実施形態では、メインメモリ30は、バス50を介して専用プロセッサ10、汎用プロセッサ20と接続されている。   The main memory 30 stores a sequence program code executed by the dedicated processor 10 and a function instruction function code executed by the general-purpose processor 20. In the present embodiment, the main memory 30 is connected to the dedicated processor 10 and the general-purpose processor 20 via the bus 50.

また、コードジェネレータが生成してバッファ15に転送された各コードが汎用プロセッサから見てメモリ上のコード領域に配置されているように見えるようにするために、例えばバッファ15のアドレス空間はメモリ上のアドレス空間の一部にマッピングされている。このような構成とすることで、コードジェネレータが生成してバッファ15に転送されたコードは、汎用プロセッサから見てメモリ空間上のコード領域に配置されているように見えるので、汎用プロセッサはこれら各コードを直接実行することができる。   Further, in order to make each code generated by the code generator and transferred to the buffer 15 appear to be arranged in the code area on the memory when viewed from the general-purpose processor, for example, the address space of the buffer 15 is stored on the memory. Is mapped to a part of the address space. With this configuration, the code generated by the code generator and transferred to the buffer 15 seems to be arranged in the code area on the memory space as seen from the general-purpose processor. The code can be executed directly.

次に、上記ハードウェア構成を備えたプログラマブルコントローラ100におけるシーケンスプログラムの実行処理について説明する。   Next, a sequence program execution process in the programmable controller 100 having the above hardware configuration will be described.

本実施形態におけるプログラマブルコントローラでは、「シーケンスプログラムコード」と「汎用プロセッサ20の命令セットにより構成されるコード」の2種類のプログラムコードを扱う。シーケンスプログラムコードは、専用プロセッサ10で直接実行でき、汎用プロセッサ20では実行できないコードである。シーケンスプログラムコードは、汎用プロセッサ20で実行する命令の種類、被演算データのアドレス情報・サイズ・形式(バイナリ形式、BCD形式など)を示す中間コードを含んでいる。一方、汎用プロセッサ20の命令セットにより構成されるコードは、汎用プロセッサ20で直接実行でき、専用プロセッサ10では実行できないコードである。   The programmable controller in the present embodiment handles two types of program codes: “sequence program code” and “code configured by the instruction set of the general-purpose processor 20”. The sequence program code is a code that can be directly executed by the dedicated processor 10 and cannot be executed by the general-purpose processor 20. The sequence program code includes an intermediate code indicating the type of instruction executed by the general-purpose processor 20 and the address information / size / format (binary format, BCD format, etc.) of the operation data. On the other hand, the code configured by the instruction set of the general-purpose processor 20 is a code that can be directly executed by the general-purpose processor 20 and cannot be executed by the dedicated processor 10.

専用プロセッサ10は、汎用プロセッサ20により実行されるべき機能命令が発生していないときは、バッファ15に対して「NOP(No−Operation)」命令コードを書き込んでいる。また、バッファメモリの見かけのメモリサイズ(汎用プロセッサ20から見た場合のメモリサイズ)に応じてnバイト毎にバッファメモリの先頭アドレスに戻るための分岐命令が記録されている。例えば、汎用プロセッサ20の命令セットの命令長が4バイト、バッファメモリの見かけのサイズを64バイトとする場合には、64バイト(16命令)毎にバッファ先頭アドレスへの分岐命令コード「BL StartAddress」を挿入する。この場合、汎用プロセッサ20から見たコード領域としてのバッファ15は、例えば図2(a)に示すような状態になる。   The dedicated processor 10 writes a “NOP (No-Operation)” instruction code in the buffer 15 when a functional instruction to be executed by the general-purpose processor 20 is not generated. A branch instruction for returning to the start address of the buffer memory is recorded every n bytes according to the apparent memory size of the buffer memory (memory size as viewed from the general-purpose processor 20). For example, when the instruction length of the instruction set of the general-purpose processor 20 is 4 bytes and the apparent size of the buffer memory is 64 bytes, the branch instruction code “BL StartAddress” to the buffer head address every 64 bytes (16 instructions) Insert. In this case, the buffer 15 as a code area viewed from the general-purpose processor 20 is in a state as shown in FIG.

専用プロセッサ10はメインメモリ30から外部バス50を介してプログラムコードをフェッチする。フェッチされたプログラムコードがシーケンスプログラムコードである場合は専用プロセッサで実行処理が行われる。一方で、フェッチされたプログラムコードが汎用プロセッサ20が実行処理するべき命令である場合には当該命令コードから命令の種類、被演算データのアドレス情報・サイズ・形式などの情報をデコードし、これらデコードされた各情報を用いてコードジェネレータ17は以下の処理を行う。
ステップ1:デコードされた被演算データのアドレス情報・サイズ・形式に基づいて演算データ格納用メモリ12から必要な被演算データを読み出す。
ステップ2:デコードされた命令の種類に基づいて該当命令の処理関数が格納されているメモリのアドレスを算出する。
ステップ3:ステップ1,2で得られた被演算データおよびアドレスを用いて汎用プロセッサ20の命令セット(「被演算データを汎用プロセッサ20の汎用レジスタにロードする命令コード」および「該当命令の処理関数が格納されているアドレスに分岐する命令コード」)を生成する。
ステップ4:ステップ3で生成した命令コードを汎用プロセッサ20へバッファ15を介して転送する。
ここで、バッファ15は例えば2バンクで構成し、一方のバッファへの命令コードの書き込みが完了したらこれを汎用プロセッサ20に転送するなどの方法により、ステップ3で生成した命令コードをバッファ15へ書き込むタイミングと、バッファ15のデータを汎用プロセッサ20へ転送するタイミングが重ならないようにする。
The dedicated processor 10 fetches the program code from the main memory 30 via the external bus 50. When the fetched program code is a sequence program code, execution processing is performed by a dedicated processor. On the other hand, when the fetched program code is an instruction to be executed by the general-purpose processor 20, information such as the instruction type and the address information, size, and format of the operation data is decoded from the instruction code. The code generator 17 performs the following processing using each piece of information.
Step 1: Necessary operation data is read from the operation data storage memory 12 based on the address information, size, and format of the decoded operation data.
Step 2: Calculate the address of the memory storing the processing function of the corresponding instruction based on the decoded instruction type.
Step 3: The instruction set of the general-purpose processor 20 (“instruction code for loading the operand data into the general-purpose register of the general-purpose processor 20” and “processing function of the corresponding instruction) using the arithmetic-operation data and the address obtained in steps 1 and 2 The instruction code that branches to the address where "is stored") is generated.
Step 4: The instruction code generated in Step 3 is transferred to the general-purpose processor 20 via the buffer 15.
Here, the buffer 15 is composed of, for example, two banks, and the instruction code generated in step 3 is written to the buffer 15 by a method such as transferring the instruction code to the general-purpose processor 20 when writing of the instruction code to one buffer is completed. The timing is not overlapped with the timing at which the data in the buffer 15 is transferred to the general-purpose processor 20.

コードジェネレータ17によって生成された命令コードが転送されると、汎用プロセッサ20から見たコード領域としてのバッファ15は例えば図2(b)に示すような状態になる。ここで、「LD Data_A, GPR_1」「LD Data_B, GPR_2」「LD Data_C, GPR_3」は被演算データData_A,Data_B,Data_Cを、それぞれ汎用プロセッサ20が備える汎用レジスタGPR_1,GPR_2,GPR_3にロードする命令である。また「BL InstAddress」は、該当する命令処理関数が格納されているメインメモリ30のアドレスへと分岐する分岐命令コードである。   When the instruction code generated by the code generator 17 is transferred, the buffer 15 as a code area viewed from the general-purpose processor 20 is in a state as shown in FIG. Here, "LD Data_A, GPR_1", "LD Data_B, GPR_2", and "LD Data_C, GPR_3" are instructions for loading the operation data Data_A, Data_B, Data_C into the general registers GPR_1, GPR_2, GPR_3 provided in the general processor 20, respectively. is there. “BL InstAddress” is a branch instruction code that branches to an address of the main memory 30 in which the corresponding instruction processing function is stored.

そして、汎用プロセッサ20は専用プロセッサ10により生成されたプログラムコードをバッファ15から読み出して順次実行する。機能命令処理に当たると、バッファ15に図2(b)のようにロード命令、分岐命令が書き込まれるので、汎用プロセッサ20がこれを実行することにより該当機能命令関数コードに分岐し、汎用プロセッサ20が備える汎用レジスタから被演算データを取り出して演算処理を実行する。   Then, the general-purpose processor 20 reads out the program code generated by the dedicated processor 10 from the buffer 15 and sequentially executes it. When the function instruction processing is performed, a load instruction and a branch instruction are written in the buffer 15 as shown in FIG. 2B. Therefore, the general-purpose processor 20 executes this to branch to the corresponding function instruction function code, and the general-purpose processor 20 The operation data is extracted from the general-purpose register provided and the operation process is executed.

汎用プロセッサ20は演算処理終了後、演算結果をバス50を介して専用プロセッサ10に内蔵されたバッファ18に書き込み、その後演算結果はバッファ18から演算データ格納用メモリ12に格納される。   After the arithmetic processing is completed, the general-purpose processor 20 writes the operation result to the buffer 18 built in the dedicated processor 10 via the bus 50, and then the operation result is stored from the buffer 18 into the operation data storage memory 12.

以上のように、汎用プロセッサ20による機能命令の実行時に、これまで処理時間中大きな割合を占めていた低速なメモリアクセス処理が発生しないため、機能命令を従来よりも高速に処理することができる。   As described above, when the general-purpose processor 20 executes the function instruction, the low-speed memory access process that has been a large proportion of the processing time does not occur so that the function instruction can be processed at a higher speed than in the past.

10 専用プロセッサ
11 演算処理回路
12 演算データ格納用メモリ
13 調停回路
14 I/F
15 バッファ
16 インストラクションデコーダ
17 コードジェネレータ
18 バッファ
20 汎用プロセッサ
30 メインメモリ
40 バス
50 バス
100 プログラマブルコントローラ
10 Dedicated Processor 11 Arithmetic Processing Circuit 12 Arithmetic Data Storage Memory 13 Arbitration Circuit 14 I / F
15 Buffer 16 Instruction decoder 17 Code generator 18 Buffer 20 General-purpose processor 30 Main memory 40 Bus 50 Bus 100 Programmable controller

Claims (7)

シーケンスプログラムを実行するプログラマブルコントローラにおいて、
所定の第1の命令を実行する第1のプロセッサと、
前記第1のプロセッサで実行できない第2の命令を実行する第2のプロセッサとを有し、
前記第1のプロセッサは、
前記第1の命令および前記第2の命令の実行時に用いられる被演算データを格納するメモリと、
前記シーケンスプログラムを構成する命令コードに含まれる前記第2のプロセッサが処理する命令に関する情報をデコードするデコード回路と、
前記メモリから前記被演算データを、前記デコード回路によりデコードされた被演算データのアドレス情報に基づいて読み出すメモリアクセス回路を内蔵するコードジェネレータとを有する、
ことを特徴とするプログラマブルコントローラ。
In a programmable controller that executes a sequence program,
A first processor for executing a predetermined first instruction;
A second processor that executes a second instruction that cannot be executed by the first processor;
The first processor is
A memory for storing operation data to be used when executing the first instruction and the second instruction;
A decoding circuit for decoding information related to an instruction to be processed by the second processor included in an instruction code constituting the sequence program;
A code generator including a memory access circuit that reads out the operation data from the memory based on address information of the operation data decoded by the decoding circuit;
A programmable controller characterized by that.
前記コードジェネレータは、前記第2のプロセッサが処理する命令を実行するための関数が格納されているメモリ上のアドレスを算出するアドレス変換回路を有する、
ことを特徴とする請求項1に記載のプログラマブルコントローラ。
The code generator includes an address conversion circuit that calculates an address on a memory in which a function for executing an instruction processed by the second processor is stored.
The programmable controller according to claim 1.
前記コードジェネレータは、前記被演算データと前記第2のプロセッサのロード命令コードを組み合わせて、前記第2のプロセッサが前記被演算データを前記第2のプロセッサの汎用レジスタにロードするロード命令を生成する、
ことを特徴とする請求項1に記載のプログラマブルコントローラ。
The code generator combines the operand data and the load instruction code of the second processor, and generates a load instruction for the second processor to load the operand data into a general-purpose register of the second processor. ,
The programmable controller according to claim 1.
前記コードジェネレータは、関数が格納されているメモリ上のアドレスデータと前記第2のプロセッサの分岐命令コードを組み合わせて、前記第2のプロセッサが実行するべき命令に該当する関数に分岐するための分岐命令を生成する、
ことを特徴とする請求項1に記載のプログラマブルコントローラ。
The code generator is a branch for branching to a function corresponding to an instruction to be executed by the second processor by combining address data on a memory storing a function and a branch instruction code of the second processor Generate instructions,
The programmable controller according to claim 1.
前記コードジェネレータは、前記第2のプロセッサがシーケンスプログラムを実行するのに必要な前記第2のプロセッサが実行できる前記第2の命令の命令コードを生成し、この命令コードを前記第2のプロセッサが読みだすことができるバッファメモリに転送する、
ことを特徴とする請求項1に記載のプログラマブルコントローラ。
The code generator generates an instruction code of the second instruction that can be executed by the second processor, which is necessary for the second processor to execute a sequence program, and the instruction code is generated by the second processor. Transfer to a buffer memory that can be read,
The programmable controller according to claim 1.
前記コードジェネレータは、シーケンスプログラムから前記第2のプロセッサが実行するべき前記第2の命令をフェッチした時以外は、前記第2のプロセッサのNOP(No Operation)コードを生成し、この命令コードを前記第2のプロセッサが読みだすことができるバッファメモリに転送する、
ことを特徴とする請求項1に記載のプログラマブルコントローラ。
The code generator generates a NOP (No Operation) code of the second processor, except when the second instruction to be executed by the second processor is fetched from a sequence program. Transfer to a buffer memory that the second processor can read;
The programmable controller according to claim 1.
前記バッファメモリは、前記コードジェネレータで生成したコードを第2のプロセッサから見てメモリ空間に配置されているように見える、
ことを特徴とする請求項5または6に記載のプログラマブルコントローラ。
The buffer memory seems to be arranged in a memory space when the code generated by the code generator is viewed from a second processor.
The programmable controller according to claim 5 or 6, wherein the programmable controller.
JP2014091226A 2014-04-25 2014-04-25 Programmable controller that does not generate external memory access for data read Active JP6294142B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014091226A JP6294142B2 (en) 2014-04-25 2014-04-25 Programmable controller that does not generate external memory access for data read

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014091226A JP6294142B2 (en) 2014-04-25 2014-04-25 Programmable controller that does not generate external memory access for data read

Publications (2)

Publication Number Publication Date
JP2015210628A true JP2015210628A (en) 2015-11-24
JP6294142B2 JP6294142B2 (en) 2018-03-14

Family

ID=54612772

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014091226A Active JP6294142B2 (en) 2014-04-25 2014-04-25 Programmable controller that does not generate external memory access for data read

Country Status (1)

Country Link
JP (1) JP6294142B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH036705A (en) * 1989-06-05 1991-01-14 Hitachi Seiki Co Ltd Sequence controller
JPH05341820A (en) * 1992-06-05 1993-12-24 Fuji Electric Co Ltd Arithmetic processing method for programmable controller
JP2008226276A (en) * 2008-06-09 2008-09-25 Matsushita Electric Works Ltd Programmable controller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH036705A (en) * 1989-06-05 1991-01-14 Hitachi Seiki Co Ltd Sequence controller
JPH05341820A (en) * 1992-06-05 1993-12-24 Fuji Electric Co Ltd Arithmetic processing method for programmable controller
JP2008226276A (en) * 2008-06-09 2008-09-25 Matsushita Electric Works Ltd Programmable controller

Also Published As

Publication number Publication date
JP6294142B2 (en) 2018-03-14

Similar Documents

Publication Publication Date Title
JP6274672B2 (en) Apparatus and method
TWI476597B (en) Data processing apparatus and semiconductor integrated circuit device
WO2017185396A1 (en) Device and method for use in executing matrix addition/subtraction operations
US10261796B2 (en) Processor and method for executing in-memory copy instructions indicating on-chip or off-chip memory
CN109508206B (en) Processor, method and system for mode dependent partial width loading of wider registers
CN107315717B (en) Device and method for executing vector four-rule operation
KR20170098803A (en) Systems, apparatuses, and methods for data speculation execution
JP5947879B2 (en) System, apparatus, and method for performing jump using mask register
JP2017016712A5 (en) Method, processor and system
KR20170099872A (en) Systems, apparatuses, and methods for data speculation execution
JP2018500630A (en) 4D Morton coordinate transformation processor, method, system, and instructions
JP2013543175A5 (en)
TW201411481A (en) Instruction-optimizing processor with branch-count table in hardware
KR20170097621A (en) Method and apparatus for performing conflict detection
JPH03158928A (en) Data processor
TW201516864A (en) Multi-threaded GPU pipeline
JP4243271B2 (en) Data processing apparatus and data processing method
CN108959180B (en) Data processing method and system
KR102152735B1 (en) Graphic processor and method of oprating the same
JP6294142B2 (en) Programmable controller that does not generate external memory access for data read
JP2008299729A (en) Processor
JP2015161997A (en) Programmable controller having instruction cache for quickly processing branch instruction
US20140365751A1 (en) Operand generation in at least one processing pipeline
CN111752614A (en) Processor, instruction execution equipment and method
US11080054B2 (en) Data processing apparatus and method for generating a status flag using predicate indicators

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161116

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170815

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170822

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171016

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180215

R150 Certificate of patent or registration of utility model

Ref document number: 6294142

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150