JPS60167038A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPS60167038A
JPS60167038A JP59023215A JP2321584A JPS60167038A JP S60167038 A JPS60167038 A JP S60167038A JP 59023215 A JP59023215 A JP 59023215A JP 2321584 A JP2321584 A JP 2321584A JP S60167038 A JPS60167038 A JP S60167038A
Authority
JP
Japan
Prior art keywords
program
address
instruction
checked
specified
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
JP59023215A
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 JP59023215A priority Critical patent/JPS60167038A/en
Publication of JPS60167038A publication Critical patent/JPS60167038A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To execute a program to be checked in a time nearly equal to the time when the program is not switched by providing an instruction pre-fetch control system with a pseudo instruction circuit which accesses a specific address with an assigned address. CONSTITUTION:When a CPU1 is allowed to execute the program 4 to be checked, the CPU1 outputs the address of an instruction to be read next to an address bus 2 and program memory 3 outputs the instruction of the program 4 to a data bus 6. When there is the assigned address during the execution of instructions, the pseudo instruction generating circuit 11 generates the specific address, which is outputted to the bus 6 by the switching of a data switching circuit 12. Consequently, the CPU1 accesses the specific address and an interruption generating circuit 13 initiates an interruption which can not be masked to the CPU1, thereby passing the control to a monitor program 5.

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は命令の先取りを行ない、マスクできない割り込
みによって例えば、デバッグ用のモニタプログラムが起
動されるマイクロプロセッサに関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a microprocessor that prefetches instructions and in which, for example, a debugging monitor program is activated by a non-maskable interrupt.

〔従来技術〕[Prior art]

通常のマイクロプロセッサではプログラム(以下被チエ
ツクプログラムと言う)をチェックするためにデパック
用プログラムとも呼ばれるモニタプログラムを備えてい
る。
A typical microprocessor is equipped with a monitor program, also called a depacking program, for checking programs (hereinafter referred to as checked programs).

このモニタプログラムは被チエツクプログラムとは別に
実行され、この被チエツクプログラムの実行、停止およ
び初期設定ならびに実行結果の表示等を行なう。
This monitor program is executed separately from the checked program, and executes, stops, and initializes the checked program, and displays the execution results.

この場合、被チエツクプログラムの実行時、特定のアド
レスで実行を停止し、モニタプログラムを起動させるに
は指定アドレスの命令の読み出し時に中央処理装置(以
下CPUと言う)に対してマスクできない割り込みをか
けてCPHの制御をモニタプログラムに移すことになる
In this case, when executing the program to be checked, in order to stop execution at a specific address and start the monitor program, an unmaskable interrupt is sent to the central processing unit (hereinafter referred to as CPU) when an instruction at the specified address is read. control of the CPH is transferred to the monitor program.

このことを第1図を参照してさらに詳しく説明する0 第1図中(1)は命令の実行を行なうCPU、(2)は
このCP U (1)が実行する命令のアドレスを出力
するアドレスバス、(8)は命令を格納しているプログ
ラムメモリ、(4)および(5)はそれぞれこのプログ
ラムメモリ(8)の内容の一部分である被チエツクプロ
グラムおよびモニタプログラム、(6)はプログラムメ
モリ(3)の出力データi CP U (1)に送り込
むデータバス、(γ)は被チエツクプログラム(4)の
実行を停止し、モニタプログラム(5)の起動を指定す
る指定アドレス、(8)はこの指定アドレス(γ)とア
ドレスノ(ス(2)の内容との一致を検出してマスクで
きない割り込み(9)全発生するアドレス一致検出回路
である。
This will be explained in more detail with reference to Figure 1.0 In Figure 1, (1) is the CPU that executes the instruction, and (2) is the address that outputs the address of the instruction that this CPU (1) executes. bus, (8) is a program memory storing instructions, (4) and (5) are a checked program and a monitor program, respectively, which are part of the contents of this program memory (8), and (6) is a program memory ( 3) Output data i CPU (1) Data bus (γ) is a specified address to stop the execution of the checked program (4) and start the monitor program (5), (8) is this address This is an address match detection circuit that detects a match between the specified address (γ) and the contents of the address number (2) and generates all interrupts (9) that cannot be masked.

第1図において、CPU(1)が実行する命令のアドレ
スをアドレスバス(2)に出力すると、プログラムメモ
リ(8)はそのアドレスの内容である被チエツクプログ
ラム(4)の命令をデータバス(6)に出力する。
In FIG. 1, when the CPU (1) outputs the address of an instruction to be executed to the address bus (2), the program memory (8) outputs the instruction of the checked program (4), which is the content of the address, to the data bus (6). ).

このとき、アドレスバス(2)の内容と指定アドレス(
7)とが一致するか否かを検出し、両者が一致していた
ときマスクできない割り込み(9)i CP U (1
)に与える。これによってCP U (1)はこの割り
込みを受けつけて読み込んだ命令を実行した後、モニタ
プログラム(6)に制御を移す。
At this time, the contents of the address bus (2) and the specified address (
7), and if they match, an interrupt that cannot be masked (9) i CPU (1
). As a result, the CPU (1) accepts this interrupt, executes the read instruction, and then transfers control to the monitor program (6).

かくして、被チエツクプログラム(4)は指定されたア
ドレスで実行を停止したことになる。
Thus, the checked program (4) has stopped execution at the specified address.

ところで、命令の先取りヲ行なっているマイクロプロセ
ッサにおいて、CPU(1)はアドレスの指定、命令の
読み取りおよび命令の実行を並列に行なっており、この
うち、命令の読み取りは命令を実行する数個の命令の前
に行なっている。その時、前もって読み取り済みの命令
が分岐命令であれば、この分岐命令を実行すると既に読
み取り済みの命令は実行されないことになる。
By the way, in a microprocessor that preempts instructions, the CPU (1) specifies addresses, reads instructions, and executes instructions in parallel. It is done before the command. At that time, if the previously read instruction is a branch instruction, if this branch instruction is executed, the already read instruction will not be executed.

すなわち、分岐命令以後の命令はこの分岐命令を実行す
る以前に読み取られても実際には実行されないものであ
り、したがって、命令が実行されるか否かは命令の読み
取9段階では確定しない。
That is, even if the instructions after the branch instruction are read before the branch instruction is executed, they are not actually executed. Therefore, whether the instruction will be executed or not is not determined at the 9th step of reading the instruction.

このように、命令の読み取9段階では実行が確定しない
アドレスで被チエツクプログラム(4)の実行を停止し
てモニタプログラム(5)を起動するには、CP U 
(1)の制御がモニタプログラム(6)に移った後、被
チエツクプログラム(4)が停止したアドレスから指定
アドレスまたは分岐命令が実行されるまで、モニタプロ
グラム(5)によって被チエツクプログラム(4)を実
行し、次いで、指定アドレスの命令が実行されれば指定
アドレスで停止したものと見做し、指定アドレスの命令
が実行されずにプログラムが別のアドレスに分岐した場
合にはモニタプログラム(5)は被チエツクプログラム
(4)を再実行させている。
In this way, in order to stop the execution of the checked program (4) and start the monitor program (5) at an address whose execution is not determined at the 9th step of reading the instruction, the CPU
After the control of (1) is transferred to the monitor program (6), the monitor program (5) continues to control the checked program (4) from the address where the checked program (4) stopped until the specified address or branch instruction is executed. If the instruction at the specified address is executed, it is assumed that the program has stopped at the specified address, and if the instruction at the specified address is not executed and the program branches to another address, the monitor program (5 ) causes the checked program (4) to be re-executed.

しかして、命令の先取pヲ行っている従来のマイクロプ
ロセッサにあっては、被チエツクプログラムの実行を停
止させる指定アドレスが分岐命令の後になるとき、この
分岐命令が実行される毎にモニタプログラムに制御が移
って指定アドレスの命令が実行されるか否かを調べなけ
ればならず、また、複数の指定アドレスを必要とする場
合にはこれに対応する個数の検出回路を必要としこれら
の指定アドレスの全てについてモニタプログラムに制御
が移るため、被チエツクプログラムの実行時間がモニタ
プログラムの実行分だけ長くなるという欠点があった。
However, in conventional microprocessors that prefetch instructions, when the specified address at which the execution of the checked program is to be stopped occurs after a branch instruction, the monitor program is It is necessary to check whether control is transferred and the instruction at the specified address is executed, and if multiple specified addresses are required, a corresponding number of detection circuits are required to detect these specified addresses. Since control is transferred to the monitor program for all of the above, there is a drawback that the execution time of the checked program becomes longer by the amount of execution of the monitor program.

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

本発明は上記の欠点を除去する目的でなされたもので、
命令の先取Ce行っているマイクロプロセッサにおいて
、指定されたアドレスの命令がプログラムメモリから読
み出されるとき、このプログラムメモリと同一のアドレ
スでアクセスされ、指定の有無をプログラムにょクメモ
リに書き込むことによって指定アドレスを検出する指定
アドレスメモリ回路と、この指定アドレスメモリ回路の
出力によって特定アドレスをアクセスするための命令を
発生する擬似命令発生回路と、この擬似命令発生回路の
出力データとプログラムメモリの出力データとを前記指
定アドレスメモリ回路の出方により切替えてデータバス
に出方するデータ切替回路と、前記特定アドレスにアク
セスしたとき、CPHに対してマスクできない割り込み
を発生する割p込み発生回路とを具備し、これによって
、被チエツクプログラムの実行を停止させる指定アドレ
スの位置および個数に係わりなく、実行の停止を行なわ
ない場合と略等しい時間で被チエツクプログラムを実行
させ得るマイクロプロセッサを提案するものである。
The present invention was made for the purpose of eliminating the above-mentioned drawbacks.
In a microprocessor that preempts an instruction, when an instruction at a specified address is read from the program memory, it is accessed at the same address as this program memory, and the specified address is read by writing the presence or absence of the instruction to the program memory. A specified address memory circuit to be detected, a pseudo-instruction generation circuit that generates an instruction for accessing a specific address by the output of this specified address memory circuit, and output data of this pseudo-instruction generation circuit and output data of the program memory as described above. A data switching circuit that outputs data to a data bus by switching depending on the output of a specified address memory circuit, and an interrupt generation circuit that generates an interrupt that cannot be masked to a CPH when the specific address is accessed. The present invention proposes a microprocessor that can execute a checked program in approximately the same time as when execution is not stopped, regardless of the location and number of specified addresses at which execution of the checked program is stopped.

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

第2図は本発明の一実施例の構成をブロック的に示した
もので、図中、第1図と同一の符号を付したものはそれ
ぞれ同一の要素を示している。そして、プログラムメモ
リ(8)と同一のアドレスでアクセスされ、指定の有無
をプログラムに書き込むことによってこの指定アドレス
を検出する指定アドレスメモリ回路αQと、この指定ア
ドレスメモリ回路θ0)の出力によって特定アドレスを
アクセスするための命令を発生する擬似命令発生回路(
111と、この擬似命令発生回路(Illの出力データ
とプログラムメモリ(8)の出力データとを切替えてデ
ータバス(6)に出力するデータ切換回路(旧とが新た
に付加され、さらに、第1図に示したアドレス一致検出
回路(8)の代わりに、特定アドレスにアクセスされた
ときマスクできない割り込み(9)全発生する割り込み
発生回路(13)が設けられている。
FIG. 2 is a block diagram showing the configuration of an embodiment of the present invention, and in the figure, the same reference numerals as in FIG. 1 indicate the same elements. Then, a specified address memory circuit αQ is accessed at the same address as the program memory (8) and detects this specified address by writing the presence or absence of the specification into the program, and a specific address is detected by the output of this specified address memory circuit θ0). Pseudo-instruction generation circuit that generates instructions for access (
111 and a data switching circuit (old) that switches between the output data of this pseudo-instruction generation circuit (Ill and the output data of the program memory (8) and outputs it to the data bus (6)), and a new In place of the address match detection circuit (8) shown in the figure, an interrupt generation circuit (13) is provided which generates all interrupts (9) that cannot be masked when a specific address is accessed.

上記の如く構成されたマイクロプロセッサの作用を以下
・に説明する。
The operation of the microprocessor configured as described above will be explained below.

先ず、モニタプログラムによってアドレスが指定アドレ
スであればデータrIJ’e、指定アドレスでなければ
データ「0」を指定アドレスメモリ回路叫に書き込む。
First, the monitor program writes data rIJ'e into the specified address memory circuit if the address is the specified address, and data "0" if the address is not the specified address.

そして、CPU(1)に被チエツクプログラム(4)を
実行させると、このCP U (1)は次に読み出す命
令のアドレス全アドレスバス(2)に出力し、プログラ
ムメモリ(8)はそのアドレンの内容である被チエツク
プログラム(4)の命令をデータバス切替回路0刀を経
由してデータバス(6)に出力する。
Then, when the CPU (1) executes the checked program (4), the CPU (1) outputs the address of the next instruction to be read to the entire address bus (2), and the program memory (8) stores the address of that address. The command of the checked program (4), which is the content, is output to the data bus (6) via the data bus switching circuit.

これによって、CPU(1)はデータバス(6)の11
を実行するが、このマイクロプロセッサは命令の先取り
を行なっているので、命令の実行中に、次に実行する命
令の読み出しを行なうためこの命令。
As a result, the CPU (1) uses 11 of the data bus (6).
However, since this microprocessor prefetches instructions, it reads the next instruction to be executed while the instruction is being executed.

のアドレスをアドレスバス(2)に出力する。outputs the address to address bus (2).

このとき、アドレスバス(2)によって指定アドレスメ
モリ回路OQのメモリを指定し、そのアドレスが指定ア
ドレスであればデータ「1」が出力される。このデータ
「1」により擬似命令発生回路C11は特定アドレスを
アクセスする擬似命令を発生し、また、このデータ「1
」によりデータ切換回路(L?Jはプログラムメモリ(
8)の出力データを擬似命令発生回路(Illの出力デ
ータに切替えてデータバス(6)に出力する。
At this time, the address bus (2) specifies the memory of the specified address memory circuit OQ, and if the address is the specified address, data "1" is output. This data "1" causes the pseudo-instruction generation circuit C11 to generate a pseudo-instruction to access a specific address, and also generates a pseudo-instruction that accesses a specific address.
”, the data switching circuit (L?J is the program memory (
The output data of 8) is switched to the output data of the pseudo-instruction generation circuit (Ill) and output to the data bus (6).

すなわち、CPU(1)は指定アドレス(γ)から、実
行すべき被チエツクプログラム(4)の命令ではなく擬
似命令を読み取ることになる0 次に、CPU(1)が指定アドレスの命令を実行しよう
とすれば擬似命令を実行することになって、特定アドレ
スをアクセスすることになり、割り込み発生回路(12
)からCP U (1)にマスクできない割り込みが加
えられる。するとCP U (1)はこの割り込みを受
け付けてモニタプログラム(5)に制御を移す。
In other words, the CPU (1) reads a pseudo-instruction from the specified address (γ) instead of the instruction of the checked program (4) to be executed.Next, the CPU (1) will execute the instruction at the specified address. If so, a pseudo-instruction will be executed and a specific address will be accessed, and the interrupt generation circuit (12
) adds a non-maskable interrupt to CPU (1). Then, the CPU (1) accepts this interrupt and transfers control to the monitor program (5).

カくシて、被チエツクプログラム(4)は指定されたア
ドレスで実行を停止したことになり、従来装置と同一の
処理を行なわせ得る0 ところで、指定アドレスの命令の読み取りを行なったと
しても、その命令の実行前に被チエツクプログラム(4
)の分岐命令により指定アドレスの命令が分岐された場
合、読み取られた擬似命令は実行されることなく捨てら
れるので、モニタプログラムに制御が移ることはない。
As a result, the checked program (4) has stopped execution at the specified address, and the same processing as the conventional device can be performed.By the way, even if the instruction at the specified address is read, The checked program (4
) When the instruction at the specified address is branched by a branch instruction, the read pseudo-instruction is discarded without being executed, so control is never transferred to the monitor program.

なお、上記実施例では指定アドレスで停止させるプログ
ラムを被チエツクプログラムとし、マスクできない割り
込みにより起動されるプログラムをモニタプログラムと
してプログラムのデバッグに使用する場合について説明
したが、被チエツクプログラムを実行プログラムとし、
モニタプログラムを変更プログラムとすることによって
、通常実行しているプログラムを外部から指定された任
意の個数の任意の位置で、通常のプログラムを変更する
ことなく別のプログラムを実行させてもよく、本発明は
命令の先取りを行なっているプロセッサにおいて指定ア
ドレスでの多重プログラムスイッチに広く適用すること
ができる。
In the above embodiment, the program to be checked is a program to be stopped at a specified address, and the program started by an interrupt that cannot be masked is used as a monitor program to debug the program.
By using the monitor program as a change program, you can make the normally running program run at any number of arbitrary positions specified from the outside without changing the normal program. The invention is broadly applicable to multiple program switches at specified addresses in processors performing instruction prefetching.

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

以上の説明によって明らかな如く、本発明によれば指定
アドレスにおけるプログラムスイッチを行なう場合にス
イッチ箇所の個数を任意に選択し得ると共に、スイッチ
を行なわない場合と略等しい時間で被チエツクプログラ
ムを実行させ得るという優れた効果が得られている。
As is clear from the above explanation, according to the present invention, when performing a program switch at a specified address, the number of switch locations can be arbitrarily selected, and the checked program can be executed in approximately the same time as when no switch is performed. Excellent effects have been obtained.

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

第1図は従来のマイクロプロセッサの構成をブロックで
示した図、第2図は本発明の一実施例の構成をブロック
で示した図である。 (1)・[株]中央処理装置 (2)・・アドレスバス
(8)・・プログラムメモリ (4)e・被チエツクプログラム (5)・・モニタプログラム (6)・・データバス (7)拳・指定アドレス(8)
−・アドレス一致回路 (9)e・マスクできない割り込み 叫・・指定アドレスメモリ回路 (11)φ・擬似命令発生回路 (廟・・データ切替回路 OB)@・割り込み発生回路 なお、図中、同一符号は同一または相当部分を示す。 代理人大岩増雄 第1図 第2図 手続補正書(自発) 1.事件の表示 特願昭# −z、3z/矛号2、発明
の名称 マイクロプロセッサ 3、補正をする者 代表者片山仁へ部 4、代理人 6、補正の内容 明細書第11頁第17行の「(8)・・・・・・アドレ
ス一致回路」という記載を「(8)・・・・・・ アド
レス一致検出回路」と補正する。 以 上
FIG. 1 is a block diagram showing the configuration of a conventional microprocessor, and FIG. 2 is a block diagram showing the configuration of an embodiment of the present invention. (1) Central processing unit (2) Address bus (8) Program memory (4) e Checked program (5) Monitor program (6) Data bus (7) Fist・Specified address (8)
- Address matching circuit (9) e - Interrupt call that cannot be masked - Specified address memory circuit (11) φ - Pseudo-instruction generation circuit (mausoleum... data switching circuit OB) @ - Interrupt generation circuit Note that the same reference numerals are used in the diagram. indicate the same or equivalent part. Agent Masuo Oiwa Figure 1 Figure 2 Procedure Amendment (Voluntary) 1. Indication of the case Patent application Sho # -z, 3z / number 2, name of the invention microprocessor 3, person making the amendment representative Hitoshi Katayama department 4, agent 6, statement of contents of amendment page 11 line 17 The description "(8) . . . address matching circuit" is corrected to "(8) . . . address matching detection circuit."that's all

Claims (1)

【特許請求の範囲】[Claims] 命令の先取#)ヲ行なっているマイクロプロセッサにお
いて、指定されたアドレスの命令がプログラムメモリか
ら読み出されるとき、このプログラムメモリと同一のア
ドレスでアクセスされ、指定の有無をプログラムにより
メモリに書き込むことによって指定アドレスを検出する
指定アドレスメモリ回路と、この指定アドレスメモリ回
路の出力によって特定アドレスをアクセスするための命
令を発生する擬似命令発生回路と、この擬似命令発生回
路の出力データとプログラムメモリの出力データとを前
記指定アドレスメモリ回路の出力により切替えてデータ
バスに出力するデータ切替回路と、前記特定アドレスに
アクセスしたとき、中央処理装置に対してマスクできな
い割り込みを発生する割り込み発生回路とを具備したこ
とを特徴とするマイクロプロセッサ。
When an instruction at a specified address is read from the program memory in a microprocessor that is performing instruction prefetching (#), it is accessed at the same address as this program memory, and the presence or absence of the instruction is specified by writing it into the memory by the program. A specified address memory circuit that detects an address, a pseudo-instruction generation circuit that generates an instruction to access a specific address by the output of this specified address memory circuit, and output data of this pseudo-instruction generation circuit and output data of the program memory. and an interrupt generation circuit that generates an interrupt that cannot be masked to the central processing unit when the specific address is accessed. Features a microprocessor.
JP59023215A 1984-02-08 1984-02-08 Microprocessor Pending JPS60167038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59023215A JPS60167038A (en) 1984-02-08 1984-02-08 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59023215A JPS60167038A (en) 1984-02-08 1984-02-08 Microprocessor

Publications (1)

Publication Number Publication Date
JPS60167038A true JPS60167038A (en) 1985-08-30

Family

ID=12104435

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59023215A Pending JPS60167038A (en) 1984-02-08 1984-02-08 Microprocessor

Country Status (1)

Country Link
JP (1) JPS60167038A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6398746A (en) * 1986-10-15 1988-04-30 Yokogawa Electric Corp Bus switching circuit for debugger
JPS63197243A (en) * 1987-02-12 1988-08-16 Yokogawa Electric Corp In-circuit emulator

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6398746A (en) * 1986-10-15 1988-04-30 Yokogawa Electric Corp Bus switching circuit for debugger
JPS63197243A (en) * 1987-02-12 1988-08-16 Yokogawa Electric Corp In-circuit emulator

Similar Documents

Publication Publication Date Title
US7178062B1 (en) Methods and apparatus for executing code while avoiding interference
US8612720B2 (en) System and method for implementing data breakpoints
JP2005122334A (en) Memory dump method, memory dumping program and virtual computer system
EP0638864A1 (en) Development support system for microcomputer with internal cache
JPS58197553A (en) Program monitor
JPH11203146A (en) Microcomputer
JPS60167038A (en) Microprocessor
JPS59183445A (en) Data processor
JPS6152747A (en) Microprocessor
KR100238174B1 (en) Parallel processor system
JP2504191B2 (en) Microprocessor
JP2653412B2 (en) How to set breakpoints
EP0591753A2 (en) A data processor and a debugging apparatus using it
JPH02135545A (en) Execution control processing system for debugger
JPS59112494A (en) Memory testing system
JPS6234238A (en) Microprocessor
JP3159155B2 (en) Method and apparatus for debugging program
JPH0795288B2 (en) Microcomputer
JPH11167500A (en) Event circuit and debug system for emulator device
JPS59103146A (en) Operation mode display device
JPS6382525A (en) Microprocessor with tracing function
JPS59158449A (en) Debugging device
JPS63316137A (en) Information processor
JPH03296832A (en) Microprocessor
JPH01298443A (en) Incircuit emulator