Program counter trace system, program counter trace method, and semiconductor device
First Claim
1. A program counter trace system which operates a processor and an external debugging tool at a same frequency to perform program counter trace for debugging, wherein the processor includes:
- a trace flag generation unit for holding a program counter value which is outputted from a processor core that executes a program in each operation cycle of the processor, obtaining a difference between a previous program counter value which is held and a present program counter value, and generating on the basis of the difference in each cycle, first and second trace status information indicating that a present status is one of;
a status corresponding to a head of serial data of a program counter value;
a status in which displacement from the previous program counter value is “
0”
;
a status in which displacement from the previous program counter value is “
1”
; and
an error occurrence status indicating that serial data outputting occurs in a period which overlaps an output period of the serial data, and branch information indicating that the program counter value is branched;
a parallel/serial conversion unit for converting a program counter value into serial data only when the branch information generated by the trace flag generation unit indicates a branch status, and outputting the serial data as trace serial data; and
a trace clock generation unit for outputting a trace clock having the same frequency as that of an operation clock for the processor, and the debugging tool receives the trace status information and the trace serial data in synchronization with the trace clock.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention provides a program counter trace system which requires fewer external terminals from a processor to a debugging tool in cases where an external debugger and the processor are operated at the same frequency to perform debugging, and performs PC trace efficiently with a simple structure.
The processor includes a means for generating, on the basis of a difference between a program counter value of the preceding cycle and a present program counter value in each cycle, trace status information indicating one of: a status corresponding to a head of serial data of the program counter value, a status indicating that displacement from the program counter value is “0”, a status indicating that displacement from the program counter value is “1”, and an error occurrence status, and branch information indicating that the program counter value is branched; a means for converting the program counter value into serial data only when the branch information indicates a branch status and outputting the serial data; and a means for outputting a trace clock having the same frequency as that of an operation clock of the processor, and the debugging tool receives the trace status information and the trace serial data in synchronization with the trace clock.
-
Citations
7 Claims
-
1. A program counter trace system which operates a processor and an external debugging tool at a same frequency to perform program counter trace for debugging, wherein
the processor includes: -
a trace flag generation unit for holding a program counter value which is outputted from a processor core that executes a program in each operation cycle of the processor, obtaining a difference between a previous program counter value which is held and a present program counter value, and generating on the basis of the difference in each cycle, first and second trace status information indicating that a present status is one of;
a status corresponding to a head of serial data of a program counter value;
a status in which displacement from the previous program counter value is “
0”
;
a status in which displacement from the previous program counter value is “
1”
; and
an error occurrence status indicating that serial data outputting occurs in a period which overlaps an output period of the serial data, and branch information indicating that the program counter value is branched;
a parallel/serial conversion unit for converting a program counter value into serial data only when the branch information generated by the trace flag generation unit indicates a branch status, and outputting the serial data as trace serial data; and
a trace clock generation unit for outputting a trace clock having the same frequency as that of an operation clock for the processor, and the debugging tool receives the trace status information and the trace serial data in synchronization with the trace clock. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A program counter trace method for operating a processor and an external debugger tool at a same frequency, and performing program counter trace for debugging, in which:
-
the processor holds a program counter value which is outputted from a processor core that executes a program in each operation cycle of the processor, obtains a difference between a previous program counter value that is held and a present program counter value, and generates on the basis of the difference in each cycle, first and second trace status information indicating that a present status is one of;
a status corresponding to a head of serial data of a program counter value;
a status in which displacement from the previous program counter value is “
0”
;
a status in which displacement from the previous program counter value is “
1”
; and
an error occurrence status indicating that serial data outputting occurs in a period that overlaps an output period of the serial data, and branch information indicating that the program counter value is branched;
the processor converts a program counter value into serial data only when the generated branch information indicates a branch status, and outputs the serial data as trace serial data;
the processor outputs a trace clock having the same frequency as that of an operation clock of the processor; and
the debugging tool receives the trace status information and the trace serial data in synchronization with the trace clock.
-
-
7. A semiconductor device which has a processor including a processor core that executes a program, wherein
the processor includes: -
a trace flag generation unit for holding a program counter value which is outputted from the processor core that executes the program in each operation cycle of the processor, obtaining a difference between a previous program counter value that is held and a present program counter value, and generating on the basis of the difference in each cycle, first and second trace status information indicating that a present status is one of;
a status corresponding to a head of serial data of the program counter value;
a status in which displacement from the previous program counter value is “
0”
;
a status in which displacement from the previous program counter value is “
1”
; and
an error occurrence status indicating that serial data outputting occurs in a period that overlaps an output period of the serial data, and branch information indicating that the program counter value is branched;
a parallel/serial conversion unit for converting a program counter value into serial data only when the branch information which is generated by the trace flag generation unit indicates a branch status, and outputting the serial data as trace serial data; and
a trace clock generation unit for outputting a trace clock having the same frequency as that of an operation clock of the processor.
-
Specification