[go: up one dir, main page]

JP2005070951A - Program processing apparatus - Google Patents

Program processing apparatus Download PDF

Info

Publication number
JP2005070951A
JP2005070951A JP2003297458A JP2003297458A JP2005070951A JP 2005070951 A JP2005070951 A JP 2005070951A JP 2003297458 A JP2003297458 A JP 2003297458A JP 2003297458 A JP2003297458 A JP 2003297458A JP 2005070951 A JP2005070951 A JP 2005070951A
Authority
JP
Japan
Prior art keywords
program
branch
cpu
address value
source address
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
JP2003297458A
Other languages
Japanese (ja)
Inventor
Takayuki Suzuki
貴之 鈴木
Naoya Yamakawa
尚哉 山川
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2003297458A priority Critical patent/JP2005070951A/en
Publication of JP2005070951A publication Critical patent/JP2005070951A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program processing apparatus for improving the efficiency of software debug. <P>SOLUTION: A back trace circuit 22 monitors an internal bus 26 of a CPU core 21 which executes a program, and monitors a previously designated branch instruction in the program. Then, when branch is generated in the program, the branch origin address value is acquired from a program counter 32 through the internal bus 26, and stored in an internal register in the order of the generation of branch. A debug tool 14 receives the branch origin address value stored in the internal register from the CPU core 21 through a debug I/F 23, and calculates the execution path of the program based on the address value. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明はプログラム処理装置に係り、詳しくは組み込みソフトウェア(ファームウェア)等の動作検証を行う場合に使用して好適な制御LSIに関する。   The present invention relates to a program processing apparatus, and more particularly to a control LSI suitable for use when performing operation verification of embedded software (firmware) or the like.

近年、CPUを内蔵したマイクロコンピュータ等のLSIが組み込み用途として用いられ、ソフトウェアの開発にはエバリュエーションチップ(以下エバチップ)が一般的に用いられる。エバチップには、ターゲットシステムに搭載されるCPUに加えて、ソフトウェアのデバッグを支援するインタフェース回路が搭載されている。そして、ユーザボードに搭載したエバチップにインサーキットエミュレータ(ICE(R))を接続して、該ICEからデバッグ用コマンドをCPUに与えることにより、ソフトウェアデバッグが行われている。なお、エバチップを使用したデバッグシステムに関連する先行技術として例えば特許文献1が知られている。
特開平11−282712号公報
In recent years, LSIs such as microcomputers with built-in CPUs are used for embedded applications, and evaluation chips (hereinafter referred to as “evaluation chips”) are generally used for software development. In the evaluation chip, in addition to the CPU mounted on the target system, an interface circuit that supports software debugging is mounted. Software debugging is performed by connecting an in-circuit emulator (ICE (R)) to an evaluation chip mounted on the user board and giving a debugging command from the ICE to the CPU. For example, Patent Document 1 is known as a prior art related to a debugging system using an evaluation chip.
JP-A-11-282712

ところで、CPUを含めた周辺回路を1チップ上に搭載してシステムレベルの機能を実現するSOC(System On a Chip)等においては、CPUのバスやコントロール信号がチップ内部に集約されてしまうため、デバッグ効率が低下するという問題があった。即ち、このようなSOCにおけるソフト開発では、CPUを個別に評価用ボードに載せてデバッグを行う必要があるため、最終的に1チップにする開発費が必要になるとともに、設計期間が長くなりTAT(Turn Around Time)を低下させるという問題があった。   By the way, in an SOC (System On a Chip) or the like in which peripheral circuits including a CPU are mounted on one chip to realize a system level function, the CPU bus and control signals are concentrated inside the chip. There was a problem that debugging efficiency was lowered. That is, in such software development in SOC, since it is necessary to perform debugging by placing the CPU on the evaluation board individually, the development cost for finally making one chip is required, and the design period becomes longer and TAT becomes longer. There was a problem of lowering (Turn Around Time).

加えて、このようなソフトウェアデバッグ等の試験コストは極力低減させることが要求されており、デバッグに使用できる端子は少数に制限されているのが実情である。このため、デバッグを効率良く行うことができないという問題を有していた。   In addition, it is required to reduce the test cost of such software debugging as much as possible, and the number of terminals that can be used for debugging is limited to a small number. For this reason, there has been a problem that debugging cannot be performed efficiently.

また、現状では、ソフトウェアの開発段階において、予めプログラムのソースコード中にブレイクポイントを設定し、そこを通過する際にプログラムの実行を停止させることで、デバッグを行うようにしている。しかしながら、この方法では、ブレイクポイントの設定のためにプログラムメモリを書き換える必要があるため、デバッグ作業が繁雑であるという問題があった。   At present, in the software development stage, breakpoints are set in advance in the source code of the program, and debugging is performed by stopping the execution of the program when passing through it. However, this method has a problem that debugging work is complicated because it is necessary to rewrite the program memory to set a breakpoint.

本発明はこうした実情に鑑みてなされたものであり、その目的はソフトウェアデバッグの効率向上を図ることのできるプログラム処理装置を提供することにある。   The present invention has been made in view of such circumstances, and an object thereof is to provide a program processing apparatus capable of improving the efficiency of software debugging.

上記の目的を達成するため、請求項1に記載の発明によれば、プログラム処理装置は、プログラムを実行するCPUと、前記CPUと同一の半導体基板上に集積された、前記CPUがメモリ空間をアクセスする際に使用する内部バスと、前記内部バスを監視して前記プログラム内の予め指定された分岐命令を1以上モニタし、前記プログラムに分岐が発生する場合にその分岐元アドレス値を記憶するバックトレース回路と、を備える。この構成によれば、CPUをチップ内に搭載したまま、バックトレース回路にてモニタした分岐命令の分岐元アドレス値からプログラムの実行経路をトレースすることができる。これにより、デバッグ作業を効率良く行うことができる。   In order to achieve the above object, according to the first aspect of the present invention, there is provided a program processing device comprising: a CPU for executing a program; and the CPU integrated on the same semiconductor substrate as the CPU. The internal bus used for access and the internal bus are monitored to monitor one or more pre-designated branch instructions in the program, and the branch source address value is stored when a branch occurs in the program A back trace circuit. According to this configuration, the execution path of the program can be traced from the branch source address value of the branch instruction monitored by the back trace circuit while the CPU is mounted on the chip. Thereby, debugging work can be performed efficiently.

請求項2に記載の発明によれば、プログラム処理装置は、プログラムを実行するCPUと、前記CPUと同一の半導体基板上に集積された、前記CPUがメモリ空間をアクセスする際に使用する内部バスと、前記内部バスを監視して前記プログラム内の予め指定された分岐命令を複数モニタし、前記プログラムに分岐が発生する場合にその分岐元アドレス値を記憶するバックトレース回路と、を備え、前記バックトレース回路には、複数の分岐元アドレス値を分岐発生順に保持する内部レジスタが備えられている。この構成によれば、CPUをチップ内に搭載したまま、バックトレース回路にてモニタした分岐命令の分岐元アドレス値からプログラムの実行経路をトレースすることができる。また、この構成では、内部レジスタがオーバーフローとなる際に新たに分岐が発生する場合にも、内部レジスタに保持されている最も古い分岐元アドレス値が消去されて新たな分岐元アドレス値が保持される。これにより、トレース情報の欠落を防止しながら、デバッグ作業を効率良く行うことができる。   According to a second aspect of the present invention, a program processing device includes a CPU that executes a program and an internal bus that is integrated on the same semiconductor substrate as the CPU and that is used when the CPU accesses a memory space. And a backtrace circuit that monitors the internal bus, monitors a plurality of pre-designated branch instructions in the program, and stores a branch source address value when a branch occurs in the program, and The back trace circuit includes an internal register that holds a plurality of branch source address values in the order of branch generation. According to this configuration, the execution path of the program can be traced from the branch source address value of the branch instruction monitored by the back trace circuit while the CPU is mounted on the chip. In this configuration, even when a new branch occurs when the internal register overflows, the oldest branch source address value held in the internal register is erased and the new branch source address value is held. The As a result, it is possible to efficiently perform debugging work while preventing loss of trace information.

請求項3に記載の発明によれば、前記バックトレース回路には、モニタする分岐命令の種類を予め設定した条件設定レジスタが備えられている。この構成によれば、トレースの対象とする分岐命令を任意に設定することができる。   According to a third aspect of the present invention, the backtrace circuit includes a condition setting register in which the type of branch instruction to be monitored is set in advance. According to this configuration, a branch instruction to be traced can be arbitrarily set.

本発明によれば、ソフトウェアデバッグの効率向上を図ることのできるプログラム処理装置を提供することができる。   According to the present invention, it is possible to provide a program processing apparatus capable of improving the efficiency of software debugging.

以下、本発明に係るプログラム処理装置を例えばファームウェアのデバッグを行うための制御LSIに適用した一実施の形態を図面に従って説明する。   Hereinafter, an embodiment in which a program processing apparatus according to the present invention is applied to a control LSI for debugging firmware, for example, will be described with reference to the drawings.

図1は、本実施形態のデバッグシステム11の概略を示すブロック図である。デバッグシステム11は、プログラム処理装置としての制御LSI12及びその制御LSI12とツールバスを介して接続されるデバッグ装置としてのパーソナルコンピュータ(以下PC)13を含む。後述するように、制御LSI12は、CPUを含めた周辺回路を1チップに搭載してシステムレベルの機能を実現するシステムLSIである。PC13は、例えばICE(R)等にてなるデバッグツール14を有している。   FIG. 1 is a block diagram showing an outline of a debugging system 11 according to this embodiment. The debug system 11 includes a control LSI 12 as a program processing device and a personal computer (hereinafter referred to as PC) 13 as a debug device connected to the control LSI 12 via a tool bus. As will be described later, the control LSI 12 is a system LSI that implements system-level functions by mounting peripheral circuits including a CPU on one chip. The PC 13 has a debugging tool 14 made of, for example, ICE (R) or the like.

詳述すると、制御LSI12にはデバッグ用端子(図示略)が備えられ、そのデバッグ用端子にツールバスのバスケーブル15が接続されている。デバッグ用端子は、制御LSI12のチップサイズに与える影響を少なくするために少数(本実施形態では例えば2ピン)で設けられ、同制御LSI12はバスケーブル15を介してデバッグツール14とシリアル通信する。尚、本実施形態では、2つのデバッグ用端子にそれぞれクロックバスとデータバスとが接続され、制御LSI12とデバッグツール14の間のデータ転送(双方向)はクロックに同期して行われるようになっている。   More specifically, the control LSI 12 includes a debugging terminal (not shown), and a tool bus bus cable 15 is connected to the debugging terminal. In order to reduce the influence on the chip size of the control LSI 12, the debugging terminals are provided in a small number (for example, 2 pins in this embodiment), and the control LSI 12 performs serial communication with the debug tool 14 via the bus cable 15. In this embodiment, a clock bus and a data bus are connected to the two debugging terminals, respectively, and data transfer (bidirectional) between the control LSI 12 and the debug tool 14 is performed in synchronization with the clock. ing.

制御LSI12は、CPUコア21、バックトレース回路22、デバッグインタフェース(以下デバッグI/F)23、外部バスインタフェース(以下外部バスI/F)24及び周辺回路としての内部RAM25を同一の半導体基板上に有している。また、制御LSI12は、図示していないが、CPUコア21によって動作制御される信号処理回路も有している。   The control LSI 12 includes a CPU core 21, a back trace circuit 22, a debug interface (hereinafter referred to as a debug I / F) 23, an external bus interface (hereinafter referred to as an external bus I / F) 24, and an internal RAM 25 as a peripheral circuit on the same semiconductor substrate. Have. The control LSI 12 also has a signal processing circuit whose operation is controlled by the CPU core 21 (not shown).

CPUコア21、バックトレース回路22、外部バスI/F24及び内部RAM25は内部バス26を介して相互に接続されている。また、CPUコア21とバックトレース回路22は内部バス27を介して接続され、CPUコア21とデバッグI/F23は内部バス28を介して接続されている。   The CPU core 21, the back trace circuit 22, the external bus I / F 24, and the internal RAM 25 are connected to each other via an internal bus 26. The CPU core 21 and the back trace circuit 22 are connected via an internal bus 27, and the CPU core 21 and the debug I / F 23 are connected via an internal bus 28.

外部バスI/F24には外部バス29を介してプログラムメモリ30が接続されている。プログラムメモリ30は、本実施形態では例えばフラッシュメモリで構成され、同メモリ30にはデバッグ対象となるファームウェアがCPUコア21にて実行可能な形態で格納されている。具体的には、C言語等の高級言語にて記述されたファームウェア(プログラム)にコンパイル処理及びリンク処理が施され、CPUコア21が実行することのできる機械語の命令列に変換されて格納されている。   A program memory 30 is connected to the external bus I / F 24 via an external bus 29. In this embodiment, the program memory 30 is configured by a flash memory, for example, and firmware to be debugged is stored in a form that can be executed by the CPU core 21. Specifically, firmware (program) described in a high-level language such as C language is subjected to compile processing and link processing, converted into a machine language instruction sequence that can be executed by the CPU core 21, and stored. ing.

CPUコア21は、ステートマシーン31とプログラムカウンタ32を備えている。ステートマシーン31は、プログラムカウンタ32を利用してプログラムメモリ30に格納されているプログラム(命令)を読み出し、該読み出した命令をデコードする。そして、そのデコード結果に応じた各種の処理をCPUコア21のメモリマップにマッピングされた領域(メモリ空間)をアクセスすることにより実行する。尚、本実施形態において、CPUコア21がアクセスするメモリ空間としては、内部バス26を介して接続される内部RAM25の他、外部バス29を介して接続される図示しない周辺回路等のメモリ空間を含む。   The CPU core 21 includes a state machine 31 and a program counter 32. The state machine 31 reads a program (instruction) stored in the program memory 30 using the program counter 32 and decodes the read instruction. Various processes according to the decoding result are executed by accessing an area (memory space) mapped to the memory map of the CPU core 21. In this embodiment, the memory space accessed by the CPU core 21 includes a memory space such as a peripheral circuit (not shown) connected via the external bus 29 in addition to the internal RAM 25 connected via the internal bus 26. Including.

プログラムカウンタ32には、CPUコア21が現在実行中の命令のアドレス値が記憶される。ステートマシーン31は、このプログラムカウンタ32に従って命令を読み出し、該命令の読み出し毎に同カウンタ32に記憶されるアドレス値をインクリメントする。   The program counter 32 stores the address value of the instruction currently being executed by the CPU core 21. The state machine 31 reads an instruction according to the program counter 32 and increments the address value stored in the counter 32 every time the instruction is read.

バックトレース回路22は、CPUコア21がメモリ空間をアクセスする際に使用する内部バス26を監視し、同CPUコア21が現在どのプログラムを実行しているかをモニタする。そして、バックトレース回路22は、CPUコア21が実行するプログラムに分岐が発生する場合にその分岐元の命令のアドレス値(以下分岐元アドレス値という)を内部バス26を通じてプログラムカウンタ32より取得し、内部レジスタ41(図2)に記憶する。   The back trace circuit 22 monitors the internal bus 26 used when the CPU core 21 accesses the memory space, and monitors which program the CPU core 21 is currently executing. Then, when a branch occurs in the program executed by the CPU core 21, the back trace circuit 22 acquires the address value of the branch source instruction (hereinafter referred to as the branch source address value) from the program counter 32 through the internal bus 26, Store in the internal register 41 (FIG. 2).

図2に示すように、本実施形態の内部レジスタ41は、例えば16個の分岐元アドレス値を記憶することが可能であり、バックトレース回路22により取得された分岐元アドレス値はモニタデータ「MON0」〜「MON15」として分岐発生順にそれぞれ記憶されるようになっている。尚、本実施形態では、分岐元アドレス値は、第1,第2,第3レジスタ「ADRH」,「ADRM」,「ADRL」にそれぞれ8ビットのデータ(計24ビット)として格納されるようになっている。   As shown in FIG. 2, the internal register 41 of the present embodiment can store, for example, 16 branch source address values. The branch source address value acquired by the back trace circuit 22 is the monitor data “MON0”. To MON15 "in the order of branch occurrence. In the present embodiment, the branch source address value is stored as 8-bit data (24 bits in total) in the first, second, and third registers “ADRH”, “ADRM”, and “ADRL”, respectively. It has become.

例えば、バックトレース回路22は、実行中のプログラムに分岐が発生したことを検知すると、図2に示す第1,第2,第3レジスタ「ADRH」,「ADRM」,「ADRL」である「03:0000h」,「03:0001h」,「03:0002h」からなる計24ビットの分岐元アドレス値をモニタデータ「MON0」として記憶する。以後、バックトレース回路22は、プログラムに分岐が発生する毎に分岐元アドレス値をモニタデータ「MON1」,「MON2」…,「MON15」として記憶し、該モニタデータ「MON15」を取り込んだ後は、再度モニタデータ「MON0」,「MON1」…として分岐元アドレス値を記憶する。即ち、バックトレース回路22は、内部レジスタ41がオーバーフローに達した場合は、同レジスタ41に記憶されている最も古い分岐元アドレス値を消去し、新たに取得した分岐元アドレス値を記憶するようになっている。   For example, when the back trace circuit 22 detects that a branch has occurred in the program being executed, the first, second, and third registers “ADRH”, “ADRM”, and “ADRL” shown in FIG. : 0000h ”,“ 03: 0001h ”,“ 03: 0002h ”, a total of 24 bits of branch source address values are stored as monitor data“ MON0 ”. Thereafter, the back trace circuit 22 stores the branch source address value as monitor data “MON1,” “MON2,”... MON15 every time a branch occurs in the program, and after capturing the monitor data “MON15” The branch source address values are stored again as monitor data “MON0”, “MON1”. That is, when the internal register 41 reaches the overflow, the back trace circuit 22 erases the oldest branch source address value stored in the register 41 and stores the newly acquired branch source address value. It has become.

このバックトレース回路22には、図3に示すように、CPUコア21の命令セットのうち、バックトレース回路22がモニタする(分岐元アドレス値を記憶する)分岐命令の種類を予め設定した条件設定レジスタ51が備えられている。尚、分岐命令はプログラム分岐を発生させる命令であって、この分岐命令には、条件分岐命令、無条件分岐命令、コ
ール命令、リターン命令が含まれる。
As shown in FIG. 3, the back trace circuit 22 has a condition setting in which the type of branch instruction monitored by the back trace circuit 22 (stores the branch source address value) in the instruction set of the CPU core 21 is set in advance. A register 51 is provided. The branch instruction is an instruction that causes a program branch, and the branch instruction includes a conditional branch instruction, an unconditional branch instruction, a call instruction, and a return instruction.

例えば、INTEL系CPU80251の場合、図3に示す条件設定レジスタ51には、バックトレース回路22によりモニタする分岐命令の種類として、「AJMP」,「LJMP」,「EJMP」,「JMP」,「REL」,「RET」が設定されている。   For example, in the case of the INTEL CPU 80251, the condition setting register 51 shown in FIG. ”And“ RET ”are set.

ちなみに、本実施形態では、上記のような条件設定レジスタ51の設定によって、具体的には以下の分岐命令が設定されるようになっている。   Incidentally, in the present embodiment, the following branch instruction is specifically set by setting the condition setting register 51 as described above.

「AJMP」…AJMP,ACALL
「LJMP」…LJMP,LCALL
「EJMP」…EJMP,ECALL,ERET,RETI
「JMP」…JMP
「REL」…JB,JBC,JNB,JC,JE,JG,JLE,JNC,JNE,JNZ,JSG,JSGE,JSL,JSLE,JZ,CJNE,DJNZ,SJMP
「RET」…RET
尚、ここで記述する分岐命令の種類は一具体例を示すものであり、この例に限定されるものではない。また、これらの分岐命令の一部に限定してもよい。
"AJMP" ... AJMP, ACALL
"LJMP" ... LJMP, LCALL
"EJMP" ... EJMP, ECALL, ERET, RETI
"JMP" ... JMP
"REL" ... JB, JBC, JNB, JC, JE, JG, JLE, JNC, JNE, JNZ, JSG, JSGE, JSL, JSLE, JZ, CJNE, DJNZ, SJMP
"RET" ... RET
Note that the type of branch instruction described here shows a specific example, and is not limited to this example. Moreover, you may limit to some of these branch instructions.

バックトレース回路22は、上記条件設定レジスタ51に設定されている分岐命令がCPUコア21に読み込まれる場合に、その分岐命令においてプログラム分岐が発生するか否かを内部バス26を通じて監視する。そして、分岐が発生する場合に、その分岐元アドレス値を前記プログラムカウンタ32より取得して内部レジスタ41に記憶するようになっている。   When the branch instruction set in the condition setting register 51 is read into the CPU core 21, the back trace circuit 22 monitors whether or not a program branch occurs in the branch instruction through the internal bus 26. When a branch occurs, the branch source address value is acquired from the program counter 32 and stored in the internal register 41.

このようなバックトレース回路22を備える制御LSI12を用いてデバッグを行う場合、デバッグツール14は、PC13の入力装置(図示略)から入力される開発者(ユーザ)からの指示に基づいて、プログラム上の任意の個所でCPUコア21の動作(プログラムの実行)を中断させる。そして、デバッグツール14は、バックトレース回路22の内部レジスタ41に格納されている分岐元アドレス値を制御LSI12から受信する。具体的には、CPUコア21は、内部レジスタ41に格納されている分岐元アドレス値を内部バス27を介して読み込み、その分岐元アドレス値をデバッグI/F23よりバスケーブル15を介してデバッグツール14に送信する。このとき、本実施形態では、バスケーブル15を2ピンとしているので、シリアルデータが送信されることになる。   When debugging is performed using the control LSI 12 including such a backtrace circuit 22, the debug tool 14 executes a program based on an instruction from a developer (user) input from an input device (not shown) of the PC 13. The operation of the CPU core 21 (execution of the program) is interrupted at any arbitrary position. Then, the debug tool 14 receives the branch source address value stored in the internal register 41 of the backtrace circuit 22 from the control LSI 12. Specifically, the CPU core 21 reads the branch source address value stored in the internal register 41 via the internal bus 27 and reads the branch source address value from the debug I / F 23 via the bus cable 15. 14 to send. At this time, in this embodiment, since the bus cable 15 has two pins, serial data is transmitted.

デバッグツール14は、この制御LSI12から受信した分岐元アドレス値に基づいてプログラムの実行経路を算出し、それをユーザが認識可能なソースレベル(例えばC言語やアセンブラなど)にてPC13の表示装置(図示略)に出力する。これにより、ユーザは、プログラムの動作状態を確認してバグ等の修正を行い、デバッグを進める。   The debug tool 14 calculates an execution path of the program based on the branch source address value received from the control LSI 12, and displays the display device (for example, C language or assembler) of the PC 13 at a source level (for example, C language or assembler). (Not shown). As a result, the user confirms the operating state of the program, corrects bugs, etc., and proceeds with debugging.

以上記述した本実施形態によれば、以下の効果を奏する。   According to this embodiment described above, the following effects are obtained.

(1)バックトレース回路22は、プログラムに分岐が発生する場合に、その分岐元アドレス値を内部バス26を通じてプログラムカウンタ32より取得し、それを内部レジスタ41に記憶する。この構成によれば、CPUコア21をチップ(制御LSI12)内に搭載したまま、バックトレース回路22にてモニタした分岐命令の分岐元アドレス値からプログラムの実行経路をトレースすることができる。これにより、デバッグ作業を効率良く行うことができる。   (1) When a branch occurs in the program, the back trace circuit 22 acquires the branch source address value from the program counter 32 through the internal bus 26 and stores it in the internal register 41. According to this configuration, the execution path of the program can be traced from the branch source address value of the branch instruction monitored by the back trace circuit 22 while the CPU core 21 is mounted in the chip (control LSI 12). Thereby, debugging work can be performed efficiently.

(2)本実施形態では、デバッグツール14の機能を利用してユーザの任意の個所でプログラムを停止させてデバッグを進めることができる。これにより、デバッグ作業を効率良く行うことができる。   (2) In the present embodiment, the function of the debug tool 14 can be used to stop the program at any point of the user and proceed with debugging. Thereby, debugging work can be performed efficiently.

(3)本実施形態では、プログラム内の分岐発生個所をモニタし、制御LSI12から順次シリアルで送信される分岐元アドレス値を元にデバッグを行うようにした。この方法では、クロックバスとデータバスの2本のバスケーブル15によってデバッグを実現することが可能である。このようにデバッグ用端子数を少なくすることで、制御LSI12のチップサイズの増加を抑えつつ、デバッグ作業を効率良く行うことができる。   (3) In the present embodiment, the branch occurrence location in the program is monitored, and debugging is performed based on the branch source address values sequentially transmitted serially from the control LSI 12. In this method, debugging can be realized by two bus cables 15 of a clock bus and a data bus. Thus, by reducing the number of debugging terminals, it is possible to efficiently perform debugging work while suppressing an increase in the chip size of the control LSI 12.

(4)本実施形態では、ユーザは分岐元アドレス値からプログラムの実行経路が推定できるため、従来よりも、デバッグのためのブレイクポイントをプログラムのソースコード中に設定する頻度を少なくできる。このため、ブレイクポイント設定のためのプログラムメモリの書き換え作業等を大幅に削減することができる。   (4) In this embodiment, since the user can estimate the execution path of the program from the branch source address value, the frequency of setting a breakpoint for debugging in the source code of the program can be reduced as compared with the prior art. For this reason, the rewriting work of the program memory for setting a breakpoint can be greatly reduced.

(5)本実施形態では、マイコン等のソフト開発において、CPU(CPUコア21)を搭載したままでソフトウェアデバッグを行うことができる。これにより、ソフト開発効率を向上させて、開発コストの低減を図ることができる。延いては設計期間を短縮してTATの向上を図ることができる。   (5) In this embodiment, in software development such as a microcomputer, software debugging can be performed with the CPU (CPU core 21) mounted. Thereby, software development efficiency can be improved and development cost can be reduced. As a result, the TAT can be improved by shortening the design period.

尚、上記実施形態は、以下のように変更して実施してもよい。   The above embodiment may be modified as follows.

・本実施形態において、制御LSI12(システムLSI)は、内部RAM25を備えるが、チップ内にCPUコア21とともに搭載される周辺回路は本実施形態に限定されない。   In the present embodiment, the control LSI 12 (system LSI) includes the internal RAM 25, but the peripheral circuit mounted together with the CPU core 21 in the chip is not limited to the present embodiment.

・バックトレース回路22の内部レジスタ41の構成は、図2に示す態様に限定されるものではない。即ち、分岐元アドレス値の取得は必ずしも24ビットで行われる必要はない。また、モニタデータとして保持する分岐元アドレス値の数は本実施形態で例述した数に限定されない。   The configuration of the internal register 41 of the back trace circuit 22 is not limited to the mode shown in FIG. That is, the acquisition of the branch source address value is not necessarily performed in 24 bits. Further, the number of branch source address values held as monitor data is not limited to the number exemplified in this embodiment.

・バックトレース回路22の条件設定レジスタ51の構成は、図3に示す態様に限定されるものではない。   The configuration of the condition setting register 51 of the back trace circuit 22 is not limited to the mode shown in FIG.

・本実施形態では、ファームウェアのデバッグを行う場合に適用したが、この適用例に限定されるものではない。   In the present embodiment, the present invention is applied when firmware is debugged. However, the present embodiment is not limited to this application example.

上記実施形態から把握できる技術思想を以下に記載する。
(イ) 前記CPUは、現在実行中の命令のアドレス値を記憶するプログラムカウンタを有しており、
前記バックトレース回路は、
前記プログラムに分岐が発生する場合にその分岐元アドレス値を前記内部バスを通じて前記プログラムカウンタより取得することを特徴とする請求項1乃至3の何れか一項記載のプログラム処理装置。
(ロ) プログラムを実行するCPUと、該CPUがメモリ空間をアクセスする際に使用する内部バスを監視して前記プログラム内の予め指定された分岐命令を1以上モニタし、前記プログラムに分岐が発生する場合にその分岐元アドレス値を記憶するバックトレース回路と、を同一チップ上に有するプログラム処理装置と、
前記プログラム処理装置に接続され、前記バックトレース回路が取込んだ分岐元アドレス値を受信してその分岐元アドレス値から前記プログラムの実行経路を算出するデバッグ装置と
を備えることを特徴とするデバッグシステム。
The technical idea that can be grasped from the above embodiment will be described below.
(B) The CPU has a program counter for storing the address value of the instruction currently being executed,
The back trace circuit is
4. The program processing apparatus according to claim 1, wherein when a branch occurs in the program, the branch source address value is acquired from the program counter through the internal bus. 5.
(B) The CPU executing the program and the internal bus used when the CPU accesses the memory space are monitored to monitor one or more pre-designated branch instructions in the program, and a branch occurs in the program A backtrace circuit that stores the branch source address value when the program processing device is provided on the same chip,
A debugging system connected to the program processing device and receiving a branch source address value taken in by the backtrace circuit and calculating an execution path of the program from the branch source address value .

一実施の形態のデバッグシステムの概略構成を示すブロック図である。1 is a block diagram illustrating a schematic configuration of a debugging system according to an embodiment. FIG. バックトレース回路の内部レジスタを示す説明図である。It is explanatory drawing which shows the internal register of a back trace circuit. バックトレース回路の条件設定レジスタを示す説明図である。It is explanatory drawing which shows the condition setting register | resistor of a back trace circuit.

符号の説明Explanation of symbols

12:プログラム処理装置としての制御LSI、13:デバッグ装置としてのパーソナルコンピュータ(PC)、21:CPUとしてのCPUコア、22:バックトレース回路、25:周辺回路としての内部RAM、26:内部バス、41:内部レジスタ、51:条件設定レジスタ。   12: Control LSI as program processing device, 13: Personal computer (PC) as debug device, 21: CPU core as CPU, 22: Back trace circuit, 25: Internal RAM as peripheral circuit, 26: Internal bus, 41: Internal register, 51: Condition setting register.

Claims (3)

プログラムを実行するCPUと、
前記CPUと同一の半導体基板上に集積された前記CPUがメモリ空間をアクセスする際に使用する内部バスと、
前記内部バスを監視して前記プログラム内の予め指定された分岐命令を1以上モニタし、前記プログラムに分岐が発生する場合にその分岐元アドレス値を記憶するバックトレース回路と、
を備えることを特徴とするプログラム処理装置。
A CPU for executing the program;
An internal bus used when the CPU integrated on the same semiconductor substrate as the CPU accesses the memory space;
A back trace circuit that monitors the internal bus and monitors one or more pre-designated branch instructions in the program, and stores a branch source address value when a branch occurs in the program;
A program processing apparatus comprising:
プログラムを実行するCPUと、
前記CPUと同一の半導体基板上に集積された前記CPUがメモリ空間をアクセスする際に使用する内部バスと、
前記内部バスを監視して前記プログラム内の予め指定された分岐命令を複数モニタし、前記プログラムに分岐が発生する場合にその分岐元アドレス値を記憶するバックトレース回路と、を備え、
前記バックトレース回路には、複数の分岐元アドレス値を分岐発生順に保持する内部レジスタが備えられていることを特徴とするプログラム処理装置。
A CPU for executing the program;
An internal bus used when the CPU integrated on the same semiconductor substrate as the CPU accesses the memory space;
A backtrace circuit that monitors the internal bus and monitors a plurality of pre-designated branch instructions in the program, and stores the branch source address value when a branch occurs in the program, and
The back trace circuit includes an internal register for holding a plurality of branch source address values in the order of branch generation.
前記バックトレース回路には、
モニタする分岐命令の種類を予め設定した条件設定レジスタが備えられていることを特徴とする請求項1又は2記載のプログラム処理装置。
The back trace circuit includes
3. The program processing apparatus according to claim 1, further comprising a condition setting register in which a type of branch instruction to be monitored is set in advance.
JP2003297458A 2003-08-21 2003-08-21 Program processing apparatus Pending JP2005070951A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003297458A JP2005070951A (en) 2003-08-21 2003-08-21 Program processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003297458A JP2005070951A (en) 2003-08-21 2003-08-21 Program processing apparatus

Publications (1)

Publication Number Publication Date
JP2005070951A true JP2005070951A (en) 2005-03-17

Family

ID=34403306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003297458A Pending JP2005070951A (en) 2003-08-21 2003-08-21 Program processing apparatus

Country Status (1)

Country Link
JP (1) JP2005070951A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012160200A (en) * 2006-05-30 2012-08-23 Arm Ltd Reducing size of data stream produced during instruction tracing
WO2016206489A1 (en) * 2015-06-25 2016-12-29 深圳市中兴微电子技术有限公司 Method and device for realizing snapshot function of micro-engine processing packet intermediate data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012160200A (en) * 2006-05-30 2012-08-23 Arm Ltd Reducing size of data stream produced during instruction tracing
JP2014220003A (en) * 2006-05-30 2014-11-20 エイアールエム リミテッド Reducing size of data stream produced during instruction tracing
WO2016206489A1 (en) * 2015-06-25 2016-12-29 深圳市中兴微电子技术有限公司 Method and device for realizing snapshot function of micro-engine processing packet intermediate data
US11010277B2 (en) 2015-06-25 2021-05-18 Sanechips Technology Co., Ltd. Method and device for realizing snapshot function of micro-engine processing packet intermediate data

Similar Documents

Publication Publication Date Title
EP0762276B1 (en) Data processor with built-in emulation circuit
US6145123A (en) Trace on/off with breakpoint register
US6662314B1 (en) Microcomputer including program for rewriting data in an internal flash memory
JP4190114B2 (en) Microcomputer
US20120278791A1 (en) Utilizing temporal assertions in a debugger
US6175913B1 (en) Data processing unit with debug capabilities using a memory protection unit
JP2005070949A (en) Program processing apparatus
US20160299859A1 (en) Apparatus and method for external access to core resources of a processor, semiconductor systems development tool comprising the apparatus, and computer program product and non-transitory computer-readable storage medium associated with the method
JP2001154876A (en) Microcomputer debug architecture and method
US9176821B2 (en) Watchpoint support system for functional simulator
US7203819B2 (en) Program processing device
US8707267B1 (en) Debugging a computer program by interrupting program execution in response to access of unused I/O port
WO2008024701A2 (en) System and method for testing software code for use on a target processor
WO2006008721A2 (en) Emulation and debug interfaces for testing an integrated circuit with an asynchronous microcontroller
JP2005070951A (en) Program processing apparatus
CN103136063A (en) Debugging method and related computer system
CN109902001B (en) Method for detecting uninitialized variable and terminal equipment
US20020188813A1 (en) On-chip hardware breakpoint generator with comprehensive memory operation detection
CN115617657A (en) Method, system, equipment and medium for realizing system start debugging based on GPIO (general purpose input/output) signal
CN100533401C (en) Emulation and debug interfaces for testing an integrated circuit with an asynchronous microcontroller
KR100952762B1 (en) Real time debugging method of digital signal processor
JPS62197831A (en) Data processor
CN112948241B (en) Anti-debugging method and device for application program, electronic equipment and storage medium
JP2004038464A (en) Microcomputer with built-in debugging function
JP2009258857A (en) Debugging device and debugging method

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20051226

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080108

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080513