JPS6152747A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPS6152747A
JPS6152747A JP59173133A JP17313384A JPS6152747A JP S6152747 A JPS6152747 A JP S6152747A JP 59173133 A JP59173133 A JP 59173133A JP 17313384 A JP17313384 A JP 17313384A JP S6152747 A JPS6152747 A JP S6152747A
Authority
JP
Japan
Prior art keywords
instruction
address
program
data
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP59173133A
Other languages
Japanese (ja)
Inventor
Masahiko Yamakoshi
山越 雅彦
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP59173133A priority Critical patent/JPS6152747A/en
Publication of JPS6152747A publication Critical patent/JPS6152747A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Abstract

PURPOSE:To select optionally switch operation of a program when instruction fetch is executed by providing a designation address memory circuit, a pseudo instruction generating circuit and a data switching circuit to a microprocessor. CONSTITUTION:When an address is designated to a memory of the designation address memory circuit 10 by a monitor program 5, ''1'', ''0'' is written depending whether the address is the designation address, the designation address is stored in the designation address memory circuit 10, allowing a CPU1 to execute a checked program. The CPU1 fetches the instruction in advance to output an address to an address bus for read of the instruction to be executed next during the execution of the instruction. When the address is the designated address of the memory circuit 10, a data ''1'' is outputted, an instruction to jump to the monitor program 5 unconditionally is generated by the pseudo instruction generation circuit 10, a switching circuit 12 outputs the data of pseudo instruction to a data bus 6 and the monitor program 5 is executed by the CPU1.

Description

【発明の詳細な説明】 〔発明の技術分野〕 この発明は、プログラム命令の先取りを行って動作する
マイクロプロセッサに関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a microprocessor that operates by prefetching program instructions.

〔従来の技術〕[Conventional technology]

従来この種の装置として第1図に示すものがあった。図
において、1は命令を実行するCPU(中央処理装置)
、2は前記CPUIが実行する命令のアドレスを出力す
るアドレスバス、3Fi命令を格納しているプログラム
メモリ、4は前記プログラムメモリ3の内容の一部分で
ある被チエツクプログラム、5t′i同じくモニタプロ
グラム、6け上記プログラムメモリ3の出力データをC
PU1に転送するデータバス、7は被チエツクプログラ
ム4の実行を停止し、モニタプログラム5の起動を指定
する指定ア・ドレス、8は前記指定アドレス7と上記ア
ドレスバス2との一致をとり、マスクできない割り込み
9を発生するアドレス一致検出回路である。
A conventional device of this type is shown in FIG. In the figure, 1 is a CPU (central processing unit) that executes instructions.
, 2 is an address bus that outputs the address of the instruction to be executed by the CPU, 3 is a program memory that stores Fi instructions, 4 is a checked program which is a part of the contents of the program memory 3, and 5t'i is also a monitor program. 6 The output data of the program memory 3 above is converted to C.
A data bus 7 transfers to the PU 1, a specified address 7 specifies the execution of the checked program 4 to be stopped and the start of the monitor program 5, 8 is a specified address 7 that matches the specified address 7 with the address bus 2, and is masked. This is an address match detection circuit that generates an interrupt 9 that cannot be performed.

次に第1図の動作について以下に説明する。通常マイク
ロプロセッサにおいては、デバッグの為のモニタプログ
ラムと称されるデバッグ用のプログラムを被チエツクプ
ログラムとけ別に実行するようにしている。
Next, the operation shown in FIG. 1 will be explained below. Usually, in a microprocessor, a debugging program called a debugging monitor program is executed separately from the checked program.

ここでモニタプログラムとは、被チエツクプログラムの
実行、停止、被チエツクプログラムの初期設定及び、実
行結果の表示等を行うもので、被チエツクプログラムの
実行時、特定のアドレスで実行を停止し、モニタプログ
ラムを起動させるには、指定アドレスの命令を読み出し
た時、CPU九対して、マスクできない割9込み信号を
発生し、その信号によ17CPUの制御をモニタプログ
ラムに移すようにしている。すなわちCPU1は、まず
実行する命令のアドレスをアドレスバス2に出力し、プ
ログラムメモリ3けそのアドレスの内容である被チエツ
クプログラム4の命令をデータバス6に出力する。次に
CPU1は前記データバス6の命令を読み込み実行する
。その時、アドレスバス2の内容と指定アドレス7との
一致をアドレス一致検出回路8でチェックし互いのアド
レスが一致していると、マスクできない割り込み9を発
生19、CPU1へ出力する。かくしてCPU1i7を
割り込みを受は付けその時、読み込んだ命令を実行し友
後、モニタプログラム5に制御を移す。このようにして
、被チエツクプログラム4は、指定されたアドレスで実
行を停止する。
Here, the monitor program executes and stops the checked program, initializes the checked program, displays the execution results, etc. When the checked program is executed, it stops execution at a specific address and monitors the checked program. To start the program, when an instruction at a designated address is read, a non-maskable interrupt signal is generated for CPU 9, and control of CPU 17 is transferred to the monitor program by this signal. That is, the CPU 1 first outputs the address of the instruction to be executed to the address bus 2, and outputs the instruction of the checked program 4, which is the contents of the address of the program memory 3, to the data bus 6. Next, the CPU 1 reads and executes the instructions on the data bus 6. At this time, an address match detection circuit 8 checks whether the contents of the address bus 2 match the specified address 7, and if the addresses match, a non-maskable interrupt 9 is generated 19 and output to the CPU 1. In this way, the CPU 1i7 accepts the interrupt, executes the read instruction, and then transfers control to the monitor program 5. In this way, the checked program 4 stops execution at the specified address.

次に、命令の先取りを行っているマイクロプロセッサの
CPUIば、アドレスの指定、命令の読み取りと命令の
実行とを並行して行っており、命令の読み取りを、命令
実行の数命令前に行っている。従って、前もって読み取
り消の命令が、分岐命令である場合にはその分岐命令を
実行し、既に読み取っである命令は実行を停止する。
Next, the CPU of a microprocessor that prefetches instructions specifies an address, reads an instruction, and executes the instruction in parallel, and reads the instruction several instructions before executing the instruction. There is. Therefore, if the previous read/cancel instruction is a branch instruction, the branch instruction is executed, and execution of the instruction that is already a read is stopped.

すなわち、前記の分岐命令以後の命令は、その分岐命令
が実行する前に読み取られるが、実際には、実行されな
いので、その分岐命令の実行後に、実行されるか否かは
、命令の読み取り段階では確定しないことKなる。  
             Iこのように命令の読み取
り段階でプログラムの実行が確定しないアドレスの場合
には被チエツクプログラム4の実行を停止する。そして
モニタプログラム5を起動するには、CPU1の制御が
モニタプログラム5に移った後、被チエツクプログラム
4が停止した時のアドレスから、頴次指定アドレス7の
命令を実行する。また、分岐命令が実行されるまでモニ
タプログラム5により被チエツクプログラム4を実行し
指定アドレス7の命令が実行されると指定アドレス7で
停止したと見なす。
In other words, the instructions after the branch instruction are read before the branch instruction is executed, but are not actually executed, so whether or not they are executed after the branch instruction is executed depends on the reading stage of the instruction. Then, it is not confirmed.
In this way, in the case of an address for which execution of the program is not determined at the stage of reading an instruction, execution of the checked program 4 is stopped. To start the monitor program 5, after the control of the CPU 1 is transferred to the monitor program 5, the command at the next specified address 7 is executed from the address at which the checked program 4 stopped. Furthermore, when the checked program 4 is executed by the monitor program 5 until the branch instruction is executed and the instruction at the specified address 7 is executed, it is assumed that the program has stopped at the specified address 7.

そして指定アドレス7の命令が実行されずにプログラム
が別のアドレスに分岐した場合には、モニタプログラム
5Fi被チエツクプログラム4を再実行させる。
If the instruction at the specified address 7 is not executed and the program branches to another address, the monitor program 5Fi causes the checked program 4 to be executed again.

従来のマイクロプロセッサは以上のように構成されてい
るので、命令の先取りを行うマイクロプロセッサでは、
被チエツクプログラムの実行を停止させる指定アドレス
が、分岐命令の後になる時、その分岐命令が実行される
ごとに、モニタプログラムに制御が移って、指定アドレ
スの命令が実行されるかどうかを調べることになる。ま
た複数の指定アドレスを必要とする場合には、必要とす
る指定アドレスの数だけ、検出回路を設けなければなら
ず、その複数の指定アドレスの全てについて、モニタプ
ログラムに制御が移る為、被チエツクプログラムの実行
時間がモニタプログラムの実行される時間の分だけ、長
くなるという欠点があった。
Conventional microprocessors are configured as described above, so in microprocessors that prefetch instructions,
When the specified address at which execution of the checked program is to be stopped occurs after a branch instruction, each time the branch instruction is executed, control is transferred to the monitor program to check whether the instruction at the specified address is executed. become. In addition, if multiple specified addresses are required, detection circuits must be provided for the number of specified addresses required, and since control is transferred to the monitor program for all of the multiple specified addresses, the check target There is a drawback that the program execution time becomes longer by the amount of time the monitor program is executed.

〔発明の概要〕[Summary of the invention]

この発明は上記のような従来のものの欠点を除去するた
めになされたもので、命令の先取9を行っているマイク
ロプロセッサの場合に、被チエツクプログラムの実行を
停止させる指定アドレスの位置や個数に無関係に、前記
被チエツクプログラムの実行時間が、プログラム実行の
停止可否と変わらないマイクロプロセッサを提供するこ
とを目的としている。
This invention was made in order to eliminate the drawbacks of the conventional ones as described above, and in the case of a microprocessor that preempts instructions9, it is possible to change the location and number of specified addresses at which execution of the checked program is stopped. Regardless, it is an object of the present invention to provide a microprocessor in which the execution time of the checked program is the same as whether or not program execution can be stopped.

〔発明の実施例〕[Embodiments of the invention]

以下、この発明の一実施例を図について説明する。 An embodiment of the present invention will be described below with reference to the drawings.

図中、第1図と同一の部分は同一の符号をもって図示し
た第2図において、10はプログラムメモリ3と同一の
アドレスでアクセスされ、指定アドレスの有無をプログ
ラムによりメモリに書き込みその指定アドレスを検出す
る指定アドレスメモリ回路、11は前記指定アドレスメ
モリ回路10ノ出力信号により、モニタプログラム5に
無条件にジャンプする命令を発生する擬似命令発生回路
、12はこの擬似命令発生回路11と前記プログラムメ
モリ3との出力を切り替えて前記データバス6に出力す
るデータ切替回路である。
In FIG. 2, the same parts as in FIG. 1 are shown with the same reference numerals. In FIG. 11 is a pseudo-instruction generating circuit that generates an instruction to unconditionally jump to the monitor program 5 based on the output signal of the specified address memory circuit 10; 12 is a pseudo-instruction generating circuit 11 and the program memory 3; This is a data switching circuit that switches the output of the data bus 6 and outputs the data to the data bus 6.

次に第2図の動作について説明する。まず指定アドレス
メモリ回路10のメモリにモニタプログラム5によって
アドレスが指定されると、それが指定アドレスであれば
データ111を書き込み、特定アドレスでなければデー
タ101を書き込み指定アドレスメモリ回路10に指定
アドレスを記憶してCPUIに被チエツクプログラムを
実行させる。
Next, the operation shown in FIG. 2 will be explained. First, when an address is specified in the memory of the specified address memory circuit 10 by the monitor program 5, if it is the specified address, data 111 is written, and if it is not a specific address, data 101 is written. It is stored and causes the CPU to execute the checked program.

CPUI−j、次に読み出す命令のアドレスをアドレス
バス2に出力し、続いてプログラムメモリ3は、前記ア
ドレスの内容である被チエツクプログラム4の命令をデ
ータ切替回路12を経由してデータバス6に出力する。
The CPU-j outputs the address of the next instruction to be read to the address bus 2, and then the program memory 3 outputs the instruction of the checked program 4, which is the contents of the address, to the data bus 6 via the data switching circuit 12. Output.

よってCPUIは前記データバス6の命令を実行するが
、ここでとのマイクロプロセッサは、命令の先取妙を行
っているので、命令の実行中に、次に実行する命令の読
み出しを行う為、アドレスバス2に次に実行する命令の
アドレスを出力する。その時、アドレスバス2により、
指定アドレスメモリ回路10のメモリを指定し、前記の
アドレスが指定アドレスであれば、データ111が出力
される。その出力されたデータ111により、モニタプ
ログラム5に無条件にジャンプする擬似命令を擬似命令
発生回路10において発生し、前記の出力されたデータ
“1′の動作によってプログラムメモリ3の出力データ
を擬似命令発生回路11の出力データと切替えるための
動作をデータ切替回路12により行い、前記擬似命令発
生回路11のデータをデータバス6に出力する。すなわ
ち、CPU1は指定アドレス7から、実行すべき被チエ
ツクプログラム4の命   ト令ではなく、擬似命令を
読み取ることになる。
Therefore, the CPU executes the instruction on the data bus 6, but since the microprocessor here preempts the instruction, it reads the next instruction to be executed while the instruction is being executed. The address of the next instruction to be executed is output to bus 2. At that time, address bus 2 causes
Specified address The memory of the memory circuit 10 is specified, and if the above address is the specified address, data 111 is output. Based on the output data 111, a pseudo-instruction to unconditionally jump to the monitor program 5 is generated in the pseudo-instruction generation circuit 10, and the output data of the program memory 3 is generated by the operation of the output data "1" as a pseudo-instruction. The data switching circuit 12 performs an operation for switching with the output data of the generating circuit 11, and outputs the data of the pseudo-instruction generating circuit 11 to the data bus 6. That is, the CPU 1 selects the checked program to be executed from the specified address 7. Instruction 4: A pseudo-instruction is read instead of an instruction.

次KCPU1が、指定アドレス7の命令を実行するとす
ると、擬似命令を実行することKなるので、モニタプロ
グラム5に制御動作を移す。
Next, when the KCPU 1 executes the instruction at the specified address 7, it will execute a pseudo-instruction K, so the control operation is transferred to the monitor program 5.

かくして、被チエツクプログラム4#−i指定されたア
ドレスでプログラムの実行を停止したことになり、従来
と同様の処理が行なわれたことになる。
In this way, the execution of the program to be checked 4#-i is stopped at the specified address, and the same processing as the conventional one is performed.

また、指定アドレス7の命令の読み取りをCPU1は行
なったが、その命令の実行前に被チエツクプログラム4
からの分岐命令により指定アドレス7の命令が分岐され
なかった場合には、読み取られた擬似命令は実行される
ことなく捨てられるので、モニタプログラム5に制御が
移ることはない。
In addition, although the CPU 1 has read the instruction at the specified address 7, the CPU 1 has read the instruction at the specified address 7, but before executing the instruction, the CPU 1 has read the instruction at the specified address 7, but before executing the instruction,
If the instruction at the specified address 7 is not branched due to the branch instruction from , the read pseudo-instruction is discarded without being executed, and control is not transferred to the monitor program 5.

なお、上記実施例では、指定アドレスで停止させるプロ
グラムを被チエツクプログラムとし、擬似命令により起
動されるプログラムをモニタプログラムとして、プログ
ラムのデバッグに使用するように説明したが上記被チエ
ツクプログラムを実行プログラムとし、逆にモニタプロ
グラムを変更プログラムとすることにより、外部から指
定した任意の個数の任意の位置で通常実行しているプロ
グラムを何ら変更することなく、別のプログラムを実行
させることもできる。従って本発明の場合には命令の先
取りを行っているようなプロセッサの動作において、指
定アドレスによる多重プログラムスイッチ機能として広
く適用できる。
In the above embodiment, the program to be stopped at a specified address is the checked program, and the program started by a pseudo-instruction is the monitor program, which is used for program debugging. Conversely, by using the monitor program as a change program, another program can be executed at any number of externally specified positions without any change in the normally executed program. Therefore, in the case of the present invention, it can be widely applied as a multiple program switch function using a designated address in the operation of a processor that prefetches instructions.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によれば、従来のマイクロプロ
セッサに指定アドレスメモリ回路、擬似命令発生回路、
及びデータ切替回路を付加することにより、命令の先取
りを行っているマイクロプロセッサでの、指定アドレス
におけるプログラムのスイッチ動作を任意に選択できる
とともに、プログラムのスイッチを行われない場合に比
しても命令実行時間に変化がない等の効果がある。
As described above, according to the present invention, a conventional microprocessor includes a specified address memory circuit, a pseudo-instruction generation circuit,
By adding a data switching circuit and a data switching circuit, it is possible to arbitrarily select the switching operation of a program at a specified address in a microprocessor that prefetches instructions, and the number of instructions This has the advantage that there is no change in execution time.

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

第1図は従来のマイクロプロセッサの構成の一例を示す
ブロック図゛、第2図はこの発明の一実施例におけるマ
イクロプロセッサ回路構成のブロック図である。 1・・・CPU、2・・・アドレスバス、3・・・プロ
クラムメモリ、4・・・被チエツクプログラム、5・・
・モニタプログラム、6・・・データバス、7・・・指
定アドレス、8・・・アドレス一致検出回路、9・・・
マスクできない割り込み、10・・・指定アドレスメモ
リ回路、11・・・擬似命令発生回路、12・・・デー
タ切替回路なお、図中、同一符号は同一、又は相当部分
を示す。 第2図 手続補正書(自発)
FIG. 1 is a block diagram showing an example of the configuration of a conventional microprocessor, and FIG. 2 is a block diagram of a microprocessor circuit configuration in an embodiment of the present invention. 1...CPU, 2...Address bus, 3...Program memory, 4...Checked program, 5...
・Monitor program, 6...Data bus, 7...Specified address, 8...Address match detection circuit, 9...
Interrupts that cannot be masked, 10: designated address memory circuit, 11: pseudo-instruction generation circuit, 12: data switching circuit. In the drawings, the same reference numerals indicate the same or equivalent parts. Figure 2 Procedural amendment (voluntary)

Claims (1)

【特許請求の範囲】[Claims] 命令の先取りを行つて動作するマイクロプロセッサのC
PUが実行するための命令を格納するプログラムメモリ
と、指定されたアドレスの命令が前記プログラムメモリ
から読み出される時、該プログラムメモリと同一のアド
レスでアクセスされ、アドレス指定の有無をプログラム
により、メモリに書き込むことによつて、該指定アドレ
スを検出する指定アドレスメモリ回路と、前記指定アド
レスメモリ回路の出力データにより特定アドレスに命令
の実行を移行する命令を発生する擬似命令発生回路と、
前記プログラムメモリの出力データと前記擬似命令発生
回路の出力データとを前記指定アドレスメモリ回路の出
力データにより切替えてデータバスにデータを出力する
データ切替回路とを備えたマイクロプロセッサ。
C microprocessor that operates by prefetching instructions
A program memory stores instructions for the PU to execute, and when an instruction at a specified address is read from the program memory, it is accessed at the same address as the program memory, and whether or not addressing is specified is determined by the program. a designated address memory circuit that detects the designated address by writing; a pseudo-instruction generation circuit that generates an instruction to shift execution of an instruction to a specific address based on output data of the designated address memory circuit;
A microprocessor comprising: a data switching circuit that switches output data of the program memory and output data of the pseudo-instruction generation circuit according to output data of the designated address memory circuit, and outputs data to a data bus.
JP59173133A 1984-08-22 1984-08-22 Microprocessor Pending JPS6152747A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59173133A JPS6152747A (en) 1984-08-22 1984-08-22 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59173133A JPS6152747A (en) 1984-08-22 1984-08-22 Microprocessor

Publications (1)

Publication Number Publication Date
JPS6152747A true JPS6152747A (en) 1986-03-15

Family

ID=15954729

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59173133A Pending JPS6152747A (en) 1984-08-22 1984-08-22 Microprocessor

Country Status (1)

Country Link
JP (1) JPS6152747A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0623307A (en) * 1992-03-24 1994-02-01 Ngk Insulators Ltd Coating device
JPH06332751A (en) * 1993-05-24 1994-12-02 Nec Corp System operation information collecting device
US6708289B1 (en) 1998-03-31 2004-03-16 Seiko Epson Corporation Microcomputer, electronic equipment and debugging system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0623307A (en) * 1992-03-24 1994-02-01 Ngk Insulators Ltd Coating device
JPH06332751A (en) * 1993-05-24 1994-12-02 Nec Corp System operation information collecting device
US6708289B1 (en) 1998-03-31 2004-03-16 Seiko Epson Corporation Microcomputer, electronic equipment and debugging system

Similar Documents

Publication Publication Date Title
US4924382A (en) Debugging microprocessor capable of switching between emulation and monitor without accessing stack area
JPH02130634A (en) Device and method for processing data
JPS5819961A (en) Emulator controller
US5544307A (en) Microcomputer development support system operable with only background monitor and without cache replacement
JPS6152747A (en) Microprocessor
US6775740B1 (en) Processor having a selector circuit for selecting an output signal from a hit/miss judgement circuit and data from a register file
JPS59183445A (en) Data processor
JPS62197831A (en) Data processor
JP2504191B2 (en) Microprocessor
JPS60167038A (en) Microprocessor
JPH06103109A (en) Data processor and debugging device using the same
JPS6234238A (en) Microprocessor
KR100329780B1 (en) Interrupt processing apparatus reducing interrupt response time
JP2619416B2 (en) emulator
JP2001222447A (en) Debug method and device to be debugged under operating environment
JP3147884B2 (en) Storage device and information processing device
JPS6118045A (en) Detecting system of program runaway
JPH0795288B2 (en) Microcomputer
JPH04140851A (en) Diagnostic system for information processor
JPS63289653A (en) In-circuit emitter
JPH0895946A (en) Microcomputer
JPS59158449A (en) Debugging device
JPH02133833A (en) Controller for in-circuit emulator
JPS59103146A (en) Operation mode display device
JPH04140852A (en) Diagnostic system for information processor