JPH04352244A - Control circuit for electronic device - Google Patents

Control circuit for electronic device

Info

Publication number
JPH04352244A
JPH04352244A JP3127252A JP12725291A JPH04352244A JP H04352244 A JPH04352244 A JP H04352244A JP 3127252 A JP3127252 A JP 3127252A JP 12725291 A JP12725291 A JP 12725291A JP H04352244 A JPH04352244 A JP H04352244A
Authority
JP
Japan
Prior art keywords
trap
address
output
memory
flag
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.)
Withdrawn
Application number
JP3127252A
Other languages
Japanese (ja)
Inventor
Hironaga Yamashita
浩永 山下
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.)
Advantest Corp
Original Assignee
Advantest 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 Advantest Corp filed Critical Advantest Corp
Priority to JP3127252A priority Critical patent/JPH04352244A/en
Publication of JPH04352244A publication Critical patent/JPH04352244A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To improve the efficiency of debugging operation by generating a trap flag at the time of program debugging similarly to an interrupt flag after all steps of an instruction processing program in a microprogram memory end. CONSTITUTION:An address arithmetic output is inputted to flag generation 6a and it is checked whether or not the output is a use inhibition address; when so, a trap signal is generated and inputted to an F/F 6b. A clock generated in each step of the memory 7 is inputted to the 0 terminal of a multiplexer 6c and an input terminal of an AND circuit 6d. Gate control data which is written in the 1st field of the memory 7 is inputted to the other input terminal and the output of a circuit 6d is inputted to the 1st terminal of an MUX. Data written in the 2nd field of the memory 7 is inputted to the select terminal of the MUX. The output of the MUX is supplied to the F/F 6b, whose output is used as a flag.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】この発明は半導体試験装置などの
電子装置の制御回路に関し、特にトラップフラグセット
方法の改良に係わる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control circuit for an electronic device such as a semiconductor testing device, and more particularly to an improvement in a trap flag setting method.

【0002】0002

【従来の技術】〔1〕まずメインメモリ1上にセットさ
れたシステムプログラムの実行の流れを図3乃至図5に
従って説明する。 (1)  メモリアドレス演算部5がアドレス値として
100を出力している所から説明を始める。
2. Description of the Related Art [1] First, the flow of execution of a system program set on the main memory 1 will be explained with reference to FIGS. 3 to 5. (1) The explanation starts from the point where the memory address calculation unit 5 outputs 100 as the address value.

【0003】(2)  メインメモリアドレス100の
内容“SUB”がメインメモリ1のリードデータとして
出力されこれがインストラクションレジスタ2に取込ま
れる。 (3)  (2)で取込まれたインストラクションレジ
スタ2の出力はインストラクションデコーダ3に入力さ
れる。このインストラクションデコーダ3の出力として
マイクロプログラムメモリ7のアドレスが出力される。
(2) The content "SUB" of main memory address 100 is output as read data of main memory 1 and taken into instruction register 2. (3) The output of the instruction register 2 fetched in (2) is input to the instruction decoder 3. The address of the microprogram memory 7 is output as the output of the instruction decoder 3.

【0004】(4)  インストラクションデゴータ3
の出力はマクチプレクサ4の0側の入力端子に接続され
ており、通常このマルチプレクサ4は0側が選択される
。 従ってマルチプレクサ4はこの例では“SUB”を実現
しているマクロプログラムメモリのアドレス0を出力す
る。 (5)  マイクロプログラムメモリの0番地には、“
SUB”のインストラクションを実現するために各ハー
ドウェアをコントロールするコントロールコードが記述
されている。このコントロールコードの一部がメモリア
ドレス演算部5へ渡される。
(4) Instruction degouter 3
The output of is connected to the 0 side input terminal of the multiplexer 4, and the 0 side of this multiplexer 4 is normally selected. Therefore, multiplexer 4 outputs address 0 of the macro program memory, which in this example implements "SUB". (5) At address 0 of the microprogram memory, “
A control code for controlling each piece of hardware is written in order to implement the "SUB" instruction. A part of this control code is passed to the memory address calculation unit 5.

【0005】(6)  メモリアドレス演算部5は(5
)で渡されたコントロールコードにより現在指している
メインメモリアドレス値100に、(2)で取込んだイ
ンストラクションレジスタ2の内容である“SUB”の
インストラクションの内“SUB”自身のインストラク
ションのサイズ情報2を加算して102という値を出力
する。
(6) The memory address calculation unit 5 performs (5
) The size information 2 of the instruction of "SUB" itself among the instructions of "SUB" which is the contents of the instruction register 2 fetched in (2) is added to the main memory address value 100 currently pointed to by the control code passed in (2). , and outputs the value 102.

【0006】(7)  (6)の結果メモリアドレス演
算部5の出力は102になり、メインメモリ1のリード
データとしては102番値の内容である。“ADD”の
インストラクションとなる。 (8)  以降(2)〜(7)が繰り返されて、メイン
メモリ1上のインストラクションを実行していく。 〔2〕次にトラップフラグ発生部6からトラップフラグ
が上がった時の動作の流れについて説明する。
(7) As a result of (6), the output of the memory address calculation unit 5 is 102, and the read data of the main memory 1 is the content of the 102nd value. This is an “ADD” instruction. (8) From then on, (2) to (7) are repeated to execute the instructions on the main memory 1. [2] Next, the flow of operations when the trap flag is raised from the trap flag generating section 6 will be explained.

【0007】(1)  通常はマルチプレクサ4の出力
は0側が選択されるため、インストラクションをデコー
ドして得たマイクロプログラムメモリ7のアドレスであ
るが、トラップフラグ発生部6からトラップフラグが上
がると、このフラグによりマルチプレクサ4は1側が選
択されマルチプレクサ4の出力は200になる。
(1) Normally, the 0 side is selected as the output of the multiplexer 4, so it is the address of the microprogram memory 7 obtained by decoding the instruction, but when the trap flag is raised from the trap flag generator 6, this The flag selects the 1 side of the multiplexer 4, and the output of the multiplexer 4 becomes 200.

【0008】(2)  従ってマイクロプログラムメモ
リ7のアドレスは200となり、マイクロプログラムメ
モリ7の200番地から記述されているトラップ処理に
関するプログラムが実行される。以降このプログラムに
よる実行の流れを説明する。 (2−1)  マイクロプログラムメモリ7からメモリ
アドレス演算部5へ渡されているコントロールコードと
してメモリアドレス演算部5の出力として0を出力させ
るコードが渡されメモリアドレス演算部5の出力は0と
なる。
(2) Therefore, the address of the microprogram memory 7 is 200, and the program related to the trap processing written in the microprogram memory 7 is executed from address 200. The flow of execution by this program will be explained below. (2-1) As a control code passed from the microprogram memory 7 to the memory address calculation unit 5, a code that causes the memory address calculation unit 5 to output 0 is passed, and the output of the memory address calculation unit 5 becomes 0. .

【0009】(2−2)  メインメモリ1の0番地に
はプログラムAの光頭アドレスを示す値60が記述され
ており、この60という値がメモリのリードデータとし
てメモリリードデータレジスタ10に取込まれる。 (2−3)  (2−2)で取り込まれた60という値
はメモリアドレス演算部5に渡され、メモリアドレス演
算部5の出力は60となる。
(2-2) A value 60 indicating the optical head address of program A is written at address 0 of the main memory 1, and this value 60 is taken into the memory read data register 10 as memory read data. . (2-3) The value 60 fetched in (2-2) is passed to the memory address calculation unit 5, and the output of the memory address calculation unit 5 becomes 60.

【0010】(2−4)  メインメモリアドレスの値
が60となり、メインメモリ1の60番地から記述され
ているプログラムA、つまりトラップ処理プログラムが
実行されていくことになる。メインメモリ1上に記述さ
れているプログラムの実行は〔1〕で説明した流れで行
われる。
(2-4) The value of the main memory address becomes 60, and the program A written in the main memory 1, ie, the trap processing program, is executed from address 60 of the main memory 1. The program written on the main memory 1 is executed according to the flow described in [1].

【0011】(3)  メインメモリ1上のプログラム
Aが実行されるということは、例えばプログラムAで記
述してあるインストラクション“abc”が〔1〕の流
れに沿って実行される。従ってインストラクション“a
bc”を実現しているマイクロプログラムメモリ1上の
インストラクション“abc”の処理プログラムが実行
される。これによってマイクロプログラムメモリ7から
CRTi/F8へコントロールコードが渡され、CRT
i/F(CRTインターフェース)8はCRT9へ文字
を出力させる。システムの利用者はCRTに出力された
文字(メッセージ)を見てトラップが発生した事を知る
ことができる。 〔3〕今までトラップを例に上げて説明してきたがここ
でトラップとインタラプトの違いについて説明する。
(3) When program A on main memory 1 is executed, for example, the instruction "abc" written in program A is executed along the flow of [1]. Therefore, the instruction “a”
The processing program for the instruction "abc" on the microprogram memory 1 that implements "bc" is executed.As a result, the control code is passed from the microprogram memory 7 to the CRTi/F8, and the CRT
The i/F (CRT interface) 8 outputs characters to the CRT 9. The system user can see the characters (message) output on the CRT and know that a trap has occurred. [3] Up until now, we have explained using traps as an example, but now we will explain the difference between traps and interrupts.

【0012】通常トラップは即応できることを目的とし
ていつでも受け付けられる様にしている。即ち、マイク
ロプログラムメモリ7上のマイクロプログラムの各ステ
ップ単位で受け付けられる。この場合の問題点としては
1つのインストラクションの動きを記述している複数ス
テップのマイクロプログラムの途中でトラップにより別
の処理プログラムを実行するわけだから、この別処理プ
ログラムの実行終了後、またさきほどのマイクロプログ
ラムを再開しようとしても、途中までの情報が残ってい
ないので再開できない。
[0012] Normally, traps are made to be accepted at any time for the purpose of prompt response. That is, each step of the microprogram on the microprogram memory 7 is accepted. The problem in this case is that another processing program is executed by a trap in the middle of a multi-step microprogram that describes the movement of one instruction, so after the execution of this other processing program is finished, the previous microprogram is executed again. Even if you try to restart the program, it cannot be restarted because no information remains.

【0013】これに対し、インタラプトは中断されたプ
ログラムを再開することを考えて、各インストラクショ
ンの切れ目、即ち各インストラクションの動きを記述し
ている複数ステップのマイクロプログラムの最後でのみ
受け付ける様にしている。例えばインストラクションA
を記述しているマイクロプログラムが■〜■の5ステッ
プで記述されているとしたら、トラップは■〜■の全ス
テップで、インタラプトはステップ■の所のみでマルチ
プレクサ4は受け付ける。“受け付ける”というのはマ
ルチプレクサ4からトラップ/インタラプト/一般のイ
ンストラクションに対応したマイクロプログラムメモリ
7のアドレスが出力されることを意味する。
On the other hand, in consideration of restarting an interrupted program, interrupts are accepted only at the end of each instruction, that is, at the end of a multi-step microprogram that describes the movement of each instruction. . For example, instruction A
If a microprogram is written in five steps (■ to ■), the multiplexer 4 accepts traps in all steps (■ to ■) and interrupts only in step (■). "Accept" means that the multiplexer 4 outputs the address of the microprogram memory 7 corresponding to the trap/interrupt/general instruction.

【0014】インタラプトフラグが上がった時も受け付
けのタイミングを除いて動作の流れは同じで、インタラ
プトフラグによりマルチプレクサ4は2側が選択され、
以降トラップの時と同様の動きを経てメインメモリ1上
のインタラプト処理プログラムが実行される。通常時/
トラップフラグ発生時/インタラプトフラグ発生時のタ
イミングについて図6を参照して簡単に説明する。
When the interrupt flag goes up, the flow of operation is the same except for the timing of acceptance, and the interrupt flag selects the 2 side of the multiplexer 4.
Thereafter, the interrupt processing program in the main memory 1 is executed through the same operations as in the trap. Normal time/
The timing when a trap flag is generated/an interrupt flag is generated will be briefly explained with reference to FIG.

【0015】通常は図6Aの様に“SUB”の全3ステ
ップ終了後次の“ADD”の■ステップが始まる。トラ
ップフラグが上がった時は、“SUB”の途中、図6B
の例では■ステップの後すぐにトラップ処理の■ステッ
プが始まる。インタラプトの場合トラップフラグと同じ
時にインタラプトフラグが上がってもインタラプト処理
の■ステップは図6Cに示すように“SUB”の全ステ
ップ■〜■が終了後に始まる。
Normally, as shown in FIG. 6A, after all three steps of "SUB" are completed, the next step (2) of "ADD" begins. When the trap flag goes up, in the middle of "SUB", Figure 6B
In the example, the ■ step of trap processing starts immediately after the ■ step. In the case of an interrupt, even if the interrupt flag goes up at the same time as the trap flag, step (2) of the interrupt processing starts after all steps (2) to (2) of "SUB" are completed, as shown in FIG. 6C.

【0016】従来のトラップフラグ発生部6は図7に示
すように、メインメモリ1のリードデータをトラップフ
ラグ発生回路6aに入力し、その出力、つまりトラップ
信号をフリップフロップ回路(以下F/Fと言う)6b
のデータ入力端子に供給する。トラップフラグ発生回路
6aは例えばパリティチェック回路であり、パリティエ
ラーを検出すると直ちにトラップ信号を発生する。F/
F6bはトラップ信号cが入力されるとクロック端子C
Kのクロックb(図Bのb;図7Baのマイクロプログ
ラムの各ステップ毎に発生する)に同期してQ出力の極
性がL(低レベル)よりH(高レベル)に反転して、ト
ラップフラグd(図7Bd)が発生され、セレクト信号
発生器10へ供給される。
As shown in FIG. 7, the conventional trap flag generating section 6 inputs read data from the main memory 1 to a trap flag generating circuit 6a, and outputs the output, that is, a trap signal, to a flip-flop circuit (hereinafter referred to as F/F). say) 6b
Supplied to the data input terminal of The trap flag generating circuit 6a is, for example, a parity check circuit, and immediately generates a trap signal upon detecting a parity error. F/
F6b is the clock terminal C when the trap signal c is input.
The polarity of the Q output is inverted from L (low level) to H (high level) in synchronization with clock b of K (b in Figure B; generated at each step of the microprogram in Figure 7Ba), and the trap flag is activated. d (FIG. 7Bd) is generated and supplied to the select signal generator 10.

【0017】[0017]

【発明が解決しようとする課題】メインメモリ1に書込
まれたシステムプログラムのデバック時にトラップフラ
グが上ると、既に述べたようにメインメモリ1に書込ま
れたインストラクションの処理を記述している複数ステ
ップのマイクロプログラムの途中でトラップ処理プログ
ラムが実行される。しかしトラップ処理プログラムの実
行終了後、中断されたさきほどのマイクロプログラムを
再開しようとしても、途中までの情報が残っていないの
で再開できない。トラップの発生原因を調べプログラム
又はハードウェアを修正した後、インストラクションの
始めからやり直さねばならない。プログラムのデバック
時にはトラッププラグの上る頻度が通常の場合(システ
ム稼働時)と比較して極めて多く、またトラップ処理プ
ログラムを緊急に実行する必要性は少いので、このよう
な中断ははなはだ不便である。この発明の目的は、デバ
ック時にはトラップフラグをインタラプトと同様に、イ
ンストラクションの処理を記述しているマイクロプログ
ラムの全ステップ終了後に上げるようにトラップフラグ
発生部6等を改良して、トラップ処理プログラム実行後
のメインプログラムの再開を容易にし、プログラムデバ
ック作業効率を向上させようとするものである。
[Problem to be Solved by the Invention] When a trap flag is raised during debugging of a system program written to the main memory 1, multiple instructions that describe the processing of the instructions written to the main memory 1 are detected as described above. A trap processing program is executed in the middle of a step microprogram. However, after the trap processing program has finished executing, even if an attempt is made to restart the previously interrupted microprogram, it cannot be restarted because no information remains. After determining the cause of the trap and correcting the program or hardware, the instructions must be restarted from the beginning. When debugging a program, trap plugs are raised much more frequently than during normal operation (when the system is running), and there is little need to urgently run a trap processing program, so such interruptions are extremely inconvenient. . An object of the present invention is to improve the trap flag generating unit 6, etc. so that during debugging, the trap flag is raised after all steps of the microprogram that describes the processing of instructions are raised, just like interrupts, and after the trap processing program is executed. The aim is to facilitate the restart of the main program and improve the efficiency of program debugging.

【0018】[0018]

【課題を解決するための手段】(1)メインメモリと、
そのメインメモリに書込まれたシステムプログラム、ト
ラップ処理プログラム及びインタラプト処理プログラム
の各インストラクションの処理プログラムが格納されて
いるマイクロプログラムメモリと、前記メインメモリに
書込まれているシステムプログラムの複数のインストラ
クションのリードデータを順次格納するインストラクシ
ョンレジスタと、そのインストラクションレジスタの出
力をデコードし、前記システムプログラムの各インスト
ラクションの処理プログラムのマイクロプログラムメモ
リ上のアドレスを出力するインストラクションデコーダ
と、そのインストラクションデコーダより入力されるア
ドレスと別途入力される前記トラップ処理プログラム及
びインタラプト処理プログラムの各インストラクション
のマイクロプログラムメモリ上のアドレスとのいずれか
を選択して、前記マイクロプログラムメモリに供給する
マルチプレクサと、前記メインメモリのアドレスを演算
してメインメモリに供給するメモリアドレス演算部と、
トラップフラグ発生部と、インタラプトフラグ発生部と
、前記トラップフラグを入力したとき、前記インタラプ
トフラグを入力したとき及びそれ以外のとき所定のタイ
ミングでそれぞれに対応するセレクト信号を発生して前
記マルチプレクサに供給するセレクト信号発生器とを具
備する電子装置の制御回路において、この発明では、前
記トラップフラグ発生部に、前記メモリアドレス演算部
の出力を入力して使用禁止アドレスであるか否かをチェ
ックし、使用禁止アドレスであるときトラップ信号を発
生するトラップ信号発生回路と、前記マイクロプログラ
ムメモリの各行のアドレス毎(各ステップ毎)に発生す
るクロックと、インストラクション処理プログラムの最
終ステップ以外の各ステップ及び最終ステップの共通の
第1フィールドにそれぞれ書込まれた論理0及び論理1
を読出したデータとの論理和を得るアンドゲートとが設
けられる。
[Means for solving the problem] (1) Main memory,
A microprogram memory that stores processing programs for each instruction of the system program, trap processing program, and interrupt processing program written in the main memory, and a microprogram memory that stores processing programs for each instruction of the system program, trap processing program, and interrupt processing program written in the main memory; An instruction register that sequentially stores read data, an instruction decoder that decodes the output of the instruction register and outputs an address on the microprogram memory of a processing program for each instruction of the system program, and an address input from the instruction decoder. and the addresses on the microprogram memory of each instruction of the trap processing program and the interrupt processing program that are input separately, and calculate the multiplexer to supply the microprogram memory and the address of the main memory. a memory address calculation unit that supplies the main memory with the
a trap flag generating section; an interrupt flag generating section; generating corresponding select signals at predetermined timings when the trap flag is input, when the interrupt flag is input, and at other times, and supplying them to the multiplexer; In the control circuit for an electronic device, the control circuit includes a select signal generator that inputs the output of the memory address calculation unit to the trap flag generation unit to check whether the address is a prohibited address; a trap signal generation circuit that generates a trap signal when the address is a prohibited address; a clock that generates for each address of each row (each step) of the microprogram memory; and each step other than the final step of the instruction processing program and the final step. a logical 0 and a logical 1 respectively written to the common first field of
An AND gate is provided to obtain a logical sum with the read data.

【0019】また、前記マイクロプログラムメモリの所
定のインストラクション処理プログラムの各ステップの
共通の第2フィールドに書込まれたモードデータ(デバ
ックモードのとき論理1,通常モードのとき論理0)の
読出しデータがセレクト端子に与えられて、デバックモ
ードのとき前記アンドゲートの出力、通常モードのとき
前記クロックを選択するマルチプレクサと、前記トラッ
プ信号発生回路の出力がデータ端子に入力されると、ク
ロック端子に入力される前記マルチプレクサの出力に同
期して出力の極性を反転させることによりトラップフラ
グを発生し、そのトラップフラグを前記セレクト信号発
生器に供給するフリップフロップ回路とが設けられる。
Further, read data of mode data (logic 1 in debug mode, logic 0 in normal mode) written in a common second field of each step of a predetermined instruction processing program in the microprogram memory is read. When the output of the AND gate is applied to the select terminal, the output of the multiplexer that selects the clock in the normal mode, and the output of the trap signal generation circuit are input to the data terminal, the output of the AND gate is input to the clock terminal. A flip-flop circuit is provided that generates a trap flag by inverting the polarity of the output in synchronization with the output of the multiplexer, and supplies the trap flag to the select signal generator.

【0020】(2)前記(1)項のトラップフラグ発生
部の成りに、フリップフロップ回路より成るトラップフ
ラグ発生部を有し、前記マイクロプログラムメモリの各
アドレスと対応する各行の共通なフィールドに書込んだ
トラップ信号(使用済アドレスの行に論理0,未使用ア
ドレスの行に論理1を書込む)の読出しデータを前記フ
リップフロップ回路のデータ入力端子に供給し、前記マ
イクロプログラムメモリの各行のアドレス毎に(各ステ
ップ毎)に発生するクロック信号を前記フリップフロッ
プ回路のクロック端子に入力し、そのフリップフロップ
回路の出力をトラップフラグとして前記セレクト信号発
生器に供給するようにしてもよい。
(2) A trap flag generating section consisting of a flip-flop circuit is provided as a part of the trap flag generating section in item (1) above, and a trap flag generating section is provided which writes to a common field of each row corresponding to each address of the microprogram memory. The read data of the input trap signal (writes a logic 0 to the row of used addresses and a logic 1 to the row of unused addresses) is supplied to the data input terminal of the flip-flop circuit, and the read data of the trap signal (writes a logic 0 to the row of used addresses and a logic 1 to the row of unused addresses) is supplied to the data input terminal of the flip-flop circuit, and the address of each row of the microprogram memory is A clock signal generated at each step (each step) may be input to the clock terminal of the flip-flop circuit, and the output of the flip-flop circuit may be supplied to the select signal generator as a trap flag.

【0021】[0021]

【実施例】図1に示す様にトラップ信号cをセットする
クロックeとしてマイクロプログラムメモリ7から出力
されるコントロールコードによってコントロールできる
クロックを用意してやることでトラップをインタラプト
の様にして使うことが可能となる。 (a)通常モード トラップ信号発生回路6aが一例としてメインメモリア
ドレスの監視回路である場合を説明する。メインメモリ
アドレス監視回路は図3のメモリアドレス演算部5から
メインメモリ1へ渡されるアドレスデータを監視し、予
め与えておいた比較用のアドレスと比較し、その一致を
検出すると直ちにトラップ信号を上げるもので、通常メ
インメモリ1上でアクセスを許す範囲を設けプログラム
の暴走を防ぐものである。
[Embodiment] As shown in FIG. 1, by preparing a clock that can be controlled by the control code output from the microprogram memory 7 as the clock e for setting the trap signal c, it is possible to use the trap like an interrupt. Become. (a) The case where the normal mode trap signal generation circuit 6a is a main memory address monitoring circuit will be described as an example. The main memory address monitoring circuit monitors the address data passed from the memory address calculation unit 5 to the main memory 1 in FIG. 3, compares it with a comparison address given in advance, and immediately raises a trap signal when a match is detected. This is usually done by setting a range in the main memory 1 that is allowed to be accessed to prevent the program from running out of control.

【0022】次に動作の流れを説明する。予め与える比
較用のアドレスとして300をメインメモリアドレス監
視回路6aに与え、アクセス可能な範囲が299番地ま
でだったとすると、従来の技術で説明した様にメモリア
ドレス演算部5の出力は100からスタートしたとして
順番に進んでゆき、106番の“ST3,ラベル1”(
このインストラクションはレジスタ3の内容をメインメ
モリ1上のラベル1番地に書き込むという動作をする。 )を実行する時、プログラムのミスで書き込みの対象ア
ドレスであるラベル1番地が300番地だった場合、メ
モリアドレス演算部5の出力が300となり、メインメ
モリアドレス監視回路6aが、予め与えられた300と
比較し両者の一致によりアクセス禁止領域をアクセスし
ていることを検出してトラップ信号cを出力し、クロッ
クbのタイミングでF/F6bよりトラップフラグdを
出力すれば、“ST”のインストラクションの実行が途
中で中断しメインメモリ1の300番地へのデータの書
き込みは実行されずメインメモリ300番地の内容が破
壊されないですむ。そこで図1のマイクロプログラムメ
モリ7のフィールド2を通常モードとして全部0で記述
しておくと、フィールド2の出力が接続されているマル
チプレクサ6cのセレクト信号入力は0となり0側すな
わちマイクロプログラムの各ステップ毎に出るクロック
bが選ばれる。これにより“ST”インストラクション
の実行の途中でトラップフラグが上がり“ST”インス
トラクションの実行は中断される。 (b)デバックモード 次に、中断された残りのマイクロプログラムの処理を実
行させ実際にメインメモリ1の300番地にデータを書
き込ませ、どんな値を書こうとしていたかをデバック中
に確認したい時、デバックモードとしてマイクロプログ
ラムメモリ7のフィールド2の所に1を記述してマルチ
プレクサ6cのセレクトを1側とする。するとクロック
bはアンド回路6dでゲートされているため、このゲー
トをコントロールしているマイクロプログラムメモリ7
のフィールド1によってコントロールできる。即ち、ト
ラップフラグを上げてもいい所、この場合“ST”のイ
ンストラクションを記述しているマイクロプログラムの
終りのステップ■のフィールド1に1を記述してやるこ
とでステップ■中にしかトラップフラグは上がらなくな
る。従って“ST”のインストラクションは全ステップ
実行できる。 請求項2に対応する実施例 図2に示す様にマイクロプログラムメモリ7の出力をト
ラップフラグ発生部6の入力に接続してやることで、マ
イクロプログラムによってプログラマブルにトラップフ
ラグを上げることを可能とする。こうすることで例えば
、マイクロプログラムメモリ7からトラップ信号として
トラップフラグ発生部6のF/F6bに接続されている
フィールド1(1ビット)に、空領域の部分だけ1を記
述しておくと、プログラムが暴走して、正常な動作では
アクセスされることのないマイクロプログラムメモリ7
のアドレスがアクセスされた時トラップフラグdが上が
り暴走の最初の段階で異常を知ることができる。
Next, the flow of operation will be explained. Assuming that 300 is given to the main memory address monitoring circuit 6a as a pre-given comparison address and the accessible range is up to address 299, the output of the memory address calculation unit 5 starts from 100 as explained in the conventional technique. 106, "ST3, label 1" (
This instruction writes the contents of register 3 to label address 1 on main memory 1. ), if label 1, which is the write target address, is address 300 due to a program error, the output of the memory address calculation unit 5 becomes 300, and the main memory address monitoring circuit 6a outputs the pre-given 300. By comparing the two and detecting that the access prohibited area is being accessed based on a match, outputting the trap signal c, and outputting the trap flag d from the F/F 6b at the timing of the clock b, the instruction of "ST" Execution is interrupted midway, and writing of data to address 300 of main memory 1 is not executed, so that the contents of address 300 of main memory are not destroyed. Therefore, if field 2 of the microprogram memory 7 in FIG. 1 is described as a normal mode with all 0s, the select signal input of the multiplexer 6c to which the output of field 2 is connected becomes 0, that is, each step of the microprogram. The clock b that appears every time is selected. As a result, the trap flag is raised during the execution of the "ST" instruction, and the execution of the "ST" instruction is interrupted. (b) Debugging mode Next, when you want to execute the remaining microprogram processing that was interrupted and actually write data to address 300 of main memory 1, and check what value you were trying to write during debugging, As a debug mode, 1 is written in field 2 of the microprogram memory 7, and the selection of the multiplexer 6c is set to the 1 side. Then, since the clock b is gated by the AND circuit 6d, the microprogram memory 7 that controls this gate
It can be controlled by field 1 of In other words, by writing 1 in field 1 of step ■ at the end of the microprogram where the trap flag can be raised, in this case the "ST" instruction is written, the trap flag will only be raised during step ■. . Therefore, all steps of the "ST" instruction can be executed. Embodiment Corresponding to Claim 2 As shown in FIG. 2, by connecting the output of the microprogram memory 7 to the input of the trap flag generating section 6, it is possible to raise the trap flag programmably by the microprogram. By doing this, for example, if 1 is written in only the empty area in field 1 (1 bit) connected to the F/F 6b of the trap flag generation unit 6 as a trap signal from the microprogram memory 7, the program The microprogram memory 7 has gone out of control and is never accessed during normal operation.
When the address is accessed, the trap flag d is raised and an abnormality can be detected at the first stage of runaway.

【0023】次に動作の流れを説明する。メインメモリ
1上にプログラムとして、SUB,ST,ADDと順次
記述されていた場合従来の技術で説明した様にマイクロ
プログラム7のアドレスは図2の場合、“SUB”に関
して100,101,102、次に“ST”に関して1
08,109,110、次に“ADD”に関して103
,104番地とアクセスされる。この時はこれらのアド
レスのトラップ信号用のフィールドには0が記述されて
いるのでトラップは上がらない。これに対しマイクロプ
ログラムのミス又はハード不良によって、例えば100
,101,102/107番地がアクセスされたとする
とこの時は107番地のトラップ信号用のフィールドに
は、1が記述されているためトラップとなりトラップ処
理に移行し、期待していないマイクロプログラムメモリ
7のアドレスがアクセスされたのを知ることができる。
Next, the flow of operation will be explained. When the programs SUB, ST, and ADD are sequentially written in the main memory 1, the addresses of the microprogram 7 are 100, 101, 102, and the next for "SUB" in the case of FIG. 2, as explained in the conventional technology. Regarding “ST” 1
08, 109, 110, then 103 regarding “ADD”
, 104. At this time, since 0 is written in the trap signal field of these addresses, no trap is generated. On the other hand, due to a microprogram error or hardware failure, for example, 100
, 101, 102/107 are accessed. At this time, 1 is written in the trap signal field at address 107, so it becomes a trap and transitions to trap processing. You can see when an address has been accessed.

【0024】[0024]

【発明の効果】請求項1の発明によれば、通常モードで
は従来と同様のタイミングでトラップフラグを発生する
ことができると共に、デバックモード時には、マイクロ
プログラムメモリの所定のインストラクション処理プロ
グラムの全ステップの終了後においてのみトラップフラ
グを発生するように、つまりトラップフラグをインタラ
プトフラグと同様に機能させることができる。これによ
って前記インストラクション処理プログラムの途中のス
テップでプログラムの実行が中断されることがないので
、トラップ処理後のプログラムの再開が容易となり、プ
ログラムデバック作業効率を著しく向上できる。
According to the invention of claim 1, in the normal mode, a trap flag can be generated at the same timing as before, and in the debug mode, all steps of a predetermined instruction processing program in the microprogram memory can be generated. A trap flag can be generated only after completion, ie, a trap flag can function similarly to an interrupt flag. This prevents the execution of the instruction processing program from being interrupted at any intermediate step, making it easy to restart the program after trap processing, and greatly improving the efficiency of program debugging.

【0025】請求項2の発明によれば、プログラムのミ
ス又はハードウェアの不良によってマイクロプログラム
メモリの正常な動作ではアクセスされることのないアド
レスがアクセスされた場合に、直ちにトラップフラグを
発生させ、異常を早期に発見できる。この場合も各イン
ストラクション処理プログラムの途中で中断していない
ので、プログラムの再開が容易となる。
According to the second aspect of the invention, when an address that is not accessed during normal operation of the microprogram memory is accessed due to a program error or hardware failure, a trap flag is immediately generated; Abnormalities can be detected early. In this case as well, since each instruction processing program is not interrupted in the middle, it is easy to restart the program.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】請求項1に対応する実施例の要部を示すブロッ
ク図。
FIG. 1 is a block diagram showing main parts of an embodiment corresponding to claim 1.

【図2】請求項2に対応する実施例の要部を示すブロッ
ク図。
FIG. 2 is a block diagram showing main parts of an embodiment corresponding to claim 2.

【図3】電子装置の制御回路の要部を示すブロック図。FIG. 3 is a block diagram showing main parts of a control circuit of the electronic device.

【図4】図3のメインメモリ1に格納されたプログラム
の一例を示す図。
FIG. 4 is a diagram showing an example of a program stored in the main memory 1 of FIG. 3.

【図5】図3のマイクロプログラムメモリ7に格納され
たマイクロプログラムの一例を示す図。
FIG. 5 is a diagram showing an example of a microprogram stored in the microprogram memory 7 of FIG. 3;

【図6】図5のマイクロプログラムメモリ7のタイムチ
ャート。
FIG. 6 is a time chart of the microprogram memory 7 in FIG. 5;

【図7】Aは図3のトラップフラグ発生部6の従来の構
成を示すブロック図、BはAのタイムチャート。
7A is a block diagram showing a conventional configuration of the trap flag generating section 6 of FIG. 3, and B is a time chart of A. FIG.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】  メインメモリと、そのメインメモリに
書込まれたシステムプログラム、トラップ処理プログラ
ム及びインタラプト処理プログラムの各インストラクシ
ョンの処理プログラムが格納されているマイクロプログ
ラムメモリと、前記メインメモリに書込まれているシス
テムプログラムの複数のインストラクションのリードデ
ータを順次格納するインストラクションレジスタと、そ
のインストラクションレジスタの出力をデコードし、前
記システムプログラムの各インストラクションの処理プ
ログラムのマイクロプログラムメモリ上のアドレスを出
力するインストラクションデコーダと、そのインストラ
クションデコーダより入力されるアドレスと別途入力さ
れる前記トラップ処理プログラム及びインタラプト処理
プログラムの各インストラクションのマイクロプログラ
ムメモリ上のアドレスとのいずれかを選択して、前記マ
イクロプログラムメモリに供給するマルチプレクサと、
前記メインメモリのアドレスを演算してメインメモリに
供給するメモリアドレス演算部と、トラップフラグ発生
部と、インタラプトフラグ発生部と、トラップフラグを
入力したとき、インタラプトフラグを入力したとき及び
それ以外のとき所定のタイミングでそれぞれに対応する
セレクト信号を発生して前記マルチプレクサに供給する
セレクト信号発生器とを具備する電子装置の制御回路に
おいて、前記トラップフラグ発生部は、前記メモリアド
レス演算部の出力を入力して使用禁止アドレスであるか
否かをチェックし、使用禁止アドレスであるときトラッ
プ信号を発生するトラップ信号発生回路と、前記マイク
ロプログラムメモリの各行のアドレス毎(各ステップ毎
)に発生するクロックと、インストラクション処理プロ
グラムの最終ステップ以外の各ステップ及び最終ステッ
プの共通の第1フィールドにそれぞれ書込まれた論理0
及び論理1を読出したデータとの論理和を得るアンドゲ
ートと、前記マイクロプログラムメモリの所定のインス
トラクション処理プログラムの各ステップの共通の第2
フィールドに書込まれたモードデータ(デバックモード
のとき論理1,通常モードのとき論理0)の読出しデー
タがセレクト端子に与えられて、デバックモードのとき
前記アンドゲートの出力、通常モードのとき前記クロッ
クを選択するマルチプレクサと、前記トラップ信号発生
回路の出力がデータ端子に入力されると、クロック端子
に入力される前記マルチプレクサの出力に同期して出力
の極性を反転させることによりトラップフラグを発生し
、そのトラップフラグを前記セレクト信号発生器に供給
するフリップフロップ回路とを具備することを特徴とす
る、電子装置の制御回路。
1. A main memory, a microprogram memory in which processing programs for each instruction of a system program, a trap processing program, and an interrupt processing program written in the main memory are stored; an instruction register that sequentially stores read data of a plurality of instructions of a system program, and an instruction decoder that decodes the output of the instruction register and outputs an address on a microprogram memory of a processing program for each instruction of the system program. , a multiplexer that selects either the address input from the instruction decoder or the address on the microprogram memory of each instruction of the trap processing program and the interrupt processing program that is input separately, and supplies the selected address to the microprogram memory; ,
a memory address calculation unit that calculates the address of the main memory and supplies it to the main memory, a trap flag generation unit, an interrupt flag generation unit, when a trap flag is input, when an interrupt flag is input, and at other times. In a control circuit for an electronic device comprising a select signal generator that generates corresponding select signals at predetermined timings and supplies them to the multiplexer, the trap flag generating section inputs the output of the memory address calculating section. a trap signal generation circuit that checks whether the address is a prohibited address and generates a trap signal when the address is a prohibited address; and a clock that is generated for each address of each row (for each step) of the microprogram memory. , a logic 0 written in the common first field of each step other than the final step of the instruction processing program and the final step, respectively.
and a common second gate for each step of the predetermined instruction processing program of the microprogram memory.
The read data of the mode data (logic 1 in debug mode, logic 0 in normal mode) written in the field is given to the select terminal, and the output of the AND gate is output in debug mode, and the clock is output in normal mode. When the output of the trap signal generating circuit and the multiplexer for selecting is input to the data terminal, a trap flag is generated by inverting the polarity of the output in synchronization with the output of the multiplexer input to the clock terminal, A control circuit for an electronic device, comprising a flip-flop circuit that supplies the trap flag to the select signal generator.
【請求項2】  請求項1のトラップフラグ発生部の代
りに、フリップフロップ回路より成るトラップフラグ発
生部を有し、前記マイクロプログラムメモリの各アドレ
スと対応する各行の共通なフィールドに書込んだトラッ
プ信号(使用済アドレスの行に論理0,未使用アドレス
の行に論理1を書込む)の読出しデータを前記フリップ
フロップ回路のデータ入力端子に供給し、前記マイクロ
プログラムメモリの各行のアドレス毎に(各ステップ毎
)に発生するクロック信号を前記フリップフロップ回路
のクロック端子に入力し、そのフリップフロップ回路の
出力をトラップフラグとして前記セレクト信号発生器に
供給することを特徴とする、電子装置の制御回路。
2. A trap flag generating section comprising a flip-flop circuit in place of the trap flag generating section of claim 1, and a trap written in a common field of each row corresponding to each address of the microprogram memory. The read data of the signal (writes a logic 0 in the row of used addresses and a logic 1 in the row of unused addresses) is supplied to the data input terminal of the flip-flop circuit, A control circuit for an electronic device, characterized in that a clock signal generated at each step) is input to a clock terminal of the flip-flop circuit, and an output of the flip-flop circuit is supplied as a trap flag to the select signal generator. .
JP3127252A 1991-05-30 1991-05-30 Control circuit for electronic device Withdrawn JPH04352244A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3127252A JPH04352244A (en) 1991-05-30 1991-05-30 Control circuit for electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3127252A JPH04352244A (en) 1991-05-30 1991-05-30 Control circuit for electronic device

Publications (1)

Publication Number Publication Date
JPH04352244A true JPH04352244A (en) 1992-12-07

Family

ID=14955454

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3127252A Withdrawn JPH04352244A (en) 1991-05-30 1991-05-30 Control circuit for electronic device

Country Status (1)

Country Link
JP (1) JPH04352244A (en)

Similar Documents

Publication Publication Date Title
US6096089A (en) Power simulation system, power simulation method and computer-readable recording medium for recording power simulation program
US4949241A (en) Microcomputer system including a master processor and a slave processor synchronized by three control lines
US20080016415A1 (en) Evaluation system and method
US20020120801A1 (en) Technique for capturing information
JP2003015958A (en) Write-protect method
JPH04352244A (en) Control circuit for electronic device
US5210758A (en) Means and method for detecting and correcting microinstruction errors
JPH05120155A (en) Microprogram controller
JPS6295644A (en) Program debugging device for microprocessor
JPH09167117A (en) Microcomputer and real time system using the microcomputer
JPH06324861A (en) System and method for controlling cpu
JP3232301B2 (en) Data processing device
JP2569693B2 (en) Microcomputer
KR0150161B1 (en) Device for displaying register and ram data
JPH087679B2 (en) Microprocessor
JPH04181334A (en) Interruption generating circuit for debugging
JP2007213415A (en) Memory device
JPS5870353A (en) Control storage device
JPH0460846A (en) Fault tolerant computer
JPH02178862A (en) Information processor
JPH0320830A (en) System for evading fault of microprocessor
JPH06162225A (en) Single chip microcomputer incorporated with self-test function
JPS58201143A (en) Monitoring system for microprogram execution
JPS63197245A (en) Microprogram controller
JPS59160896A (en) Detection and correction system of memory error

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980806