JP2011101113A - Mac circuit - Google Patents

Mac circuit Download PDF

Info

Publication number
JP2011101113A
JP2011101113A JP2009253272A JP2009253272A JP2011101113A JP 2011101113 A JP2011101113 A JP 2011101113A JP 2009253272 A JP2009253272 A JP 2009253272A JP 2009253272 A JP2009253272 A JP 2009253272A JP 2011101113 A JP2011101113 A JP 2011101113A
Authority
JP
Japan
Prior art keywords
control unit
self
diagnosis
buffer 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.)
Pending
Application number
JP2009253272A
Other languages
Japanese (ja)
Inventor
Atsushi Inoue
篤 井上
Jun Takehara
潤 竹原
Naoya Onishi
直哉 大西
Yasutaka Umeda
泰隆 梅田
Motohiko Okabe
基彦 岡部
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2009253272A priority Critical patent/JP2011101113A/en
Publication of JP2011101113A publication Critical patent/JP2011101113A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an MAC (media access control) circuit for performing periodical self-diagnosis and maintaining integrity, without abandoning reception data from other nodes in any cases, when being online. <P>SOLUTION: The MAC circuit is interposed between the PHY of a physical layer and a CPU to control the access of a communication medium, and includes a transmission buffer memory 2; a TX_WRC 1 for writing transmission data in the transmission buffer memory; a TX_RDC 3 for transmitting a MAC frame to the physical layer; a reception buffer memory 8; an RX_WRC 6 for adding an FCS value to reception data and writing them to the reception buffer memory; an RX_RDC 9 for outputting read reception data to the CPU; and a CHECK circuit 12 for determining first timing for performing self-diagnosis. The TX_RDC 3 reads the reception data output by the RX_RDC 9 according to the first timing, and the CHECK circuit 12 performs self-diagnosis, by comparing the FCS value calculated by the RX_WRC 6 and the TX_RDC 3. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、データを送信するためのMAC(MEDIA ACCESS CONTROL)フレームの生成や受信したデータの誤り検出等を行うMAC回路に関する。   The present invention relates to a MAC circuit that generates a MAC (MEDIA ACCESS CONTROL) frame for transmitting data, detects an error in received data, and the like.

イーサネット(登録商標)のMAC回路は、OSI(Open Systems Interconnection)参照モデルのレイヤ2(データリンク層)において、データを送信するためのMACフレームの生成、及び受信したデータの誤り確認を行っている。これらの規格は、IEEE802.3により規定されている。   A MAC circuit of Ethernet (registered trademark) generates a MAC frame for transmitting data and checks an error of received data in Layer 2 (data link layer) of an OSI (Open Systems Interconnection) reference model. . These standards are defined by IEEE 802.3.

図4は、一般的なMAC回路の構成を示す機能ブロック図である。まず、図4を用いてMAC回路の構成について説明する。MAC回路は、図4に示すように、TX_WRC1、送信バッファメモリ2、TX_RDC3、FCS回路4、ループバック回路5、RX_WRC6、FCS回路7、受信バッファメモリ8、及びRX_RDC9により構成される。なお、MAC回路は、CPUの動作タイミングとPHYへの送受信タイミングが異なるため、一般的に緩衝用のバッファメモリ(送信バッファメモリ2、受信バッファメモリ8)を備えている。PHYは、例えばICチップにより構成され、レイヤ1(物理層)における信号処理を行う。   FIG. 4 is a functional block diagram showing a configuration of a general MAC circuit. First, the configuration of the MAC circuit will be described with reference to FIG. As shown in FIG. 4, the MAC circuit includes TX_WRC1, transmission buffer memory 2, TX_RDC3, FCS circuit 4, loopback circuit 5, RX_WRC6, FCS circuit 7, reception buffer memory 8, and RX_RDC9. The MAC circuit generally includes a buffer memory (transmission buffer memory 2 and reception buffer memory 8) because the operation timing of the CPU is different from the transmission / reception timing to the PHY. The PHY is configured by an IC chip, for example, and performs signal processing in the layer 1 (physical layer).

最初に、CPUからのデータ送信について説明する。図5は、一般的なMAC回路のデータ送信時の動作を示す図であり、データの流れを太線の矢印で示している。まず、CPUは、送信データ1aをMAC回路に転送する。次に、TX_WRC1は、送信側の書き込み制御を行うものであり、CPUにより転送された送信データを送信バッファメモリ2に書き込む。   First, data transmission from the CPU will be described. FIG. 5 is a diagram showing an operation at the time of data transmission of a general MAC circuit, and a data flow is indicated by a thick line arrow. First, the CPU transfers the transmission data 1a to the MAC circuit. Next, TX_WRC1 performs write control on the transmission side, and writes the transmission data transferred by the CPU into the transmission buffer memory 2.

書き込みが完了すると、送信側の読み出し制御を行うTX_RDC3は、送信バッファメモリ2に書き込まれた送信データを読み出す。その際に、FCS(Frame Check Sequence)回路4は、FCS計算を行い、FCSデータを付加したMACフレームを作成する。作成したMACフレームのデータ4aは、TX_RDC3によりPHYにデータ送信される。   When the writing is completed, the TX_RDC 3 that performs reading control on the transmission side reads the transmission data written in the transmission buffer memory 2. At that time, an FCS (Frame Check Sequence) circuit 4 performs an FCS calculation and creates a MAC frame to which FCS data is added. The created MAC frame data 4a is transmitted to the PHY by TX_RDC3.

次に、PHYからのデータ受信について説明する。図6は、一般的なMAC回路のデータ受信時の動作を示す図であり、データの流れを太線の矢印で示している。PHYからの受信データ5bは、ループバック回路5を通り、受信側の書き込み制御を行うRX_WRC6に転送される。ここで、ループバック回路5は、CPUからの切替指令5aに基づいて、PHYからのデータ5bを受信するか、あるいは送信側からのデータ5cを受信するかの選択を行うものであり、この場合においてはPHYからのデータ5bを受信する旨の選択を行っている。   Next, data reception from the PHY will be described. FIG. 6 is a diagram showing the operation of a general MAC circuit when receiving data, and the flow of data is indicated by thick arrows. The reception data 5b from the PHY passes through the loopback circuit 5 and is transferred to the RX_WRC 6 that performs write control on the reception side. Here, the loopback circuit 5 selects whether to receive the data 5b from the PHY or the data 5c from the transmission side based on the switching command 5a from the CPU. Is selecting to receive the data 5b from the PHY.

RX_WRC6は、PHYから転送されたデータを受信バッファメモリ8に書き込む。その際にFCS回路7は、FCS計算を行ってFCSエラーが無いことを確認している。その後、受信側の読み出し制御を行うRX_RDC9は、受信バッファメモリ8に書き込まれたデータを読み出し、CPUに対して読み出したデータ9aをデータ転送する。   The RX_WRC 6 writes the data transferred from the PHY into the reception buffer memory 8. At that time, the FCS circuit 7 performs an FCS calculation and confirms that there is no FCS error. Thereafter, the RX_RDC 9 that performs read control on the reception side reads the data written in the reception buffer memory 8 and transfers the read data 9a to the CPU.

次に、上述したMAC回路における従来の自己診断方法について説明する。図7は、従来のMAC回路の自己診断時の動作を示す図であり、データの流れを太線の矢印で示している。まず、CPUは、初期時に自己診断を行うためにループバック指令5aをループバック回路5に対して出力するとともに、データをMAC回路に転送する。ループバック回路5は、入力されたループバック指令5aに基づいて、送信側からのデータ(すなわちTX_RDC3により出力されたデータ)を受信する旨の選択を行う。   Next, a conventional self-diagnosis method in the above-described MAC circuit will be described. FIG. 7 is a diagram showing an operation at the time of self-diagnosis of a conventional MAC circuit, and a data flow is indicated by a thick arrow. First, the CPU outputs a loopback command 5a to the loopback circuit 5 to perform self-diagnosis at the initial stage, and transfers data to the MAC circuit. The loopback circuit 5 performs selection to receive data from the transmission side (that is, data output by the TX_RDC3) based on the input loopback command 5a.

一方、TX_WRC1は、CPUにより転送されたデータを送信バッファメモリ2に書き込む。TX_RDC3は、送信バッファメモリ2にある程度データが蓄積されると、送信バッファメモリ2からデータを読み出すとともに、FCS回路4にFCSデータを付加させ、生成したデータを送信する。   On the other hand, TX_WRC1 writes the data transferred by the CPU to the transmission buffer memory 2. When some data is accumulated in the transmission buffer memory 2, the TX_RDC 3 reads data from the transmission buffer memory 2, adds FCS data to the FCS circuit 4, and transmits the generated data.

送信されたデータは、PHY転送されるとともに、ループバック回路5を通って受信側回路(すなわちRX_WRC6)に転送される。RX_WRC6は、受信したデータを受信バッファメモリ8に書き込む。その際に、FCS回路7は、FCSのエラーチェックを行う。その後、RX_RDC9は、受信バッファメモリ8に書き込まれたデータを読出し、CPUに転送する。CPUは、自分が送信したデータと受信したデータとが一致することを確認し、データが一致した場合に回路は正常に動作していると判断する。CPUは、データ確認後にループバック指令5aを解除する。これにより、ループバック回路5は、PHYからのデータ5bを受信する旨の選択を行い、PHY側からデータを受信できるように回路を切り替えている。   The transmitted data is PHY-transferred and also transferred to the receiving side circuit (that is, RX_WRC6) through the loopback circuit 5. The RX_WRC 6 writes the received data into the reception buffer memory 8. At that time, the FCS circuit 7 performs an FCS error check. Thereafter, the RX_RDC 9 reads the data written in the reception buffer memory 8 and transfers it to the CPU. The CPU confirms that the data transmitted by itself matches the received data, and determines that the circuit is operating normally when the data matches. The CPU cancels the loopback command 5a after confirming the data. As a result, the loopback circuit 5 selects to receive the data 5b from the PHY, and switches the circuit so that the data can be received from the PHY side.

特許文献1には、リモート環境からのポートのトラフィックの解析を可能とし、ネットワークの診断を容易にすることができるイーサネット(登録商標)スイッチが記載されている。このイーサネット(登録商標)スイッチは、複数のポートと、その複数のポートのうちの所定のポートから受信したフレームを指定された別のポートに転送するスイッチングコントローラと、制御手段と、記憶手段とを備えている。制御手段は、ネットワークを介して受信したキャプチャ開始リクエストに従い、スイッチングコントローラに対してキャプチャするフレームの条件を設定する機能を備えている。また、スイッチングコントローラは、設定された条件に合致するフレームを記憶手段にキャプチャデータとしてコピーする機能を備えている。   Patent Document 1 describes an Ethernet (registered trademark) switch that can analyze port traffic from a remote environment and facilitate network diagnosis. The Ethernet (registered trademark) switch includes a plurality of ports, a switching controller that transfers a frame received from a predetermined port among the plurality of ports to another designated port, a control unit, and a storage unit. I have. The control means has a function of setting a frame condition to be captured to the switching controller in accordance with a capture start request received via the network. The switching controller also has a function of copying a frame that matches a set condition as capture data to the storage means.

また、制御手段は、ネットワークを介して受信したキャプチャ取得リクエストに従い、記憶手段に格納されたキャプチャデータを読み出すと共に、ネットワーク経由でキャプチャ取得リクエスト要求を発行した相手に転送する機能を備えるとよい。   The control means may have a function of reading the capture data stored in the storage means in accordance with the capture acquisition request received via the network and transferring it to the other party that issued the capture acquisition request via the network.

さらに、制御手段は、ネットワークを介して受信したリクエストに従い、記憶手段に格納されたキャプチャデータを削除する機能と、記憶手段に格納されているキャプチャデータの一覧をネットワーク経由で転送する機能と、記憶手段に格納されたキャプチャデータのファイル名を変更する機能とをリネームする機能のうち、少なくとも1つの機能を備えると良い。   Further, the control means is configured to delete the capture data stored in the storage means according to the request received via the network, to transfer the list of capture data stored in the storage means via the network, It is preferable to provide at least one of the functions for renaming the capture data file name stored in the means.

特開2008−258846号公報JP 2008-258846 A

しかしながら、図4乃至図7を用いて説明した従来のMAC回路は、初期時に自己診断を1回行うのみであるため、回路の運用中にオンラインで回路診断を行うことができないという問題点を有する。すなわち、従来のMAC回路は、自己診断をオンライン時に行うとすると診断中において他ノードからの受信データを破棄してしまうおそれがあるため、オンライン状態において定期診断を行うことが困難であり、健全性を維持するうえで問題となる。   However, the conventional MAC circuit described with reference to FIGS. 4 to 7 has a problem that the circuit diagnosis cannot be performed online during circuit operation because the self-diagnosis is performed only once at the initial stage. . In other words, if the conventional MAC circuit performs self-diagnosis at the time of online, it is difficult to perform periodic diagnosis in the online state because there is a possibility that received data from other nodes may be discarded during the diagnosis. It becomes a problem in maintaining.

特許文献1に記載のイーサネット(登録商標)スイッチは、リモート環境からのポートのトラフィックの解析を可能とするものであるが、自己診断を行うものではなく、オンライン中における定期的な自己診断機能と他ノードからのデータ受信機能とを併存させる解決策とはならない。   The Ethernet (registered trademark) switch described in Patent Document 1 enables analysis of port traffic from a remote environment. However, it does not perform self-diagnosis, but has a periodic self-diagnosis function while online. It is not a solution for coexisting with the function of receiving data from other nodes.

本発明は上述した従来技術の問題点を解決するもので、オンライン時に他のノードからの受信データをいかなる場合にも破棄することなく、定期的な自己診断を行って健全性を保ち続けるMAC回路を提供することを課題とする。   The present invention solves the above-mentioned problems of the prior art, and a MAC circuit that maintains periodicity by performing periodic self-diagnosis without discarding received data from other nodes in any case when online. It is an issue to provide.

本発明に係るMAC回路は、上記課題を解決するために、物理層と中央処理装置との間に介在して通信媒体のアクセスを制御するMAC回路であって、前記中央処理装置により送信された送信データを一時的に記憶するための送信バッファメモリと、前記中央処理装置により送信された送信データを前記送信バッファメモリに書き込む第1書き込み制御部と、前記送信バッファメモリに書き込まれた送信データを読み出すとともに、読み出した送信データに基づいてFCS値を含むMACフレームを生成して前記物理層に送信するMACフレーム生成部と、前記物理層から受信した受信データを一時的に記憶するための受信バッファメモリと、前記物理層から受信した受信データに基づいてFCSエラーの有無を確認するとともに、前記受信データに計算したFCS値を付加して前記受信バッファメモリに書き込む第2書き込み制御部と、前記受信バッファメモリに書き込まれた受信データを読み出すとともに、読み出した受信データを前記中央処理装置に出力する読み出し制御部と、前記物理層から受信した受信データを利用して自己診断を行う第1タイミングを決定する自己診断制御部と、前記自己診断制御部により決定された第1タイミングに応じて前記MACフレーム生成部によるMACフレームの送信を遮断する遮断部と、前記自己診断制御部により決定された第1タイミングに応じて前記読み出し制御部により出力された受信データを前記MACフレーム生成部に転送する第1転送部とを備え、前記MACフレーム生成部は、前記自己診断制御部により決定された第1タイミングに応じて、前記送信バッファメモリに代えて前記読み出し制御部により出力された受信データを前記第1転送部を介して読み出すとともに、読み出した受信データに基づいてFCS値を計算し、前記自己診断制御部は、前記第2書き込み制御部により計算されたFCS値と前記MACフレーム生成部により計算されたFCS値とを比較することにより自己の回路内における異常の有無を診断することを特徴とする。   In order to solve the above problems, a MAC circuit according to the present invention is a MAC circuit that is interposed between a physical layer and a central processing unit and controls access to a communication medium, and is transmitted by the central processing unit. A transmission buffer memory for temporarily storing transmission data; a first write control unit for writing transmission data transmitted by the central processing unit into the transmission buffer memory; and transmission data written in the transmission buffer memory. A MAC frame generation unit that reads and generates a MAC frame including an FCS value based on the read transmission data and transmits the MAC frame to the physical layer, and a reception buffer for temporarily storing reception data received from the physical layer The presence of an FCS error is confirmed based on memory and received data received from the physical layer, and the reception A second write control unit that adds the calculated FCS value to the data and writes the received data to the reception buffer memory, and reads the received data written to the reception buffer memory, and outputs the read received data to the central processing unit A read control unit; a self-diagnosis control unit that determines a first timing for performing self-diagnosis using received data received from the physical layer; and the MAC according to the first timing determined by the self-diagnosis control unit A blocking unit that blocks transmission of the MAC frame by the frame generation unit; and a reception unit that transfers the reception data output by the read control unit to the MAC frame generation unit according to a first timing determined by the self-diagnosis control unit. 1 transfer unit, and the MAC frame generation unit is a first determined by the self-diagnosis control unit According to the timing, the reception data output by the read control unit instead of the transmission buffer memory is read through the first transfer unit, and the FCS value is calculated based on the read reception data, and the self-diagnosis is performed. The control unit diagnoses whether there is an abnormality in its own circuit by comparing the FCS value calculated by the second write control unit and the FCS value calculated by the MAC frame generation unit. .

本発明によれば、オンライン時に他のノードからの受信データをいかなる場合にも破棄することなく、定期的な自己診断を行って健全性を保ち続けるMAC回路を提供することができる。   According to the present invention, it is possible to provide a MAC circuit that performs periodic self-diagnosis and maintains soundness without discarding received data from other nodes in any case when online.

本発明の実施例1の形態のMAC回路の構成を示す図である。It is a figure which shows the structure of the MAC circuit of the form of Example 1 of this invention. 本発明の実施例1の形態のMAC回路の受信データを利用して自己診断を行う際の動作を示す図である。It is a figure which shows the operation | movement at the time of performing a self-diagnosis using the received data of the MAC circuit of the form of Example 1 of this invention. 本発明の実施例2の形態のMAC回路の送信データを利用して自己診断を行う際の動作を示す図である。It is a figure which shows the operation | movement at the time of performing a self-diagnosis using the transmission data of the MAC circuit of the form of Example 2 of this invention. 従来のMAC回路の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the conventional MAC circuit. 従来のMAC回路のデータ送信時の動作を示す図である。It is a figure which shows the operation | movement at the time of the data transmission of the conventional MAC circuit. 従来のMAC回路のデータ受信時の動作を示す図である。It is a figure which shows the operation | movement at the time of the data reception of the conventional MAC circuit. 従来のMAC回路の自己診断時の動作を示す図である。It is a figure which shows the operation | movement at the time of the self-diagnosis of the conventional MAC circuit.

以下、本発明のMAC回路の実施の形態について図面を参照して詳細に説明する。   Hereinafter, embodiments of the MAC circuit of the present invention will be described in detail with reference to the drawings.

図1は、本発明の実施例1のMAC回路の構成を示す図である。図1を参照して、MAC回路の構成を説明する。本実施例のMAC回路は、物理層と中央処理装置(CPU)との間に介在して通信媒体のアクセスを制御する回路であり、図1に示すように、TX_WRC1、送信バッファメモリ2、TX_RDC3、FCS回路4、ループバック回路5、RX_WRC6、FCS回路7、受信バッファメモリ8、RX_RDC9、カウンタ10,11、CHECK回路12、バッファコントロール13、SEL14、カウンタ15、バッファコントロール16、SEL17、及びSEL18により構成される。   1 is a diagram illustrating a configuration of a MAC circuit according to a first embodiment of the present invention. The configuration of the MAC circuit will be described with reference to FIG. The MAC circuit of this embodiment is a circuit that controls access to a communication medium interposed between a physical layer and a central processing unit (CPU). As shown in FIG. 1, TX_WRC1, transmission buffer memory 2, TX_RDC3 , FCS circuit 4, loopback circuit 5, RX_WRC6, FCS circuit 7, reception buffer memory 8, RX_RDC9, counters 10, 11, CHECK circuit 12, buffer control 13, SEL14, counter 15, buffer control 16, SEL17, and SEL18 Composed.

すなわち、図4乃至図7で説明した従来のMAC回路と異なる点は、カウンタ10,11、CHECK回路12、バッファコントロール13、SEL14、カウンタ15、バッファコントロール16、SEL17、及びSEL18を備えている点である。   That is, the difference from the conventional MAC circuit described with reference to FIGS. 4 to 7 is that it includes counters 10 and 11, a CHECK circuit 12, a buffer control 13, a SEL 14, a counter 15, a buffer control 16, a SEL 17 and a SEL 18. It is.

TX_WRC1は、本発明の第1書き込み制御部に対応し、CPU(中央処理装置)により送信された送信データを送信バッファメモリ2に書き込む。ここで、送信バッファメモリ2は、CPUにより送信された送信データを一時的に記憶するためのメモリである。   TX_WRC1 corresponds to the first write control unit of the present invention, and writes the transmission data transmitted by the CPU (central processing unit) to the transmission buffer memory 2. Here, the transmission buffer memory 2 is a memory for temporarily storing transmission data transmitted by the CPU.

カウンタ15は、本発明の第3カウンタに対応し、TX_WRC1がCPUにより送信された送信データを受信した回数をカウントするとともに、カウント数が所定の回数に達した場合に第3設定カウント信号を生成する。   The counter 15 corresponds to the third counter of the present invention, counts the number of times TX_WRC1 has received transmission data transmitted by the CPU, and generates a third set count signal when the count reaches a predetermined number To do.

バッファコントロール16は、送信バッファメモリ2の空き容量を監視し、メモリがあふれそうになった場合に、その旨をCPUに知らせるものである。CPUは、バッファコントロール16の警告に応じて送信データ量の制限等の対処を行う。   The buffer control 16 monitors the free capacity of the transmission buffer memory 2, and notifies the CPU when the memory is about to overflow. The CPU takes measures such as limiting the amount of transmission data in accordance with the warning from the buffer control 16.

SEL17は、後述するCHECK回路12の指令にしたがい、送信バッファメモリ2の出力と後述するRX_RDC9の出力とのいずれかを選択してTX_RDC3に出力する。   The SEL 17 selects either the output of the transmission buffer memory 2 or the output of the RX_RDC 9 described later and outputs it to the TX_RDC 3 in accordance with a command from the CHECK circuit 12 described later.

TX_RDC3とFCS回路4とは、本発明のMACフレーム生成部に対応し、送信バッファメモリ2に書き込まれた送信データをTX_RDC3が読み出すとともに、読み出した送信データに基づいてFCS回路4がFCS計算を行い、TX_RDC3がFCS値を含むMACフレームを生成して物理層のPHYに送信する。   The TX_RDC 3 and the FCS circuit 4 correspond to the MAC frame generation unit of the present invention. The TX_RDC 3 reads the transmission data written in the transmission buffer memory 2, and the FCS circuit 4 performs the FCS calculation based on the read transmission data. , TX_RDC 3 generates a MAC frame including the FCS value and transmits it to the physical layer PHY.

ループバック回路5は、CPUの指令に応じてSEL18の出力であるMACフレームと物理層のPHYから受信した受信データとのいずれかを選択し、RX_WRC6に出力する。   The loopback circuit 5 selects either the MAC frame that is the output of the SEL 18 or the received data received from the physical layer PHY in accordance with a command from the CPU, and outputs the selected data to the RX_WRC 6.

RX_WRC6とFCS回路7とは、本発明の第2書き込み制御部に対応し、物理層から受信した受信データに基づいてFCSエラーの有無をFCS回路7が確認するとともに、受信データに計算したFCS値を付加してRX_WRC6が受信バッファメモリ8に書き込む。ここで、受信バッファメモリ8は、物理層から受信した受信データを一時的に記憶するためのメモリである。なお、上述した送信バッファメモリ2や受信バッファメモリ8は、本実施例においてFIFO型のバッファメモリを使用しているものとする。   The RX_WRC 6 and the FCS circuit 7 correspond to the second write control unit of the present invention. The FCS circuit 7 confirms the presence or absence of an FCS error based on the received data received from the physical layer, and the FCS value calculated for the received data And the RX_WRC 6 writes in the reception buffer memory 8. Here, the reception buffer memory 8 is a memory for temporarily storing reception data received from the physical layer. It is assumed that the above-described transmission buffer memory 2 and reception buffer memory 8 use a FIFO buffer memory in this embodiment.

カウンタ10は、本発明の第1カウンタに対応し、第2書き込み制御部(RX_WRC6)が物理層から受信データを受信した回数をカウントするとともに、カウント数が所定の回数(例えば100回)に達した場合に第1設定カウント信号を生成する。   The counter 10 corresponds to the first counter of the present invention, and counts the number of times the second write control unit (RX_WRC6) has received the received data from the physical layer, and the count reaches a predetermined number (for example, 100 times). In this case, the first setting count signal is generated.

カウンタ11は、本発明の第2カウンタに対応し、カウンタ10により第1設定カウント信号が生成された場合に、自己診断中における第2書き込み制御部(RX_WRC6)が物理層から受信データを受信した回数をカウントするとともに、カウント数が所定の回数(例えば10回)に達した場合に第2設定カウント信号を生成する。   The counter 11 corresponds to the second counter of the present invention, and when the first set count signal is generated by the counter 10, the second write control unit (RX_WRC6) during the self-diagnosis has received the received data from the physical layer. The number of times is counted, and a second set count signal is generated when the count number reaches a predetermined number (for example, 10 times).

バッファコントロール13は、本発明のバッファ制御部に対応し、受信バッファメモリ8の空き容量を監視し、受信バッファメモリ8における記憶量が所定値を超えた場合にメモリ容量警告信号を生成する。   The buffer control 13 corresponds to the buffer control unit of the present invention, monitors the free capacity of the reception buffer memory 8, and generates a memory capacity warning signal when the storage amount in the reception buffer memory 8 exceeds a predetermined value.

SEL14は、後述するCHECK回路12の指令にしたがい、受信バッファメモリ8の出力とTX_RDC3の出力とのいずれかを選択してRX_RDC9に出力する。   The SEL 14 selects either the output of the reception buffer memory 8 or the output of the TX_RDC 3 and outputs it to the RX_RDC 9 in accordance with a command from the CHECK circuit 12 described later.

RX_RDC9は、本発明の読み出し制御部に対応し、受信バッファメモリ8に書き込まれた受信データをSEL14を介して読み出すとともに、読み出した受信データをCPUに出力する。   The RX_RDC 9 corresponds to the read control unit of the present invention, reads the reception data written in the reception buffer memory 8 through the SEL 14 and outputs the read reception data to the CPU.

CHECK回路12は、本発明の自己診断制御部に対応し、物理層から受信した受信データを利用して自己診断を行う第1タイミングを決定する。具体的には、CHECK回路12は、カウンタ10により生成された第1設定カウント信号に基づいて第1タイミングを決定する。   The CHECK circuit 12 corresponds to the self-diagnosis control unit of the present invention, and determines the first timing for performing self-diagnosis using received data received from the physical layer. Specifically, the CHECK circuit 12 determines the first timing based on the first set count signal generated by the counter 10.

SEL18は、本発明の遮断部に対応し、CHECK回路12により決定された第1タイミングに応じてTX_RDC3によるMACフレームの送信を遮断する。   The SEL 18 corresponds to the blocking unit of the present invention, and blocks transmission of the MAC frame by the TX_RDC 3 according to the first timing determined by the CHECK circuit 12.

また、上述したSEL17は、本発明の第1転送部に対応し、CHECK回路12により決定された第1タイミングに応じて、RX_RDC9により出力された受信データをTX_RDC3に転送する。   The SEL 17 described above corresponds to the first transfer unit of the present invention, and transfers the reception data output by the RX_RDC 9 to the TX_RDC 3 according to the first timing determined by the CHECK circuit 12.

次に、上述のように構成された本実施の形態の作用を説明する。図2は、本実施例のMAC回路の受信データを利用して自己診断を行う際の動作を示す図である。この場合における本実施例のMAC回路は、回路中におけるRX_WRC6、RX_RDC9、TX_RDC3といった部分を主に自己診断し、正常な動作が行われているか否かを判断する。   Next, the operation of the present embodiment configured as described above will be described. FIG. 2 is a diagram illustrating an operation when performing self-diagnosis using received data of the MAC circuit of the present embodiment. In this case, the MAC circuit according to the present embodiment mainly performs self-diagnosis on portions such as RX_WRC6, RX_RDC9, and TX_RDC3 in the circuit to determine whether normal operation is performed.

まず、カウンタ10は、RX_WRC6が物理層のPHYから受信データ5bを受信した回数をカウントする。なお、カウンタ10は、ループバック回路5を介して送信回路からのループバックデータ5cをRX_WRC6が受信したときにもカウントアップする設定でもよい。   First, the counter 10 counts the number of times the RX_WRC 6 has received the reception data 5b from the physical layer PHY. The counter 10 may be configured to count up when the RX_WRC 6 receives the loop back data 5c from the transmission circuit via the loop back circuit 5.

カウンタ10は、カウント数が所定の回数(例えば100回)に達した場合に第1設定カウント信号を生成し、CHECK回路12に出力する。CHECK回路12は、カウンタ10により生成された第1設定カウント信号に基づいて第1タイミングを決定する。すなわち、本実施例のMAC回路は、CHECK回路12により決定された第1タイミングに合わせて受信データを利用した自己診断を1回(あるいは複数回)行う。   The counter 10 generates a first setting count signal and outputs it to the CHECK circuit 12 when the count number reaches a predetermined number of times (for example, 100 times). The CHECK circuit 12 determines the first timing based on the first set count signal generated by the counter 10. That is, the MAC circuit of this embodiment performs self-diagnosis using received data once (or a plurality of times) in accordance with the first timing determined by the CHECK circuit 12.

カウンタ10により第1設定カウント信号が生成されると、CHECK回路12は、CPUに対してTX_RDC3による送信バッファメモリ2からの送信データの読み出しを中止させる旨の指令信号を出力する。CPUは、当該指令信号を受けた場合にTX_RDC3に指令を与えることにより、TX_RDC3による送信バッファメモリ2からの送信データの読み出しを中止させるとともに、RX_RDC9からの受信データの読み出しを開始させる。   When the first setting count signal is generated by the counter 10, the CHECK circuit 12 outputs a command signal for stopping reading of transmission data from the transmission buffer memory 2 by the TX_RDC 3 to the CPU. When receiving the command signal, the CPU gives a command to the TX_RDC 3 to stop reading the transmission data from the transmission buffer memory 2 by the TX_RDC 3 and start reading the reception data from the RX_RDC 9.

また、SEL17は、CHECK回路12により決定された第1タイミングに応じてRX_RDC9により出力された受信データ13bをTX_RDC3に転送する。   Further, the SEL 17 transfers the reception data 13b output from the RX_RDC 9 to the TX_RDC 3 according to the first timing determined by the CHECK circuit 12.

すなわち、MACフレーム生成部たるTX_RDC3及びFCS回路4は、CHECK回路12により決定された第1タイミングに応じて、送信バッファメモリ2に代えてRX_RDC9により出力された受信データ13bをSEL17を介して読み出すとともに、読み出した受信データに基づいてFCS回路4がFCS値を計算する。   That is, the TX_RDC 3 and the FCS circuit 4 serving as the MAC frame generation unit read out the reception data 13b output from the RX_RDC 9 instead of the transmission buffer memory 2 via the SEL 17 according to the first timing determined by the CHECK circuit 12. The FCS circuit 4 calculates the FCS value based on the read received data.

なお、SEL18は、CHECK回路12により決定された第1タイミングに応じてTX_RDC3によるMACフレームの送信を遮断する。   Note that the SEL 18 blocks transmission of the MAC frame by the TX_RDC 3 according to the first timing determined by the CHECK circuit 12.

RX_WRC6は、受信バッファメモリ8に受信データを書き込むとともに、FCS回路7でFCS値を計算させ、PHYから送られてきた受信データに付加されているFCS値と照合を行い、FCSエラーの有無を確認する。FCSエラーが発生した場合には、RX_WRC6は、受信バッファメモリ8に対して受信データの書き込みを行うが、PHYから送信されてくる次データで上書きすることにより、当該FCSエラーを含む受信データを破棄する。RX_WRC6は、受信バッファメモリ8に対して受信データを書き込む際に、受信データのみならず、FCS回路7で計算したFCS値も書き込む。   The RX_WRC 6 writes the received data in the receive buffer memory 8, causes the FCS circuit 7 to calculate the FCS value, checks the FCS value added to the received data sent from the PHY, and checks whether there is an FCS error To do. When an FCS error occurs, the RX_WRC 6 writes the received data to the receive buffer memory 8, but discards the received data including the FCS error by overwriting with the next data transmitted from the PHY. To do. The RX_WRC 6 writes not only the reception data but also the FCS value calculated by the FCS circuit 7 when writing the reception data to the reception buffer memory 8.

RX_RDC9は、受信バッファメモリ8から受信データ及びFCS値を読み出すとともに、読み出した受信データを出力する。出力された受信データは、CPUに転送されるとともに、上述したようにSEL17を介してTX_RDC3にも転送される。また、RX_RDC9は、読み出したFCS値13cをCHECK回路12に転送する。すなわち、第2書き込み制御部のFCS回路7により計算されたFCS値は、RX_RDC9によりCHECK回路12に転送されることになる。   The RX_RDC 9 reads the received data and the FCS value from the receive buffer memory 8 and outputs the read received data. The output received data is transferred to the CPU and also transferred to the TX_RDC 3 via the SEL 17 as described above. Further, the RX_RDC 9 transfers the read FCS value 13 c to the CHECK circuit 12. That is, the FCS value calculated by the FCS circuit 7 of the second write control unit is transferred to the CHECK circuit 12 by the RX_RDC 9.

一方、MACフレーム生成部のFCS回路4は、TX_RDC3に転送された受信データに基づいてFCS値を再計算し、計算結果たるFCS値をCHECK回路12に転送する。   On the other hand, the FCS circuit 4 of the MAC frame generation unit recalculates the FCS value based on the received data transferred to the TX_RDC 3 and transfers the FCS value as the calculation result to the CHECK circuit 12.

CHECK回路12は、第2書き込み制御部(FCS回路7)により計算されたFCS値とMACフレーム生成部(FCS回路4)により計算されたFCS値とを比較することにより、当該MAC回路内における異常の有無を診断する。具体的には、CHECK回路12は、両FCS値が一致した場合には、RX_WRC6、RX_RDC9、及びTX_RDC3が正常に動作していると判断する。一方、FCS値が一致しない場合には、CHECK回路12は、エラー信号をCPUに対して通知する。   The CHECK circuit 12 compares the FCS value calculated by the second write control unit (FCS circuit 7) with the FCS value calculated by the MAC frame generation unit (FCS circuit 4), thereby detecting an abnormality in the MAC circuit. Diagnose the presence or absence of. Specifically, the CHECK circuit 12 determines that RX_WRC6, RX_RDC9, and TX_RDC3 are operating normally when both FCS values match. On the other hand, if the FCS values do not match, the CHECK circuit 12 notifies the CPU of an error signal.

なお、RX_WRC6が受け取った受信データにFCSエラーがあった場合には、RX_WRC6は、上述したように、その受信データを一旦受信バッファメモリ8に書き込むものの、その後に受け取った受信データを受信バッファメモリ8に上書きすることにより、当該FCSエラーのあった受信データが破棄される。   If there is an FCS error in the received data received by the RX_WRC 6, the RX_WRC 6 once writes the received data in the receive buffer memory 8 as described above, but the received data received thereafter is received in the receive buffer memory 8 By overwriting, the received data having the FCS error is discarded.

このように、受信バッファメモリ8でデータが上書きされ、FCSエラーのある受信データが破棄される場合には、本発明のMAC回路は、受信データを利用した自己診断ができないことになる。また、自己診断中に送信されてくる全受信データにFCSエラーが発生した場合には、受信側回路が止まってしまうおそれもある。   As described above, when data is overwritten in the reception buffer memory 8 and reception data having an FCS error is discarded, the MAC circuit of the present invention cannot perform self-diagnosis using the reception data. In addition, if an FCS error occurs in all received data transmitted during self-diagnosis, the receiving circuit may stop.

そこで、カウンタ11は、カウンタ10により第1設定カウント信号が生成された場合に、自己診断中における第2書き込み制御部(RX_WRC6)が物理層から受信データを受信した回数をカウントするとともに、カウント数が所定の回数(例えば10回)に達した場合に第2設定カウント信号を生成する。このようにして、カウンタ11は、自己診断中の受信データ数をカウントし、規定値内で自己診断が完了できなかった場合は、自己診断モードを中止するための第2設定カウント信号を生成してCHECK回路12に出力する。   Therefore, the counter 11 counts the number of times the second write control unit (RX_WRC6) receives the received data from the physical layer during the self-diagnosis when the first setting count signal is generated by the counter 10, and the count number When the number reaches a predetermined number (for example, 10 times), the second set count signal is generated. In this way, the counter 11 counts the number of received data during self-diagnosis, and if the self-diagnosis cannot be completed within the specified value, generates a second setting count signal for stopping the self-diagnosis mode. To the CHECK circuit 12.

CHECK回路12は、カウンタ11により生成された第2設定カウント信号に基づいて自己診断を中止する。   The CHECK circuit 12 stops the self-diagnosis based on the second set count signal generated by the counter 11.

ここで、自己診断の終了方法について説明する。CHECK回路12は、自己診断を完了した場合でも中止した場合でも、以下に示す終了方法により自己診断を終了する。   Here, a method for terminating the self-diagnosis will be described. The CHECK circuit 12 terminates the self-diagnosis by the termination method described below regardless of whether the self-diagnosis is completed or stopped.

まずCHECK回路12は、TX_RDC3が送信バッファメモリ2から読出しを行わないようにするための信号を解除する。本実施例においては、CHECK回路12は、CPUに対してTX_RDC3による送信バッファメモリ2からの送信データの読み出しを再開させる旨の指令信号を出力する。CPUは、当該指令信号を受けた場合にTX_RDC3に指令を与えることにより、TX_RDC3によるRX_RDC9からの受信データの読み出しを中止させるとともに、送信バッファメモリ2からの送信データの読み出しを再開させる。   First, the CHECK circuit 12 cancels a signal for preventing the TX_RDC 3 from reading from the transmission buffer memory 2. In the present embodiment, the CHECK circuit 12 outputs a command signal for resuming reading of transmission data from the transmission buffer memory 2 by the TX_RDC 3 to the CPU. The CPU gives a command to the TX_RDC 3 when receiving the command signal, thereby stopping reading of the reception data from the RX_RDC 9 by the TX_RDC 3 and restarting reading of the transmission data from the transmission buffer memory 2.

また、CHECK回路12は、SEL18による遮断を解除するとともに、SEL17がRX_RDC9からの受信データの転送を中止して送信バッファメモリ2からTX_RDC3に対して送信データの転送が行われるように回路を切り替える。その後、MAC回路は、データの送受信を通常通りに行う。   Further, the CHECK circuit 12 releases the block by the SEL 18 and switches the circuit so that the SEL 17 stops the transfer of the reception data from the RX_RDC 9 and the transmission data is transferred from the transmission buffer memory 2 to the TX_RDC 3. Thereafter, the MAC circuit performs data transmission / reception as usual.

なお、本実施例のMAC回路は、自己診断中に受信バッファメモリ8あるいは送信バッファメモリ2があふれそうになった場合には自己診断を中止する。具体的には、バッファコントロール13は、受信バッファメモリ8の空き容量を監視し、受信バッファメモリ8における記憶量が所定値を超えた場合にメモリ容量警告信号を生成する。CPUは、バッファコントロール13により生成されたメモリ容量警告信号に応じてCHECK回路12に自己診断を中止する旨の指令信号を出力する。   Note that the MAC circuit of this embodiment stops the self-diagnosis when the reception buffer memory 8 or the transmission buffer memory 2 is likely to overflow during the self-diagnosis. Specifically, the buffer control 13 monitors the free capacity of the reception buffer memory 8 and generates a memory capacity warning signal when the storage amount in the reception buffer memory 8 exceeds a predetermined value. The CPU outputs a command signal to stop the self-diagnosis to the CHECK circuit 12 in accordance with the memory capacity warning signal generated by the buffer control 13.

同様に、バッファコントロール16は、送信バッファメモリ2の空き容量を監視し、送信バッファメモリ2における記憶量が所定値を超えた場合に警告信号を生成する。CPUは、バッファコントロール16により生成された警告信号に応じてCHECK回路12に自己診断を中止する旨の指令信号を出力する。   Similarly, the buffer control 16 monitors the free capacity of the transmission buffer memory 2 and generates a warning signal when the storage amount in the transmission buffer memory 2 exceeds a predetermined value. The CPU outputs a command signal to stop the self-diagnosis to the CHECK circuit 12 in accordance with the warning signal generated by the buffer control 16.

上述のとおり、本発明の実施例1の形態に係るMAC回路によれば、オンライン時に他のノードからの受信データをいかなる場合にも破棄することなく、定期的な自己診断を行って健全性を保ち続けることができる。すなわち、本実施例のMAC回路は、受信データを利用して自己診断を行うとともに、RX_RDC9が受信データをCPUと(SEL17を介して)TX_RDC3との双方に出力しているので、通常の受信データの受信に並行して自己診断も行うことができ、PHYからの受信をとめることなく自己診断を行うことができるメリットがある。   As described above, according to the MAC circuit according to the first embodiment of the present invention, it is possible to perform periodic self-diagnosis without discarding received data from other nodes in any case at the time of online operation, thereby improving the soundness. You can keep keeping. That is, the MAC circuit of the present embodiment performs self-diagnosis using the received data, and the RX_RDC 9 outputs the received data to both the CPU and the TX_RDC 3 (via the SEL 17). There is an advantage that self-diagnosis can be performed in parallel with reception of, and self-diagnosis can be performed without stopping reception from PHY.

また、CHECK回路12は、カウンタ10によりカウントされた受信データ数に基づいて自己診断を行うタイミングを決めているので、MAC回路の使用頻度に応じたタイミングで自己診断を行うことができ、より適切にMAC回路の健全性を保つことができる。   In addition, since the CHECK circuit 12 determines the timing for performing the self-diagnosis based on the number of received data counted by the counter 10, the self-diagnosis can be performed at a timing according to the usage frequency of the MAC circuit, and more appropriately. In addition, the soundness of the MAC circuit can be maintained.

さらに、カウンタ11を備えることにより、本実施例のMAC回路は、受信データにFCSエラーが生じている場合には適切に自己診断を中止することができる。   Furthermore, by providing the counter 11, the MAC circuit of the present embodiment can appropriately stop the self-diagnosis when an FCS error has occurred in the received data.

また、自己診断中に受信バッファメモリ8があふれそうになった場合にはバッファコントロール13の警告により、CHECK回路12は、自己診断処理を中断し通常の送受信モードに戻るため、受信処理が中断されることはない。   If the reception buffer memory 8 is likely to overflow during the self-diagnosis, the CHECK circuit 12 interrupts the self-diagnosis process and returns to the normal transmission / reception mode by a warning from the buffer control 13, so the reception process is interrupted. Never happen.

なお、カウンタ11のエラーカウントが規定値を超えた場合に、CHECK回路12は、CPUに対してループバック回路5を切り替える要求を出す構成でもよい。要求を受けたCPUは、ループバック回路5を切り替えて、CPUが自ら送信したデータをループバックさせる。   Note that when the error count of the counter 11 exceeds a specified value, the CHECK circuit 12 may be configured to issue a request to switch the loopback circuit 5 to the CPU. Upon receiving the request, the CPU switches the loopback circuit 5 to loop back the data transmitted by the CPU.

すなわち、ループバック回路5は、本発明のループバック部に対応し、カウンタ11により生成された第2設定カウント信号に応じて、物理層からRX_WRC6に対する受信データの受信を遮断するとともに、TX_RDC3により生成されたMACフレームをRX_WRC6に転送する。   That is, the loopback circuit 5 corresponds to the loopback unit of the present invention, and blocks reception of received data from the physical layer to the RX_WRC6 according to the second set count signal generated by the counter 11, and is generated by the TX_RDC3. The received MAC frame is transferred to RX_WRC6.

CPUは、自分が送信したデータとループバックで戻ってきたデータとが一致するか否かを確認し、データが一致した場合にはループバック回路5を切り替えて元に戻す。一致しない場合には、CPUは、例えば5フレームの送受信を繰り返し、それでもデータが一致しない場合には、MAC回路内に故障部分があると判断し、ループバック回路5を元に戻す。   The CPU checks whether or not the data transmitted by itself matches the data returned by the loopback, and when the data matches, switches the loopback circuit 5 to restore the original. If they do not match, the CPU repeats transmission / reception of, for example, 5 frames. If the data still does not match, the CPU determines that there is a failed part in the MAC circuit and returns the loopback circuit 5 to its original state.

ループバックさせている最中においては、MAC回路は、PHYから受信データを受信することができないが、FCSエラーについて外部からの受信データに原因があるのかMAC回路内に原因があるのかを判断することができる。   While the loopback is in progress, the MAC circuit cannot receive the received data from the PHY, but determines whether there is a cause in the received data from the outside or in the MAC circuit for the FCS error. be able to.

図3は、本実施例のMAC回路の送信データを利用して自己診断を行う際の動作を示す図である。なお、本実施例のMAC回路の構成は、実施例1と同様であり、重複した説明を省略する。ただし、本実施例のCHECK回路12は、CPUにより送信された送信データを利用して自己診断を行う第2タイミングを決定する。   FIG. 3 is a diagram illustrating an operation when performing self-diagnosis using transmission data of the MAC circuit of the present embodiment. The configuration of the MAC circuit of the present embodiment is the same as that of the first embodiment, and a duplicate description is omitted. However, the CHECK circuit 12 of this embodiment determines a second timing for performing self-diagnosis using transmission data transmitted by the CPU.

次に、上述のように構成された本実施の形態の作用を説明する。本実施例におけるMAC回路は、CPUからの送信データを利用することにより、回路中におけるTX_WRC1、TX_RDC3、RX_RDC9といった部分を主に自己診断し、正常な動作が行われているか否かを判断する。   Next, the operation of the present embodiment configured as described above will be described. The MAC circuit in the present embodiment mainly uses the transmission data from the CPU to perform self-diagnosis mainly on portions of TX_WRC1, TX_RDC3, and RX_RDC9 in the circuit to determine whether normal operation is being performed.

まず、カウンタ15は、TX_WRC1がCPUにより送信された送信データを受信した回数をカウントするとともに、カウント数が所定の回数に達した場合に第3設定カウント信号を生成し、CHECK回路12に出力する。   First, the counter 15 counts the number of times TX_WRC1 has received the transmission data transmitted by the CPU, and generates a third setting count signal when the count number reaches a predetermined number, and outputs it to the CHECK circuit 12 .

CHECK回路12は、カウンタ15により生成された第3設定カウント信号に基づいて第2タイミングを決定する。すなわち、本実施例のMAC回路は、CHECK回路12により決定された第2タイミングに合わせて送信データを利用した自己診断を1回(あるいは複数回)行う。   The CHECK circuit 12 determines the second timing based on the third set count signal generated by the counter 15. That is, the MAC circuit of the present embodiment performs self-diagnosis using the transmission data once (or a plurality of times) in accordance with the second timing determined by the CHECK circuit 12.

カウンタ15により第3設定カウント信号が生成されると、CHECK回路12は、CPUによる新規データの送信が中止されるようにCPUに対して指令信号を出力する。送信バッファメモリ2に書き込まれた送信データが全て送信されると、CHECK回路12は、CPUに対してRX_RDC9による受信バッファメモリ8からの受信データの読み出しを中止させる旨の指令信号を出力する。CPUは、当該指令信号を受けた場合にRX_RDC9に指令を与えることにより、RX_RDC9による受信バッファメモリ8からの送信データの読み出しを中止させるとともに、TX_RDC4からの送信データの読み出しを開始させる。   When the third setting count signal is generated by the counter 15, the CHECK circuit 12 outputs a command signal to the CPU so that transmission of new data by the CPU is stopped. When all the transmission data written in the transmission buffer memory 2 is transmitted, the CHECK circuit 12 outputs a command signal for stopping reading of the reception data from the reception buffer memory 8 by the RX_RDC 9 to the CPU. When receiving the command signal, the CPU gives a command to the RX_RDC 9 to stop reading the transmission data from the reception buffer memory 8 by the RX_RDC 9 and to start reading the transmission data from the TX_RDC 4.

また、SEL14は、本発明の第2転送部に対応し、CHECK回路12により決定された第2タイミングに応じてMACフレーム生成部(TX_RDC3)により出力されたMACフレームをRX_RDC9に転送する。   The SEL 14 corresponds to the second transfer unit of the present invention, and transfers the MAC frame output by the MAC frame generation unit (TX_RDC3) to the RX_RDC 9 according to the second timing determined by the CHECK circuit 12.

すなわち、RX_RDC9は、CHECK回路12により決定された第2タイミングに応じて、受信バッファメモリ8に代えてTX_RDC3により出力されたMACフレームをSEL14を介して読み出すとともに、読み出したMACフレームをCPUに出力する。   That is, the RX_RDC 9 reads out the MAC frame output from the TX_RDC 3 instead of the reception buffer memory 8 via the SEL 14 according to the second timing determined by the CHECK circuit 12, and outputs the read MAC frame to the CPU. .

なお、SEL18は、CHECK回路12により決定された第2タイミングに応じてTX_RDC3によるMACフレームの送信を遮断する。   Note that the SEL 18 blocks transmission of the MAC frame by the TX_RDC 3 according to the second timing determined by the CHECK circuit 12.

自己診断は、以下の手順により行われる。まずCPUは、テスト用送信データをMAC回路に対して送信する。TX_WRC1は、送信バッファメモリ2にテスト用送信データを書き込む。   The self-diagnosis is performed according to the following procedure. First, the CPU transmits test transmission data to the MAC circuit. TX_WRC1 writes test transmission data in the transmission buffer memory 2.

次に、TX_RDC3は、送信バッファメモリ2に書き込まれたテスト用送信データを読み出すとともに、読み出したテスト用送信データに基づいたMACフレームを生成し、SEL14を介してRX_RDC9に転送する。   Next, the TX_RDC 3 reads the test transmission data written in the transmission buffer memory 2, generates a MAC frame based on the read test transmission data, and transfers it to the RX_RDC 9 via the SEL 14.

RX_RDC9は、読み出したMACフレームをCPUに出力する。CPUは、送信したテスト用送信データと受信したMACフレームとを比較し、データが一致するか否かを判断する。データが一致した場合には、CPUは、TX_WRC1、TX_RDC3、RX_RDC9といった部分が正常に動作していると判断する。一方、データが不一致の場合には、CPUは、TX_WRC1、TX_RDC3、RX_RDC9のいずれかの回路部分が故障していると判断する。   The RX_RDC 9 outputs the read MAC frame to the CPU. The CPU compares the transmitted test transmission data with the received MAC frame, and determines whether the data match. If the data match, the CPU determines that the portions TX_WRC1, TX_RDC3, RX_RDC9 are operating normally. On the other hand, if the data do not match, the CPU determines that one of the circuit portions of TX_WRC1, TX_RDC3, and RX_RDC9 has failed.

自己診断を完了すると、CHECK回路12は、SEL14がTX_RDC3からのMACフレームの転送を中止して受信バッファメモリ8からRX_RDC9に対して受信データの転送が行われるように回路を切り替える。また、CHECK回路12は、CPUによる新規データの送信が再開されるようにCPUに対して指令信号を出力する。さらに、CHECK回路12は、SEL18による遮断を解除する。   When the self-diagnosis is completed, the CHECK circuit 12 switches the circuit so that the SEL 14 stops the transfer of the MAC frame from the TX_RDC 3 and the reception data is transferred from the reception buffer memory 8 to the RX_RDC 9. Further, the CHECK circuit 12 outputs a command signal to the CPU so that transmission of new data by the CPU is resumed. Further, the CHECK circuit 12 releases the blocking by the SEL 18.

また、CHECK回路12は、RX_RDC9が受信バッファメモリ8から読出しを行わないようにするための信号を解除する。本実施例においては、CHECK回路12は、CPUに対してRX_RDC9による受信バッファメモリ8からの受信データの読み出しを再開させる旨の指令信号を出力する。CPUは、当該指令信号を受けた場合にRX_RDC9に指令を与えることにより、RX_RDC9によるTX_RDC3からのMACフレームの読み出しを中止させるとともに、受信バッファメモリ8からの受信データの読み出しを再開させる。その後、MAC回路は、データの送受信を通常通りに行う。   Further, the CHECK circuit 12 cancels a signal for preventing the RX_RDC 9 from reading from the reception buffer memory 8. In the present embodiment, the CHECK circuit 12 outputs a command signal for resuming reading of received data from the reception buffer memory 8 by the RX_RDC 9 to the CPU. When receiving the command signal, the CPU gives a command to the RX_RDC 9 to stop the reading of the MAC frame from the TX_RDC 3 by the RX_RDC 9 and to restart the reading of the reception data from the reception buffer memory 8. Thereafter, the MAC circuit performs data transmission / reception as usual.

なお、本実施例のMAC回路は、自己診断中に受信バッファメモリ8あるいは送信バッファメモリ2があふれそうになった場合には自己診断を中止する。具体的には、バッファコントロール13は、受信バッファメモリ8の空き容量を監視し、受信バッファメモリ8における記憶量が所定値を超えた場合にメモリ容量警告信号を生成する。   Note that the MAC circuit of this embodiment stops the self-diagnosis when the reception buffer memory 8 or the transmission buffer memory 2 is likely to overflow during the self-diagnosis. Specifically, the buffer control 13 monitors the free capacity of the reception buffer memory 8 and generates a memory capacity warning signal when the storage amount in the reception buffer memory 8 exceeds a predetermined value.

SEL14は、バッファコントロール13により生成されたメモリ容量警告信号に応じてMACフレームの転送を中止する。ただし、本実施例においては、バッファコントロール13が直接的にSEL14に対して指令を行うわけではなく、CPU及びCHECK回路12を介した動作となる。   The SEL 14 stops the transfer of the MAC frame in response to the memory capacity warning signal generated by the buffer control 13. However, in this embodiment, the buffer control 13 does not directly issue a command to the SEL 14, and the operation is performed via the CPU and the CHECK circuit 12.

すなわち、SEL14は、バッファコントロール13によりメモリ容量警告信号が生成されると、CHECK回路12から指令を受け、TX_RDC3からのMACフレームの転送を中止して受信バッファメモリ8からRX_RDC9に対して受信データの転送が行われるように回路を切り替える。   That is, when the memory capacity warning signal is generated by the buffer control 13, the SEL 14 receives a command from the CHECK circuit 12, stops the transfer of the MAC frame from the TX_RDC 3, and receives the received data from the reception buffer memory 8 to the RX_RDC 9 Switch the circuit so that the transfer takes place.

また、RX_RDC9は、バッファコントロール13により生成されたメモリ容量警告信号に応じて、読み出し先を再度受信バッファメモリ8に戻す。具体的には、メモリ容量警告信号を受信したCPUが、RX_RDC9に指令を与えることにより、RX_RDC9によるTX_RDC3からのMACフレームの読み出しを中止させるとともに、受信バッファメモリ8からの受信データの読み出しを再開させる。   Further, the RX_RDC 9 returns the read destination to the reception buffer memory 8 again according to the memory capacity warning signal generated by the buffer control 13. Specifically, the CPU that has received the memory capacity warning signal gives a command to the RX_RDC 9, thereby stopping the reading of the MAC frame from the TX_RDC 3 by the RX_RDC 9 and restarting the reading of the reception data from the reception buffer memory 8. .

本実施例におけるMAC回路は、上述したように、自己診断中においては受信バッファメモリ8に書き込まれた受信データがRX_RDC9により読み出されないので、実施例1のように自己診断中にリアルタイムで受信データがCPUに出力されることはなく、自己診断中に受信した受信データは受信バッファメモリ8に記憶され、自己診断終了後にまとめて受信バッファメモリ8から受信データをCPUに送るものである。したがって、受信バッファメモリ8に空き容量が無くなると、受信バッファメモリ8は、新たに受信データを受信するたびに古いデータに上書きしてしまい、CPUに出力することなく受信データを破棄してしまうことになる。バッファコントロール13は、上述した問題が発生する前に受信バッファメモリ8の空き容量に応じて自己診断を中止し、受信データの破棄を回避するものである。   As described above, the MAC circuit in the present embodiment does not read the received data written in the reception buffer memory 8 by the RX_RDC 9 during the self-diagnosis, so that the received data in real time during the self-diagnosis as in the first embodiment. Is not output to the CPU, and the received data received during the self-diagnosis is stored in the reception buffer memory 8, and after the self-diagnosis is completed, the received data is sent from the reception buffer memory 8 to the CPU. Therefore, when there is no more free space in the reception buffer memory 8, the reception buffer memory 8 overwrites the old data every time new reception data is received, and discards the reception data without outputting to the CPU. become. The buffer control 13 stops the self-diagnosis according to the free capacity of the reception buffer memory 8 before the above-described problem occurs, and avoids discarding of received data.

上述のとおり、本発明の実施例2の形態に係るMAC回路によれば、実施例1と同様の効果を得ることができるのみならず、送信データを利用して自己診断を行うことで、TX_WRC1等の実施例1で確認できなかった回路部分について自己診断を行うことができる。また、CHECK回路12は、カウンタ15によりカウントされた送信データ数に基づいて自己診断を行うタイミングを決めているので、MAC回路の使用頻度に応じたタイミングで自己診断を行うことができ、より適切にMAC回路の健全性を保つことができる。   As described above, according to the MAC circuit according to the second embodiment of the present invention, not only can the same effect as the first embodiment be obtained, but also TX_WRC1 can be obtained by performing self-diagnosis using transmission data. Self-diagnosis can be performed for circuit portions that could not be confirmed in the first embodiment. In addition, since the CHECK circuit 12 determines the timing for performing the self-diagnosis based on the number of transmission data counted by the counter 15, the self-diagnosis can be performed at a timing according to the frequency of use of the MAC circuit. In addition, the soundness of the MAC circuit can be maintained.

また、自己診断中に受信バッファメモリ8があふれそうになった場合にはバッファコントロール13の警告により、CHECK回路12は、自己診断処理を中断し通常の送受信モードに戻るため、受信データが破棄されることなく適切に受信処理を行うことができる。   If the reception buffer memory 8 is likely to overflow during the self-diagnosis, the CHECK circuit 12 interrupts the self-diagnosis process and returns to the normal transmission / reception mode by the warning of the buffer control 13, so that the received data is discarded. The reception process can be appropriately performed without any problem.

本発明に係るMAC回路は、データを送信するためのMACフレームの生成や受信したデータの誤り検出等を行って通信媒体のアクセスを制御するMAC回路に利用可能である。   The MAC circuit according to the present invention can be used for a MAC circuit that controls access to a communication medium by generating a MAC frame for transmitting data, detecting an error in received data, and the like.

1 TX_WRC
2 送信バッファメモリ
3 TX_RDC
4 FCS回路
5 ループバック回路
5a ループバック指令
5b 受信データ
5c ループバックデータ
6 RX_WRC
7 FCS回路
8 受信バッファメモリ
9 RX_RDC
9a 受信データ
10,11 カウンタ
12 CHECK回路
13 バッファコントロール
13b 受信データ
13c FCS値
14 SEL
15 カウンタ
16 バッファコントロール
17,18 SEL
1 TX_WRC
2 Transmission buffer memory 3 TX_RDC
4 FCS circuit 5 Loopback circuit 5a Loopback command 5b Received data 5c Loopback data 6 RX_WRC
7 FCS circuit 8 Receive buffer memory 9 RX_RDC
9a Received data 10, 11 Counter 12 CHECK circuit 13 Buffer control 13b Received data 13c FCS value 14 SEL
15 Counter 16 Buffer control 17, 18 SEL

Claims (7)

物理層と中央処理装置との間に介在して通信媒体のアクセスを制御するMAC回路であって、
前記中央処理装置により送信された送信データを一時的に記憶するための送信バッファメモリと、
前記中央処理装置により送信された送信データを前記送信バッファメモリに書き込む第1書き込み制御部と、
前記送信バッファメモリに書き込まれた送信データを読み出すとともに、読み出した送信データに基づいてFCS値を含むMACフレームを生成して前記物理層に送信するMACフレーム生成部と、
前記物理層から受信した受信データを一時的に記憶するための受信バッファメモリと、
前記物理層から受信した受信データに基づいてFCSエラーの有無を確認するとともに、前記受信データに計算したFCS値を付加して前記受信バッファメモリに書き込む第2書き込み制御部と、
前記受信バッファメモリに書き込まれた受信データを読み出すとともに、読み出した受信データを前記中央処理装置に出力する読み出し制御部と、
前記物理層から受信した受信データを利用して自己診断を行う第1タイミングを決定する自己診断制御部と、
前記自己診断制御部により決定された第1タイミングに応じて前記MACフレーム生成部によるMACフレームの送信を遮断する遮断部と、
前記自己診断制御部により決定された第1タイミングに応じて前記読み出し制御部により出力された受信データを前記MACフレーム生成部に転送する第1転送部とを備え、
前記MACフレーム生成部は、前記自己診断制御部により決定された第1タイミングに応じて、前記送信バッファメモリに代えて前記読み出し制御部により出力された受信データを前記第1転送部を介して読み出すとともに、読み出した受信データに基づいてFCS値を計算し、
前記自己診断制御部は、前記第2書き込み制御部により計算されたFCS値と前記MACフレーム生成部により計算されたFCS値とを比較することにより当該MAC回路内における異常の有無を診断することを特徴とするMAC回路。
A MAC circuit for controlling access to a communication medium interposed between a physical layer and a central processing unit,
A transmission buffer memory for temporarily storing transmission data transmitted by the central processing unit;
A first write control unit for writing the transmission data transmitted by the central processing unit into the transmission buffer memory;
A MAC frame generation unit that reads transmission data written in the transmission buffer memory, generates a MAC frame including an FCS value based on the read transmission data, and transmits the MAC frame to the physical layer;
A reception buffer memory for temporarily storing reception data received from the physical layer;
A second write control unit for confirming the presence or absence of an FCS error based on the received data received from the physical layer, and adding the calculated FCS value to the received data and writing to the receive buffer memory;
A read controller that reads the received data written in the reception buffer memory and outputs the read received data to the central processing unit;
A self-diagnosis control unit for determining a first timing for performing self-diagnosis using received data received from the physical layer;
A blocking unit that blocks transmission of the MAC frame by the MAC frame generation unit according to the first timing determined by the self-diagnosis control unit;
A first transfer unit that transfers the received data output by the read control unit to the MAC frame generation unit according to a first timing determined by the self-diagnosis control unit;
The MAC frame generation unit reads the reception data output by the read control unit instead of the transmission buffer memory via the first transfer unit according to the first timing determined by the self-diagnosis control unit. At the same time, the FCS value is calculated based on the read received data,
The self-diagnosis control unit diagnoses whether there is an abnormality in the MAC circuit by comparing the FCS value calculated by the second write control unit with the FCS value calculated by the MAC frame generation unit. Feature MAC circuit.
前記第2書き込み制御部が前記物理層から受信データを受信した回数をカウントするとともに、カウント数が所定の回数に達した場合に第1設定カウント信号を生成する第1カウンタを備え、
前記自己診断制御部は、前記第1カウンタにより生成された第1設定カウント信号に基づいて前記第1タイミングを決定することを特徴とする請求項1記載のMAC回路。
A first counter that counts the number of times the second write control unit receives received data from the physical layer and generates a first set count signal when the count reaches a predetermined number;
2. The MAC circuit according to claim 1, wherein the self-diagnosis control unit determines the first timing based on a first setting count signal generated by the first counter.
前記第1カウンタにより第1設定カウント信号が生成された場合に、自己診断中における前記第2書き込み制御部が前記物理層から受信データを受信した回数をカウントするとともに、カウント数が所定の回数に達した場合に第2設定カウント信号を生成する第2カウンタを備え、
前記自己診断制御部は、前記第2カウンタにより生成された第2設定カウント信号に基づいて自己診断を中止することを特徴とする請求項2記載のMAC回路。
When the first setting count signal is generated by the first counter, the second write control unit during self-diagnosis counts the number of times received data is received from the physical layer, and the count number is set to a predetermined number. A second counter for generating a second set count signal when reached
3. The MAC circuit according to claim 2, wherein the self-diagnosis control unit stops the self-diagnosis based on a second setting count signal generated by the second counter.
前記第2カウンタにより生成された第2設定カウント信号に応じて、前記物理層から前記第2書き込み制御部に対する受信データの受信を遮断するとともに前記MACフレーム生成部により生成されたMACフレームを前記第2書き込み制御部に転送するループバック部を備えることを特徴とする請求項3記載のMAC回路。   According to the second set count signal generated by the second counter, reception of reception data from the physical layer to the second write control unit is blocked and the MAC frame generated by the MAC frame generation unit is 4. The MAC circuit according to claim 3, further comprising a loopback unit for transferring to the two write control unit. 自己診断制御部は、前記中央処理装置により送信された送信データを利用して自己診断を行う第2タイミングを決定し、
前記遮断部は、前記自己診断制御部により決定された第2タイミングに応じて前記MACフレーム生成部によるMACフレームの送信を遮断し、
前記自己診断制御部により決定された第2タイミングに応じて前記MACフレーム生成部により出力されたMACフレームを前記読み出し制御部に転送する第2転送部を備え、
前記読み出し制御部は、前記自己診断制御部により決定された第2タイミングに応じて、前記受信バッファメモリに代えて前記MACフレーム生成部により出力されたMACフレームを前記第2転送部を介して読み出すとともに、読み出したMACフレームを前記中央処理装置に出力することを特徴とする請求項1乃至請求項4のいずれか1項記載のMAC回路。
The self-diagnosis control unit determines a second timing for performing self-diagnosis using transmission data transmitted by the central processing unit,
The blocking unit blocks transmission of the MAC frame by the MAC frame generation unit according to the second timing determined by the self-diagnosis control unit,
A second transfer unit that transfers the MAC frame output by the MAC frame generation unit to the read control unit according to the second timing determined by the self-diagnosis control unit;
The read control unit reads the MAC frame output from the MAC frame generation unit instead of the reception buffer memory via the second transfer unit according to the second timing determined by the self-diagnosis control unit. 5. The MAC circuit according to claim 1, wherein the read MAC frame is output to the central processing unit.
前記第1書き込み制御部が前記中央処理装置により送信された送信データを受信した回数をカウントするとともに、カウント数が所定の回数に達した場合に第3設定カウント信号を生成する第3カウンタを備え、
前記自己診断制御部は、前記第3カウンタにより生成された第3設定カウント信号に基づいて前記第2タイミングを決定することを特徴とする請求項5記載のMAC回路。
A third counter that counts the number of times the first write control unit has received the transmission data transmitted by the central processing unit and generates a third set count signal when the count reaches a predetermined number; ,
The MAC circuit according to claim 5, wherein the self-diagnosis control unit determines the second timing based on a third setting count signal generated by the third counter.
前記受信バッファメモリの空き容量を監視し、前記受信バッファメモリにおける記憶量が所定値を超えた場合にメモリ容量警告信号を生成するバッファ制御部を備え、
前記第2転送部は、前記バッファ制御部により生成されたメモリ容量警告信号に応じて転送を中止し、
前記読み出し制御部は、前記バッファ制御部により生成されたメモリ容量警告信号に応じて、読み出し先を再度受信バッファメモリに戻すことを特徴とする請求項5又は請求項6記載のMAC回路。
A buffer control unit that monitors a free capacity of the reception buffer memory and generates a memory capacity warning signal when a storage amount in the reception buffer memory exceeds a predetermined value;
The second transfer unit stops transfer according to the memory capacity warning signal generated by the buffer control unit,
7. The MAC circuit according to claim 5, wherein the read control unit returns the read destination to the reception buffer memory again according to the memory capacity warning signal generated by the buffer control unit.
JP2009253272A 2009-11-04 2009-11-04 Mac circuit Pending JP2011101113A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009253272A JP2011101113A (en) 2009-11-04 2009-11-04 Mac circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009253272A JP2011101113A (en) 2009-11-04 2009-11-04 Mac circuit

Publications (1)

Publication Number Publication Date
JP2011101113A true JP2011101113A (en) 2011-05-19

Family

ID=44191953

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009253272A Pending JP2011101113A (en) 2009-11-04 2009-11-04 Mac circuit

Country Status (1)

Country Link
JP (1) JP2011101113A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016009931A (en) * 2014-06-23 2016-01-18 日本電信電話株式会社 Station side optical line termination device, subscriber side optical line termination device, signal generation method, and signal reception method
JP2016009930A (en) * 2014-06-23 2016-01-18 日本電信電話株式会社 Station side optical line terminator and signal generation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016009931A (en) * 2014-06-23 2016-01-18 日本電信電話株式会社 Station side optical line termination device, subscriber side optical line termination device, signal generation method, and signal reception method
JP2016009930A (en) * 2014-06-23 2016-01-18 日本電信電話株式会社 Station side optical line terminator and signal generation method

Similar Documents

Publication Publication Date Title
JP4437984B2 (en) Network relay device and control method thereof
JP4874185B2 (en) Multi-fault handling system and shared link terminator used therefor
US20060126517A1 (en) Loop detection method and device
KR19990067626A (en) Packet transmitter and receiver
JP2007067528A (en) Network relaying apparatus, fault diagnostic apparatus, and program
WO2011131081A1 (en) Method and apparatus for implementing redundancy serial bus
JP2008301003A (en) Relay apparatus, network, and frame relaying method used for them
JP5125430B2 (en) Information processing apparatus and information processing method
US9294342B2 (en) Network node apparatus system, apparatus, and method
JP2010160660A (en) Network interface, computer system, operation method therefor, and program
JP2011101113A (en) Mac circuit
JP3861226B2 (en) Concentrator and its reset management method
TW201512832A (en) Snapshot message
JP2008236266A (en) Transmission device, frame for maintenance processing method and transmission program
US7542418B2 (en) Method and apparatus for detecting and removing orphaned primitives in a fibre channel network
WO2009089710A1 (en) Method and apparatus for port configuration
WO2021044652A1 (en) Master device, arithmetic processing device, programmable logic controller, network, and method
JP6136754B2 (en) Communication control apparatus and image forming apparatus
JP2001203705A (en) Device and method for controlling flow and storage medium recording flow control program
JP3916455B2 (en) Digital interface device and bus control method between information processing devices using the same
JP4086839B2 (en) Network communication system and failure detection notification method
JP5579637B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND CONNECTION STATE DETECTION METHOD
JP2000354040A (en) Device and method for controlling system switching
JP2002032269A (en) Communication error restoring method and its device
JP2002057712A (en) Memory leakage recovery method for packet memory and buffer processing unit