JP2006222627A - Data processing module and managing method for transmission/reception message thereof - Google Patents
Data processing module and managing method for transmission/reception message thereof Download PDFInfo
- Publication number
- JP2006222627A JP2006222627A JP2005033014A JP2005033014A JP2006222627A JP 2006222627 A JP2006222627 A JP 2006222627A JP 2005033014 A JP2005033014 A JP 2005033014A JP 2005033014 A JP2005033014 A JP 2005033014A JP 2006222627 A JP2006222627 A JP 2006222627A
- Authority
- JP
- Japan
- Prior art keywords
- buffer
- message
- pointer
- data processing
- history
- 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
- Information Transfer Systems (AREA)
- Small-Scale Networks (AREA)
Abstract
Description
本発明は、データ処理モジュール及びその送受信メッセージの管理方法に関する。 The present invention relates to a data processing module and a method for managing transmission / reception messages thereof.
近年、通信プロトコルとして、マルチマスタの通信プロトコルが注目されている。マルチマスタのプロトコルでは、バスが解放されているとき、バスに接続されている複数の通信ノードのいずれもがデータをバス上に送信することができ、システムの柔軟性が高い等の特徴を持っている。このようなマルチマスタの通信プロトコルとして、自動車内のECU(電子制御ユニット)間のシリアル通信プロトコルとして用いられている、特開昭61−195453号公報に記載されたマルチマスタのCAN(Controller Area Network、以下、CANという)プロトコル(ISO11898、ISO11519シリーズで規格化)が知られている。このようなマルチマスタの通信プロトコルは、通信ノードの増減が簡単にできる等システムの柔軟性が高いため、上記した自動車分野に止まらず、FA(Factory Automation)、船舶、医療機器といった分野の通信プロトコルとしても有望視されている。 In recent years, multi-master communication protocols have attracted attention as communication protocols. In the multi-master protocol, when the bus is released, any of a plurality of communication nodes connected to the bus can transmit data on the bus, and the system is highly flexible. ing. As such a multi-master communication protocol, a multi-master CAN (Controller Area Network) described in Japanese Patent Application Laid-Open No. 61-195453 is used as a serial communication protocol between ECUs (electronic control units) in an automobile. , Hereinafter referred to as CAN) (standardized by ISO 11898 and ISO 11519 series) is known. Such a multi-master communication protocol has high system flexibility such that communication nodes can be easily increased / decreased. Therefore, the multi-master communication protocol is not limited to the automobile field described above, but is a communication protocol in fields such as FA (Factor Automation), ships, and medical devices. As promising.
図12は、通信ノードとしてのCANの概略構成を表した図である。サブネットワークを構成するCANバス(図示せず)に接続されるCANトランシーバ60を有するCANモジュール11、1n、16を接続することが可能となっており、各CANモジュール11、1n、16がCPU I/F(インタフェース)40を介して、メッセージを送受信することが可能となっている。また、図12のCANモジュール19は、メッセージの受信のみを行うことが可能となっている。
CANプロトコルでは、特許文献1の30頁左下欄5)−1.1.4送信されるべきであるメッセージの待ち行列、及び同文献35頁左下欄5)−3.6 探索プロセス以下に示されたとおりメッセージ送信に先だって、送信要求ビットがセットされたバッファの中から送信候補メッセージを決定する送信サーチプロセスが行われる。また、メッセージを受信した場合も、特許文献1の30頁左下欄5)−1.1.5受信メッセージの待ち行列及び同文献35頁右上欄5)−3 データ交換DPRAM以下に示されたとおり受信メッセージの識別子がメッセージバッファ(同公報でいうDPRAM)に格納されているかどうか、を判定するため受信サーチプロセスが行われ、メッセージバッファに記憶する場合は割り込み要求ビットがセットされる。 In the CAN protocol, page 30, lower left column 5) -1.1.4 queue of messages to be transmitted, and page 35, lower left column 5) -3.6 The search process is shown below. As described above, prior to message transmission, a transmission search process is performed to determine a transmission candidate message from the buffer in which the transmission request bit is set. In addition, even when a message is received, page 30, lower left column 5) -1.1.5 queue of received messages and page 35, upper right column 5) -3 data exchange DPRAM as shown below A reception search process is performed to determine whether or not the identifier of the received message is stored in the message buffer (DPRAM as referred to in the same publication). When the received message identifier is stored in the message buffer, an interrupt request bit is set.
図13は、CANモジュールに備えられるメッセージバッファの構成を表した図であり、図14は、メッセージを受信した際の受信割り込み発生以降の動作を表したフローチャートである。従来は、図14に示されたとおり、受信割り込みの発生後(ステップS101)、CPUがすべての受信バッファにリードアクセスし(ステップS102)、各バッファが更新されたか否かを表すDNビット(データ更新ビット)の状態を確認して受信バッファの特定を行っていた(ステップS103)。また、送信プロセスも同様であり、すべてのバッファの探索を行って、TRQビット(送信要求ビット)の状態を確認して送信したバッファの特定を行っていた。 FIG. 13 is a diagram showing a configuration of a message buffer provided in the CAN module, and FIG. 14 is a flowchart showing an operation after a reception interrupt is generated when a message is received. Conventionally, as shown in FIG. 14, after the occurrence of a reception interrupt (step S101), the CPU performs read access to all reception buffers (step S102), and a DN bit (data) indicating whether or not each buffer has been updated. The status of the (update bit) is confirmed and the reception buffer is specified (step S103). The transmission process is the same, and all buffers are searched, the state of the TRQ bit (transmission request bit) is confirmed, and the transmitted buffer is specified.
図15上段の(A)は、CANによる受信書き込み(Rx)終了後の受信完了割込信号にCPUが追従できている場合のタイミングチャートであり、同図下段の(B)は、CANによる受信書き込み(Rx)終了後の受信完了割込信号にCPUが追従できなくなった状態のタイミングチャートである。同図(A)に表されたように、従来の方式は、その都度すべてのバッファをリードする必要があるため、バッファの特定に時間がかかり、CPUへの負荷も高い。更に同図(B)に表されたように、受信が先行しバッファの特定が遅れた場合には、複数のバッファでDNビット=1が検知され、送受信された順番がCPUからわからなくなってしまうという問題点があった。 (A) in the upper part of FIG. 15 is a timing chart in the case where the CPU can follow the reception completion interrupt signal after completion of reception writing (Rx) by CAN, and (B) in the lower part of FIG. 15 is reception by CAN. It is a timing chart of the state which became impossible for CPU to follow the reception completion interruption signal after completion | finish of writing (Rx). As shown in FIG. 5A, the conventional method needs to read all the buffers each time, so that it takes time to specify the buffers and the load on the CPU is high. Further, as shown in FIG. 5B, when reception precedes and buffer specification is delayed, DN bit = 1 is detected in a plurality of buffers, and the order of transmission / reception is lost from the CPU. There was a problem.
また、CANでは、予め送信/受信サーチを行ってからメッセージバッファの位置を指定しメッセージのリード/ライトを行っており、メッセージバッファ上のバッファ位置から、送受信が行われた順序を特定することができないという事情がある。また、上記した問題点は、送信のメッセージの順序を把握する際にも生じるものであり、複数の送信バッファないし受信バッファを備え、ダイレクトに位置を指定してリード/ライトを行う構成であれば、少なからず発生するものであるといえる。 In addition, the CAN performs a transmission / reception search in advance and then designates the position of the message buffer to read / write the message. The order in which transmission / reception is performed can be specified from the buffer position on the message buffer. There is a circumstance that cannot be done. The above-mentioned problem also occurs when grasping the order of messages to be transmitted. If the configuration includes a plurality of transmission buffers or reception buffers and performs direct read / write by specifying a position. It can be said that this is not a problem.
本発明の第1の視点によれば、上述したCANに代表されるマルチマスタ方式のネットワークに接続されたデータ処理モジュールに、メッセージバッファ上の更新メッセージの位置を示す履歴情報を所定回数分格納可能な履歴バッファを備えて、メッセージの送受信順序を特定可能な送受信メッセージの管理方法が提供される。この方法によれば、まず、データ処理モジュール(CANモジュール)のメッセージハンドリング部は、まず任意のメッセージバッファの任意のバッファの更新を行った際に、該更新が行われたバッファの位置情報を、前記履歴バッファの次書き込み位置に格納(記録)する。また、前記メッセージハンドリング部は、CPU(Central Processing Unit)からのリードアクセスに応じて、前記履歴バッファのうちCPUから未参照の履歴情報の位置を示す未読ポインタを逐次更新する。前記履歴バッファの直近書き込み位置と未読ポインタは、CPUから参照可能であり、それぞれ、最新メッセージや最古の未読メッセージの格納位置を特定することが可能となる。 According to the first aspect of the present invention, history information indicating the position of an update message on a message buffer can be stored a predetermined number of times in a data processing module connected to a multi-master network represented by the above-mentioned CAN. There is provided a method for managing transmitted / received messages, which includes a simple history buffer and can specify the order of transmitting / receiving messages. According to this method, first, when the message handling unit of the data processing module (CAN module) first updates an arbitrary buffer of an arbitrary message buffer, the position information of the updated buffer is obtained as follows: Store (record) at the next writing position of the history buffer. In addition, the message handling unit sequentially updates an unread pointer indicating the position of history information unreferenced from the CPU in the history buffer in response to a read access from a CPU (Central Processing Unit). The latest write position and unread pointer in the history buffer can be referred to from the CPU, and the storage position of the latest message and the oldest unread message can be specified.
また、本発明の第2の視点によれば、上述の送受信メッセージの管理方法を実施するために適した構成、回路構成を備えたデータ処理モジュール(CANモジュール)が提供される。即ち、このデータ処理モジュール(CANモジュール)は、複数のバッファによって構成されて、送信するメッセージ及び受信したメッセージを複数バッファ可能なメッセージバッファと、少なくとも、受信メッセージが記憶されているバッファの番地と前記受信メッセージが受信された順番を保持・管理する履歴バッファと、メッセージバッファ上のメッセージの管理を行うメッセージハンドリング部とを備える。 Further, according to the second aspect of the present invention, there is provided a data processing module (CAN module) having a configuration and a circuit configuration suitable for implementing the above-described transmission / reception message management method. That is, this data processing module (CAN module) is composed of a plurality of buffers, a message buffer capable of buffering a plurality of messages to be transmitted and received, a buffer address storing at least the received message, It includes a history buffer that holds and manages the order in which received messages are received, and a message handling unit that manages messages on the message buffer.
本発明によれば、処理すべきバッファを速やかに特定可能となり、CPUへの負荷及び、バッファの特定に遅れが生じる可能性を減ずることができる。また仮に、バッファの特定に遅れが生じた場合にも、送受信の順序を履歴バッファによって追跡し、処理漏れを無くすことが可能となる。 According to the present invention, it is possible to quickly specify a buffer to be processed, and it is possible to reduce the load on the CPU and the possibility of delay in specifying the buffer. In addition, even if there is a delay in specifying the buffer, the transmission / reception order can be traced by the history buffer, and processing omission can be eliminated.
続いて、本発明を実施するための最良の形態について図面を参照して詳細に説明する。図1は、本実施の形態に係るCANモジュール(データ処理モジュール)とCPU51、RAM52、周辺回路53を1チップで構成したCANデバイス100の概略構成を表した図である。例えば、周辺回路53は、I/O回路を含み、CANデバイス100の外部に設けられた各種センサ及び表示装置と接続され外部と内部との間のインターフェースを行い、CPU51は、各種センサからのデータをI/Oを介して取り出すと共にRAMを利用して所望の処理を実行してメッセージバッファに書き込む処理及びメッセージバッファに書き込まれたメッセージを取り出し所望の処理を実行した後I/Oを介して外部に接続された表示装置にデータを送信する処理等を行う。
Next, the best mode for carrying out the present invention will be described in detail with reference to the drawings. FIG. 1 is a diagram illustrating a schematic configuration of a
CANモジュールは、メッセージハンドリング部2と、メッセージバッファ3と、CANプロトコル送信層4、マスクセット5、後述するCAN書き込みポインタにてリング状に書き込み制御されるリングバッファ6で構成された履歴バッファを備えている。
The CAN module includes a history buffer composed of a
図2は、上述したCANモジュールのメッセージハンドリング部2の詳細構成を表した図である。図2を参照すると、メッセージハンドリング部2は、メッセージの送受信に必要な構成のほか、履歴情報提供機能を実現すべく、メッセージバッファ3及びリングバッファ6と接続され、メッセージバッファ3からデータを読み出すためのデータ処理回路、データを破壊されないようにするデータ保護回路として、フリップフロップ回路で構成されたCAN書き込みポインタ21、最古(未読)履歴情報ポインタ23を備え、更に、前記各ポインタの内容に従属する最新履歴情報ポインタ22、履歴無効フラグ24、オーバーフローフラグ25とを含んで構成される。また、図中2重線で囲まれた最新履歴情報ポインタ22、最古(未読)履歴情報ポインタ23、履歴無効フラグ24、オーバーフローフラグ25が、CPU51から見える状態に保持される。
FIG. 2 is a diagram showing a detailed configuration of the
メッセージハンドリング部2は、メッセージバッファ3の所定バッファにメッセージ書き込みが完了すると、CAN書き込みポインタ21の値に基づいて、リングバッファ6に履歴情報(当該バッファのメッセージ番号)を記録する。最新履歴情報ポインタ22は、CAN書き込みポインタ21が示す位置の一つ前の位置を示し、直近に(一番最近に)書き込みが行われたバッファのメッセージ番号が格納される。また、最古(未読)履歴情報ポインタ23は、初期状態においては、CAN書き込みポインタ21と一致するが、CPU51からのリードアクセスと連動し、常に最も古く未読の履歴情報が示されるように遷移していく。
When message writing is completed in a predetermined buffer of the
また、履歴無効フラグ24は、リングバッファ6の資源が全く使われていない状態を示す。例えば、履歴無効フラグ24は、CAN書き込みポインタ21=最古(未読)履歴情報ポインタ23である場合にオン状態レベル「1」に設定され、CAN書き込みポインタ21≠最古(未読)履歴情報ポインタ23である場合にオフ状態レベル「0」に設定される。また、オーバーフローフラグ25は、リングバッファ6の資源が使われた状態を示す。例えば、オーバーフローフラグ25は、CAN書き込みポインタ21が最古(未読)履歴情報ポインタ23から一つ前の位置と一致する場合にオン状態レベル「1」に設定され、それ以外の場合にオフ状態レベル「0」に設定される。
The history
図3は、メッセージバッファとリングバッファの構成を表した図である。図3を参照すると、メッセージバッファ3は、メッセージ優先度を表す識別子(ID)、送信要求メッセージであるか否かやメッセージ本文長を指定するコントロールフィールド(制御セグメント)、メッセージ本文の順で所定数(n個)のメッセージをバッファ可能となっている。
FIG. 3 is a diagram illustrating the configuration of the message buffer and the ring buffer. Referring to FIG. 3, the
また、リングバッファ6は、RHL0からRHL23までのアドレスに24個の受信履歴情報(Reception History List)を格納可能な構成であり、リングバッファ6は、THL0からTHL7までのアドレスに8個の送信履歴情報(Transmission History List)を格納可能な構成となっている。例えば、リングバッファ6のRHL0にメッセージ番号#1、RHL1にメッセージ番号#m、RHL2にメッセージ番号#3が記録されているとすると、同図矢線に示された通り、メッセージバッファ3のメッセージ番号#1、メッセージ番号#m、メッセージ番号#3の順にメッセージが受信されたことを意味している。
The
CANプロトコル送信層4は、CANプロトコルに従ってCANトランシーバとデータの送受信を行う。マスクセット5は、メッセージの所定部分(例えばIDの一部)をマスクする際に用いられ、例えば、IDが2進数4ビットのデータであるとして、0〜31番地のメッセージバッファのn番地のメッセージバッファ3にIDの1100が割り振られていた場合において、上位2ビットにマスクをかけることによって1100以外に0000、0100、1000が番地のメッセージバッファに格納されることになるよう用いられる。
The CAN protocol transmission layer 4 transmits / receives data to / from the CAN transceiver according to the CAN protocol. The mask set 5 is used when masking a predetermined part of the message (for example, a part of the ID). For example, assuming that the ID is binary 4-bit data, the message at address n in the message buffer at
図4は、本実施の形態に係るCANモジュールにおいて、受信割り込みが発生した場合の動作を表した図である。図4を参照すると、CANモジュールによってメッセージバッファへの書き込みが行われ、受信割り込み信号がCPUに送信されると(ステップS001)、CPU51は、最古(未読)履歴情報ポインタ23で示された位置の最古(未読)履歴情報ポインタで示されるリングバッファの情報を読み出す(ステップS002)。上述のとおり、リングバッファ6は所定回数分(本実施の形態では23個)の履歴情報を記録可能であり、最古(未読)履歴情報ポインタの内容は、CPU51のリードアクセスと連動し、CPUは、最古(未読)履歴情報ポインタ23の内容にて、メッセージバッファ3の中で未だ参照されていない最古のバッファを特定することが可能となる(ステップS003)。
FIG. 4 is a diagram showing an operation when a reception interrupt occurs in the CAN module according to the present embodiment. Referring to FIG. 4, when writing to the message buffer is performed by the CAN module and a reception interrupt signal is transmitted to the CPU (step S001), the
図5は、本実施の形態のメッセージ受信時の動作を表したタイミングチャートである。同図上段(A)CPUがCANモジュールの受信動作に追従できている状態においても、多数のDNビットを読み出す処理が不要となるため、CPU処理時間を大幅に短縮し負荷を低減することが可能となっている。また、同図下段(B)CPUがCANモジュールの受信動作に追従できていない状態になると、図15(B)で説明したとおり従来であればメッセージの格納順序が不定となるところであるが、本発明では、メッセージの到着順序で整理した情報をCPUに与えることができる。従って、CPUにメッセージバッファに先に格納されたメッセージから順に着実に処理させることや、最新履歴情報を用いて、最後に受信したメッセージを最初に処理させることも可能となる。 FIG. 5 is a timing chart showing the operation when a message is received according to this embodiment. (A) Even when the CPU can follow the receiving operation of the CAN module, it is not necessary to read many DN bits, so the CPU processing time can be greatly shortened and the load can be reduced. It has become. Also, if the lower part (B) of the figure is in a state where the CPU cannot follow the reception operation of the CAN module, as described with reference to FIG. In the invention, information arranged in the order of arrival of messages can be given to the CPU. Therefore, it is possible to cause the CPU to steadily process the messages stored in the message buffer first, and to process the last received message first using the latest history information.
また、本実施の形態では、図6に示したとおり、受信用のリングバッファ61、送信用のリングバッファ62、そして、CAN読み出しポインタ、最新履歴情報ポインタ、最古(未読)履歴情報ポインタ、履歴無効フラグ、オーバフローフラグに対応するポインタ(送信の場合はCAN書き込みポインタはCAN読み出しポインタとなる)、フラグをそれぞれ備えることによって、CPUが、CANモジュールが送信したメッセージの順序をCPUに提供可能な構成も採用可能である。
In this embodiment, as shown in FIG. 6, the
[実施例] [Example]
続いて、上記した本発明の作用効果をより具体的に説明すべく、上述した構成による動作例について順を追って説明する。図7は、初期状態、即ち、リングバッファ6に履歴情報が格納されていない状態を表した図である。リングバッファ6のRHL0〜23は不定であり、CAN書き込みポインタ21及び最古(未読)履歴情報ポインタ23は、初期位置RHL0を指した状態となっている。また、最新履歴情報ポインタ22は、CAN書き込みポインタ21より一つ戻った位置RHL23を指している。この状態では、CAN書き込みポインタ21と最古(未読)履歴情報ポインタ23が一致するため履歴無効フラグ24が立てられている。
Subsequently, in order to more specifically describe the above-described operation and effect of the present invention, an operation example having the above-described configuration will be described in order. FIG. 7 is a diagram showing an initial state, that is, a state in which history information is not stored in the
図8は、図7の初期状態の後で、CANモジュールが2つのメッセージを受信し、最初のメッセージをバッファ#31に、次のメッセージをバッファ#1に格納した状態を表した図である。メッセージハンドリング部2によって、メッセージを格納したバッファの位置を示すメッセージ番号msg#31、msg#1がそれぞれRHL0、RHL1に記録されている。CAN書き込みポインタ21は、次に書き込むRHLを指しており、CPUのリードアクセスが行われていない現段階では最古(未読)履歴情報ポインタ23は、初期位置RHL0を指したままとなっている。また、最新履歴情報ポインタ22は、CAN書き込みポインタ21より一つ戻った位置RHL1を指している。この状態では、CAN書き込みポインタ21と最古(未読)履歴情報ポインタ23が一致しなくなったため履歴無効フラグ24はレベル「0」に変更される。従って、CPUとしては、履歴無効フラグ24により履歴情報が有効であることを確認し、最古(未読)履歴情報ポインタ23からメッセージ番号msg#31を、最新履歴情報ポインタ22からは、メッセージ番号msg#1を確認することが可能となっている。
FIG. 8 is a diagram showing a state where the CAN module receives two messages after the initial state of FIG. 7 and stores the first message in buffer # 31 and the next message in
図9は、図8のCANモジュールが2つのメッセージを受信した状態からCPUが一つのメッセージを読み出した状態を表した図である。CPUのリードアクセスが行われた結果、最古(未読)履歴情報ポインタ23が初期位置RHL0からRHL1に一つ移動している。一方、新たな履歴情報が書き込まれた訳ではないので、CAN書き込みポインタ21、最新履歴情報ポインタ22は移動していない。また、履歴無効フラグ24やオーバーフローフラグ25もレベル「0」のままである。この状態では、CPUは、履歴無効フラグ24により履歴情報が有効であることを確認し、最古(未読)履歴情報ポインタ23、最新履歴情報ポインタ22から、メッセージ番号msg#1を確認することが可能となっている。
FIG. 9 is a diagram illustrating a state where the CPU reads one message from the state where the CAN module of FIG. 8 has received two messages. As a result of the CPU read access, the oldest (unread)
図10は、CPUのリードアクセスに対し、CANモジュールのメッセージ受信が多数先行した結果、リングバッファ6の空きが無くなった直後の状態を表した図である。同図では、CAN書き込みポインタ21がRHL8を指しているので、CANモジュールがRHL7にメッセージ番号msg#9を書き込んだ直後の状態を表している。また、最古(未読)履歴情報ポインタ23はRHL9を指しており、RHL9〜23、及び、RHL0〜7までの履歴情報が未だリードされていない状態(最古(未読)履歴情報ポインタ23に対し、CAN書き込みポインタ21が約一周先行している)となっている。履歴無効フラグ24はレベル「0」のままであり、CPUは、履歴情報が有効であることを確認し、最古(未読)履歴情報ポインタ23から、メッセージ番号msg#5、最新履歴情報ポインタ22からメッセージ番号msg#9を確認することが可能となっている。また、この状態となると、CAN書き込みポインタ21(=RHL8)と最古(未読)履歴情報ポインタ23から一つ戻った位置(=(RHL9−1)=RHL8)が一致するためオーバーフローフラグ25が立てられている。
FIG. 10 is a diagram showing a state immediately after the
図11は、図10のオーバーフローが成立した状態から新たにメッセージを受信し、メッセージバッファに格納した状態を表した図である。オーバーフローフラグ25がレベル「1」の状態では、CAN書き込みポインタ21は現在の値(RHL8)保持し、CAN書き込みポインタ21の現在の位置から一つ戻った位置に履歴情報を上書きする特定制御が開始される。例えば、図11では、CAN書き込みポインタ21はRHL8を指したままであるが、一減されてRHL7にmsg#27が上書きされている。このような特定制御は、オーバフローフラグがクリアされるまで継続される。このような特定制御を行うことによって、最古(未読)履歴情報ポインタ23の値を保護するとともに、最新履歴情報ポインタ22に指定される位置に常に最新の履歴情報が格納される状態が保持される。
FIG. 11 is a diagram showing a state in which a new message is received from the state where the overflow of FIG. 10 is established and stored in the message buffer. When the
以上のように、リングバッファ6の内容が更新されるため、CPUは、未参照であって最先に受信したメッセージが格納されたバッファや最新のメッセージが格納されたバッファを即時に特定することが可能となる。
As described above, since the contents of the
以上、本発明の一実施の形態及び実施例を説明したが、その原理からも明らかなとおり、本発明の技術的範囲は、上述した実施の形態に限定されるものではなく、履歴情報を参照可能とし、処理すべきメッセージを即座に決定できるようにしておくという本発明の要旨を逸脱しない範囲で、各種の変形・置換をなしうることが可能であることはいうまでもない。 The embodiment and examples of the present invention have been described above. However, as is clear from the principle, the technical scope of the present invention is not limited to the above-described embodiment, and reference is made to history information. Needless to say, various modifications and substitutions can be made without departing from the gist of the present invention, which allows the message to be processed to be determined immediately.
例えば、上述した実施の形態及び実施例では、CPUから読み出し可能とするポインタの例を示したが、追加のポインタを設けて、参照できるようにしておいてもよい。また、リングバッファのサイズ(履歴情報格納可能数)も特に限定されるものではなく、CPUの処理能力やメッセージバッファのサイズに応じて変更可能である。 For example, in the above-described embodiments and examples, an example of a pointer that can be read from the CPU has been described. However, an additional pointer may be provided so that it can be referred to. The size of the ring buffer (the number of history information that can be stored) is not particularly limited, and can be changed according to the processing capacity of the CPU and the size of the message buffer.
また、上記した実施の形態及び実施例では、履歴情報が全く無い状態(初期状態)とオーバーフロー状態を簡単に区別すべく、CAN書き込みポインタ21と最古(未読)履歴情報ポインタ23の関係の判定基準(A=BとA=B−1)を区別して設けたが、直前の状態を保存するなどして、実質的なオーバーフロー状態を判断できるようにしても良い。
In the above-described embodiments and examples, the relationship between the CAN write pointer 21 and the oldest (unread)
また、上述した実施の形態及び実施例では、リングバッファを採用し、オーバーフロー時に特定制御が行われるものとして説明したが、その他当業者がなしうる修正を加えることが可能である。また、オーバーフロー状態が発生しないという前提の下では、通常のリングバッファリング制御を行うことで足りることになる。また例えば、リングバッファ以外のバッファ構成も採用可能であり、履歴情報の格納・読み出し手順もその他よく知られているのものを採用可能である。 In the above-described embodiments and examples, the ring buffer is used and specific control is performed at the time of overflow. However, other modifications that can be made by those skilled in the art can be added. Further, under the assumption that no overflow condition occurs, it is sufficient to perform normal ring buffering control. Further, for example, a buffer configuration other than the ring buffer can be employed, and other well-known procedures for storing / reading history information can be employed.
2 メッセージハンドリング部
3 メッセージバッファ
4 CANプロトコル送信層
5 マスクセット
6、61、62 リングバッファ
11、1n、16、19 CANモジュール(CAN コントローラ)
20 サーチ用共通アドレス生成部
21 CAN書き込みポインタ
22 最新履歴情報ポインタ
23 最古(未読)履歴情報ポインタ
24 履歴無効フラグ
25 オーバーフローフラグ
40 CPU I/F
51 CPU
52 RAM
53 周辺回路
60 CANトランシーバ
100 CANデバイス
2
20 Search common address generator 21 CAN write
51 CPU
52 RAM
53 Peripheral circuit 60
Claims (17)
前記データ処理モジュールのメッセージハンドリング部が、メッセージバッファ上の更新が行われたバッファの位置情報を、前記履歴バッファの次書き込み位置に格納する工程と、
前記メッセージハンドリング部が、CPU(Central Processing Unit)からのリードアクセスに応じて、前記履歴バッファのうちCPUから未参照の履歴情報の位置を示す未読ポインタを逐次更新する工程と、を含み、
少なくとも前記履歴バッファの直近書き込み位置と、前記未読ポインタを、前記CPUから参照可能に保持すること、
を特徴とするデータ処理モジュールにおける送受信メッセージの管理方法。 A transmission / reception message management method in a data processing module connected to a multi-master network and having a history buffer capable of storing history information indicating the position of an update message on a message buffer a predetermined number of times,
The message handling unit of the data processing module stores the position information of the buffer that has been updated on the message buffer at the next write position of the history buffer;
The message handling unit sequentially updating an unread pointer indicating a position of unreferenced history information from the CPU in the history buffer in response to a read access from a CPU (Central Processing Unit),
Holding at least the latest write position of the history buffer and the unread pointer so that the CPU can refer to them,
A method for managing transmitted and received messages in a data processing module.
前記データ処理モジュールのメッセージハンドリング部が、メッセージバッファ上の更新が行われたバッファの位置情報を、前記リングバッファの次書き込み位置に格納する工程と、
前記メッセージハンドリング部が、CPU(Central Processing Unit)からのリードアクセスに応じて、前記リングバッファのうちCPUから未参照の履歴情報の位置を示す未読ポインタを逐次更新する工程と、を含み、
少なくとも前記リングバッファの直近書き込み位置と、前記未読ポインタを、前記CPUから参照可能に保持すること、
を特徴とするデータ処理モジュールにおける送受信メッセージの管理方法。 A transmission / reception message management method in a data processing module connected to a multi-master network and having a ring buffer capable of storing history information indicating the position of an update message on a message buffer a predetermined number of times,
The message handling unit of the data processing module stores the position information of the updated buffer on the message buffer at the next write position of the ring buffer;
The message handling unit sequentially updating an unread pointer indicating a position of unreferenced history information from the CPU in the ring buffer in response to a read access from a CPU (Central Processing Unit);
Holding at least the latest write position of the ring buffer and the unread pointer so that they can be referred to by the CPU;
A method for managing transmitted and received messages in a data processing module.
前記最新履歴情報ポインタを前記CPUから参照可能としたこと、
を特徴とする請求項2に記載のデータ処理モジュールにおける送受信メッセージの管理方法。 The message handling unit has a latest history information pointer that indicates a position immediately before a write position to the ring buffer,
Making it possible to refer to the latest history information pointer from the CPU;
The transmission / reception message management method in the data processing module according to claim 2.
前記メッセージハンドリング部は、前記リングバッファの次書き込み位置と未読ポインタが一致する初期状態で前記履歴無効フラグをオン状態に設定し、前記リングバッファの次書き込み位置と未読ポインタが不一致となった段階で前記履歴無効フラグをオフ状態に設定し、
前記CPUは、前記履歴無効フラグを参照して前記リングバッファへの履歴情報の格納有無を判定すること、
を特徴とする請求項2又は3に記載のデータ処理モジュールにおける送受信メッセージの管理方法。 The message handling unit has a history invalid flag indicating whether or not history information is stored in the ring buffer;
The message handling unit sets the history invalid flag to an ON state in an initial state in which the next write position of the ring buffer matches an unread pointer, and when the next write position of the ring buffer and the unread pointer do not match. Set the history invalid flag to an off state,
The CPU refers to the history invalid flag to determine whether or not history information is stored in the ring buffer;
4. A method for managing transmission / reception messages in a data processing module according to claim 2 or 3.
前記メッセージハンドリング部は、前記リングバッファの次書き込み位置と未読ポインタより一つ前の位置が一致する状態で前記オーバーフローフラグをオン状態に設定し、
前記オーバーフローフラグがオン状態である場合は、前記メッセージハンドリング部は、前記リングバッファの直近書き込み位置に、爾後の履歴情報を上書きすること、
を特徴とする請求項2乃至4いずれか一に記載のデータ処理モジュールにおける送受信メッセージの管理方法。 The message handling unit has an overflow flag indicating that the ring buffer has run out of free space;
The message handling unit sets the overflow flag to an on state in a state where the next write position of the ring buffer and the position before the unread pointer match.
When the overflow flag is on, the message handling unit overwrites the latest history information at the most recent write position of the ring buffer;
The method for managing transmission / reception messages in the data processing module according to claim 2.
メッセージを受信したとき前記受信メッセージの識別子(ID)に基づき前記メッセージバッファ内を走査し、前記受信メッセージを記憶するバッファを前記複数のバッファの中から選択するメッセージハンドリング部と、
前記複数のバッファのうち、受信メッセージが記憶されているバッファの番地を保持し、前記受信メッセージが受信された順番を管理する履歴バッファとを備えること、
を特徴とするデータ処理モジュール。 A message buffer composed of multiple buffers;
A message handling unit that scans the message buffer based on an identifier (ID) of the received message when a message is received, and selects a buffer for storing the received message from the plurality of buffers;
A history buffer that holds an address of a buffer in which received messages are stored among the plurality of buffers and manages an order in which the received messages are received;
A data processing module.
を特徴とする請求項6に記載のデータ処理モジュール。 A data processing circuit that reads data from the message buffer based on the order of reception of the received messages managed in the history buffer;
The data processing module according to claim 6.
前記メッセージハンドリング部によって選択されたバッファの番地を記憶する位置を示す書き込みポインタと、を備えること、
を特徴とする請求項6又は7に記載のデータ処理モジュール。 An oldest history information pointer indicating the oldest buffer for managing received messages stored in the history buffer;
A write pointer indicating a position for storing the address of the buffer selected by the message handling unit,
The data processing module according to claim 6 or 7.
を特徴とする請求項8に記載のデータ処理モジュール。 A data protection circuit is provided that protects the order of writing to the history buffer from the top to a predetermined order by returning the address of the write pointer to a predetermined address when the free capacity of the history buffer becomes a predetermined value or less. ,
The data processing module according to claim 8.
を特徴とする請求項9に記載のデータ処理モジュール。 The history buffer is constituted by a ring buffer;
The data processing module according to claim 9.
送信するメッセージ及び受信したメッセージを複数バッファ可能なメッセージバッファと、
前記メッセージバッファ上の更新が行われたバッファの位置を示す履歴情報を所定回数分格納可能な履歴バッファと、
前記メッセージバッファ上のメッセージの管理を行うメッセージハンドリング部とを備え、
前記メッセージハンドリング部は、前記履歴バッファ上の前記履歴情報の書き込み位置を示す書き込み位置ポインタと、
CPU(Central Processing Unit)からのリードアクセスに応じて、前記履歴バッファのうちCPUから未参照の履歴情報の位置を示す未読ポインタと、を備え、
少なくとも前記履歴バッファの直近書き込み位置と、前記未読ポインタを、前記CPUから参照可能に保持すること、
を特徴とするデータ処理モジュール。 In a data processing module connected to a multi-master network,
A message buffer capable of buffering a plurality of messages to be sent and received;
A history buffer capable of storing history information indicating the position of the buffer on which update has been performed on the message buffer for a predetermined number of times;
A message handling unit for managing messages on the message buffer;
The message handling unit, a write position pointer indicating a write position of the history information on the history buffer;
In response to a read access from a CPU (Central Processing Unit), an unread pointer indicating the position of history information that has not been referenced from the CPU in the history buffer,
Holding at least the latest write position of the history buffer and the unread pointer so that the CPU can refer to them,
A data processing module.
少なくとも前記履歴バッファ、書き込み位置ポインタ、未読ポインタを送信メッセージ管理用と受信メッセージ管理用にそれそれ個別に備えていること、
を特徴とするデータ処理モジュール。 The data processing module of claim 11, wherein
At least the history buffer, the write position pointer, and the unread pointer are separately provided for transmission message management and reception message management,
A data processing module.
前記メッセージバッファ上の更新が行われたバッファの位置を示す履歴情報を所定回数分格納可能なリングバッファと、
前記メッセージバッファ上のメッセージの管理を行うメッセージハンドリング部とを備え、
前記メッセージハンドリング部は、前記リングバッファ上の前記履歴情報の書き込み位置を示す書き込み位置ポインタと、
CPU(Central Processing Unit)からのリードアクセスに応じて、前記リングバッファのうちCPUから未参照の履歴情報の位置を示す未読ポインタと、を備え、
少なくとも前記リングバッファの直近書き込み位置と、前記未読ポインタを、前記CPUから参照可能に保持すること、
を特徴とするデータ処理モジュール。 A message buffer capable of buffering a plurality of messages to be sent and received;
A ring buffer capable of storing history information indicating the position of the buffer on which update has been performed on the message buffer a predetermined number of times;
A message handling unit for managing messages on the message buffer;
The message handling unit, a write position pointer indicating a write position of the history information on the ring buffer;
In response to a read access from a CPU (Central Processing Unit), an unread pointer that indicates a position of history information that is not referenced from the CPU in the ring buffer,
Holding at least the latest write position of the ring buffer and the unread pointer so that they can be referred to by the CPU;
A data processing module.
前記リングバッファへの書き込み位置より一つ前の位置を示す最新履歴情報ポインタを有し、
前記最新履歴情報ポインタを前記CPUから参照可能としたこと、
を特徴とするデータ処理モジュール。 14. The data processing module according to claim 13, further comprising:
A latest history information pointer indicating a position immediately before the writing position to the ring buffer;
Making it possible to refer to the latest history information pointer from the CPU;
A data processing module.
前記メッセージハンドリング部は、前記リングバッファの次書き込み位置と未読ポインタが一致する初期状態でオン状態に設定され、前記リングバッファの次書き込み位置と未読ポインタが不一致となった段階でオフ状態に設定される履歴無効フラグを有し、
前記CPUは、前記履歴無効フラグを参照して前記リングバッファへの履歴情報の格納有無を判定すること、
を特徴とするデータ処理モジュール。 15. The data processing module according to claim 13 or 14, further comprising:
The message handling unit is set to an on state in an initial state where the next write position of the ring buffer matches an unread pointer, and is set to an off state when the next write position of the ring buffer and an unread pointer do not match. Has a history invalid flag,
The CPU refers to the history invalid flag to determine whether or not history information is stored in the ring buffer;
A data processing module.
前記メッセージハンドリング部は、前記リングバッファの次書き込み位置と未読ポインタより一つ前の位置が一致する状態でオン状態に設定されるオーバーフローフラグを有し、
前記メッセージハンドリング部は、
前記オーバーフローフラグがオン状態である場合は、前記リングバッファの直近書き込み位置に爾後の履歴情報を上書きすること、
を特徴とするデータ処理モジュール。 The data processing module according to any one of claims 13 to 15, further comprising:
The message handling unit has an overflow flag that is set to an on state in a state where the next write position of the ring buffer and the position before the unread pointer match.
The message handling unit
If the overflow flag is on, overwriting the latest history information at the latest write position of the ring buffer;
A data processing module.
少なくとも前記リングバッファ、書き込み位置ポインタ、未読ポインタ、履歴無効フラグ、オーバーフローフラグを、送信メッセージ管理用と受信メッセージ管理用にそれぞれ個別に備えていること、
を特徴とするデータ処理モジュール。
The data processing module according to any one of claims 13 to 16,
At least the ring buffer, the write position pointer, the unread pointer, the history invalid flag, and the overflow flag are individually provided for transmission message management and reception message management,
A data processing module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005033014A JP4574377B2 (en) | 2005-02-09 | 2005-02-09 | Data processing module and method for managing transmitted / received messages thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005033014A JP4574377B2 (en) | 2005-02-09 | 2005-02-09 | Data processing module and method for managing transmitted / received messages thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006222627A true JP2006222627A (en) | 2006-08-24 |
JP4574377B2 JP4574377B2 (en) | 2010-11-04 |
Family
ID=36984658
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005033014A Expired - Fee Related JP4574377B2 (en) | 2005-02-09 | 2005-02-09 | Data processing module and method for managing transmitted / received messages thereof |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4574377B2 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012222466A (en) * | 2011-04-05 | 2012-11-12 | Denso Corp | Multiplex communication device and multiplex communication method |
JP2012222441A (en) * | 2011-04-05 | 2012-11-12 | Denso Corp | On-vehicle communication device |
JP2015092337A (en) * | 2013-10-11 | 2015-05-14 | ジーイー・アビエイション・システムズ・エルエルシー | Data communications network for aircraft |
CN112379844A (en) * | 2020-11-25 | 2021-02-19 | 深圳市华宝电子科技有限公司 | Data protection method and device, electronic terminal and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004258856A (en) * | 2003-02-25 | 2004-09-16 | Seiko Epson Corp | Data transfer control system, electronic apparatus, and data transfer control method |
-
2005
- 2005-02-09 JP JP2005033014A patent/JP4574377B2/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004258856A (en) * | 2003-02-25 | 2004-09-16 | Seiko Epson Corp | Data transfer control system, electronic apparatus, and data transfer control method |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012222466A (en) * | 2011-04-05 | 2012-11-12 | Denso Corp | Multiplex communication device and multiplex communication method |
JP2012222441A (en) * | 2011-04-05 | 2012-11-12 | Denso Corp | On-vehicle communication device |
JP2015092337A (en) * | 2013-10-11 | 2015-05-14 | ジーイー・アビエイション・システムズ・エルエルシー | Data communications network for aircraft |
CN112379844A (en) * | 2020-11-25 | 2021-02-19 | 深圳市华宝电子科技有限公司 | Data protection method and device, electronic terminal and storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP4574377B2 (en) | 2010-11-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6961063B2 (en) | Network hub, transfer method and in-vehicle network system | |
JP6961062B2 (en) | Electronic control unit, communication method and in-vehicle network system | |
US6857030B2 (en) | Methods, system and article of manufacture for pre-fetching descriptors | |
EP2038744B1 (en) | Method and system of grouping interrupts from a time-dependent data storage means | |
JP5505516B2 (en) | Information processing system and information transmission method | |
EP0436104B1 (en) | FIFO with variable commit pointer | |
JP4574377B2 (en) | Data processing module and method for managing transmitted / received messages thereof | |
CN116233036B (en) | DMA transmission control method and device | |
JP2010211322A (en) | Network processor, reception controller, and data reception processing method | |
EP2504771B1 (en) | Addressable fifo | |
US20100306405A1 (en) | Prefetch Optimization of the Communication of Data Using Descriptor Lists | |
JP4721741B2 (en) | Data processing module and message receiving method thereof | |
JP4522846B2 (en) | Data processing module and method for determining candidate message for sending | |
EP1894089B1 (en) | Data pipeline management system and method for using the system | |
WO2017047657A1 (en) | Buffer control apparatus, communication node, and relay apparatus | |
JP4708901B2 (en) | Data processing module and method for preparing message transmission | |
JP2006238350A (en) | Data processing module and method for deciding stored position of its received message | |
CN113709061A (en) | Message forwarding method and circuit | |
US6940865B2 (en) | System and method for interleaving frames with different priorities | |
JP4531555B2 (en) | Data processing module and method for determining candidate message for sending | |
JP4492955B2 (en) | Data processing module and method for determining candidate message for sending | |
CN112559196B (en) | Transmission method for sharing communication data between processes | |
JP2004350138A (en) | Data relaying apparatus and multiplex communication system | |
JP3388852B2 (en) | Multiplex transmission equipment | |
JP2007034892A (en) | Data processing module and its message transmission termination processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20071212 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100426 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100518 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100720 |
|
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: 20100817 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100818 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130827 Year of fee payment: 3 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |