JP2011044114A - Microprocessor and debugging method therefor - Google Patents

Microprocessor and debugging method therefor Download PDF

Info

Publication number
JP2011044114A
JP2011044114A JP2009193537A JP2009193537A JP2011044114A JP 2011044114 A JP2011044114 A JP 2011044114A JP 2009193537 A JP2009193537 A JP 2009193537A JP 2009193537 A JP2009193537 A JP 2009193537A JP 2011044114 A JP2011044114 A JP 2011044114A
Authority
JP
Japan
Prior art keywords
instruction
copy
instructions
data
check
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009193537A
Other languages
Japanese (ja)
Other versions
JP5387231B2 (en
Inventor
Kenji Ezoe
健司 江副
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2009193537A priority Critical patent/JP5387231B2/en
Publication of JP2011044114A publication Critical patent/JP2011044114A/en
Application granted granted Critical
Publication of JP5387231B2 publication Critical patent/JP5387231B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To facilitate the survey of illegal logic operation inside a microprocessor. <P>SOLUTION: An instruction string producing illegality of logic operation is stored in a comparison instruction storage buffer 40. By the operation of a program, an instruction comparison unit 41 compares an instruction actually in execution with the instruction stored in the comparison instruction storage buffer 40. When an instruction having a copy indication is detected, even numbers of copy instructions are generated. As to the subsequent even numbers of copied instructions, each instruction interval thereof is set so that each instruction is not executed before the preceding instructions are completed, and accordingly, the illegality of logic operation due to timing or conflict does not occur. An instruction producing the illegality of logic operation is identified by the execution of the program with a shift of the copy indication from the final instruction in the instruction string to the preceding instruction on an instruction-by-instruction basis, and by the confirmation of a majority processing check result. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、マイクロプロセッサ及びマイクロプロセッサのデバッグ方法に関するもので、特に、内部の論理不正動作の調査の容易化に係わる。   The present invention relates to a microprocessor and a debugging method of the microprocessor, and particularly relates to facilitating investigation of internal logic illegal operations.

近年、半導体プロセスの微細化により、マイクロプロセッサ内の論理回路の数は飛躍的に増加し、その制御論理は複雑さを増している。マイクロプロセッサを設計開発する上でのチェック手段やシミュレーション環境は充実してきている。しかしながら、タイミングや競合条件によって発生する非常にまれな論理動作不正については、シミュレーションと異なり、内部状態の観測が難しいため、論理動作不正を引き起こす命令列を調査・特定し、解決するまでに、長期間必要になることが多い。   In recent years, with the miniaturization of semiconductor processes, the number of logic circuits in a microprocessor has increased dramatically, and the control logic has increased in complexity. Checking methods and simulation environments for designing and developing microprocessors have been enhanced. However, unlike the simulation, it is difficult to observe the internal state of the very rare logic operation fraud that occurs due to timing and race conditions. Therefore, it takes a long time to investigate, identify, and resolve the instruction sequence that causes the logic operation fraud. Often required for a period.

マイクロプロセッサ内部の動作履歴の収集・保存を行い観測するための技術としては、マイクロプロセッサ内部の動作履歴を収集・保存し、外部に出力することで、内部状態を観測し論理動作不正の調査を容易化するものがある。また、命令列を特定した後の回避手段に関しては、論理動作不正を引き起こす命令列を比較・検出してハードウェアが割り込みを発生させることにより、ソフトウェアでバグ回避コードを動作させる技術がある(例えば特許文献1)。   The technology to collect and store the operation history inside the microprocessor is to collect and store the operation history inside the microprocessor and output it to the outside to observe the internal state and investigate the logic operation fraud. There are things that make it easier. As for the avoidance means after specifying the instruction sequence, there is a technique for operating the bug avoidance code by software by comparing and detecting the instruction sequence causing the illegal logic operation and causing the hardware to generate an interrupt (for example, Patent Document 1).

特開2003−76579号公報JP 2003-76579 A

しかしながら、マイクロプロセッサ内部の動作履歴の収集・保存を行い観測する技術のみでは、収集した情報を解析するのに時間がかかり、論理動作不正の原因を究明するまでに時間を要することが多い。また、割込みを発生させる技術の場合には、ハードウェア単独では論理動作不正を回避することができず、回避コードを実行するためにOS(Operating System)あるいはコンパイラの改造とアプリケーションのリコンパイルが必要になる。さらに、回避手段として割り込みを用いるためアプリケーションの実行速度が著しく低下するという問題があった。   However, with only the technology that collects and stores the operation history inside the microprocessor and observes it, it takes time to analyze the collected information, and it often takes time to investigate the cause of the logic operation fraud. In addition, in the case of a technique for generating an interrupt, it is not possible to avoid an illegal logical operation with hardware alone, and an OS (Operating System) or compiler modification and application recompilation are required to execute the avoidance code. become. Furthermore, since an interrupt is used as an avoidance means, there has been a problem that the execution speed of the application is remarkably reduced.

上述の課題を鑑み、本発明は、内部の論理不正動作の調査を容易化できるマイクロプロセッサ及びマイクロプロセッサのデバッグ方法を提供することを目的とする。   In view of the above-described problems, an object of the present invention is to provide a microprocessor and a microprocessor debugging method that can facilitate the investigation of internal illegal logic operations.

本発明は上記の課題を解決するためになされたものであり、検査対象として比較すべき命令列、当該命令以前の命令との依存関係、当該命令を複製するか否かを示すコピー指示、及び当該命令の発行間隔の設定値を含む情報を格納する比較命令格納手段と、前記比較命令格納手段が格納する情報が示す命令と実行中の命令とが一致するか否かを判定する命令比較手段と、前記命令比較手段によって、命令が一致し且つコピー指示が当該命令を複製することを示すと判定された場合、当該命令の複製であるコピー命令を複数生成する命令制御手段と、前記設定値に設定された発行間隔に従って命令を発行するスケジュール設定手段と、前記スケジュール設定手段が発行する前記コピーの元となった命令及び前記複数のコピー命令を実行し、この実行結果を多数決処理によりチェックする多数決処理チェック手段とを備えることを特徴とするマイクロプロセッサである。   The present invention has been made to solve the above-described problem, and includes an instruction sequence to be compared as an inspection target, a dependency relationship with an instruction before the instruction, a copy instruction indicating whether or not to copy the instruction, and Comparison instruction storage means for storing information including the set value of the instruction issue interval, and instruction comparison means for determining whether or not the instruction indicated by the information stored in the comparison instruction storage means matches the instruction being executed And a command control means for generating a plurality of copy instructions that are duplicates of the instruction when the instruction comparison means determines that the instructions match and the copy instruction indicates that the instruction is duplicated, and the set value A schedule setting unit that issues an instruction according to an issuance interval set in the command, a command that is the source of the copy issued by the schedule setting unit, and the plurality of copy commands, Line results is a microprocessor, characterized in that it comprises a majority processing check means for checking by the majority processing.

また、本発明は、検査対象として比較すべき命令列、当該命令以前の命令との依存関係、当該命令を複製するか否かを示すコピー指示、及び当該命令の発行間隔の設定値を含む情報を登録する工程と、前記登録した命令と実行中の命令とが一致するか否かを判定する工程と、命令が一致し且つコピー指示が当該命令を複製することを示すと判定された場合、当該命令の複製であるコピー命令を複数生成する工程と、前記設定値に設定された発行間隔に従って命令を発行する工程と、前記コピーの元となった命令及び前記複数のコピー命令を実行し、この実行結果を多数決処理によりチェックする工程とを含むことを特徴とするマイクロプロセッサのデバッグ方法である。   In addition, the present invention provides information including an instruction sequence to be compared as an inspection target, a dependency relationship with an instruction before the instruction, a copy instruction indicating whether or not the instruction is to be copied, and a setting value of an issue interval of the instruction If it is determined that the registered instruction and the instruction being executed match, and if the instruction matches and the copy instruction indicates to copy the instruction, A step of generating a plurality of copy instructions that are copies of the instruction, a step of issuing an instruction according to an issue interval set in the set value, and executing the instruction that is the source of the copy and the plurality of copy instructions, And a step of checking the execution result by majority processing.

本発明によれば、単独のマイクロプロセッサにおいて論理動作不正の発生する命令を特殊な解析なしで特定することが可能になり、調査を容易化できる。また、多数決処理チェックの結果を観測することで、正しく論理動作不正が回避できているか確認できる。また、ハードウェアのみで論理動作不正を回避することができる。また、スケジューラーの発行条件を設定して論理動作不正の発生しない最小のタイミングに設定することで性能低下の影響を最小にでき、割込みとソフトウェアによる手段とによる解析と比較して、性能が向上する。   According to the present invention, it is possible to specify an instruction in which a logical operation error occurs in a single microprocessor without special analysis, and the investigation can be facilitated. In addition, by observing the result of the majority processing check, it can be confirmed whether the logical operation fraud is correctly avoided. In addition, it is possible to avoid an illegal logic operation only with hardware. In addition, by setting the scheduler issue condition and setting it to the minimum timing that does not cause logical operation fraud, the effect of performance degradation can be minimized, and the performance improves compared to analysis by means of interrupts and software. .

本発明の第1の実施形態に係るマイクロプロセッサの構成を示すブロック図である。1 is a block diagram showing a configuration of a microprocessor according to a first embodiment of the present invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける命令検出制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the instruction detection control part in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおけるロード・ストア命令パイプのデータチェック制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the data check control part of the load / store instruction pipe in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける演算命令パイプのデータチェック制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the data check control part of the arithmetic instruction pipe in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける命令フォーマットの一例の説明図である。It is explanatory drawing of an example of the instruction format in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける比較命令格納バッファの登録可能な設定値の一例の説明図である。It is explanatory drawing of an example of the setting value which can be registered of the comparison instruction storage buffer in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける命令デコーダーから送られた論理動作不正の発生する命令列の一例の説明図である。It is explanatory drawing of an example of the command sequence which the logic operation injustice sent from the instruction decoder in the microprocessor which concerns on the 1st Embodiment of this invention generate | occur | produces. 本発明の第1の実施形態に係るマイクロプロセッサにおけるデバッグ時の比較命令格納バッファの登録内容の一例の説明図である。It is explanatory drawing of an example of the registration content of the comparison instruction storage buffer at the time of debugging in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける通常時の比較命令格納バッファの登録内容の一例の説明図である。It is explanatory drawing of an example of the registration content of the normal time comparison instruction storage buffer in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける命令検出制御部で命令のコピー処理を行った後の命令列の一例の説明図である。It is explanatory drawing of an example of the command sequence after performing the copy process of the command in the command detection control part in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける命令検出制御部で命令のコピー処理を行った後の命令列の一例の説明図である。It is explanatory drawing of an example of the command sequence after performing the copy process of the command in the command detection control part in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける実行処理の説明に用いるタイミングチャートである。It is a timing chart used for description of the execution process in the microprocessor which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態に係るマイクロプロセッサにおける実行処理の説明に用いるタイミングチャートである。It is a timing chart used for description of the execution process in the microprocessor which concerns on the 1st Embodiment of this invention.

以下、本発明の実施の形態について図面を参照しながら説明する。図1は、本発明の第1の実施形態に係るマイクロプロセッサの内部構成を示すものである。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 shows an internal configuration of a microprocessor according to the first embodiment of the present invention.

本発明の第1の実施形態に係るマイクロプロセッサは、図1に示すように、命令キャッシュ10と、デコーダー11と、命令検出制御部12と、スケジューラー13と、演算器20と、データキャッシュ(AA:アドレスアレイ)21と、データチェック制御部22と、データキャッシュ(DA:データアレイ)23と、リクエスト制御部24と、演算器30と、データチェック制御部31と、レジスタ32とを有している。また、それぞれの構成要素を接続する信号線100、110、120、130、131、200、210、220、221、230、240、241、242、243、300、310、320を有している。   As shown in FIG. 1, the microprocessor according to the first embodiment of the present invention includes an instruction cache 10, a decoder 11, an instruction detection control unit 12, a scheduler 13, a computing unit 20, a data cache (AA). : Address array) 21, data check control unit 22, data cache (DA: data array) 23, request control unit 24, computing unit 30, data check control unit 31, and register 32. Yes. In addition, signal lines 100, 110, 120, 130, 131, 200, 210, 220, 221, 230, 240, 241, 242, 243, 300, 310, and 320 are connected to the respective components.

命令キャッシュ10は、フェッチ部(図示せず)がメインメモリ(図示せず)からフェッチした命令を格納する。
デコーダー11は、プログラムカウンタ(図示せず)に従って、命令キャッシュ10が格納する命令を解析する。
命令検出制御部12は、検査対象として比較すべき命令列や、当該命令以前の命令との依存関係などを含む情報を内部バッファに格納し、当該格納された情報とデコーダー11から出力された命令とを比較する。また、命令検出制御部12の内部バッファに格納された情報には、デコーダー11から出力された命令の複製であるコピー命令を出力するか否かを示すコピー指示フラグが含まれる。当該コピー指示フラグが「有効」、すなわちコピー命令を出力することを示す場合において、当該コピー指示フラグを含む情報とデコーダー11から出力された命令とが一致するとき、命令検出制御部12は、デコーダー11から出力された命令のコピー命令を出力する。
スケジューラー13は、命令の発行間隔のスケジューリングを行う。
The instruction cache 10 stores an instruction fetched from a main memory (not shown) by a fetch unit (not shown).
The decoder 11 analyzes an instruction stored in the instruction cache 10 according to a program counter (not shown).
The instruction detection control unit 12 stores, in an internal buffer, information including an instruction sequence to be compared as an inspection target and a dependency relationship with an instruction before the instruction, and the stored information and an instruction output from the decoder 11 And compare. The information stored in the internal buffer of the instruction detection control unit 12 includes a copy instruction flag indicating whether or not to output a copy instruction that is a duplicate of the instruction output from the decoder 11. When the copy instruction flag indicates “valid”, that is, when a copy instruction is output, when the information including the copy instruction flag matches the instruction output from the decoder 11, the instruction detection control unit 12 A copy instruction of the instruction output from 11 is output.
The scheduler 13 schedules instruction issue intervals.

演算器20、データキャッシュ(AA)21、データチェック制御部22、データキャッシュ(DA)23は、ロード・ストアパイプを構成している。ロード・ストアパイプとは、パイプライン処理によってロード命令・ストア命令を実行する構成のことである。
データチェック制御部22は、多数決処理により、データ・アドレスのチェックを行う。具体的には、データチェック制御部22は、演算器20が処理した命令検出制御部12が出力した命令及び当該命令のコピー命令の実行結果を比較し、それぞれの命令で異なる値が出力された場合に、出力結果が同値となるものが多いものを実行結果として採用する。
リクエスト制御部24は、外部との間で、リクエストの入出力を行う。
The arithmetic unit 20, the data cache (AA) 21, the data check control unit 22, and the data cache (DA) 23 constitute a load / store pipe. The load / store pipe is a configuration for executing a load instruction / store instruction by pipeline processing.
The data check control unit 22 checks the data address by majority processing. Specifically, the data check control unit 22 compares the instruction output by the instruction detection control unit 12 processed by the arithmetic unit 20 and the execution result of the copy instruction of the instruction, and a different value is output for each instruction. In such a case, the output results that are often the same value are adopted as the execution results.
The request control unit 24 inputs and outputs requests with the outside.

演算器30、データチェック制御部31、レジスタ32は、演算命令パイプを構成している。演算命令パイプとは、パイプライン処理によって演算命令を実行する構成のことである。
データチェック制御部31は、多数決処理により、データのチェックを行う。このことについては後に説明する。
The arithmetic unit 30, the data check control unit 31, and the register 32 constitute an arithmetic instruction pipe. An arithmetic instruction pipe is a configuration that executes arithmetic instructions by pipeline processing.
The data check control unit 31 checks data by majority processing. This will be described later.

図2は、命令検出制御部12の構成を示すものである。命令検出制御部12は、図2に示すように、比較命令格納バッファ40、命令比較部41、命令トレーサー42、命令制御部43を有している。また、それぞれの構成要素を接続する信号線400、401、402、410、411、420、430を有している。   FIG. 2 shows the configuration of the instruction detection control unit 12. As shown in FIG. 2, the instruction detection control unit 12 includes a comparison instruction storage buffer 40, an instruction comparison unit 41, an instruction tracer 42, and an instruction control unit 43. In addition, signal lines 400, 401, 402, 410, 411, 420, and 430 are connected to the respective components.

比較命令格納バッファ40には、検査対象として比較すべき命令列や依存関係などを含む情報が登録される。なお、比較命令格納バッファ40に登録される命令列や依存関係については後に説明する。
命令比較部41は、実際の命令と、比較命令格納バッファ40に登録されている設定が一致しているかをチェックし、比較結果が一致している場合は、比較命令格納バッファ40へ次エントリーの命令を出力するように指示する。また、コピー指示が「有効」の場合には、コピー動作を行うように、命令制御部43へ出力する。
命令トレーサー42は、実行している命令の履歴を取得し、内部メモリーに保存する。また、内部メモリーに登録されたデータは論理動作不正の解析に用いられる。
命令制御部43は、スケジューラー13へ命令を出力する。
In the comparison instruction storage buffer 40, information including an instruction sequence to be compared as a check target and dependency relations is registered. Note that the instruction sequence and dependency relationship registered in the comparison instruction storage buffer 40 will be described later.
The instruction comparison unit 41 checks whether the actual instruction matches the setting registered in the comparison instruction storage buffer 40. If the comparison results match, the instruction comparison unit 41 stores the next entry in the comparison instruction storage buffer 40. Instructs the command to be output. When the copy instruction is “valid”, the instruction is output to the instruction control unit 43 so as to perform the copy operation.
The instruction tracer 42 acquires a history of executed instructions and stores it in an internal memory. The data registered in the internal memory is used for analysis of illegal logic operation.
The instruction control unit 43 outputs an instruction to the scheduler 13.

図3は、ロード・ストア命令パイプのデータチェック制御部22の構成を示すものである。データチェック制御部22は、図3に示すように、コピー命令チェック部50と、データ・アドレスバッファ51と、多数決チェック部52とを有している。また、それぞれの構成要素を接続する信号線500、501、502、503、510、520、521、522、523を有している。   FIG. 3 shows the configuration of the data check control unit 22 of the load / store instruction pipe. As shown in FIG. 3, the data check control unit 22 includes a copy instruction check unit 50, a data address buffer 51, and a majority decision check unit 52. In addition, signal lines 500, 501, 502, 503, 510, 520, 521, 522, and 523 are connected to each component.

コピー命令チェック部50は、演算器20によって実行された命令がコピー命令であるか否かをチェックする。
データ・アドレスバッファ51は、実行された命令のデータ・アドレスを格納する。
多数決チェック部52は、多数決処理を行い、奇数個の命令から1命令を選び、データキャッシュ(DA)23へ書き込む。また、多数結処理チェック部52は、リクエスト制御部24へストア命令(命令・データ・アドレス)を出力する。
The copy instruction check unit 50 checks whether the instruction executed by the computing unit 20 is a copy instruction.
The data address buffer 51 stores the data address of the executed instruction.
The majority check unit 52 performs majority processing, selects one instruction from an odd number of instructions, and writes it to the data cache (DA) 23. The multi-connection processing check unit 52 outputs a store instruction (instruction / data / address) to the request control unit 24.

図4は、演算命令パイプのデータチェック制御部31の構成を示すものである。データチェック制御部31は、図4に示すように、コピー命令チェック部60、データバッファ61、多数決チェック部62を有している。また、それぞれの構成要素を接続する信号線600、601、602、603、610、620、621、622を有している。   FIG. 4 shows the configuration of the data check control unit 31 of the operation instruction pipe. As shown in FIG. 4, the data check control unit 31 includes a copy instruction check unit 60, a data buffer 61, and a majority decision check unit 62. In addition, signal lines 600, 601, 602, 603, 610, 620, 621, and 622 are connected to the respective components.

コピー命令チェック部60は、演算器30によって実行された命令がコピー命令であるかをチェックする。
データバッファ61は、実行された命令のデータを保存する。
多数決チェック部62は、多数決処理を行い、奇数個の命令から1命令を選び、レジスタ32へデータを出力する。
The copy instruction check unit 60 checks whether the instruction executed by the arithmetic unit 30 is a copy instruction.
The data buffer 61 stores data of executed instructions.
The majority check unit 62 performs majority processing, selects one instruction from an odd number of instructions, and outputs data to the register 32.

次に、本発明の第1の実施形態に係るマイクロプロセッサのデバッグ動作の概要について説明する。本発明の第1の実施形態に係るマイクロプロセッサの特徴は、図1に示すように、命令検出制御部12と、データチェック制御部22及びデータチェック制御部31とを有していることである。これにより、単独のマイクロプロセッサにおいて論理動作不正の発生する命令を容易に解析することができる。   Next, an outline of the debugging operation of the microprocessor according to the first embodiment of the present invention will be described. The feature of the microprocessor according to the first embodiment of the present invention is that it has an instruction detection control unit 12, a data check control unit 22, and a data check control unit 31, as shown in FIG. . Thereby, it is possible to easily analyze an instruction in which a logical operation error occurs in a single microprocessor.

つまり、本発明の第1の実施形態では、予め論理動作不正が発生する命令列を、命令検出制御部12の比較命令格納バッファ40(図2参照)に格納しておき、動作不正の発生するプログラムを動作させる。当該プログラムの動作により、命令比較部41は、実際に実行している命令と比較命令格納バッファ40に記憶されている命令とを比較し、コピー指示が「有効」である命令を検出すると、命令制御部43にコピー命令を生成する。このとき、命令制御部43は、多数決処理を行うために、元の命令と合わせて奇数個となる個数のコピー命令、すなわち偶数個のコピー命令を生成する。   In other words, in the first embodiment of the present invention, an instruction sequence in which a logical operation error occurs is stored in advance in the comparison instruction storage buffer 40 (see FIG. 2) of the instruction detection control unit 12, and the operation error occurs. Run the program. By the operation of the program, the instruction comparison unit 41 compares the instruction actually executed with the instruction stored in the comparison instruction storage buffer 40, and detects the instruction whose copy instruction is “valid”. A copy command is generated in the control unit 43. At this time, the instruction control unit 43 generates an odd number of copy instructions, that is, an even number of copy instructions together with the original instruction in order to perform majority processing.

デバッグを行う際、予め命令検出制御部12の比較命令格納バッファ40が格納する命令の発行間隔を、前方に存在する全命令が完了する間隔に設定しておく。これにより、元々プログラム中に存在した命令は、通常のタイミングで動作するが、後続のコピーされた偶数個の命令は、前方に存在する命令が完了するまで実行しない。このように動作することで、後続の偶数個のコピー命令はマイクロプロセッサを専有して1命令のみ動作しているので、タイミングや競合による論理動作不正が発生しない。したがって、最終的に多数決処理でデータをチェックすると、元々存在した命令の不正な結果は破棄され、コピー命令動作時の正しい結果が得られる。   When performing debugging, an instruction issue interval stored in the comparison instruction storage buffer 40 of the instruction detection control unit 12 is set in advance to an interval at which all the instructions existing in the front are completed. As a result, the instruction originally present in the program operates at the normal timing, but the subsequent copied even number of instructions are not executed until the instruction existing ahead is completed. By operating in this way, the subsequent even number of copy instructions occupy the microprocessor and operate only one instruction, so that the logical operation fraud due to timing and contention does not occur. Therefore, when the data is finally checked by majority processing, the incorrect result of the originally existing instruction is discarded, and the correct result at the time of the copy instruction operation is obtained.

上記のような機能は、論理動作不正が発生する命令列を比較命令格納バッファ40に記憶できる程度の命令数に絞り込んだ後に使用する。特に、命令列中の最後の命令から1命令ずつコピー指示を前の命令に移動させながらプログラムを実行し、多数決処理チェックの結果を確認することで、論理動作不正の発生する命令を特殊な解析なしで機械的に特定することが可能になる。また、このような機能を含むことで、本発明によるマイクロプロセッサは、ハードウェアのみで論理動作不正を回避できる。さらに、通常時は後続のコピー命令の発行間隔を論理動作不正の発生しない最小のタイミングに設定することで、性能低下を最小限に抑え、割り込みを用いた方法と比較すると性能を向上させることができる。   The functions as described above are used after narrowing down the number of instructions that can be stored in the comparison instruction storage buffer 40 to the instruction sequence in which the logical operation error occurs. In particular, the program is executed while moving the copy instruction from the last instruction in the instruction sequence to the previous instruction one by one, and the result of the majority processing check is checked to specially analyze the instruction in which the logical operation error occurs It becomes possible to specify mechanically without. Further, by including such a function, the microprocessor according to the present invention can avoid the illegal logic operation only by hardware. Furthermore, by setting the interval for issuing subsequent copy instructions to the minimum timing that does not cause incorrect logical operation, it is possible to minimize performance degradation and improve performance compared to methods using interrupts. it can.

次に、命令検出制御部12の比較命令格納バッファ40への設定内容について、具体的に説明する。図5に本発明の第1の実施形態に係るマイクロプロセッサで利用する命令フォーマットを示す。この例では、ソースレジスタは2個(レジスタ(S1)、(S2))、デスティネーションレジスタは1個(レジスタ(D))の3オペランド形式とする。   Next, the contents set in the comparison instruction storage buffer 40 of the instruction detection control unit 12 will be specifically described. FIG. 5 shows an instruction format used in the microprocessor according to the first embodiment of the present invention. In this example, the three-operand format has two source registers (registers (S1) and (S2)) and one destination register (register (D)).

図6は、命令検出制御部12の比較命令格納バッファ40に格納する情報の各パラメータを示す図である。比較命令格納バッファ40への設定方法として、以下のようなものが考えられる。ソフトウェア(SW)によって情報を設定する方法としてデコーダー11から信号線400を介して設定する方法がある。また、ハードウェア(HW)によって情報を設定する方法として外部から信号線401を介して設定する方法がある。あるいは、命令トレーサー42で事前に採取した命令を、信号線420を介して設定するようにしても良い。上記の設定方法は一例であり、その他の設定方法も考えられる。   FIG. 6 is a diagram illustrating parameters of information stored in the comparison instruction storage buffer 40 of the instruction detection control unit 12. As a setting method for the comparison instruction storage buffer 40, the following can be considered. As a method of setting information by software (SW), there is a method of setting from the decoder 11 via the signal line 400. Further, as a method for setting information by hardware (HW), there is a method for setting from the outside via a signal line 401. Alternatively, a command collected in advance by the command tracer 42 may be set via the signal line 420. The above setting method is an example, and other setting methods are also conceivable.

図6において、Vbit(Valid bit)の項目にはエントリーが「有効」あるいは「無効」であるかを設定する。オペコードの項目にはオペコードを設定する。レジスタ番号(D)には、図5に示した命令フォーマットのデスティネーションレジスタDの値を設定する。レジスタ番号(S1)の項目には、ソースレジスタS1の値を設定する。レジスタ番号(S2)の項目には、ソースレジスタS2の値を設定する。ただし、上記レジスタ番号の設定が不要の場合は「指定なし」を設定することで比較不要にすることも可能である。   In FIG. 6, whether the entry is “valid” or “invalid” is set in the item of Vbit (Valid bit). An operation code is set in the operation code item. In the register number (D), the value of the destination register D of the instruction format shown in FIG. 5 is set. In the register number (S1) item, the value of the source register S1 is set. In the register number (S2) item, the value of the source register S2 is set. However, if it is not necessary to set the register number, it is possible to make comparison unnecessary by setting “no designation”.

依存関係(D)の項目には、デスティネーションレジスタが前方にある命令と依存関係を持つ場合に、依存元の命令が登録されているエントリー番号を設定する。依存関係(S1)の項目には、ソースレジスタ(S1)が前方にある命令と依存関係を持つ場合に、依存元の命令が登録されているエントリー番号を設定する。依存関係(S2)の項目には、ソースレジスタ(S2)が前方にある命令と依存関係を持つ場合に依存元の命令が登録されているエントリー番号を設定する。それぞれ、依存関係のない場合は「依存なし」を設定する。   In the item of dependency (D), when the destination register has a dependency relationship with the preceding instruction, an entry number in which the instruction of the dependency source is registered is set. In the item of the dependency relationship (S1), when the source register (S1) has a dependency relationship with the preceding instruction, an entry number in which the dependency source instruction is registered is set. In the item of the dependency relationship (S2), an entry number in which the dependency source instruction is registered when the source register (S2) has a dependency relationship with the preceding instruction is set. When there is no dependency relationship, “no dependency” is set.

コピー指示の項目には、「有効」あるいは「無効」が設定される。「有効」の場合、命令検出制御部12は、該当命令を検出した場合にコピー命令を発生させる。コピー命令を発生する数は、多数決処理を行うために、元の命令を含めて奇数となる個数、すなわちコピーする命令数は偶数個になる。以下の例では、コピーする命令数を2個として説明を行うが、4個以上の構成でもよい。コピーする命令数が2個である場合は、(元の命令(1個)+コピー命令(2個))となるので、同じ命令が3回実行されることとなる。発行間隔の項目は、スケジューラー13がコピー命令を演算器へ投入する時の直前の命令との発行間隔の設定になる。設定された値のクロック時間待ってからコピー命令は発行される。
なお、命令検出制御部12は、コピー元となる命令のフレームにおいて、コピー元の命令であることを示すコピー元bitを「有効」を示す値に書き換える。また、命令検出制御部12は、コピー命令のフレームにおいて、コピー命令であることを示すコピーbitを「有効」を示す値に書き換える。
In the item of the copy instruction, “valid” or “invalid” is set. If “valid”, the instruction detection control unit 12 generates a copy instruction when the corresponding instruction is detected. In order to perform majority processing, the number of copy instructions to be generated is an odd number including the original instruction, that is, the number of instructions to be copied is an even number. In the following example, the number of instructions to be copied is described as two, but a configuration of four or more may be used. When the number of instructions to be copied is two, it becomes (original instruction (1) + copy instruction (2)), so the same instruction is executed three times. The issue interval item is a setting of an issue interval with the immediately preceding instruction when the scheduler 13 inputs a copy instruction to the computing unit. The copy command is issued after waiting for the set clock time.
The instruction detection control unit 12 rewrites the copy source bit indicating the copy source instruction to a value indicating “valid” in the copy instruction frame. Further, the instruction detection control unit 12 rewrites the copy bit indicating the copy instruction to a value indicating “valid” in the frame of the copy instruction.

次に、具体的な例を用いてマイクロプロセッサの処理を説明する。
図7は、マイクロプロセッサで実行されるプログラムの一例であり、図8は、これに対するデバッグ時の比較命令格納バッファ40の登録内容の一例である。図7において、LDはロード命令であり、ADDは加算命令であり、STはストア命令である。
Next, the processing of the microprocessor will be described using a specific example.
FIG. 7 shows an example of a program executed by the microprocessor, and FIG. 8 shows an example of registered contents of the comparison instruction storage buffer 40 during debugging. In FIG. 7, LD is a load instruction, ADD is an addition instruction, and ST is a store instruction.

図8に示すように、各エントリー毎に、図6に示した設定例に従って、比較命令格納バッファ40に登録内容が設定される。ここでは、論理動作不正を発生させる命令がまだ完全に特定できていないため、動作不正を起こす可能性のある命令列中の最後の命令であるエントリー番号「4」のST命令に対して、コピー指示が「有効」になっている。デバッグ時は、直前の命令が完了した後でコピー命令を動作させる必要があるため、発行間隔は充分大きな値、例えば4096クロックという値に設定されている。この後で、実際にプログラムを動作させ、多数決処理チェックを行い、コピー指示を1命令ずつ前の命令に移動させることで、不正の発生する命令を機械的に特定する。   As shown in FIG. 8, the registered contents are set in the comparison instruction storage buffer 40 for each entry according to the setting example shown in FIG. In this case, since the instruction that causes the illegal operation of the logic has not been completely specified, the ST instruction with the entry number “4” that is the last instruction in the instruction sequence that may cause the incorrect operation is copied. The instruction is “valid”. At the time of debugging, since the copy instruction needs to be operated after the immediately preceding instruction is completed, the issue interval is set to a sufficiently large value, for example, a value of 4096 clocks. Thereafter, the program is actually operated, the majority process check is performed, and the copy instruction is moved to the previous instruction one by one, thereby mechanically specifying the instruction in which the fraud occurs.

不正の発生する命令を特定した後は、詳細な解析を行い理論的に論理動作不正が発生しない発行間隔を求めてもよいし、(発行間隔=1)から機械的に発行間隔の設定値を大きくし、不正の発生しない設定値を多数決処理チェックの結果を確認しながら見つけるようにしてもよい。上記例のようにデバッグを終えた後で、通常時の動作を設定する。   After identifying the illegal instruction, detailed analysis may be performed to determine the issuance interval at which logical operation fraud does not occur theoretically, or the issue interval setting value may be determined mechanically from (issue interval = 1). It is also possible to increase the setting value and find a setting value that does not cause fraud while checking the result of the majority processing check. After debugging is completed as in the above example, the normal operation is set.

図9は、通常時の比較命令格納バッファ40の登録内容の例を示すものである。図9に示すように、発行間隔は論理動作不正の発生しない最小の値(図9では例えば「2」に設定)を設定することで、多数決処理チェックにより不正を起こさずに可能な限り性能を向上させることができる。   FIG. 9 shows an example of the registered contents of the comparison instruction storage buffer 40 at the normal time. As shown in FIG. 9, by setting a minimum value (for example, “2” in FIG. 9) in which the logical operation does not occur, the issuance interval performs as much as possible without causing fraud by majority processing check. Can be improved.

次に、デバッグ時の命令検出制御部12の動作について説明する。図2に示したように、命令検出制御部12は、比較命令格納バッファ40と、命令比較部41と、命令トレーサー42と、命令制御部43とを有している。   Next, the operation of the instruction detection control unit 12 during debugging will be described. As shown in FIG. 2, the instruction detection control unit 12 includes a comparison instruction storage buffer 40, an instruction comparison unit 41, an instruction tracer 42, and an instruction control unit 43.

図2において、命令は、デコーダー11から信号線400を介して比較命令格納バッファ40、命令比較部41、命令トレーサー42、命令制御部43に送られる。比較命令格納バッファ40への信号線400は、ソフトウェア(SW)で設定をライトするために使用する。   In FIG. 2, the instruction is sent from the decoder 11 to the comparison instruction storage buffer 40, the instruction comparison unit 41, the instruction tracer 42, and the instruction control unit 43 via the signal line 400. The signal line 400 to the comparison instruction storage buffer 40 is used for writing the setting by software (SW).

命令比較部41は、デコーダー11から信号線400を介して送られてくる命令と比較命令格納バッファ40から信号線402を介して送られてくる設定が一致しているかチェックする。比較結果が一致している場合は、信号線411を介して比較命令格納バッファ40へ次エントリーの命令を出力するように指示する。また、コピー指示が「有効」の場合はコピー命令を生成して信号線410を介して命令制御部43へ出力する。比較結果が一致していない場合は、信号線411を介して比較命令格納バッファ40へ先頭エントリーの出力に戻すように指示する。また、その場合、比較結果が不一致であることを、信号線410を介して命令制御部43へ出力する。   The instruction comparison unit 41 checks whether the instruction sent from the decoder 11 via the signal line 400 matches the setting sent from the comparison instruction storage buffer 40 via the signal line 402. If the comparison results match, an instruction is given to output the next entry instruction to the comparison instruction storage buffer 40 via the signal line 411. If the copy instruction is “valid”, a copy command is generated and output to the command control unit 43 via the signal line 410. If the comparison results do not match, the comparison instruction storage buffer 40 is instructed to return to the output of the first entry via the signal line 411. In this case, the fact that the comparison results do not match is output to the instruction control unit 43 via the signal line 410.

命令トレーサー42は、実行している命令の履歴を取得し、内部メモリーに保存する。命令トレーサー42に登録されているデータは論理動作不正の解析のために用いられる。観測方法は、信号線420を介して、ソフトウェア(SW)の命令で出力してもよいし、ハードウェア(HW)の作りこみでLSIの外部へ出力してもよい。   The instruction tracer 42 acquires a history of executed instructions and stores it in an internal memory. The data registered in the instruction tracer 42 is used for analyzing a logical operation error. The observation method may be output by a software (SW) command via the signal line 420, or may be output to the outside of the LSI by hardware (HW) creation.

命令制御部43は、命令比較結果を利用してコピー命令を使用するかあるいは通常の命令を使用するかを判断した後で、信号線430を介してスケジューラー13へ命令を出力する。具体的には、命令比較部41が、デコーダー11から送られてきた命令と命令格納バッファ40から送られてくる情報が示す設定とが一致すると判定した場合において、比較命令格納バッファ40から取得した情報のコピー指示が「有効」である場合に、コピー命令を使用すると判断し、コピー指示が「無効」である場合に、コピー命令を使用しないと判断する。   The instruction control unit 43 outputs an instruction to the scheduler 13 via the signal line 430 after determining whether to use a copy instruction or a normal instruction using the instruction comparison result. Specifically, when the instruction comparison unit 41 determines that the instruction sent from the decoder 11 matches the setting indicated by the information sent from the instruction storage buffer 40, the instruction comparison unit 41 obtains the instruction from the comparison instruction storage buffer 40. When the information copy instruction is “valid”, it is determined that the copy command is used, and when the information is “invalid”, it is determined that the copy command is not used.

次に、スケジューラー13による命令発行間隔の制御について説明する。スケジューラー13は、命令検出制御部12より送られてきた命令に関して発行間隔のチェックを行う。発行間隔が「0」でない命令は指定されたクロック時間の間だけ命令発行を遅らせる。例えば、発行間隔が「2」の場合、直前に発行した命令に対して2クロック待ってから該当命令を発行する。デバッグ時は、この発行間隔を充分大きい値に設定することで、該当命令がマイクロプロセッサを専有して1命令のみ動作する状態を作り出し、タイミングや競合による論理動作不正の発生を防ぐ。命令の種類によってロード・ストア命令は信号線130を介して演算器20へ発行される。また、通常の演算命令は信号線131を介して演算器30へ発行される。   Next, the control of the instruction issue interval by the scheduler 13 will be described. The scheduler 13 checks the issue interval for the instruction sent from the instruction detection control unit 12. An instruction whose issue interval is not “0” delays the issuance of an instruction for a designated clock time. For example, when the issue interval is “2”, the corresponding instruction is issued after waiting for two clocks with respect to the instruction issued immediately before. At the time of debugging, this issue interval is set to a sufficiently large value to create a state in which the corresponding instruction occupies the microprocessor and operates only one instruction, and prevents the occurrence of illegal logic operation due to timing or contention. Depending on the type of instruction, a load / store instruction is issued to the arithmetic unit 20 via the signal line 130. Further, a normal calculation instruction is issued to the calculator 30 via the signal line 131.

次に、各命令の動作について説明する。図1において、演算器20と演算器30は、それぞれ入力オペランドに従ってレジスタリードの場合は信号線320を介してデータを入力する。フォワーディングデータを使用する場合は信号線310を介してデータを入力する。その後で、指定された演算を行う。演算を行った命令は、演算器20を使用した場合は信号線200を介してデータキャッシュ(AA)21とデータチェック制御部22とデータキャッシュ(DA)23へ送られる。また、演算器30を使用した場合は信号線300を介してデータチェック制御部31へ送られる。この後は命令によって動作が異なるので分けて説明をする。   Next, the operation of each command will be described. In FIG. 1, the arithmetic unit 20 and the arithmetic unit 30 respectively input data via a signal line 320 in the case of register read according to the input operand. When using forwarding data, data is input via the signal line 310. After that, the specified operation is performed. When the arithmetic unit 20 is used, the instruction that has performed the calculation is sent to the data cache (AA) 21, the data check control unit 22, and the data cache (DA) 23 via the signal line 200. Further, when the arithmetic unit 30 is used, it is sent to the data check control unit 31 via the signal line 300. After this, since the operation differs depending on the instruction, it will be described separately.

(1)ロード・ストアパイプの動作
データチェック制御部22がデータチェックを行うのは、レジスタあるいはデータキャッシュなどの内部資源にライトして内部状態が変化するときのみでよい。ここで、データキャッシュへのライトが発生するのはストア命令のキャッシュヒット時とロード命令のキャッシュミス時(キャッシュフィルによるライト)の2通り存在する。
(1) Operation of Load / Store Pipe The data check control unit 22 performs data check only when the internal state changes by writing to an internal resource such as a register or a data cache. Here, there are two types of writing to the data cache, that is, when the store instruction hits the cache and when the load instruction cache miss (write due to cache fill).

a.ストア命令
ストア命令実行時、データチェック制御部22は、データキャッシュ(AA)21にアクセスし、キャッシュヒット/ミスの情報を、信号線210を介して取得する。
以下に、メインメモリーへの書き込み方式がライトバック方式である場合とライトスルー方式である場合との動作をそれぞれ説明する。
a. Store Instruction When the store instruction is executed, the data check control unit 22 accesses the data cache (AA) 21 and acquires cache hit / miss information via the signal line 210.
In the following, the operation when the writing method to the main memory is the write-back method and when the write-through method is used will be described.

・ライトバック方式の場合
データチェック制御部22は、まず多数決処理によるチェックを行う。その後、データチェック制御部22が取得したキャッシュヒット/ミスの情報がキャッシュヒットを示す場合、データチェック制御部22は、信号線220を介してデータキャッシュ(DA)23へライトする。他方、データチェック制御部22が取得したキャッシュヒット/ミスの情報がキャッシュミスを示す場合は、信号線221を介してリクエスト制御部24へ命令を出力する。リクエスト制御部24は信号線240を介して当該命令をマイクロプロセッサの外部へ出力する。
In the case of the write back method The data check control unit 22 first performs a check by majority processing. Thereafter, when the cache hit / miss information acquired by the data check control unit 22 indicates a cache hit, the data check control unit 22 writes to the data cache (DA) 23 via the signal line 220. On the other hand, when the cache hit / miss information acquired by the data check control unit 22 indicates a cache miss, an instruction is output to the request control unit 24 via the signal line 221. The request control unit 24 outputs the instruction to the outside of the microprocessor via the signal line 240.

・ライトスルー方式の場合
データチェック制御部22は、まず多数決処理によるチェックを行う。その後、データチェック制御部22が取得したキャッシュヒット/ミスの情報がキャッシュヒットを示す場合、信号線220を介してデータキャッシュ(DA)23へライトする。また、データチェック制御部22は、キャッシュヒット/ミスにかかわらず、信号線221を介してリクエスト制御部24へ命令を出力する。リクエスト制御部24は信号線240を介して当該命令をマイクロプロセッサ外部へ出力する。
In the case of the write-through method The data check control unit 22 first performs a check by majority processing. Thereafter, when the cache hit / miss information acquired by the data check control unit 22 indicates a cache hit, the data is written to the data cache (DA) 23 via the signal line 220. Further, the data check control unit 22 outputs an instruction to the request control unit 24 via the signal line 221 regardless of cache hit / miss. The request control unit 24 outputs the instruction to the outside of the microprocessor via the signal line 240.

図3を用いてロード・ストア命令パイプのデータチェック制御部の詳細な動作について説明する。
図3において、コピー命令チェック部50に、演算器20から信号線500を介して命令・データ・アドレスが送られる。また、コピー命令チェック部50に、データキャッシュ(AA)21から信号線501を介してキャッシュヒット/ミス情報が送られる。
The detailed operation of the data check control unit of the load / store instruction pipe will be described with reference to FIG.
In FIG. 3, the instruction / data / address is sent from the arithmetic unit 20 to the copy instruction check unit 50 via the signal line 500. Further, cache hit / miss information is sent from the data cache (AA) 21 to the copy instruction check unit 50 via the signal line 501.

コピー命令チェック部50は、キャッシュヒット/ミスにかかわらず、演算器20から送られてきた命令がコピー元の命令またはコピー命令(コピー元bitが「有効」あるいはコピーbitが「有効」の命令)であるかをチェックする。コピー元の命令またはコピー命令のいずれにも当てはまらない場合、コピー命令チェック部50は、そのまま信号線503を介して多数決チェック部52へ出力する。コピー元の命令またはコピー命令であった場合、コピー命令チェック部50は、信号線502を介してデータ・アドレスバッファ51に命令のデータ・アドレスを登録する。コピー命令中で最後の命令(3個目の命令)を検出すると、コピー命令チェック部50は、信号線503を介して多数決チェック部52に命令とキャッシュヒット/ミス情報を出力する。   The copy instruction check unit 50 determines whether the instruction sent from the computing unit 20 is a copy source instruction or a copy instruction regardless of a cache hit / miss (a copy source bit is “valid” or a copy bit is “valid”). Check if it is. If neither of the copy source instruction or the copy instruction applies, the copy instruction check unit 50 outputs the same to the majority decision check unit 52 via the signal line 503 as it is. If the instruction is a copy source instruction or a copy instruction, the copy instruction check unit 50 registers the data address of the instruction in the data address buffer 51 via the signal line 502. When the last instruction (third instruction) is detected in the copy instruction, the copy instruction check unit 50 outputs the instruction and cache hit / miss information to the majority check unit 52 via the signal line 503.

多数決チェック部52は、コピー命令でなかった場合は多数決処理を行わずにそのまま命令を、信号線521、522を介してデータキャッシュ(DA)23及びリクエスト制御部24に出力する。コピー命令であった場合は信号線520を介してデータ・アドレスバッファ51に該当命令のデータ・アドレスの出力依頼を行う。データ・アドレスバッファ51は、信号線510を介して該当命令のデータ・アドレスを出力する。   If it is not a copy instruction, the majority decision checking unit 52 outputs the instruction as it is to the data cache (DA) 23 and the request control unit 24 via the signal lines 521 and 522 without performing the majority process. If the instruction is a copy instruction, the data address buffer 51 is requested to output the data address of the corresponding instruction via the signal line 520. The data address buffer 51 outputs the data address of the corresponding instruction via the signal line 510.

多数決チェック部52は、多数決処理を行いコピー命令中の3命令から1命令を選び、信号線521を介してデータキャッシュ(DA)へライトを行う。また、信号線522を介してリクエスト制御部へストア命令(命令・データ・アドレス)を出力する。   The majority check unit 52 performs majority processing, selects one instruction from the three instructions in the copy instruction, and writes to the data cache (DA) via the signal line 521. Further, a store instruction (instruction / data / address) is output to the request control unit via the signal line 522.

多数決処理チェックの結果は、信号線523を介してソフトウェア(SW)の命令で出力してもよいし、ハードウェア(HW)の作りこみでマイクロプロセッサの外部へ出力してもよい。このように多数決チェックの結果を外部に出力するような観測機能を設けると論理動作不正の解析の容易化と動作の確認を行うことが可能になる。   The result of the majority processing check may be output by a software (SW) command via the signal line 523, or may be output to the outside of the microprocessor by creating hardware (HW). By providing an observation function for outputting the result of majority vote check to the outside in this way, it becomes possible to facilitate analysis of logic operation fraud and to confirm the operation.

次に、ロード命令の実行時におけるロード・ストアパイプの動作を説明する。
b.ロード命令
図1において、ロード命令実行時、データチェック制御部22は、データキャッシュ(AA)21にアクセスし、キャッシュヒット/ミスの情報を、信号線210を介して取得する。同時に、データチェック制御部22は、データキャッシュ(DA)23にアクセスする。
Next, the operation of the load / store pipe when the load instruction is executed will be described.
b. Load Instruction In FIG. 1, when a load instruction is executed, the data check control unit 22 accesses the data cache (AA) 21 and acquires cache hit / miss information via the signal line 210. At the same time, the data check control unit 22 accesses the data cache (DA) 23.

取得したキャッシュヒット/ミスの情報がキャッシュヒットを示す場合、データチェック制御部22は、信号線230を介して命令・データをデータチェック制御部31へ出力する。他方、取得したキャッシュヒット/ミスの情報がキャッシュミスを示す場合、データチェック制御部22は多数決処理チェックの処理を行い、信号線221を介してリクエスト制御部24にキャッシュフィルのリクエストを出力する。   When the acquired cache hit / miss information indicates a cache hit, the data check control unit 22 outputs an instruction / data to the data check control unit 31 via the signal line 230. On the other hand, if the acquired cache hit / miss information indicates a cache miss, the data check control unit 22 performs majority processing check processing and outputs a cache fill request to the request control unit 24 via the signal line 221.

リクエスト制御部24は、信号線240を介して外部にキャッシュフィルのリクエストを出力する。キャッシュフィルのデータは信号線241を介して返ってくる。リクエスト制御部24は、信号線242を介してキャッシュフィルのデータをデータキャッシュ(AA)21とデータキャッシュ(DA)23にライトする。キャッシュフィルのデータの中でロード命令のターゲットデータをチェックして信号線243を介してデータチェック制御部31へ出力する。   The request control unit 24 outputs a cache fill request to the outside via the signal line 240. The cache fill data is returned via the signal line 241. The request control unit 24 writes the cache fill data to the data cache (AA) 21 and the data cache (DA) 23 via the signal line 242. The target data of the load instruction is checked in the cache fill data and output to the data check control unit 31 via the signal line 243.

図3を用いてロード・ストア命令パイプのデータチェック制御部の詳細な動作について説明する。
図3において、コピー命令チェック部50には、演算器20から信号線500を介して命令・アドレスが送られる。また、コピー命令チェック部50には、データキャッシュ(AA)から信号線501を介してキャッシュヒット/ミス情報が送られる。
ここで、コピー命令チェック部50は、キャッシュヒットの場合、多数決処理チェックはレジスタライトの直前の図1のデータチェック制御部31で行うので、何も行わない。キャッシュミスの場合、演算器20から送られてきた命令がコピー元の命令またはコピー命令(コピー元bitが有効あるいはコピーbitが有効の命令)であるかをチェックする。
The detailed operation of the data check control unit of the load / store instruction pipe will be described with reference to FIG.
In FIG. 3, an instruction / address is sent from the arithmetic unit 20 to the copy instruction check unit 50 via the signal line 500. Further, cache hit / miss information is sent from the data cache (AA) to the copy instruction check unit 50 via the signal line 501.
Here, in the case of a cache hit, the copy instruction check unit 50 does nothing because the majority processing check is performed by the data check control unit 31 of FIG. 1 immediately before the register write. In the case of a cache miss, it is checked whether the instruction sent from the computing unit 20 is a copy source instruction or a copy instruction (a copy source bit is valid or a copy bit is valid).

コピー元の命令またはコピー命令でなかった場合、コピー命令チェック部50は、そのまま信号線503を介して多数決チェック部52へ出力する。コピー命令であった場合、コピー命令チェック部50は、信号線502を介してデータ・アドレスバッファ51に命令のアドレスを登録する。また、コピー命令チェック部50は、コピー命令中で最後の命令(3個目の命令)を検出すると信号線503を介して多数決チェック部52に命令とキャッシュミス情報を出力する。   If the instruction is not a copy source instruction or a copy instruction, the copy instruction check unit 50 outputs the same to the majority check unit 52 via the signal line 503 as it is. If the instruction is a copy instruction, the copy instruction check unit 50 registers the instruction address in the data address buffer 51 via the signal line 502. Further, when the copy instruction check unit 50 detects the last instruction (third instruction) in the copy instruction, it outputs the instruction and cache miss information to the majority decision check unit 52 via the signal line 503.

多数決チェック部52は、コピー命令でなかった場合は多数決処理を行わずにそのまま信号線522を介して出力する。他方、コピー命令であった場合は信号線520を介してデータ・アドレスバッファ51に該当命令のアドレスの出力依頼を行う。データ・アドレスバッファ51は、信号線510を介して該当命令のアドレスを出力する。多数決チェック部52は、多数決処理を行いコピー命令中の3命令から1命令を選び、信号線522を介してリクエスト制御部24へキャッシュフィルのリクエスト命令(命令・アドレス)を出力する。   If it is not a copy command, the majority decision checking unit 52 outputs the signal as it is through the signal line 522 without performing the majority process. On the other hand, if the instruction is a copy instruction, the data address buffer 51 is requested to output the address of the corresponding instruction via the signal line 520. The data address buffer 51 outputs the address of the corresponding instruction via the signal line 510. The majority check section 52 performs majority processing, selects one instruction from the three instructions in the copy instruction, and outputs a cache fill request instruction (instruction / address) to the request control section 24 via the signal line 522.

多数決処理チェックの結果は、信号線523を介してソフトウェア(SW)の命令で出力してもよいし、ハードウェア(HW)の作りこみでLSIの外部へ出力してもよい。このように観測機能を設けると論理動作不正の解析の容易化と動作の確認を行うことが可能になる。   The result of the majority processing check may be output by a software (SW) command via the signal line 523, or may be output to the outside of the LSI by creating hardware (HW). By providing an observation function in this way, it becomes possible to facilitate the analysis of the logic operation fraud and to confirm the operation.

上記説明では、キャッシュフィルのリクエストを多数決処理チェック後に外部に出力したが、リクエスト制御部24にキャッシュフィル用の多数決処理チェックの制御部を設ければ、キャッシュフィルのデータが戻ってきた後にキャッシュフィルデータの多数決処理チェックを行うことも可能である。この場合は、ターゲットデータは信号線243を介してコピー命令も含めて3命令分 データチェック制御部31へ送られ多数決処理チェックを行った後で信号線310を介してレジスタ32へライトされる。   In the above description, a cache fill request is output to the outside after a majority processing check. However, if a cache fill majority processing check control unit is provided in the request control unit 24, the cache fill data is returned after the cache fill data is returned. It is also possible to perform data majority processing check. In this case, the target data is sent to the data check control unit 31 for three instructions including the copy instruction via the signal line 243, and after majority processing is checked, the target data is written to the register 32 via the signal line 310.

(2)演算命令パイプの動作
データチェックを行うのは、レジスタあるいはデータキャッシュなどの内部資源にライトして内部状態が変化する時のみでよい。本発明の実施例においてレジスタへのライトが発生するのは演算命令とロード命令の2通り存在する。
(2) Operation of the operation instruction pipe The data check is performed only when the internal state is changed by writing to an internal resource such as a register or a data cache. In the embodiment of the present invention, writing to a register occurs in two ways: an operation instruction and a load instruction.

c.演算命令
図1において、演算命令の動作は、データチェック制御部31が多数決処理チェックの処理を行い、信号線310を介してレジスタ32へライトを行う。また信号線310を介してフォワーディングデータを演算器20、演算器30へ転送する。
c. Arithmetic Instruction In FIG. 1, the operation of the arithmetic instruction is performed by the data check control unit 31 performing majority processing check processing and writing to the register 32 via the signal line 310. Further, the forwarding data is transferred to the arithmetic unit 20 and the arithmetic unit 30 via the signal line 310.

図4を用いて演算命令パイプのデータチェック制御部31の詳細な動作について説明する。図4において、演算器30から信号線600を介して命令・データが送られる。コピー命令チェック部60は、演算器20から送られてきた命令がコピー元の命令またはコピー命令(コピー元bitが有効あるいはコピーbitが有効の命令)であるかをチェックする。   The detailed operation of the data check control unit 31 of the operation instruction pipe will be described with reference to FIG. In FIG. 4, an instruction / data is sent from the arithmetic unit 30 via the signal line 600. The copy instruction check unit 60 checks whether the instruction sent from the computing unit 20 is a copy source instruction or a copy instruction (a copy source bit is valid or a copy bit is valid).

コピー命令でなかった場合、コピー命令チェック部60は、そのまま信号線603を介して多数決チェック部62へ出力する。コピー命令であった場合は信号線602を介してデータバッファ61に命令のデータを保存する。また、コピー命令中で最後の命令(3個目の命令)を検出すると信号線603を介して多数決チェック部62に命令を出力する。   If it is not a copy command, the copy command check unit 60 outputs the same to the majority decision check unit 62 via the signal line 603 as it is. If the instruction is a copy instruction, the instruction data is stored in the data buffer 61 via the signal line 602. When the last instruction (third instruction) in the copy instruction is detected, the instruction is output to the majority decision check unit 62 via the signal line 603.

多数決チェック部62は、コピー命令でなかった場合は多数決処理を行わずに取得した命令をそのまま信号線621を介して出力する。コピー命令であった場合は信号線620を介してデータバッファ61に該当命令のデータの出力依頼を行う。データバッファ61は、信号線610を介して該当命令のデータを出力する。多数決チェック部62は、多数決処理を行いコピー命令中の3命令から1命令を選び、信号線621を介してレジスタへデータを出力する。   If it is not a copy command, the majority decision check unit 62 outputs the acquired command as it is through the signal line 621 without performing the majority process. If the instruction is a copy instruction, the data buffer 61 is requested to output the data of the corresponding instruction via the signal line 620. The data buffer 61 outputs the data of the corresponding instruction via the signal line 610. The majority check unit 62 performs majority processing, selects one instruction from three instructions in the copy instruction, and outputs data to the register via the signal line 621.

多数決処理チェックの結果は、信号線622を介してソフトウェア(SW)の命令で出力してもよいし、ハードウェア(HW)の作りこみでマイクロプロセッサの外部へ出力してもよい。このように観測機能を設けると論理動作不正の解析の容易化と動作の確認を行うことが可能になる。   The result of the majority processing check may be output by a software (SW) command via the signal line 622, or may be output to the outside of the microprocessor by creating hardware (HW). By providing an observation function in this way, it becomes possible to facilitate the analysis of the logic operation fraud and to confirm the operation.

次に、ロード命令のレジスタライト動作実行時における演算命令パイプの動作を説明する。
d.ロード命令のレジスタライト動作
図1において、ロード命令の動作は、キャッシュヒット/ミスで異なる。キャッシュヒット時は、データチェック制御部31は多数決処理チェックの処理を行い、信号線310を介してレジスタ32へライトを行う。また信号線310を介してフォワーディングデータを演算器20、演算器30へ転送する。キャッシュミス時は、データチェック制御部31は多数決処理チェックを行わずに信号線310を介してレジスタ32へライトを行う。
Next, the operation of the operation instruction pipe when the register write operation of the load instruction is executed will be described.
d. Register Write Operation of Load Instruction In FIG. 1, the operation of the load instruction differs depending on cache hit / miss. At the time of a cache hit, the data check control unit 31 performs majority processing check processing and writes to the register 32 via the signal line 310. Further, the forwarding data is transferred to the arithmetic unit 20 and the arithmetic unit 30 via the signal line 310. When a cache miss occurs, the data check control unit 31 writes to the register 32 via the signal line 310 without performing majority processing check.

図4を用いて演算命令パイプのデータチェック制御部31の詳細な動作について説明する。図4において、データキャッシュ(DA)から信号線601を介して命令・データが送られる。コピー命令チェック部60は、コピー命令(コピー元bitが有効あるいはコピーbitが有効の命令)であるかをチェックする。   The detailed operation of the data check control unit 31 of the operation instruction pipe will be described with reference to FIG. In FIG. 4, an instruction / data is sent from a data cache (DA) via a signal line 601. The copy instruction check unit 60 checks whether it is a copy instruction (a copy source bit is valid or a copy bit is valid).

コピー命令でなかった場合は、そのまま信号線603を介して多数決チェック部62へ出力する。コピー命令であった場合は、信号線602を介してデータバッファ61に命令のデータを保存する。コピー命令中で最後の命令(3個目の命令)を検出すると信号線603を介して多数決チェック部62に命令を出力する。   If it is not a copy command, it is output as it is to the majority check unit 62 via the signal line 603. If the instruction is a copy instruction, the instruction data is stored in the data buffer 61 via the signal line 602. When the last command (third command) is detected in the copy command, the command is output to the majority check unit 62 via the signal line 603.

多数決チェック部62は、コピー命令でなかった場合は多数決処理を行わずにそのまま信号線621を介して出力する。コピー命令であった場合は信号線620を介してデータバッファ61に該当命令のデータの出力依頼を行う。データバッファ61は、該当命令のデータを信号線610を介して出力する。多数決チェック部62は、多数決処理を行いコピー命令中の3命令から1命令を選び、信号線621を介してレジスタへデータを出力する。   If it is not a copy command, the majority decision checking unit 62 outputs the signal as it is through the signal line 621 without performing the majority process. If the instruction is a copy instruction, the data buffer 61 is requested to output the data of the corresponding instruction via the signal line 620. The data buffer 61 outputs the data of the corresponding instruction via the signal line 610. The majority check unit 62 performs majority processing, selects one instruction from three instructions in the copy instruction, and outputs data to the register via the signal line 621.

多数決処理チェックの結果は、信号線622を介してソフトウェア(SW)の命令で出力してもよいし、ハードウェア(HW)の作りこみでLSIの外部へ出力してもよい。観測機能を設けると論理動作不正の解析の容易化と動作の確認を行うことが可能になる。   The result of the majority processing check may be output by a software (SW) command via the signal line 622, or may be output to the outside of the LSI by creating hardware (HW). If an observation function is provided, it becomes possible to facilitate analysis of logic operation fraud and to confirm operation.

次に、本発明の第1の実施形態に係るマイクロプロセッサのデバッグ時の各部の動作を具体的に説明する。まず、マイクロプロセッサでは、図7に示したプログラムを実行するものとする。また、比較命令格納バッファ40には、図8に示したような設定を登録したものとする。ここで、論理動作不正が発生する命令は、エントリー番号「3」のADD命令であるとする。   Next, the operation of each unit during debugging of the microprocessor according to the first embodiment of the present invention will be specifically described. First, it is assumed that the microprocessor executes the program shown in FIG. It is assumed that the setting as shown in FIG. 8 is registered in the comparison instruction storage buffer 40. Here, it is assumed that the instruction causing the logical operation fraud is the ADD instruction having the entry number “3”.

図1において、論理動作不正が発生するプログラムを実行すると、命令は命令キャッシュ10からフェッチされ、信号線100を介してデコーダー11へ送られる。デコーダー11は命令のデコードを行い、信号線110を介して命令検出制御部12へ出力する。   In FIG. 1, when a program in which an illegal logic operation occurs is executed, an instruction is fetched from the instruction cache 10 and sent to the decoder 11 via the signal line 100. The decoder 11 decodes the instruction and outputs the instruction to the instruction detection control unit 12 via the signal line 110.

命令検出制御部12の命令比較部41(図2に参照)には、デコーダー11から信号線400を介して、図7の番号「1」のLD命令が、実際の命令として入力される。同時に比較命令格納バッファ40から、信号線402を介して、図8のエントリー番号「1」の内容が、設定された命令として入力される。命令比較部41は、実際の命令と設定された命令とを比較すると、オペコード、レジスタ番号(D、S1、S2)、依存関係(D、S1、S2)とが一致することを検出する。ただし、ここではコピー指示が「無効」のためコピー命令は発生しない。   7 is input as an actual instruction to the instruction comparison unit 41 (see FIG. 2) of the instruction detection control unit 12 via the signal line 400 from the decoder 11. At the same time, the contents of the entry number “1” in FIG. 8 are input from the comparison instruction storage buffer 40 via the signal line 402 as a set instruction. When comparing the actual instruction with the set instruction, the instruction comparison unit 41 detects that the operation code, the register number (D, S1, S2), and the dependency relationship (D, S1, S2) match. However, since the copy instruction is “invalid” here, no copy command is generated.

命令比較部41は、次の比較に備えて信号線411を介して比較命令格納バッファ40に次エントリーの内容を出力するように指示する。次に、図7の番号「2」のLD命令と、図8のエントリー番号「2」の内容を比較する。この場合、「1」の命令と同様に、一致を検出し、各種処理を行うが、コピー命令は発生しない。   The instruction comparison unit 41 instructs the comparison instruction storage buffer 40 to output the contents of the next entry via the signal line 411 in preparation for the next comparison. Next, the LD instruction with the number “2” in FIG. 7 is compared with the contents of the entry number “2” in FIG. In this case, similar to the instruction “1”, a match is detected and various processes are performed, but no copy instruction is generated.

次に、図7の番号「3」のADD命令と、図8のエントリー番号「3」の内容を比較する。この場合、「1」、「2」と同様に、一致を検出するので、各種処理を行うが、コピー命令は発生しない。   Next, the ADD instruction with the number “3” in FIG. 7 is compared with the contents of the entry number “3” in FIG. In this case, as in “1” and “2”, since a match is detected, various processes are performed, but no copy command is generated.

次に、図7の番号「4」のST命令と、図8のエントリー番号「4」の内容を比較する。この場合、一致を検出し、さらに、図8のエントリー番号「4」はコピー指示が「有効」になっているので、命令比較部41は、信号線410を介して命令制御部43へ比較結果が一致、且つコピー指示が「有効」、且つ発行間隔が「4096」であることを出力する。また、図8の番号「4」のST命令に対して、2個のコピー命令を発生し、信号線410を介して命令制御部43へ出力する。   Next, the ST instruction with the number “4” in FIG. 7 is compared with the contents of the entry number “4” in FIG. In this case, a match is detected. Further, since the copy instruction is “valid” for the entry number “4” in FIG. 8, the instruction comparison unit 41 sends the comparison result to the instruction control unit 43 via the signal line 410. , The copy instruction is “valid”, and the issuance interval is “4096”. Also, two copy instructions are generated for the ST instruction with the number “4” in FIG. 8 and output to the instruction control unit 43 via the signal line 410.

命令制御部43は、図7の番号「4」のST命令に、コピー元bit(コピー指示が有効な命令で元のプログラムの命令列中に存在した命令を示すbit)が「有効」、発行間隔が「0」を付与して、信号線430を介してスケジューラー13へ出力する。次に、ST命令のコピー命令を2命令分、コピーbit(コピー指示が有効な命令で新しくコピーとして生成した命令を示すbit)が「有効」、発行間隔が「4096」を付与して、信号線430を介してスケジューラー13へ出力する。上記処理を行って命令制御部43からスケジューラー13に送られる命令は、図10のようになる。   The instruction control unit 43 issues a copy source bit (a bit indicating a command in which the copy instruction is valid and existing in the instruction sequence of the original program) to the ST command with the number “4” in FIG. The interval is given “0” and is output to the scheduler 13 via the signal line 430. Next, a copy instruction of ST instruction is given for two instructions, a copy bit (bit indicating a newly generated copy instruction with a valid copy instruction) is “valid”, an issue interval is “4096”, and a signal is given. The data is output to the scheduler 13 via the line 430. The instruction sent from the instruction control unit 43 to the scheduler 13 by performing the above processing is as shown in FIG.

図12は、上記動作に関してのタイミングチャートを示すものである。番号「2」のLD命令から、番号「3」のADD命令へのデータのフォワーディングのタイミングで動作不正が発生している。この例では、番号「4」のST命令をコピー対象としたために、時刻が「8202」で多数決処理チェックを行っても、3命令とも同じ動作不正の発生したストア命令になり、論理動作不正は回避できないことになる。   FIG. 12 shows a timing chart regarding the above operation. An operation error occurs at the data forwarding timing from the LD instruction with the number “2” to the ADD instruction with the number “3”. In this example, since the ST instruction with the number “4” is the copy target, even when the majority process check is performed at the time “8202”, all the three instructions become the store instruction in which the same operation error occurs, and the logical operation error is It cannot be avoided.

論理動作不正が回避できていないので、比較命令格納バッファ40の登録内容の再設定を行う。命令列中で1命令前の番号「3」のADD命令にコピー指示を移動させる。ただし、デバッグ中なので発行間隔は「4096」である。   Since the illegal logic operation cannot be avoided, the registered contents of the comparison instruction storage buffer 40 are reset. The copy instruction is moved to the ADD instruction with the number “3” one instruction before in the instruction sequence. However, since debugging is in progress, the issue interval is “4096”.

その後、プログラムを再実行すると、番号「3」のADDは動作不正になるが、番号「4」のADDと、番号「5」のADDの2つのコピー命令は正しく動作する。よって、論理動作不正が発生しても多数決処理チェック回路で正しい結果が得られる。   Thereafter, when the program is re-executed, the ADD of the number “3” becomes invalid, but the two copy instructions of the ADD of the number “4” and the ADD of the number “5” operate correctly. Therefore, even if a logical operation error occurs, a correct result can be obtained by the majority processing check circuit.

ここで、論理動作不正の回避による影響を少なくするために、上記動作について命令トレーサー42や多数決処理チェックの結果を用いて机上で解析すると、理論的には発行間隔を「2」に設定すれば正しく動作することが分かったとする。この理想的な設定を通常時の動作設定とすることで性能低下の影響を最小にすることができる。   Here, in order to reduce the influence of avoiding the logical operation fraud, if the above operation is analyzed on the desk using the result of the instruction tracer 42 or the majority decision check, the issue interval is theoretically set to “2”. Suppose you know it works correctly. By making this ideal setting the normal operation setting, the influence of the performance degradation can be minimized.

比較命令格納バッファ40に図9に示した設定を登録してプログラムを実行する。この場合、命令制御部43からスケジューラー13に送られる命令は、図11のようになる。上記動作に関してのタイミングチャートは図13のようになる。時刻が「11」で多数決処理チェックを行うと、番号「3」のADD命令は論理動作不正を起こすが、番号「4」のADDと、番号「5」のADDのコピー命令2個は正常動作するため、多数決処理チェックを行うと、ADD命令としては正しく動作した上で、デバッグ時と比較して性能が向上する。   The setting shown in FIG. 9 is registered in the comparison instruction storage buffer 40 and the program is executed. In this case, the command sent from the command control unit 43 to the scheduler 13 is as shown in FIG. A timing chart concerning the above operation is as shown in FIG. When the majority processing check is performed at the time “11”, the ADD instruction with the number “3” causes an illegal logic operation, but the ADD instruction with the number “4” and the two ADD copy instructions with the number “5” operate normally. Therefore, when the majority processing check is performed, the ADD instruction operates correctly, and the performance is improved as compared with debugging.

以上説明したように、本発明の実施形態では、以下に記載するような効果を持つ。
(1)単独のマイクロプロセッサにおいて論理動作不正の発生する命令を特殊な解析なしで特定することが可能になり調査を容易化できる。
(2)多数決処理チェックの結果を観測することで正しく論理動作不正が回避できているか確認できる。
(3)ハードウェアのみで論理動作不正を回避できる。
(4)スケジューラーの発行条件を設定して論理動作不正の発生しない最小のタイミングに設定することで性能低下の影響を最小にでき、割込みとソフトウェアによる解析と比較して性能が向上する。
As described above, the embodiment of the present invention has the following effects.
(1) It is possible to specify an instruction in which a logical operation error occurs in a single microprocessor without special analysis, and the investigation can be facilitated.
(2) By observing the result of the majority processing check, it can be confirmed whether the logical operation fraud is correctly avoided.
(3) Incorrect logic operation can be avoided only by hardware.
(4) By setting the issue condition of the scheduler and setting it to the minimum timing that does not cause the logical operation fraud, the influence of the performance degradation can be minimized, and the performance is improved as compared with the analysis by the interrupt and software.

本発明は、上述した実施形態に限定されるものではなく、この発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。例えば、図1において命令キャッシュ10やデータキャッシュ(AA)21やデータキャッシュ(DA)23は構成せずに、直接メモリーに接続されていてもよい。また、上述の実施形態では、演算命令パイプとロード・ストア命令パイプの2パイプ構成にしているが、1パイプ構成や3パイプ構成以上でもよい。また、図2において命令トレーサー42は構成しなくてもよい。また、比較命令格納バッファと命令比較部を複数用意して同時に2つ以上の比較を行ってもよい。   The present invention is not limited to the above-described embodiments, and various modifications and applications can be made without departing from the gist of the present invention. For example, the instruction cache 10, the data cache (AA) 21, and the data cache (DA) 23 in FIG. 1 may be directly connected to the memory without being configured. In the above-described embodiment, a two-pipe configuration of an operation instruction pipe and a load / store instruction pipe is used. However, a one-pipe configuration or a three-pipe configuration or more may be used. Further, the instruction tracer 42 may not be configured in FIG. Alternatively, a plurality of comparison instruction storage buffers and instruction comparison units may be prepared and two or more comparisons may be performed simultaneously.

また、図6において発行間隔の設定は、コピー命令毎に細かく設定できるようにしてもよい。この場合は、さらなる性能の向上を期待できる。発行条件は、発行間隔という時間ではなく、例えば、演算器が動作していない時やデータキャッシュをアクセスしていない時やキャッシュフィルを要求している命令が存在しない時やマイクロプロセッサ内の命令が全て完了している時などの状態等、マイクロプロセッサの内部状態を検出して制御を行ってもよい。   In FIG. 6, the issue interval may be set finely for each copy command. In this case, further improvement in performance can be expected. The issue condition is not the issue interval time. For example, when the arithmetic unit is not operating, when the data cache is not accessed, when there is no instruction requesting a cache fill, or when there is an instruction in the microprocessor. Control may be performed by detecting the internal state of the microprocessor, such as the state when everything is complete.

また、比較命令格納バッファの設定登録、不正動作の発生するプログラムの実行、多数決処理チェックの結果の確認という一連の動作をスクリプトなどを使用して自動的に実行できる仕組みを用いれば、人手を介せずに不正の発生する命令を特定することができる。   In addition, if a mechanism that can automatically execute a series of operations such as setting and registering the comparison instruction storage buffer, executing a program in which an illegal operation occurs, and confirming the result of the majority processing check using a script or the like is used manually, It is possible to specify an illegal instruction without performing the above operation.

本発明は、上述した実施形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。   The present invention is not limited to the above-described embodiments, and various modifications and applications can be made without departing from the gist of the present invention.

10:命令キャッシュ
11:デコーダー
12:命令検出制御部
13:スケジューラー
20:演算器
21:データキャッシュ(AA)
22:データチェック制御部
23:データキャッシュ(DA)
24:リクエスト制御部
30:演算器
31:データチェック制御部
32:レジスタ
40:比較命令格納バッファ
41:命令比較部
42:命令トレーサー
43:命令制御部
50:コピー命令チェック部
51:データ・アドレスバッファ
52:多数決チェック部
60:コピー命令チェック部
61:データバッファ
62:多数決チェック部
10: Instruction cache 11: Decoder 12: Instruction detection control unit 13: Scheduler 20: Calculator 21: Data cache (AA)
22: Data check control unit 23: Data cache (DA)
24: request control unit 30: arithmetic unit 31: data check control unit 32: register 40: comparison instruction storage buffer 41: instruction comparison unit 42: instruction tracer 43: instruction control unit 50: copy instruction check unit 51: data address buffer 52: Majority check unit 60: Copy command check unit 61: Data buffer 62: Majority check unit

Claims (5)

検査対象として比較すべき命令列、当該命令以前の命令との依存関係、当該命令を複製するか否かを示すコピー指示、及び当該命令の発行間隔の設定値を含む情報を格納する比較命令格納手段と、
前記比較命令格納手段が格納する情報が示す命令と実行中の命令とが一致するか否かを判定する命令比較手段と、
前記命令比較手段によって、命令が一致し且つコピー指示が当該命令を複製することを示すと判定された場合、当該命令の複製であるコピー命令を複数生成する命令制御手段と、
前記設定値に設定された発行間隔に従って命令を発行するスケジュール設定手段と、
前記スケジュール設定手段が発行する前記コピーの元となった命令及び前記複数のコピー命令を実行し、この実行結果を多数決処理によりチェックする多数決処理チェック手段と
を備えることを特徴とするマイクロプロセッサ。
Comparison instruction storage for storing information including instruction sequence to be compared as an object to be inspected, dependency with an instruction before the instruction, a copy instruction indicating whether or not the instruction is duplicated, and a setting value of the issue interval of the instruction Means,
Instruction comparing means for determining whether or not the instruction indicated by the information stored in the comparison instruction storage means matches the instruction being executed;
An instruction control means for generating a plurality of copy instructions that are duplicates of the instruction when the instruction comparison means determines that the instructions match and the copy instruction indicates that the instruction is to be duplicated;
Schedule setting means for issuing an instruction according to an issue interval set in the set value;
A microprocessor comprising: a majority voting process checking unit that executes the copy source instruction issued by the schedule setting unit and the plurality of copy instructions and checks the execution result by a majority voting process.
前記コピー命令として、偶数個の命令を生成することを特徴とする請求項1に記載のマイクロプロセッサ。   The microprocessor according to claim 1, wherein an even number of instructions are generated as the copy instructions. 前記多数決処理チェック手段は、前記コピーの元となった命令と、前記偶数個のコピー命令とから、多数決処理により1命令を選ぶことを特徴とする請求項2に記載のマイクロプロセッサ。   3. The microprocessor according to claim 2, wherein the majority processing check means selects one instruction by majority processing from the instruction that is the source of the copy and the even number of copy instructions. 検査対象として比較すべき命令列、当該命令以前の命令との依存関係、当該命令を複製するか否かを示すコピー指示、及び当該命令の発行間隔の設定値を含む情報を登録する工程と、
前記登録した命令と実行中の命令とが一致するか否かを判定する工程と、
命令が一致し且つコピー指示が当該命令を複製することを示すと判定された場合、当該命令の複製であるコピー命令を複数生成する工程と、
前記設定値に設定された発行間隔に従って命令を発行する工程と、
前記コピーの元となった命令及び前記複数のコピー命令を実行し、この実行結果を多数決処理によりチェックする工程とを含む
ことを特徴とするマイクロプロセッサのデバッグ方法。
Registering information including an instruction sequence to be compared as an inspection target, a dependency relationship with an instruction before the instruction, a copy instruction indicating whether or not to copy the instruction, and a setting value of an issue interval of the instruction;
Determining whether the registered instruction and the instruction being executed match;
Generating a plurality of copy instructions that are duplicates of the instructions if the instructions match and it is determined that the copy instruction indicates to duplicate the instructions;
Issuing a command according to an issue interval set to the set value;
A method of debugging a microprocessor, comprising: executing an instruction that is a source of the copy and the plurality of copy instructions, and checking a result of the execution by a majority process.
前記コピー命令は、前方に存在する命令が完了するまで実行しない発行間隔に設定し、
命令列中の最後の命令から1命令ずつコピー指示を前の命令に移動させながらプログラムを実行し、多数決処理チェックの結果を確認することで、論理動作不正の発生する命令を特定する
ことを特徴とする請求項4に記載のマイクロプロセッサのデバッグ方法。
The copy instruction is set to an issuance interval that is not executed until an instruction existing ahead is completed,
The program is executed while the copy instruction is moved to the previous instruction one by one from the last instruction in the instruction sequence, and the result of the majority processing check is identified to identify the instruction in which the logical operation error occurs. The microprocessor debugging method according to claim 4.
JP2009193537A 2009-08-24 2009-08-24 Microprocessor and microprocessor debugging method Expired - Fee Related JP5387231B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009193537A JP5387231B2 (en) 2009-08-24 2009-08-24 Microprocessor and microprocessor debugging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009193537A JP5387231B2 (en) 2009-08-24 2009-08-24 Microprocessor and microprocessor debugging method

Publications (2)

Publication Number Publication Date
JP2011044114A true JP2011044114A (en) 2011-03-03
JP5387231B2 JP5387231B2 (en) 2014-01-15

Family

ID=43831483

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009193537A Expired - Fee Related JP5387231B2 (en) 2009-08-24 2009-08-24 Microprocessor and microprocessor debugging method

Country Status (1)

Country Link
JP (1) JP5387231B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007188379A (en) * 2006-01-16 2007-07-26 Renesas Technology Corp Error correction method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007188379A (en) * 2006-01-16 2007-07-26 Renesas Technology Corp Error correction method

Also Published As

Publication number Publication date
JP5387231B2 (en) 2014-01-15

Similar Documents

Publication Publication Date Title
US10289469B2 (en) Reliability enhancement utilizing speculative execution systems and methods
US6754856B2 (en) Memory access debug facility
US7263600B2 (en) System and method for validating a memory file that links speculative results of load operations to register values
US7313673B2 (en) Fine grained multi-thread dispatch block mechanism
US6266768B1 (en) System and method for permitting out-of-order execution of load instructions
TW201331836A (en) Speculative execution and rollback
US9280349B2 (en) Decode time instruction optimization for load reserve and store conditional sequences
US8533394B2 (en) Controlling simulation of a microprocessor instruction fetch unit through manipulation of instruction addresses
US20120029900A1 (en) Simulation method and system for simulating a multi-core hardware platform
US6301654B1 (en) System and method for permitting out-of-order execution of load and store instructions
US7376820B2 (en) Information processing unit, and exception processing method for specific application-purpose operation instruction
US20220413870A1 (en) Technology For Optimizing Memory-To-Register Operations
JP4243271B2 (en) Data processing apparatus and data processing method
US7305586B2 (en) Accessing and manipulating microprocessor state
US10346165B2 (en) Resource locking for load store scheduling in a VLIW processor
JP5387231B2 (en) Microprocessor and microprocessor debugging method
US9710389B2 (en) Method and apparatus for memory aliasing detection in an out-of-order instruction execution platform
JP7403541B2 (en) Speculative instruction wake-up to tolerate memory ordering violation check buffer drain delay
EP1220088A2 (en) Circuit and method for supporting misaligned accesses in the presence of speculative load instructions
JPH1049373A (en) Method and device for operating multiplex and highly accurate event for pipeline digital processor
US20140365751A1 (en) Operand generation in at least one processing pipeline
US11907724B2 (en) In-memory trace with overlapping processing and logout
WO2009096161A1 (en) Processor performance analysis device, method, and simulator
Utamaphethai et al. Relating buffer-oriented microarchitecture validation to high-level pipeline functionality
CN116450430A (en) Verification method, verification system and storage medium for processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120711

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130828

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130910

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130923

R150 Certificate of patent or registration of utility model

Ref document number: 5387231

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees