JP2014132251A - Counter circuit - Google Patents

Counter circuit Download PDF

Info

Publication number
JP2014132251A
JP2014132251A JP2013000700A JP2013000700A JP2014132251A JP 2014132251 A JP2014132251 A JP 2014132251A JP 2013000700 A JP2013000700 A JP 2013000700A JP 2013000700 A JP2013000700 A JP 2013000700A JP 2014132251 A JP2014132251 A JP 2014132251A
Authority
JP
Japan
Prior art keywords
counter
counters
circuit
control circuit
signal
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
JP2013000700A
Other languages
Japanese (ja)
Inventor
Atsuyuki Sasaki
敦之 佐々木
Yasushi Sasaki
靖 笹木
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2013000700A priority Critical patent/JP2014132251A/en
Publication of JP2014132251A publication Critical patent/JP2014132251A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a technique which allows a counter circuit to continue counting operation even when an anomaly is detected in the middle of counting operation.SOLUTION: A counter circuit includes L N/M-bit counters. Each counter outputs a result signal representing a carry every time N/M bits are counted using an input signal. A control circuit performs an anomaly detection process during counting operation. In the anomaly detection process, the control circuit selects two or more of the L counters as comparison counters, sets connections such that an identical signal is fed to the comparison counters as input signals, and determines whether the comparison counters include an abnormal counter or not by comparing the result signals from the comparison counters.

Description

本発明は、カウンタ回路に関する。   The present invention relates to a counter circuit.

半導体集積回路においてカウンタ回路は広く利用されている。カウンタ回路の異常は半導体集積回路の動作不良の原因となるため、カウンタ回路の異常を検出することは重要である。特に車載用の電子制御装置の場合、安全性確保の観点から、カウンタ回路の異常を検出することは非常に重要である。   Counter circuits are widely used in semiconductor integrated circuits. Since an abnormality of the counter circuit causes a malfunction of the semiconductor integrated circuit, it is important to detect the abnormality of the counter circuit. In particular, in the case of an on-vehicle electronic control device, it is very important to detect an abnormality in the counter circuit from the viewpoint of ensuring safety.

特許文献1(特開2004−29992号公報)は、2つのカウンタ回路を並列に動作させることによってクロック異常を検出する技術を開示している。より詳細には、監視CPUは、自身に入力されるクロック信号に基づいて一定周期でトリガ信号を生成し、そのトリガ信号を制御CPUに送信する。制御CPUは、自身に入力されるクロック信号に基づいて第1カウンタ回路を動作させ、且つ、監視CPUより入力されるトリガ信号に基づいて第2カウンタ回路を動作させる。そして、第1カウンタ回路と第2カウンタ回路のカウント値の差分を2つの異なるタイミングで比較し、その比較結果からクロック異常を検出する。   Japanese Patent Laid-Open No. 2004-29992 discloses a technique for detecting a clock abnormality by operating two counter circuits in parallel. More specifically, the monitoring CPU generates a trigger signal at a constant period based on a clock signal input to itself, and transmits the trigger signal to the control CPU. The control CPU operates the first counter circuit based on the clock signal input to itself, and operates the second counter circuit based on the trigger signal input from the monitoring CPU. Then, the difference between the count values of the first counter circuit and the second counter circuit is compared at two different timings, and a clock abnormality is detected from the comparison result.

特許文献2(特開平10−206508号公報)は、カウンタ回路が正常に動作するか否かを判断するテストに関する技術を開示している。より詳細には、通常動作とは異なるテスト時、テスト回路は、カウンタ回路を第1カウンタ回路と第2カウンタ回路とに分割し、クロック信号をそれら第1、第2カウンタ回路のそれぞれに入力する。そして、テスト回路は、第1カウンタ回路の出力信号と第2カウンタ回路の出力信号とを比較し、両信号が一致しているか否かにより、カウンタ回路が正常に動作しているか否かを判断する。   Japanese Patent Laid-Open No. 10-206508 discloses a technique related to a test for determining whether or not a counter circuit operates normally. More specifically, during a test different from the normal operation, the test circuit divides the counter circuit into a first counter circuit and a second counter circuit, and inputs a clock signal to each of the first and second counter circuits. . Then, the test circuit compares the output signal of the first counter circuit and the output signal of the second counter circuit, and determines whether the counter circuit is operating normally based on whether the two signals match. To do.

特開2004−29992号公報JP 2004-29992 A 特開平10−206508号公報Japanese Patent Laid-Open No. 10-206508

上記の関連技術では、カウント動作の最中に異常が検出された場合に、カウント動作を継続させることができない。このことは、カウンタが搭載された半導体集積回路の動作信頼性の低下を招く。   In the related art, when an abnormality is detected during the counting operation, the counting operation cannot be continued. This leads to a decrease in operation reliability of the semiconductor integrated circuit on which the counter is mounted.

その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるだろう。   Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.

カウンタ回路は、L個のカウンタと、L個のカウンタに接続された制御回路と、を備える。L個のカウンタの各々は、N/Mビットカウンタであり、入力信号に基づいてN/Mビットカウントする度に桁上がりを示す結果信号を出力する。ここで、Nは2以上の整数であり、Mは2以上の整数であり、LはM以上の整数である。制御回路は、L個のカウンタの各々について、入力信号がクロック信号あるいは他のカウンタの結果信号となるように接続関係を制御する機能と、カウント動作中に異常検知処理を行う機能と、を備える。異常検知処理において、制御回路は、L個のカウンタのうち2以上を比較対象カウンタとして選択し、比較対象カウンタに対して同じ信号が入力信号として入力されるように接続関係を設定し、更に、比較対象カウンタからの結果信号を比較することによって比較対象カウンタの中に異常カウンタが含まれているか否かを判定する。   The counter circuit includes L counters and a control circuit connected to the L counters. Each of the L counters is an N / M bit counter and outputs a result signal indicating a carry each time N / M bits are counted based on an input signal. Here, N is an integer greater than or equal to 2, M is an integer greater than or equal to 2, and L is an integer greater than or equal to M. The control circuit has a function of controlling a connection relationship so that an input signal becomes a clock signal or a result signal of another counter for each of the L counters, and a function of performing an abnormality detection process during the counting operation. . In the abnormality detection process, the control circuit selects two or more of the L counters as comparison target counters, sets the connection relationship so that the same signal is input as an input signal to the comparison target counter, It is determined whether or not an abnormality counter is included in the comparison target counter by comparing result signals from the comparison target counter.

制御回路は、N/Mビットのカウント毎に異常検知処理を行う。第1のN/Mビットのカウントに対する異常検知処理の結果、制御回路は、比較対象カウンタのうち異常カウンタ以外の少なくとも1つを、第1のN/Mビットのカウントを担当する第1カウンタとして設定する。第1のN/Mビットに続く第2のN/Mビットのカウントに対する異常検知処理において、制御回路は、第1カウンタ以外のカウンタから比較対象カウンタを選択し、比較対象カウンタに対して第1カウンタからの結果信号が入力信号として入力されるように接続関係を設定する。   The control circuit performs an abnormality detection process every count of N / M bits. As a result of the abnormality detection processing for the first N / M bit count, the control circuit sets at least one of the comparison target counters other than the abnormality counter as a first counter in charge of the first N / M bit count. Set. In the abnormality detection processing for the second N / M bit count subsequent to the first N / M bit, the control circuit selects a comparison target counter from counters other than the first counter, and the first comparison target counter is first selected. The connection relationship is set so that the result signal from the counter is input as an input signal.

本開示によれば、カウント動作の最中に異常が検出された場合でも、カウント動作を継続させることが可能である。カウント動作が停止しないため、カウンタ回路が搭載された半導体集積回路の動作信頼性が向上する。   According to the present disclosure, even when an abnormality is detected during the counting operation, the counting operation can be continued. Since the count operation does not stop, the operation reliability of the semiconductor integrated circuit on which the counter circuit is mounted is improved.

図1は、第1の実施の形態に係るカウンタ回路の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a counter circuit according to the first embodiment. 図2Aは、第1の実施の形態に係るカウンタ回路の第1の動作例を説明するための概念図である。FIG. 2A is a conceptual diagram for explaining a first operation example of the counter circuit according to the first embodiment. 図2Bは、第1の実施の形態に係るカウンタ回路の第1の動作例を説明するための概念図である。FIG. 2B is a conceptual diagram for explaining a first operation example of the counter circuit according to the first embodiment. 図2Cは、第1の実施の形態に係るカウンタ回路の第1の動作例を説明するための概念図である。FIG. 2C is a conceptual diagram for explaining a first operation example of the counter circuit according to the first embodiment. 図2Dは、第1の実施の形態に係るカウンタ回路の第1の動作例を説明するための概念図である。FIG. 2D is a conceptual diagram for explaining a first operation example of the counter circuit according to the first embodiment. 図3は、第1の実施の形態に係るカウンタ回路の第1の動作例を説明するための概念図である。FIG. 3 is a conceptual diagram for explaining a first operation example of the counter circuit according to the first embodiment. 図4Aは、第1の実施の形態に係るカウンタ回路の第2の動作例を説明するための概念図である。FIG. 4A is a conceptual diagram for explaining a second operation example of the counter circuit according to the first embodiment. 図4Bは、第1の実施の形態に係るカウンタ回路の第2の動作例を説明するための概念図である。FIG. 4B is a conceptual diagram for explaining a second operation example of the counter circuit according to the first embodiment. 図4Cは、第1の実施の形態に係るカウンタ回路の第2の動作例を説明するための概念図である。FIG. 4C is a conceptual diagram for explaining a second operation example of the counter circuit according to the first embodiment. 図4Dは、第1の実施の形態に係るカウンタ回路の第2の動作例を説明するための概念図である。FIG. 4D is a conceptual diagram for explaining a second operation example of the counter circuit according to the first embodiment. 図5は、第2の実施の形態に係るカウンタ回路に内蔵されるアラーム回路の構成を示すブロック図である。FIG. 5 is a block diagram showing a configuration of an alarm circuit built in the counter circuit according to the second embodiment. 図6は、アラームレジスタの一例を示す概念図である。FIG. 6 is a conceptual diagram illustrating an example of an alarm register. 図7は、アラームレジスタの他の例を示す概念図である。FIG. 7 is a conceptual diagram illustrating another example of an alarm register. 図8は、第3の実施の形態に係る構成を示すブロック図である。FIG. 8 is a block diagram showing a configuration according to the third embodiment.

添付図面を参照して、実施の形態に係るカウンタ回路を説明する。   A counter circuit according to an embodiment will be described with reference to the accompanying drawings.

1.第1の実施の形態
1−1.構成
図1は、第1の実施の形態に係るカウンタ回路1の構成を示すブロック図である。カウンタ回路1は、Nビット(2カウント)のカウント値を得るための回路である。ここで、Nは2以上の整数である。
1. 1. First embodiment 1-1. Configuration FIG. 1 is a block diagram showing a configuration of a counter circuit 1 according to the first embodiment. The counter circuit 1 is a circuit for obtaining a count value of N bits (2 N counts). Here, N is an integer of 2 or more.

本実施の形態に係るカウンタ回路1は、L個のカウンタ10(カウンタ10−1〜カウンタ10−L)を備えている。各々のカウンタ10はN/Mビットカウンタであり、M個のカウンタ10をつなぐことによってNビットのカウントが可能となる。ここで、Mは2以上且つN以下の整数であり、LはM以上の整数である(L≧M)。例えば、N=12、M=3、L=4の場合、12ビットカウントのために4ビットカウンタが4個設けられる。この場合、1個の4ビットカウンタは予備となる。このようにLがMより大きい場合(L>M)、予備のカウンタが発生するが、これは必須ではない。本実施の形態は、LがMと同じである場合(L=M)も含む。   The counter circuit 1 according to the present embodiment includes L counters 10 (counter 10-1 to counter 10-L). Each counter 10 is an N / M bit counter, and N bits can be counted by connecting M counters 10. Here, M is an integer of 2 or more and N or less, and L is an integer of M or more (L ≧ M). For example, when N = 12, M = 3, and L = 4, four 4-bit counters are provided for 12-bit counting. In this case, one 4-bit counter is reserved. Thus, if L is greater than M (L> M), a spare counter is generated, but this is not essential. This embodiment also includes a case where L is the same as M (L = M).

各々のカウンタ10は、入力信号に基づいてN/Mビットのカウント動作を行う。そして、各カウンタ10は、N/Mビットカウントする度に、“桁上がり”を示す結果信号Dを出力する。以下の説明において、カウンタ10−i(i=1〜L)から出力される結果信号は、Dと参照される。 Each counter 10 performs an N / M bit count operation based on an input signal. Each time the counter 10 counts N / M bits, it outputs a result signal D indicating “carry”. In the following description, the result signal output from the counter 10-i (i = 1~L) is referred to as D i.

各カウンタ10に入力される入力信号は、任意に設定可能である。そのために、カウンタ10−1〜10−Lの前段にスイッチ20−1〜20−Lがそれぞれ設けられている。例えば、あるカウンタ10−iとスイッチ20−iを考える(iは1〜Lのいずれか)。スイッチ20−iは、発振器30から出力されるクロック信号CLKと、カウンタ10−i以外のカウンタ10−j(j=1〜L、j≠i)から出力される結果信号Dを受け取る。そして、スイッチ20−iは、スイッチ制御信号SWに応じて、クロック信号CLKと結果信号Dの中から1つを選択し、その選択信号をカウンタ10−iに出力する。すなわち、カウンタ10−iに対する入力信号は、クロック信号CLKあるいは他のカウンタ10−jからの結果信号Dであり、それはスイッチ制御信号SWにより動的に制御可能である。 The input signal input to each counter 10 can be arbitrarily set. For this purpose, switches 20-1 to 20-L are provided in front of the counters 10-1 to 10-L, respectively. For example, consider a counter 10-i and a switch 20-i (i is any one of 1 to L). The switch 20-i receives the clock signal CLK output from the oscillator 30 and the result signal D j output from the counter 10-j (j = 1 to L, j ≠ i) other than the counter 10-i. The switch 20-i, in accordance with the switch control signal SW, selects one of the clock signal CLK and the result signals D j, and outputs the selection signal counter 10-i. That is, the input signal for the counter 10-i is the result signals D j from the clock signal CLK or the other counters 10-j, it can be dynamically controlled by the switch control signal SW.

そのようなスイッチ制御信号SWを生成するのが制御回路40である。制御回路40は、カウンタ10−1〜10−L及びスイッチ20−1〜20−Lに接続されている。この制御回路40は、スイッチ制御信号SWをスイッチ20−1〜20−Lのそれぞれに出力することによって、カウンタ10−1〜10−Lのそれぞれへの入力信号を動的に制御する。これは、制御回路40が、カウンタ10−1〜10−Lの接続関係を動的に制御することと等価である。すなわち、制御回路40は、カウンタ10−1〜10−Lの接続関係を動的に制御する機能を備えている。   The control circuit 40 generates such a switch control signal SW. The control circuit 40 is connected to the counters 10-1 to 10-L and the switches 20-1 to 20-L. The control circuit 40 dynamically controls an input signal to each of the counters 10-1 to 10-L by outputting a switch control signal SW to each of the switches 20-1 to 20-L. This is equivalent to the control circuit 40 dynamically controlling the connection relationship of the counters 10-1 to 10-L. That is, the control circuit 40 has a function of dynamically controlling the connection relationship of the counters 10-1 to 10-L.

更に、制御回路40は、カウンタ回路1がカウント動作を行っている最中に「異常検知処理」を行う機能を備えている。異常検知処理において、制御回路40は、カウンタ10−1〜10−Lの中に異常カウンタが含まれているか否かを判定する。ここで、異常カウンタとは、ノイズや回路劣化等の要因により正常なカウント動作ができなくなったカウンタ10のことである。   Further, the control circuit 40 has a function of performing “abnormality detection processing” while the counter circuit 1 is performing the counting operation. In the abnormality detection process, the control circuit 40 determines whether or not an abnormality counter is included in the counters 10-1 to 10-L. Here, the abnormal counter is the counter 10 that cannot perform a normal counting operation due to factors such as noise and circuit deterioration.

より詳細には、異常検知処理において、制御回路40は、L個のカウンタ10−1〜10−Lのうち2以上を「比較対象カウンタ10−S」として選択する。そして、制御回路40は、選択した比較対象カウンタ10−Sに対して同じ信号が入力信号として入力されるように、接続関係を設定する。また、制御回路40は、比較対象カウンタ10−Sのそれぞれから結果信号Dを受け取る。そして、制御回路40は、比較対象カウンタ10−Sのそれぞれからの結果信号D同士を比較することによって、比較対象カウンタ10−Sの中に異常カウンタが含まれているか否かを判定する。例えば、第1の比較対象カウンタ10−S1からの結果信号DS1が“桁上がり”を示しているが、第2の比較対象カウンタ10−S2からの結果信号DS2が“桁上がり”を示していない場合、第2の比較対象カウンタ10−S2は異常カウンタであると判定される。尚、この異常検知処理については、後に具体例を用いて詳細に説明する。 More specifically, in the abnormality detection process, the control circuit 40 selects two or more of the L counters 10-1 to 10-L as “comparison counter 10-S”. The control circuit 40 sets the connection relationship so that the same signal is input as an input signal to the selected comparison target counter 10-S. Further, the control circuit 40 receives a result signal D S from each of the comparison counter 10-S. Then, the control circuit 40 determines whether by comparing the result signal D S between from each comparison counter 10-S, contains abnormality counter in the comparison counter 10-S. For example, a result signal D S1 from the first comparison counter 10-S1 indicates "carry", but result signal D S2 from the second comparison counter 10-S2 indicates "carry" If not, it is determined that the second comparison target counter 10-S2 is an abnormal counter. The abnormality detection process will be described in detail later using a specific example.

制御回路40は、出力信号OUTを出力する。出力信号OUTの例としては、カウント結果を示すカウント値データ、異常カウンタを検知した場合のエラー信号、CPUへの割り込み信号等が挙げられる。   The control circuit 40 outputs an output signal OUT. Examples of the output signal OUT include count value data indicating a count result, an error signal when an abnormal counter is detected, an interrupt signal to the CPU, and the like.

1−2.動作例
1−2−1.第1の動作例
まず、図2A〜図2Dを参照して、異常カウンタが無い場合を説明する。
1-2. Example of operation 1-2-1. First Operation Example First, a case where there is no abnormality counter will be described with reference to FIGS.

図2Aは、最初のN/Mビットのカウント動作(同時に1回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−1〜10−Lを比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1〜10−Lに対してクロック信号CLKが入力信号として入力されるように、接続関係を設定する。   FIG. 2A is a conceptual diagram for explaining the first N / M bit count operation (simultaneously the first abnormality detection process). The control circuit 40 selects the counters 10-1 to 10-L as the comparison target counter 10-S. Further, the control circuit 40 sets the connection relationship so that the clock signal CLK is input as an input signal to the counters 10-1 to 10-L.

クロック信号CLKが供給されると、カウンタ10−1〜10−Lの各々は、そのクロック信号CLKに基づいてカウント動作を行う。そして、カウンタ10−1〜10−Lの各々は、N/Mビットのカウントが完了すると結果信号Dを出力する。   When the clock signal CLK is supplied, each of the counters 10-1 to 10-L performs a counting operation based on the clock signal CLK. Each of the counters 10-1 to 10-L outputs the result signal D when the N / M bit count is completed.

N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−1〜10−Lのそれぞれからの出力される結果信号D〜D同士を比較する(1回目の比較処理)。この比較処理により、カウンタ10−1〜10−Lの中に異常カウンタが存在するか否かが判定される。本例において、異常カウンタは存在しない。 In the count is completed timing of N / M bits, the control circuit 40, the counter 10-1 to 10-L of results output from each comparing the signal D 1 to D L between (first comparison processing) . By this comparison processing, it is determined whether or not an abnormality counter exists in the counters 10-1 to 10-L. In this example, there is no abnormality counter.

続いて、制御回路40は、カウンタ10−1〜10−L(比較対象カウンタ)のうち少なくとも1つを、N/Mビットのカウントを担当するカウンタとして設定する。本例において、制御回路40は、カウンタ10−1を、N/Mビットのカウントを担当するカウンタとして設定するとする。その後、次の2N/Mビットのカウント動作に移行する。   Subsequently, the control circuit 40 sets at least one of the counters 10-1 to 10-L (comparison target counter) as a counter in charge of counting N / M bits. In this example, it is assumed that the control circuit 40 sets the counter 10-1 as a counter in charge of counting N / M bits. Thereafter, the operation shifts to the next 2N / M bit count operation.

図2Bは、2N/Mビットのカウント動作(同時に2回目の異常検知処理)を説明するための概念図である。制御回路40は、N/Mビットのカウントを担当するカウンタ10−1以外のカウンタ10から、比較対象カウンタ10−Sを選択する。例えば、制御回路40は、カウンタ10−2〜10−Lを比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1に対してクロック信号CLKが入力信号として入力され、且つ、カウンタ10−2〜10−Lに対して「カウンタ10−1からの結果信号D」が入力信号として入力されるように、接続関係を設定する。桁上がりを示す結果信号Dが入力されることにより、カウンタ10−2〜10−Lの各々のカウント値は“1”となる。 FIG. 2B is a conceptual diagram for explaining a 2N / M-bit counting operation (simultaneously the second abnormality detection process). The control circuit 40 selects the comparison target counter 10-S from the counters 10 other than the counter 10-1 in charge of counting N / M bits. For example, the control circuit 40 selects the counters 10-2 to 10-L as the comparison target counter 10-S. In addition, the control circuit 40 receives the clock signal CLK as an input signal to the counter 10-1, and the “result signal D 1 from the counter 10-1” is input to the counters 10-2 to 10-L. The connection relationship is set so that it is input as an input signal. By result signal D 1 indicative of the carry is input, the count value of each counter 10-2 to 10-L is "1".

続いて、2N/Mビットのカウント動作が開始する。クロック信号CLKが供給されると、カウンタ10−1は、そのクロック信号CLKに基づいてカウント動作を行う。そして、カウンタ10−1は、N/Mビットのカウントが完了する度に結果信号Dを出力する。カウンタ10−2〜10−L(比較対象カウンタ)の各々は、その結果信号Dを受け取り、その結果信号Dに基づいてカウント動作を行う。そして、カウンタ10−2〜10−Lの各々は、N/Mビットのカウントが完了すると結果信号Dを出力する。 Subsequently, a count operation of 2N / M bits starts. When the clock signal CLK is supplied, the counter 10-1 performs a counting operation based on the clock signal CLK. The counter 10-1 outputs a result signal D 1 each time the N / M bits of the count is completed. Each of the counters 10-2 to 10-L (comparative counter), the result receives signals D 1, performs a count operation based on the result signal D 1. Then, each of the counters 10-2 to 10-L outputs a result signal D when the count of N / M bits is completed.

2N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−2〜10−Lのそれぞれからの出力される結果信号D〜D同士を比較する(2回目の比較処理)。この比較処理により、カウンタ10−2〜10−Lの中に異常カウンタが存在するか否かが判定される。本例において、異常カウンタは存在しない。 In the count is completed timing of 2N / M bits, the control circuit 40, the counter 10-2 to 10-L of results output from each of the signal D 2 to D L between compare (second comparison processing) . By this comparison processing, it is determined whether or not an abnormality counter exists in the counters 10-2 to 10-L. In this example, there is no abnormality counter.

続いて、制御回路40は、カウンタ10−2〜10−L(比較対象カウンタ)のうち少なくとも1つを、2N/Mビットのカウントを担当するカウンタとして設定する。本例において、制御回路40は、カウンタ10−2を、2N/Mビットのカウントを担当するカウンタとして設定するとする。その後、次の3N/Mビットのカウント動作に移行する。   Subsequently, the control circuit 40 sets at least one of the counters 10-2 to 10-L (comparison target counters) as a counter in charge of counting 2N / M bits. In this example, it is assumed that the control circuit 40 sets the counter 10-2 as a counter in charge of counting 2N / M bits. Thereafter, the operation shifts to the next 3N / M bit count operation.

図2Cは、3N/Mビットのカウント動作(同時に3回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−1、10−2以外のカウンタ10から、比較対象カウンタ10−Sを選択する。例えば、制御回路40は、カウンタ10−3〜10−Lを比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1に対してクロック信号CLKが入力信号として入力され、カウンタ10−2に対して「カウンタ10−1からの結果信号D」が入力信号として入力され、且つ、カウンタ10−3〜10−Lに対して「カウンタ10−2からの結果信号D」が入力信号として入力されるように、接続関係を設定する。桁上がりを示す結果信号Dが入力されることにより、カウンタ10−3〜10−Lの各々のカウント値は“1”となる。 FIG. 2C is a conceptual diagram for explaining a 3N / M-bit counting operation (simultaneous third abnormality detection processing). The control circuit 40 selects the comparison target counter 10-S from the counters 10 other than the counters 10-1 and 10-2. For example, the control circuit 40 selects the counters 10-3 to 10-L as the comparison target counter 10-S. Further, the control circuit 40 receives the clock signal CLK as an input signal to the counter 10-1, and inputs the “result signal D 1 from the counter 10-1” as an input signal to the counter 10-2. In addition, the connection relationship is set so that the “result signal D 2 from the counter 10-2” is input as an input signal to the counters 10-3 to 10-L. By result signal D 2 that indicates the carry is input, the count value of each counter 10-3~10-L is "1".

続いて、3N/Mビットのカウント動作が開始する。クロック信号CLKが供給されると、カウンタ10−1は、そのクロック信号CLKに基づいてカウント動作を行う。そして、カウンタ10−1は、N/Mビットのカウントが完了する度に結果信号Dを出力する。カウンタ10−2は、その結果信号Dを受け取り、その結果信号Dに基づいてカウント動作を行う。そして、カウンタ10−2は、N/Mビットのカウントが完了する度に結果信号Dを出力する。カウンタ10−3〜10−L(比較対象カウンタ)の各々は、その結果信号Dを受け取り、その結果信号Dに基づいてカウント動作を行う。そして、カウンタ10−3〜10−Lの各々は、N/Mビットのカウントが完了すると結果信号Dを出力する。 Subsequently, a count operation of 3N / M bits starts. When the clock signal CLK is supplied, the counter 10-1 performs a counting operation based on the clock signal CLK. The counter 10-1 outputs a result signal D 1 each time the N / M bits of the count is completed. Counter 10-2, the result receives signals D 1, performs a count operation based on the result signal D 1. The counter 10-2 outputs a result signal D 2 each time the N / M bits of the count is completed. Each counter 10-3~10-L (comparative counter), the result receives signals D 2, performs a count operation based on the result signal D 2. Each of the counters 10-3 to 10-L outputs the result signal D when the N / M bit count is completed.

3N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−3〜10−Lのそれぞれからの出力される結果信号D〜D同士を比較する(3回目の比較処理)。この比較処理により、カウンタ10−3〜10−Lの中に異常カウンタが存在するか否かが判定される。本例において、異常カウンタは存在しない。 In the count is completed timing of 3N / M bits, the control circuit 40, the counter 10-3~10-L of results output from each comparing the signal D 3 to D L between (comparison processing the third) . By this comparison processing, it is determined whether or not an abnormality counter exists in the counters 10-3 to 10-L. In this example, there is no abnormality counter.

続いて、制御回路40は、カウンタ10−3〜10−L(比較対象カウンタ)のうち少なくとも1つを、3N/Mビットのカウントを担当するカウンタとして設定する。本例において、制御回路40は、カウンタ10−3を、3N/Mビットのカウントを担当するカウンタとして設定するとする。   Subsequently, the control circuit 40 sets at least one of the counters 10-3 to 10-L (comparison target counter) as a counter in charge of counting of 3N / M bits. In this example, it is assumed that the control circuit 40 sets the counter 10-3 as a counter in charge of counting 3N / M bits.

同様の処理が、N/Mビットのカウント毎に繰り返し実行される。   Similar processing is repeatedly executed for each N / M bit count.

図2Dは、最後のNビットのカウント動作(同時にM回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−M〜10−Lを比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1に対してクロック信号CLKが入力信号として入力され、カウンタ10−k(k=2〜M)に対して「カウンタ10−(k−1)からの結果信号D(k−1)」が入力信号として入力されるように、接続関係を設定する。 FIG. 2D is a conceptual diagram for explaining the last N-bit counting operation (simultaneously, the M-th abnormality detection process). The control circuit 40 selects the counters 10-M to 10-L as the comparison target counter 10-S. In addition, the control circuit 40 receives the clock signal CLK as an input signal to the counter 10-1, and outputs “the result from the counter 10- (k−1)” to the counter 10-k (k = 2 to M). The connection relation is set so that the signal D (k-1) "is input as an input signal.

Nビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−M〜10−Lのそれぞれからの出力される結果信号D〜D同士を比較する(M回目の比較処理)。この比較処理により、カウンタ10−M〜10−Lの中に異常カウンタが存在するか否かが判定される。 At the timing when the N-bit count is completed, the control circuit 40 compares the result signals D M to D L output from the counters 10-M to 10-L (M-th comparison process). By this comparison processing, it is determined whether or not an abnormality counter exists in the counters 10-M to 10-L.

このように、制御回路40は、N/Mビットのカウント毎に、異常検知処理を繰り返し実行する。そして、制御回路40は、異常検知処理をM回繰り返すことによって、N/Mビット毎にカウントを担当するカウンタ10を決定する。尚、制御回路40は、どのカウンタ10がどのN/Mビットのカウンタを担当するかに関する情報(割り当てテーブル等)を保持していてもよい。その情報は、カウンタ回路1の外部から参照可能なように制御回路40内に格納される。   In this way, the control circuit 40 repeatedly executes the abnormality detection process for each N / M bit count. The control circuit 40 then repeats the abnormality detection process M times to determine the counter 10 that is responsible for counting every N / M bits. Note that the control circuit 40 may hold information (allocation table or the like) regarding which counter 10 is responsible for which N / M bit counter. The information is stored in the control circuit 40 so that it can be referred to from the outside of the counter circuit 1.

次に、異常カウンタが有る場合を説明する。例えば、上記図2Aで示された1回目の異常検知処理の結果、カウンタ10−1が異常カウンタであることが判明したとする。   Next, a case where there is an abnormality counter will be described. For example, it is assumed that the counter 10-1 is an abnormality counter as a result of the first abnormality detection process shown in FIG. 2A.

この場合、図3に示されるように、制御回路40は、カウンタ10−1〜10−L(比較対象カウンタ)のうち異常カウンタ10−1以外の少なくとも1つを、N/Mビットのカウントを担当するカウンタとして設定する。例えば、制御回路40は、カウンタ10−2を、N/Mビットのカウントを担当するカウンタとして設定する。   In this case, as shown in FIG. 3, the control circuit 40 counts at least one of the counters 10-1 to 10-L (comparison target counter) other than the abnormality counter 10-1 by counting N / M bits. Set as the counter in charge. For example, the control circuit 40 sets the counter 10-2 as a counter in charge of counting N / M bits.

続いて、制御回路40は、異常カウンタ10−1とカウンタ10−2以外のカウンタ10から、比較対象カウンタ10−Sを選択する。例えば、制御回路40は、カウンタ10−3〜10−Lを比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−2に対してクロック信号CLKが入力信号として入力され、且つ、カウンタ10−3〜10−Lに対して「カウンタ10−2からの結果信号D」が入力信号として入力されるように、接続関係を設定する。その後の処理は、図2A〜図2Dの場合と同様である。 Subsequently, the control circuit 40 selects the comparison target counter 10-S from the counters 10 other than the abnormality counter 10-1 and the counter 10-2. For example, the control circuit 40 selects the counters 10-3 to 10-L as the comparison target counter 10-S. Further, the control circuit 40 receives the clock signal CLK as an input signal to the counter 10-2, and the “result signal D 2 from the counter 10-2” is output to the counters 10-3 to 10-L. The connection relationship is set so that it is input as an input signal. The subsequent processing is the same as in the case of FIGS. 2A to 2D.

このように、カウント動作の最中に異常カウンタが検出された場合、制御回路40は、その異常カウンタを除外することにより、カウント動作を継続させる。尚、異常カウンタが検出された場合にNビットのカウントを完了するためには、その異常カウンタの代わりとなる予備のカウンタが必要である。この点では、LがMより大きいことが好適である。但し、LがMと同じであってもよい(L=M)。この場合、制御回路40は、異常カウンタを回避しつつ、可能な限り大きいビットまでカウント動作を継続させることができる。   In this way, when an abnormal counter is detected during the counting operation, the control circuit 40 continues the counting operation by excluding the abnormal counter. In order to complete N-bit counting when an abnormal counter is detected, a spare counter is required instead of the abnormal counter. In this respect, L is preferably larger than M. However, L may be the same as M (L = M). In this case, the control circuit 40 can continue the count operation up to the largest possible bit while avoiding the abnormal counter.

1−2−2.第2の動作例
上記第1の動作例では、比較対象カウンタ10−Sを1つずつ減らしていくような制御が行われている。しかし、制御方式はそれに限られない。異常検知処理とカウント動作の継続が実現されさえすれば、どのような制御方式でも構わない。図4A〜図4Dを参照して、第2の動作例を説明する。尚、異常カウンタは無いとする。
1-2-2. Second Operation Example In the first operation example, control is performed such that the comparison target counter 10-S is decreased one by one. However, the control method is not limited thereto. Any control method may be used as long as the abnormality detection process and the continuation of the count operation are realized. A second operation example will be described with reference to FIGS. 4A to 4D. It is assumed that there is no abnormality counter.

図4Aは、最初のN/Mビットのカウント動作(同時に1回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−1、10−2を比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1、10−2に対してクロック信号CLKが入力信号として入力されるように、接続関係を設定する。その後、N/Mビットのカウント動作が開始する。   FIG. 4A is a conceptual diagram for explaining the first N / M bit count operation (simultaneously the first abnormality detection process). The control circuit 40 selects the counters 10-1 and 10-2 as the comparison target counter 10-S. Further, the control circuit 40 sets the connection relationship so that the clock signal CLK is input as an input signal to the counters 10-1 and 10-2. Thereafter, the N / M bit counting operation starts.

N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−1、10−2のそれぞれからの出力される結果信号D、Dを比較する(1回目の比較処理)。この比較処理により、カウンタ10−1、10−2の中に異常カウンタが存在するか否かが判定される。本例において、異常カウンタは存在しない。制御回路40は、カウンタ10−1、10−2を、N/Mビットのカウントを担当するカウンタとして設定する。その後、次の2N/Mビットのカウント動作に移行する。 At the timing when the N / M bit count is completed, the control circuit 40 compares the result signals D 1 and D 2 output from the counters 10-1 and 10-2 (first comparison process). By this comparison processing, it is determined whether or not an abnormal counter exists in the counters 10-1 and 10-2. In this example, there is no abnormality counter. The control circuit 40 sets the counters 10-1 and 10-2 as counters in charge of counting N / M bits. Thereafter, the operation shifts to the next 2N / M bit count operation.

図4Bは、2N/Mビットのカウント動作(同時に2回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−3〜10−6を比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1、10−2に対してクロック信号CLKが入力信号として入力され、且つ、カウンタ10−3〜10−Lに対して結果信号Dが入力信号として入力されるように、接続関係を設定する。桁上がりを示す結果信号Dが入力されることにより、カウンタ10−3〜10−6の各々のカウント値は“1”となる。その後、2N/Mビットのカウント動作が開始する。 FIG. 4B is a conceptual diagram for explaining a 2N / M-bit counting operation (simultaneously the second abnormality detection process). The control circuit 40 selects the counters 10-3 to 10-6 as the comparison target counter 10-S. Further, the control circuit 40, the clock signal CLK to the counter 10-1 and 10-2 is input as an input signal, and the counter 10-3~10-L with respect to the result input signal D 2 as input signal To set the connection relationship. By result signal D 2 that indicates the carry is input, the count value of each counter 10-3~10-6 becomes "1". Thereafter, the 2N / M bit counting operation starts.

2N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−3〜10−6のそれぞれからの出力される結果信号D〜D同士を比較する(2回目の比較処理)。この比較処理により、カウンタ10−3〜10−6の中に異常カウンタが存在するか否かが判定される。本例において、異常カウンタは存在しない。制御回路40は、カウンタ10−3、10−4を、2N/Mビットのカウントを担当するカウンタとして設定する。その後、次の3N/Mビットのカウント動作に移行する。 At the timing when the 2N / M bit count is completed, the control circuit 40 compares the result signals D 3 to D 6 output from each of the counters 10-3 to 10-6 (second comparison process). . By this comparison processing, it is determined whether or not an abnormality counter exists in the counters 10-3 to 10-6. In this example, there is no abnormality counter. The control circuit 40 sets the counters 10-3 and 10-4 as counters in charge of counting 2N / M bits. Thereafter, the operation shifts to the next 3N / M bit count operation.

図4Cは、3N/Mビットのカウント動作(同時に3回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−5、10−6を比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1、10−2に対してクロック信号CLKが入力信号として入力され、カウンタ10−3、10−4に対して結果信号Dが入力信号として入力され、且つ、カウンタ10−5、10−6に対して結果信号Dが入力信号として入力されるように、接続関係を設定する。桁上がりを示す結果信号Dが入力されることにより、カウンタ10−5、10−6の各々のカウント値は“1”となる。その後、3N/Mビットのカウント動作が開始する。 FIG. 4C is a conceptual diagram for explaining a 3N / M-bit counting operation (simultaneous third abnormality detection processing). The control circuit 40 selects the counters 10-5 and 10-6 as the comparison target counter 10-S. Further, the control circuit 40 is the input clock signal CLK as the input signal to the counter 10-1 and 10-2, the result signal D 2 to the counter 10-3 and 10-4 is input as an input signal, and, as a result signal D 4 against counter 10-5,10-6 is input as an input signal, sets a connection relation. By result signal D 4 indicating a carry is input, the count value of each counter 10-5,10-6 becomes "1". Thereafter, a count operation of 3N / M bits starts.

3N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−5、10−6のそれぞれからの出力される結果信号D、D同士を比較する(3回目の比較処理)。この比較処理により、カウンタ10−5、10−6の中に異常カウンタが存在するか否かが判定される。本例において、異常カウンタは存在しない。制御回路40は、カウンタ10−6を、3N/Mビットのカウントを担当するカウンタとして設定する。その後、次の4N/Mビットのカウント動作に移行する。 At the timing when the count of 3N / M bits is completed, the control circuit 40 compares the result signals D 5 and D 6 output from the counters 10-5 and 10-6, respectively (third comparison process). . By this comparison processing, it is determined whether or not an abnormal counter exists in the counters 10-5 and 10-6. In this example, there is no abnormality counter. The control circuit 40 sets the counter 10-6 as a counter in charge of counting 3N / M bits. Thereafter, the operation shifts to the next 4N / M-bit counting operation.

図4Dは、4N/Mビットのカウント動作(同時に4回目の異常検知処理)を説明するための概念図である。制御回路40は、カウンタ10−3、10−5を比較対象カウンタ10−Sとして選択する。また、制御回路40は、カウンタ10−1、10−2に対してクロック信号CLKが入力信号として入力され、カウンタ10−4に対して結果信号Dが入力信号として入力され、カウンタ10−6に対して結果信号Dが入力信号として入力され、且つ、カウンタ10−3、10−5に対して結果信号Dが入力信号として入力されるように、接続関係を設定する。桁上がりを示す結果信号Dが入力されることにより、カウンタ10−3、10−5の各々のカウント値は“1”となる。その後、4N/Mビットのカウント動作が開始する。 FIG. 4D is a conceptual diagram for explaining a 4N / M-bit counting operation (simultaneously the fourth abnormality detection process). The control circuit 40 selects the counters 10-3 and 10-5 as the comparison target counter 10-S. Further, the control circuit 40, the clock signal CLK to the counter 10-1 and 10-2 is input as an input signal, the result signal D 2 to the counter 10-4 is input as an input signal, the counter 10-6 result signal D 4 is inputted as an input signal to, and, as a result signal D 6 against counter 10-3 and 10-5 is input as an input signal, it sets a connection relation. By result signal D 6 indicating a carry is input, the count value of each counter 10-3 and 10-5 becomes "1". Thereafter, the 4N / M bit counting operation starts.

4N/Mビットのカウントが完了するタイミングにおいて、制御回路40は、カウンタ10−3、10−5のそれぞれからの出力される結果信号D、D同士を比較する(4回目の比較処理)。この比較処理により、カウンタ10−3、10−5の中に異常カウンタが存在するか否かが判定される。 At the timing when the 4N / M bit count is completed, the control circuit 40 compares the result signals D 3 and D 5 output from the counters 10-3 and 10-5, respectively (fourth comparison process). . By this comparison processing, it is determined whether or not an abnormality counter exists in the counters 10-3 and 10-5.

その後、同様の処理が、N/Mビットのカウント毎に繰り返し実行される。   Thereafter, the same processing is repeatedly executed every count of N / M bits.

1−3.効果
以上に説明されたように、本実施の形態によれば、カウンタ回路1がカウント動作を行っている最中に、異常検知処理が実施される。具体的には、Nビットのカウント動作のために複数のN/Mビットカウンタ10が設けられ、それら複数のN/Mビットカウンタ10のうち2以上の比較対象カウンタ10−Sに対して同じ入力信号が入力される。そして、比較対象カウンタ10−Sのそれぞれからの結果信号D同士を比較することによって、異常カウンタの有無が判定される。
1-3. Effect As described above, according to the present embodiment, the abnormality detection process is performed while the counter circuit 1 is performing the counting operation. Specifically, a plurality of N / M bit counters 10 are provided for the N-bit counting operation, and the same input is made to two or more comparison target counters 10-S among the plurality of N / M bit counters 10. A signal is input. Then, by comparing the result signal D S between from each comparison counter 10-S, the presence or absence of the abnormality counter is determined.

また、本実施の形態によれば、異常カウンタを検出するために必要なカウンタ面積(カウンタビット数)を削減することができる。それは、カウント回路1の構成要素であるN/Mビットカウンタ10を利用して異常検知処理が実施されるからである。上記の特許文献1のようにカウント回路1を2セット用意して、それら2つのカウント回路1を並列に動作させる必要はない。従って、回路面積削減の効果が得られる。すなわち、本実施の形態によれば、回路面積の増大を抑えつつ、カウンタ回路1の異常を検出することが可能となる。   Further, according to the present embodiment, it is possible to reduce the counter area (counter bit number) necessary for detecting an abnormal counter. This is because the abnormality detection process is performed using the N / M bit counter 10 which is a component of the count circuit 1. It is not necessary to prepare two sets of count circuits 1 as in Patent Document 1 and operate the two count circuits 1 in parallel. Therefore, the effect of reducing the circuit area can be obtained. That is, according to the present embodiment, it is possible to detect an abnormality in the counter circuit 1 while suppressing an increase in circuit area.

更に、カウント動作の最中に異常カウンタが検出された場合、制御回路40は、その異常カウンタを除外することにより、カウント動作を継続させる。カウント動作が停止しないため、カウンタ回路1が搭載された半導体集積回路の動作信頼性が向上する。   Further, when an abnormal counter is detected during the counting operation, the control circuit 40 excludes the abnormal counter and continues the counting operation. Since the count operation does not stop, the operation reliability of the semiconductor integrated circuit on which the counter circuit 1 is mounted is improved.

尚、異常カウンタが検出された場合にNビットのカウントを最後まで完了するためには、その異常カウンタの代わりとなる予備のカウンタが必要である。この点では、LがMより大きいことが好適である。但し、LがMと同じであってもよい(L=M)。この場合、制御回路40は、異常カウンタを回避しつつ、可能な限り大きいビットまでカウント動作を継続させることができる。これによっても、動作信頼性向上の効果は、ある程度得られる。また、異常カウンタの数が予備のカウンタの数を超える場合も同様であり、可能な限り大きいビットまでカウント動作を継続させることができる。   In order to complete the N-bit counting to the end when an abnormal counter is detected, a spare counter is required instead of the abnormal counter. In this respect, L is preferably larger than M. However, L may be the same as M (L = M). In this case, the control circuit 40 can continue the count operation up to the largest possible bit while avoiding the abnormal counter. Also by this, the effect of improving the operation reliability can be obtained to some extent. The same applies to the case where the number of abnormal counters exceeds the number of spare counters, and the counting operation can be continued up to the largest possible bit.

車載用の電子制御装置の分野においては、回路面積削減と動作信頼性向上は重要な課題である。従って、本実施の形態に係るカウンタ回路1は、車載用の電子制御装置に対して特に有効である。もちろん、汎用的な半導体集積回路においても、本実施の形態に係るカウンタ回路1は有用である。   In the field of in-vehicle electronic control devices, circuit area reduction and operational reliability improvement are important issues. Therefore, the counter circuit 1 according to the present embodiment is particularly effective for an on-vehicle electronic control device. Of course, the counter circuit 1 according to the present embodiment is useful also in a general-purpose semiconductor integrated circuit.

2.第2の実施の形態
制御回路40は、図5に示されるようなアラーム回路50を搭載していてもよい。アラーム回路50は、ロジック回路51及びSPI(Serial Peripheral Interface)通信回路55を備えている。
2. Second Embodiment The control circuit 40 may be equipped with an alarm circuit 50 as shown in FIG. The alarm circuit 50 includes a logic circuit 51 and an SPI (Serial Peripheral Interface) communication circuit 55.

ロジック回路51は、上述の比較処理の結果を受け取る。異常カウンタが検出された場合、ロジック回路51は、アラーム信号を外部に出力する。また、ロジック回路51は、カウンタ10−1〜10−Lのそれぞれの状態(正常/異常)を示す情報が格納されるアラームレジスタ52を有していてもよい。ロジック回路51は、上述の比較処理の結果に応じて、アラームレジスタ52の内容を更新する。アラームレジスタ52の内容は、SPI通信回路55を介して外部から参照することができる。   The logic circuit 51 receives the result of the comparison process described above. When the abnormality counter is detected, the logic circuit 51 outputs an alarm signal to the outside. The logic circuit 51 may include an alarm register 52 that stores information indicating the states (normal / abnormal) of the counters 10-1 to 10-L. The logic circuit 51 updates the contents of the alarm register 52 in accordance with the result of the comparison process described above. The contents of the alarm register 52 can be referred to from the outside via the SPI communication circuit 55.

図6は、アラームレジスタ52の一例を示す概念図である。アラームレジスタ52は、カウンタ10−1〜10−Lのそれぞれに関連付けられたレジスタ53−1〜53−Lを有している。レジスタ53−1〜53−Lには、カウンタ10−1〜10−Lのそれぞれの状態(正常/異常)を示すフラグが格納される。例えば、正常の場合、フラグは“0”に設定され、異常の場合、フラグは“1”に設定される。   FIG. 6 is a conceptual diagram illustrating an example of the alarm register 52. The alarm register 52 includes registers 53-1 to 53-L associated with the counters 10-1 to 10-L, respectively. The registers 53-1 to 53-L store flags indicating the states (normal / abnormal) of the counters 10-1 to 10-L. For example, when normal, the flag is set to “0”, and when abnormal, the flag is set to “1”.

図7は、アラームレジスタ52の他の例を示す概念図である。図6で示された例と比較して、バックアップビット54が追加されている。バックアップビット54は、L>Mの場合に、予備のカウンタ10の残存状況を示す。例えば、予備のカウンタ10が無くなった場合、バックアップビット54は“1”に設定される。これをSPI通信回路55を介して参照することにより、早期の対応が可能となる。   FIG. 7 is a conceptual diagram showing another example of the alarm register 52. Compared to the example shown in FIG. 6, a backup bit 54 is added. The backup bit 54 indicates the remaining status of the spare counter 10 when L> M. For example, when the spare counter 10 is lost, the backup bit 54 is set to “1”. By referring to this via the SPI communication circuit 55, an early response is possible.

3.第3の実施の形態
上述の実施の形態に係るカウンタ回路1の一適用例として、ボーレートジェネレータが考えられる。図8を参照して、カウンタ回路1がボーレートジェネレータに適用される場合を説明する。
3. Third Embodiment As an application example of the counter circuit 1 according to the above-described embodiment, a baud rate generator can be considered. A case where the counter circuit 1 is applied to a baud rate generator will be described with reference to FIG.

プリスケーラ60は、発振器30からクロック信号CLK(周波数:fPRS)を受け取る。プリスケーラ60は、クロック信号CLKの分周を行い、分周後のクロック信号CLK(周波数:fCLK)を出力する。ここで、分周比は可変に設定可能である。 The prescaler 60 receives the clock signal CLK (frequency: f PRS ) from the oscillator 30. The prescaler 60 divides the clock signal CLK and outputs the divided clock signal CLK (frequency: f CLK ). Here, the frequency division ratio can be variably set.

ボーレートジェネレータ70は、カウンタ回路1と一致検出回路71を備えている。カウンタ回路1は、プリスケーラ60から出力されるクロック信号CLK(周波数:fCLK)に基づいてカウント動作を行う。つまり、ボーレートジェネレータ70は、カウンタ回路1を用いてクロック信号CLK(周波数:fCLK)のカウントを行う。 The baud rate generator 70 includes a counter circuit 1 and a coincidence detection circuit 71. The counter circuit 1 performs a counting operation based on the clock signal CLK (frequency: f CLK ) output from the prescaler 60. That is, the baud rate generator 70 uses the counter circuit 1 to count the clock signal CLK (frequency: f CLK ).

ボーレートジェネレータコントロールレジスタ80は、所望のボーレートに対応する目標カウント値(1/2ビット期間に相当するクロック数の理論値)を保持する。この目標カウント値の設定は変更可能である。   The baud rate generator control register 80 holds a target count value (theoretical value of the number of clocks corresponding to a 1/2 bit period) corresponding to a desired baud rate. The setting of the target count value can be changed.

一致検出回路71は、カウンタ回路1によるカウント値と目標カウント値との比較を行う。そして、一致検出回路71は、カウンタ回路1によるカウント値が目標カウント値に一致するタイミングで、一致検出信号をI/Oインタフェース90に出力する。一致検出信号は、I/Oインタフェース90の内部で分周回路によって分周され、それにより、データ送受信に必要なクロック信号(サンプリングクロック、シフトクロック)が生成される。   The coincidence detection circuit 71 compares the count value from the counter circuit 1 with the target count value. The coincidence detection circuit 71 outputs a coincidence detection signal to the I / O interface 90 at a timing when the count value by the counter circuit 1 coincides with the target count value. The coincidence detection signal is frequency-divided by a frequency dividing circuit inside the I / O interface 90, whereby a clock signal (sampling clock, shift clock) necessary for data transmission / reception is generated.

このように、ボーレートジェネレータ70は、カウンタ回路1を用いることにより、データ送受信のボーレートの設定を行う。   As described above, the baud rate generator 70 uses the counter circuit 1 to set the baud rate for data transmission / reception.

ここで、カウンタ回路1のカウンタ10−1〜10−Lに異常カウンタが含まれており、カウンタ回路1が目標カウント値までカウントできない場合を考える。この場合であっても、カウント回路1は、上述の通り、異常カウンタを回避しつつ、可能な限り大きいビットまでカウント動作を継続させる。本実施の形態によれば、このような特徴を活かすため、最大カウント数の減少が発生した場合であってもボーレートの設定が継続するような制御が行われる。具体的には、ボーレートジェネレータ70は、目標カウント値を減少させ、また、それに応じて、プリスケーラ60における分周比を増加させる。これにより、ボーレートの設定精度は低下するものの、ボーレートの設定(補正)処理自体は継続させることが可能となる。   Here, let us consider a case where the counters 10-1 to 10-L of the counter circuit 1 include an abnormal counter and the counter circuit 1 cannot count up to the target count value. Even in this case, the count circuit 1 continues the count operation up to the largest possible bit while avoiding the abnormal counter as described above. According to the present embodiment, in order to take advantage of such characteristics, control is performed so that the baud rate setting continues even when the maximum count number is reduced. Specifically, the baud rate generator 70 decreases the target count value and increases the frequency division ratio in the prescaler 60 accordingly. As a result, although the baud rate setting accuracy is lowered, the baud rate setting (correction) processing itself can be continued.

具体例として、目標ボーレート=19200bps、fPRS=20MHz、N=12、M=L=4(12ビットカウンタを4個の3ビットカウンタ10−1〜10−4で構成する)の場合を考える。 As a specific example, consider a case where the target baud rate = 19200 bps, f PRS = 20 MHz, N = 12, and M = L = 4 (a 12-bit counter is composed of four 3-bit counters 10-1 to 10-4).

異常カウンタが無い場合の設定は、次の通りである。
・分周比=2
・fCLK=fPRS/2=2.5MHz
・目標カウント値=65
この場合、設定ボーレートは19230bpsとなり、設定誤差は0.156%となった。
The setting when there is no abnormality counter is as follows.
・ Division ratio = 2 3
・ F CLK = f PRS / 2 3 = 2.5 MHz
・ Target count value = 65
In this case, the set baud rate was 19230 bps and the setting error was 0.156%.

次に、異常カウンタが2個発生した場合を考える。この場合、設定は次のように変更される。
・分周比=2
・fCLK=fPRS/2=625kHz
・目標カウント値=16
この場合、設定ボーレートは19531bpsとなり、設定誤差は1.724%となった。このように、ボーレートの設定精度は低下するものの、ボーレート設定処理は2個のカウンタ10を用いて継続させることが可能となる。
Next, consider a case where two abnormal counters occur. In this case, the setting is changed as follows.
・ Division ratio = 2 5
・ F CLK = f PRS / 2 5 = 625 kHz
・ Target count value = 16
In this case, the set baud rate was 19531 bps and the setting error was 1.724%. Thus, although the baud rate setting accuracy is reduced, the baud rate setting process can be continued using the two counters 10.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

1 カウンタ回路
10、10−1〜10−L カウンタ
10−S 比較対象カウンタ
20、20−1〜20−L スイッチ
30 発振器
40 制御回路
50 アラーム回路
51 ロジック回路
52 アラームレジスタ
53 レジスタ
54 バックアップビット
55 SPI通信回路
60 プリスケーラ
70 ボーレートジェネレータ
71 一致検出回路
80 ボーレートジェネレータコントロールレジスタ
90 I/Oインタフェース
CLK クロック信号
D、D〜D 結果信号
SW スイッチ制御信号
OUT 出力信号
1 counter circuit 10, 10-1 to 10-L counter 10-S comparison target counter 20, 20-1 to 20-L switch 30 oscillator 40 control circuit 50 alarm circuit 51 logic circuit 52 alarm register 53 register 54 backup bit 55 SPI communication circuit 60 prescaler 70 baud rate generator 71 match detection circuit 80 the baud rate generator control register 90 I / O interface CLK clock signals D, D 1 ~D L result signal SW switch control signal OUT output signal

Claims (4)

L個のカウンタと、
前記L個のカウンタに接続された制御回路と
を備え、
前記L個のカウンタの各々は、N/Mビットカウンタであり、入力信号に基づいてN/Mビットカウントする度に桁上がりを示す結果信号を出力し、
Nは2以上の整数であり、
Mは2以上の整数であり、
LはM以上の整数であり、
前記制御回路は、
前記L個のカウンタの各々について、前記入力信号がクロック信号あるいは他のカウンタの前記結果信号となるように接続関係を制御する機能と、
カウント動作中に異常検知処理を行う機能と
を備え、
前記異常検知処理において、前記制御回路は、前記L個のカウンタのうち2以上を比較対象カウンタとして選択し、前記比較対象カウンタに対して同じ信号が前記入力信号として入力されるように前記接続関係を設定し、更に、前記比較対象カウンタからの前記結果信号を比較することによって前記比較対象カウンタの中に異常カウンタが含まれているか否かを判定し、
前記制御回路は、N/Mビットのカウント毎に前記異常検知処理を行い、
第1のN/Mビットのカウントに対する前記異常検知処理の結果、前記制御回路は、前記比較対象カウンタのうち前記異常カウンタ以外の少なくとも1つを、前記第1のN/Mビットのカウントを担当する第1カウンタとして設定し、
前記第1のN/Mビットに続く第2のN/Mビットのカウントに対する前記異常検知処理において、前記制御回路は、前記第1カウンタ以外のカウンタから前記比較対象カウンタを選択し、前記比較対象カウンタに対して前記第1カウンタからの前記結果信号が前記入力信号として入力されるように前記接続関係を設定する
カウンタ回路。
L counters,
A control circuit connected to the L counters;
Each of the L counters is an N / M bit counter, and outputs a result signal indicating a carry each time N / M bits are counted based on an input signal,
N is an integer greater than or equal to 2,
M is an integer greater than or equal to 2,
L is an integer greater than or equal to M,
The control circuit includes:
For each of the L counters, a function of controlling connection relation so that the input signal becomes a clock signal or the result signal of another counter;
With an abnormality detection process during counting operation,
In the abnormality detection process, the control circuit selects two or more of the L counters as comparison target counters, and the connection relationship is such that the same signal is input as the input signal to the comparison target counters. Further, it is determined whether or not an abnormality counter is included in the comparison target counter by comparing the result signal from the comparison target counter,
The control circuit performs the abnormality detection process every N / M bit count,
As a result of the abnormality detection processing for the first N / M bit count, the control circuit is responsible for counting the first N / M bit for at least one of the comparison target counters other than the abnormality counter. Set as the first counter to
In the abnormality detection process for the second N / M bit count following the first N / M bit, the control circuit selects the comparison target counter from counters other than the first counter, and the comparison target A counter circuit that sets the connection relationship such that the result signal from the first counter is input as the input signal to the counter.
請求項1に記載のカウンタ回路であって、
前記制御回路は、前記異常検知処理をM回繰り返すことによって、N/Mビット毎にカウントを担当するカウンタを決定する
カウンタ回路。
The counter circuit according to claim 1,
The control circuit determines a counter in charge of counting every N / M bits by repeating the abnormality detection process M times.
クロック信号の分周比を可変に設定し、分周後のクロック信号を出力するプリスケーラと、
目標カウント値を保持するコントロールレジスタと、
前記分周後のクロック信号のカウント値と前記目標カウント値を比較することによってボーレートの設定を行うボーレートジェネレータと
を備え、
前記ボーレートジェネレータは、請求項1又は2に記載のカウンタ回路を備え、前記カウンタ回路を用いて前記分周後のクロック信号のカウントを行う
半導体集積回路。
A prescaler that variably sets the division ratio of the clock signal and outputs the divided clock signal;
A control register that holds the target count value;
A baud rate generator that sets a baud rate by comparing the count value of the divided clock signal with the target count value;
The baud rate generator includes the counter circuit according to claim 1, and counts the divided clock signal using the counter circuit.
請求項3に記載の半導体集積回路であって、
前記カウンタ回路の前記L個のカウンタに前記異常カウンタが含まれており、前記カウンタ回路が前記目標カウント値までカウントできなくなった場合、前記ボーレートジェネレータは、前記分周比を増加させ、且つ、前記目標カウント値を減少させることにより、ボーレートの設定を継続する
半導体集積回路。
The semiconductor integrated circuit according to claim 3,
When the abnormality counter is included in the L counters of the counter circuit and the counter circuit cannot count to the target count value, the baud rate generator increases the frequency division ratio and A semiconductor integrated circuit that continues to set the baud rate by decreasing the target count value.
JP2013000700A 2013-01-07 2013-01-07 Counter circuit Pending JP2014132251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013000700A JP2014132251A (en) 2013-01-07 2013-01-07 Counter circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013000700A JP2014132251A (en) 2013-01-07 2013-01-07 Counter circuit

Publications (1)

Publication Number Publication Date
JP2014132251A true JP2014132251A (en) 2014-07-17

Family

ID=51411389

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013000700A Pending JP2014132251A (en) 2013-01-07 2013-01-07 Counter circuit

Country Status (1)

Country Link
JP (1) JP2014132251A (en)

Similar Documents

Publication Publication Date Title
CN105021972B (en) aging detection circuit and method thereof
US20160179472A1 (en) Random number generation device and method for generating random number
US8369477B2 (en) Clock frequency divider circuit and clock frequency division method
TWI453427B (en) Clock glitch detection circuit
US9081913B2 (en) Integrated circuit and clock frequency control method of integrated circuit
EP2761516A1 (en) Method and apparatus for low jitter distributed clock calibration
US9453881B2 (en) Oscillation circuit, integrated circuit, and abnormality detection method
US8564355B2 (en) Clock device
US8564336B2 (en) Clock frequency divider circuit and clock frequency division method
US8248169B2 (en) Semiconductor integrated circuit and abnormal oscillation detection method for semiconductor integrated circuit
JP6594309B2 (en) Channel circuit and automatic test system
US8810321B2 (en) Oscillator auto-trimming method and semiconductor device using the method
US8525597B2 (en) Clock frequency overshoot detection circuit
US20170288677A1 (en) Clock signal stop detection circuit
US8761332B2 (en) Dynamic prescaling counters
JP2006172202A (en) Semiconductor device
US10749510B2 (en) Semiconductor device and control methods thereof
JP2014132251A (en) Counter circuit
JP4819707B2 (en) Redundant computing system and computing unit
US8645742B2 (en) Semiconductor device operating according to an operation clock and having a serial communication interface performing external communications according to a unit transfer time based on the operation clock
CN107918442B (en) Frequency adjusting device and method for adjusting frequency
CN113692562A (en) Synchronous reset signal generating circuit and digital processing device
JP2020035205A (en) Computation device, and mutual monitoring system
JP2017173068A (en) Testing circuit
JP2523170B2 (en) Burst error detection circuit