CN101777021B - Implementing device for precise data breakpoint in microprocessor and method thereof - Google Patents

Implementing device for precise data breakpoint in microprocessor and method thereof Download PDF

Info

Publication number
CN101777021B
CN101777021B CN2010100344646A CN201010034464A CN101777021B CN 101777021 B CN101777021 B CN 101777021B CN 2010100344646 A CN2010100344646 A CN 2010100344646A CN 201010034464 A CN201010034464 A CN 201010034464A CN 101777021 B CN101777021 B CN 101777021B
Authority
CN
China
Prior art keywords
breakpoint
address
configuration information
information
numerical value
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.)
Active
Application number
CN2010100344646A
Other languages
Chinese (zh)
Other versions
CN101777021A (en
Inventor
汪文祥
李祖松
徐翠萍
郝守青
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.)
Loongson Technology Corp Ltd
Original Assignee
Loongson Technology Corp 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 Loongson Technology Corp Ltd filed Critical Loongson Technology Corp Ltd
Priority to CN2010100344646A priority Critical patent/CN101777021B/en
Publication of CN101777021A publication Critical patent/CN101777021A/en
Application granted granted Critical
Publication of CN101777021B publication Critical patent/CN101777021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an implementing device for precise data breakpoint in microprocessor and a method thereof. The device comprises a breakpoint configuring part, a breakpoint match judging part and a breakpoint triggering part, wherein, the breakpoint configuring part is used for preserving one piece or plural pieces of breakpoint configuring information, the breakpoint match judging part is used for judging whether a memory-reference instruction is matched with the breakpoint configuring information preserved in the breakpoint configuring part and preserving the judgment result in the state domain executed by the memory-reference instruction, and the breakpoint triggering part is used for checking the state domain of the memory-reference instruction, when the judgment result shows match, the normal executing state of the processor is suspended, and the processor enters into debug state. The manages breakpoint configuring information by adopting chart form, thus not only strengthening expansibility of breakpoint configuring capacity, but also causing breakpoint configuring to be more flexible. And precise data breakpoint can be effectively implemented by fine sorting breakpoint match success state and quasi breakpoint match success state under the condition that the processor flow line is hardly altered.

Description

The implement device of precise data breakpoint and method thereof in the microprocessor
Technical field
The invention belongs to the microprocessor technology field, the implement device and the method thereof of data breakpoint in particularly a kind of microprocessor.
Background technology
Along with the scale of the software systems on the computing machine enlarges day by day, the development difficulty of software systems also increases greatly, and software debugging work is as the important ring in the software development process, and the lifting of its efficient becomes the major issue that computer system development is paid close attention to.Can promote the efficient of software debugging work at bottom of computer system hardware greatly to the support that software debugging provided, so modern processors hardware all gives special support to software debugging.The EJTAG debugging interface of the JTAG debugging interface of arm processor, MIPS processor for example.Through these interfaces, software can directly be controlled bottom hardware and carry out such as functions such as single step execution, instruction breakpoint, data breakpoints.
For the data breakpoint function, address and data that the software debugging personnel will be to be observed are informed processor, and processor is monitored all data access operation automatically.When the address of finding accessing operation was identical with address to be observed, then processor stopped normal execution, got into debugging mode, transferred to software and did further processing.Under situation about having, the observed data breakpoint will see not only whether the address of visit matees, and will see also whether the data of visit are data to be observed.Software behind the completion associative processor, returns the processor setting to normal execution pattern and continues to carry out under debugging mode.Usually software hopes that hardware provides the function of accurate breakpoint.
So-called accurate breakpoint is a finger processor when returning normal mode by debugging mode, turns back in that instruction of report breakpoint coupling.But in the processor of having realized out of order scheduling, accurate breakpoint can make design complexities promote because the result of peek operation return be used to judge whether breakpoint matees in, the instruction that is positioned at after this instruction possibly carried out.In order to realize precise data breakpoint in this case; Common technical scheme is all instructions all to be arranged into instruction to the modification of processor state carry out after submitting to; The cost of making like this is to need a large amount of storage resources of cost to be used to deposit the modification information of all instructions to processor state; Particularly, need to preserve more related content for access instruction.Therefore, existing technical deficiency causes designing more the simple and high-efficient device and realizes the precise data breakpoint in the microprocessor.
Summary of the invention
The implement device and the method thereof that the purpose of this invention is to provide precise data breakpoint in a kind of microprocessor when guaranteeing that processor pipeline basic structure is constant, have realized the precise data breakpoint in the processor with the simple and high-efficient mode.
For realizing above-mentioned purpose, the present invention adopts following technical scheme:
The implement device of precise data breakpoint in a kind of microprocessor comprises:
The breakpoint arrangement components is used to preserve one or more breakpoint configuration information;
Breakpoint coupling judging part is used for judging that whether access instruction is complementary with the breakpoint configuration information that said breakpoint arrangement components is preserved, and result of determination is stored in the status field that access instruction carries out;
The breakpoint trigger parts are used to check the status field of access instruction, when result of determination during for coupling, suspend the normal execution mode of processor, get into debugging mode.
Further, the said breakpoint configuration information in the said breakpoint arrangement components is organized into the breakpoint configuration information table with the form of complete association look-up table, breakpoint configuration information of each of this table correspondence.
Further, every said breakpoint configuration information comprises a breakpoint content information and a breakpoint control information, wherein:
Said breakpoint content information is used to preserve the information of waiting to observe breakpoint, and it comprises:
One data access address territory is used to deposit the address of waiting to observe breakpoint;
One address mask territory, the address of corresponding visit is used to represent whether the corresponding address position participates in the breakpoint matching ratio;
One data access numerical value territory is used to deposit the numerical value of waiting to observe breakpoint;
One numerical value mask field, the numerical value of corresponding visit is used to represent whether the value corresponding position participates in the breakpoint matching ratio;
Said breakpoint control information is used to control the breakpoint matching process, and it comprises:
One enables control domain, is used to control the breakpoint configuration information and whether participates in the breakpoint matching ratio;
One match pattern territory, being used to control breakpoint coupling manner of comparison is only matching ratio to be carried out in the address or to address and numerical value to carry out matching ratio simultaneously;
One address pattern territory is used to identify the corresponding virtual address or the physical address of waiting to observe visit of address information of this breakpoint configuration information.
The present invention also provides the implementation method of precise data breakpoint in a kind of microprocessor, may further comprise the steps successively:
A, breakpoint configuration step are used to preserve one or more breakpoint configuration information;
B, breakpoint coupling determination step are used to judge whether access instruction is complementary with said breakpoint configuration information, and result of determination are stored in the status field of access instruction execution;
C, breakpoint trigger step are used to check the status field of access instruction, when result of determination during for coupling, suspend the normal execution mode of processor, get into debugging mode.
Further, the said breakpoint configuration information in the said steps A is organized into the breakpoint configuration information table with the form of complete association look-up table, breakpoint configuration information of each of this table correspondence.
Further, every said breakpoint configuration information comprises a breakpoint content information and a breakpoint control information, wherein:
Said breakpoint content information is used to preserve the information of waiting to observe breakpoint, and it comprises:
One data access address territory is used to deposit the address of waiting to observe breakpoint;
One address mask territory, the address of corresponding visit is used to represent whether the corresponding address position participates in the breakpoint matching ratio;
One data access numerical value territory is used to deposit the numerical value of waiting to observe breakpoint;
One numerical value mask field, the numerical value of corresponding visit is used to represent whether the value corresponding position participates in the breakpoint matching ratio;
Said breakpoint control information is used to control the breakpoint matching process, and it comprises:
One enables control domain, is used to control the breakpoint configuration information and whether participates in the breakpoint matching ratio;
One match pattern territory, being used to control breakpoint coupling manner of comparison is only matching ratio to be carried out in the address or to address and numerical value to carry out matching ratio simultaneously;
One address pattern territory is used to identify the corresponding virtual address or the physical address of waiting to observe visit of address information of this breakpoint configuration information.
Further, the said breakpoint configuration information of steps A is through hardware curing mode or the typing of software arrangements mode;
Said software arrangements mode comprises memory-mapped and special register read-write dual mode, wherein:
Said memory-mapped mode does, processor is marked as the breakpoint configure dedicated with a good address area of predefined, and the visit to this address area subsequently corresponds to the breakpoint configuration information table;
Said special register mode comprises: directly the breakpoint configuration information table is stored in some appointment special registers and specifies special register as read-write interface the processor storage inside to be operated with utilizing;
Said utilization is specified special register as read-write interface the processor storage inside to be operated and is specially; Each territory in the said breakpoint configuration information table is equipped with a unique addressing; To be converted into read-write to the read-write in each territory to one section continuous space particular address; Definition address interface register and data-interface register carry out read and write access through it to above-mentioned specific continuation address space.
Further; Among the said step B; For the access instruction that each bar in the processor is carried out, the address information that it is contained, numerical information be respectively with obtaining first result after each item corresponding address mask, the effect of numerical value mask in the breakpoint configuration information table, and the address information of each item, numerical information obtain second result respectively with after each item corresponding address mask, the effect of numerical value mask; Compare first result and second result; If two results are consistent, then breakpoint of this access instruction coupling is saved in the result who judges in the status field of access instruction execution.
Further, the matching ratio of every access instruction is accomplished in a clock period.
Further, in said step B, for the peek operation; Judgement is mated in address to its operation, if the address is consistent, then this load instruction is marked as " accurate breakpoint matees successfully " state; When the numerical value of peek operation returns, carry out values match and judge, if numerical value is consistent; Then the command status of this peek operation changes " breakpoint matees successfully " into, otherwise cancels " accurate breakpoint matees successfully " state of this load instruction, should continue to carry out by the peek operational order.
Further, the said step C point of interruption triggers the priority that the priority of handling is lower than exception triggering in the processor.
The present invention has the following advantages:
1, the present invention adopts the format management breakpoint configuration information of table, not only increases the extendability of breakpoint configuration capacity, also makes the breakpoint configuration more become flexible.
2, through " breakpoint matees successfully " state and " accurate breakpoint matees successfully " state of segmentation,, effectively realize precise data breakpoint processor pipeline being done under the situation of little change.
Below in conjunction with accompanying drawing and embodiment the present invention is done and to describe in further detail.
Description of drawings
Fig. 1 is the implement device example structure synoptic diagram of precise data breakpoint in the microprocessor of the present invention;
Fig. 2 is the implementation method embodiment process flow diagram of precise data breakpoint in the microprocessor of the present invention.
Embodiment
Embodiment one
As shown in Figure 1, the implement device of precise data breakpoint in a kind of microprocessor comprises:
Breakpoint arrangement components 1 is used to preserve one or more breakpoint configuration information;
Breakpoint coupling judging part 2 is used for judging that whether access instruction is complementary with the breakpoint configuration information that said breakpoint arrangement components 1 is preserved, and result of determination is stored in the status field that access instruction carries out;
Breakpoint trigger parts 3 are used to check the status field of access instruction, when result of determination during for coupling, suspend the normal execution mode of processor, get into debugging mode.
Wherein, in breakpoint arrangement components 1, said breakpoint configuration information is organized into the breakpoint configuration information table with the form of complete association look-up table.Breakpoint configuration information of each of this table correspondence, every said breakpoint configuration information comprises a breakpoint content information 11 and a breakpoint control information 12.Wherein, said breakpoint content information 11 is used to preserve the information of waiting to observe breakpoint, its preservation be the content of describing the breakpoint speciality, the content information of breakpoint described in the present embodiment 11 comprises:
One data access address territory is used to deposit the address of waiting to observe breakpoint, and this address promptly can be virtual address used in the program, also can be the used physical address of hardware;
One address mask territory, the address of corresponding visit is used to represent whether the corresponding address position participates in the breakpoint matching ratio;
One data access numerical value territory is used to deposit the numerical value of waiting to observe breakpoint;
One numerical value mask field, the numerical value of corresponding visit is used to represent whether the value corresponding position participates in the breakpoint matching ratio;
The big I in above-mentioned four territories is set as required, is 32 bits in the present embodiment.The mask of said address mask territory and numerical value mask field for the corresponding position of bit 0 presentation address or numerical value carry out the breakpoint matching ratio than the time do not participate in comparison, promptly this position both can be regarded as bit 0 and also can be regarded as bit 1; Mask for the corresponding position of bit 1 presentation address or numerical value when carrying out the breakpoint coupling, must with the breakpoint configuration information in deposit wait observe corresponding of address or numerical value to compare.Through this implementation, a breakpoint configuration information can be represented a series of relative addresses and numerical value, and can effectively promote the storage efficiency of breakpoint configuration information table through this simple data compression mode.
Said breakpoint control information 12 is used to control the breakpoint matching process, specifically comprises in the present embodiment:
One enables control domain; Be used to control the breakpoint configuration information and whether participate in the breakpoint matching ratio; Whether promptly control this breakpoint configuration information and be regarded as effectively, this territory in the present embodiment, be that this breakpoint configuration information participation breakpoint matching ratio function is closed in 0 expression if being changed to 1 this breakpoint information of expression and participating in the breakpoint matching ratio; And only will enable control domain and be changed to closed condition; Be 0 o'clock, the content information in every breakpoint configuration information still can be kept in the table, until explicit next time it is made amendment;
One match pattern territory is used to control breakpoint coupling manner of comparison, promptly is only matching ratio to be carried out in the address or to address and numerical value to carry out matching ratio simultaneously; In the present embodiment of said match pattern territory this territory be changed to 0 the expression only matching ratio is carried out in the address, be 1 the expression matching ratio is carried out simultaneously in address and numerical value;
One address pattern territory is used to identify the corresponding virtual address or the physical address of waiting to observe visit of address information of this breakpoint configuration information, and what this territory was changed to that 1 expression deposited in the present embodiment is physical address, and what be that 0 expression deposited is the virtual address.
Breakpoint configuration information described in the present embodiment can be entered in the processor through hardware curing and software arrangements dual mode.
Wherein, Said hardware curing mode is specially; After powering on, be filled into automatically in the breakpoint configuration information table of breakpoint arrangement components 1 by hardware at every turn; Here the breakpoint configuration information that solidifies can be any appointment, and the control domain that enables of all in the present embodiment breakpoint configuration informations all is set to 0, promptly closes the breakpoint matching ratio.
Wherein, said software arrangements mode specifically comprises memory-mapped and special register read-write dual mode, and the software arrangements mode can guarantee user's real-time new desire observation breakpoint of adding in concrete debug process, and control enables or closes each breakpoint matching ratio.
Wherein, said memory-mapped mode is specially, and processor is marked as the breakpoint configure dedicated with a good address area of predefined, and like this, the visit to this address area subsequently promptly directly corresponds to the breakpoint configuration information table.
Wherein, said special register mode can further be divided into directly again the breakpoint configuration information table is stored in some appointment special registers, and utilizes and specify special register as read-write interface the processor storage inside to be operated this two kinds of different modes.Adopt a kind of mode in back in the present embodiment; Said utilization is specified special register as read-write interface the processor storage inside to be operated and is specially; Each territory in the said breakpoint configuration information table is equipped with a unique addressing; To be converted into the read-write to one section continuous space particular address to the read-write in each territory, definition address interface register and data-interface register carry out read and write access through it to above-mentioned specific continuation address space.With the write operation is example; Program at first is written to the address in territory to be visited in the said address interface register; Subsequently the data of desiring to write are written in the said data-interface register, breakpoint arrangement components 1 will be according to the content of specified domain in the information updating breakpoint information table in these two registers subsequently.Read operation process and write operation are similar, and program at first is written to the address in territory to be visited in the address interface register, and reading of data interface register subsequently can return the content of specified domain in the breakpoint information table of desire visit.
Said breakpoint coupling judging part 2 marks the access instruction that matches according to the breakpoint configuration information in the breakpoint arrangement components 1.Specifically; Access instruction for each bar execution in the processor; The address information that it is contained, numerical information be respectively with obtaining first result after each item corresponding address mask, the effect of numerical value mask in the breakpoint configuration information table, and the address information of each item, numerical information obtain second result respectively with after each item corresponding address mask, the effect of numerical value mask, relatively first result and second result; If two results are consistent, then this access instruction is mated a breakpoint.Because every access instruction all must be with all enable effectively to compare one by one in the breakpoint configuration information table, for reducing the delay expense of searching comparison as far as possible, relatively being set in a clock period of all accomplished.The result that said breakpoint coupling judging part 2 will be judged is saved in the status field of access instruction execution, follows this instruction to enter into follow-up pipelining-stage, until arriving breakpoint trigger parts 3.The breakpoint result of determination that breakpoint coupling judging part 2 is deposited in is a kind of as the state of execution process instruction record, and other state that deposits the status field in the and instruction implementation in is independent of each other.
The parts 3 of breakpoint trigger described in the present embodiment are in the presentation stage of every instruction; The breakpoint matching result of inspection instruction; If the success of breakpoint matching result, then breakpoint trigger parts 3 empty streamline immediately, trigger the influence of processor inside for breakpoint; Make processor be absorbed in debugging mode, get into debugging and handle routine.Breakpoint trigger parts 3 processing priority are lower than the trigger unit that makes an exception in the processor, in the time of successful as if an access instruction breakpoint coupling, also are labeled other exception, and the trigger unit that makes an exception so will preferentially be handled.
Embodiment two
As shown in Figure 2, the implementation method of precise data breakpoint in a kind of microprocessor, the implement device of precise data breakpoint in the employing embodiment one described microprocessor may further comprise the steps successively:
A, breakpoint configuration step 10 are used to preserve one or more breakpoint configuration information;
B, breakpoint coupling determination step 20 are used to judge whether access instruction is complementary with said breakpoint configuration information, and result of determination are stored in the status field of access instruction execution;
C, breakpoint trigger step 30 are used to check the status field of access instruction, when result of determination during for coupling, suspend the normal execution mode of processor, get into debugging mode.
Said breakpoint configuration information in the said steps A is organized into the breakpoint configuration information table with the form of complete association look-up table, breakpoint configuration information of each of this table correspondence.
Wherein, every said breakpoint configuration information comprises a breakpoint content information 11 and a breakpoint control information 12, wherein:
Said breakpoint content information 11 is used to preserve the information of waiting to observe breakpoint, and it comprises:
One data access address territory is used to deposit the address of waiting to observe breakpoint;
One address mask territory, the address of corresponding visit is used to represent whether the corresponding address position participates in the breakpoint matching ratio;
One data access numerical value territory is used to deposit the numerical value of waiting to observe breakpoint;
One numerical value mask field, the numerical value of corresponding visit is used to represent whether the value corresponding position participates in the breakpoint matching ratio;
Said breakpoint control information 12 is used to control the breakpoint matching process, and it comprises:
One enables control domain, is used to control the breakpoint configuration information and whether participates in the breakpoint matching ratio;
One match pattern territory, being used to control breakpoint coupling manner of comparison is only matching ratio to be carried out in the address or to address and numerical value to carry out matching ratio simultaneously;
One address pattern territory is used to identify the corresponding virtual address or the physical address of waiting to observe visit of address information of this breakpoint configuration information.
The said breakpoint configuration information of steps A is through hardware curing mode or the typing of software arrangements mode;
Wherein, said hardware curing mode is specially, and after powering on, is inserted automatically in the breakpoint configuration information table by hardware at every turn.
Said software arrangements mode comprises memory-mapped and special register read-write dual mode, wherein:
Said memory-mapped mode does, processor is marked as the breakpoint configure dedicated with a good address area of predefined, and the visit to this address area subsequently corresponds to the breakpoint configuration information table;
Said special register mode comprises: directly the breakpoint configuration information table is stored in some appointment special registers and specifies special register as read-write interface the processor storage inside to be operated with utilizing;
Said utilization is specified special register as read-write interface the processor storage inside to be operated and is specially; Each territory in the said breakpoint configuration information table is equipped with a unique addressing; To be converted into read-write to the read-write in each territory to one section continuous space particular address; Definition address interface register and data-interface register carry out read and write access through it to above-mentioned specific continuation address space.
Among the said step B; Access instruction for each bar execution in the processor; The address information that it is contained, numerical information are respectively with obtaining first result after each item corresponding address mask, the effect of numerical value mask in the breakpoint configuration information table; And the address information of each item, numerical information obtain second result respectively with after each item corresponding address mask, the effect of numerical value mask, compare first result and second result, if two results are consistent; Then breakpoint of this access instruction coupling is saved in the result who judges in the status field of access instruction execution.
Wherein, the matching ratio of every access instruction is accomplished in a clock period.
In said step B,, judgement is mated in the address of its operation for the peek operation; If the address is consistent, then this load instruction is marked as " accurate breakpoint matees successfully " state, when the numerical value of peek operation returns; Carry out values match and judge, if numerical value is consistent, then the command status of this peek operation changes " breakpoint matees successfully " into; Otherwise cancel " accurate breakpoint matees successfully " state of this load instruction, should continue to carry out by the peek operational order.
Wherein, the said step C point of interruption triggers the priority that the priority of handling is lower than exception triggering in the processor.
Lift three concrete examples of implementation below, the example of the breakpoint coupling of the configuration through data breakpoint information, the breakpoint coupling of number storage order and load instruction specifies the data breakpoint that the present invention mentions and realizes.
Example 1, in processor through two data breakpoints of software arrangements:
First: observe address and data simultaneously, the address: 0x00401280 is the virtual address; Data: 0x0, address and data mask are 0xffffffff;
Second: only observe the address, the address: 0x0047ff80, be the virtual address, address mask is 0xffffff80.
These two data breakpoints are deposited in first and second of breakpoint configuration information table in when configuration.For first page or leaf speech, its data access address territory, address mask territory, data access numerical value territory and numerical value mask field, address pattern territory, match pattern territory and enable this seven territories from 0 to 6 addressing successively of control domain.Seven territories from 7 to 13 addressings successively of second.
Address field with first is written as example; Earlier the address interface special register is write 0; The address that is about to first data access address territory writes; Subsequently data interface special register is write 0x00401280, first of the breakpoint configuration information table data access address territory promptly is set to 0x00401280 like this.Repeating such process all is provided with until first and second and finishes.
Example 2, suppose to have in the breakpoint configuration information table three contents:
First: the address: 0x00400100 is the virtual address; Address mask: 0xffffffff; Numerical value: 0x64; Numerical value mask: 0xffffffff; Match pattern: address date is all observed, and enables to close;
Second: the address: 0x00400200 is the virtual address; Address mask; 0xffffffff; Numerical value: 0x7c; Numerical value mask: 0xffffffff, address date is all observed, and enables to open;
Second: the address: 0x00400210 is the virtual address; Address mask: 0xffffffff; Numerical value: 0x1; Numerical value mask: 0xffffffff, address date is all observed, and enables to open.
, a number storage order, its visit virtual address is 0x00400200, and physical address is 0x0008d200, and data to be deposited are 0x7c.This instruction when memory access is carried out, its reference address with deposit data in and mate judging part 2 via breakpoint and judge.At first, only need second and the 3rd of inspection breakpoint configuration information table, check that further match pattern territory and address pattern territory learn that these two all need while compare address and numerical value according to enabling control information.With the virtual address of this access instruction and numerical value and second, the 3rd corresponding address mask and data mask by turn with after; Simultaneously with second with the 3rd address mask and data mask and the address of self preserving and numerical value also carry out by turn with, the result after two parts processing is compared.Comparative result and second are complementary.Therefore judge that this access instruction hits second in the breakpoint configuration information table, the information of breakpoint being hit and hitting second is deposited in the status field of this instruction.This number storage order does not produce the operation implementation effect, from the memory access parts, withdraws from.When treating that this number storage order is submitted to, breakpoint trigger parts 3 are checked the status field of this instruction, learn this instruction hit breakpoint, therefore empty streamline immediately, and notification processor gets into debugging mode, let instruction fetching component handle the routine inlet from debugging and begin to get finger.
Content in example 3, the breakpoint configuration information table is with example 2.
Suppose to have a load instruction, its visit virtual address is 0x00400210, and physical address is 0x0008d210.Do not hit in high-speed cache (Cache) in this load instruction; Before its result returns from internal memory; Breakpoint coupling judging part 2 adopts the decision method in the example 2 to judge earlier according to this instruction address, can get the result and be the 3rd matching addresses in address and the breakpoint configuration information table.Therefore breakpoint coupling judging part 3 is changed to this load instruction " accurate breakpoint hits " state earlier.This instruction results returns from internal memory, and its value is 0x78.Breakpoint coupling judging part 2 compares the 3rd data in this numerical value and the breakpoint configuration information table, finds inconsistent, " the accurate breakpoint hits " state of therefore cancelling this load instruction, this instruction continues normally execution.
What should explain at last is: above embodiment is the unrestricted technical scheme of the present invention in order to explanation only; Although the present invention is specified with reference to the foregoing description; Those of ordinary skill in the art is to be understood that: still can make amendment or be equal to replacement the present invention; And replace any modification or the part that do not break away from the spirit and scope of the present invention, and it all should be encompassed in the claim scope of the present invention.

Claims (10)

1. the implement device of precise data breakpoint in the microprocessor is characterized in that comprising:
Breakpoint arrangement components (1) is used to preserve one or more breakpoint configuration information;
Breakpoint coupling judging part (2) is used for judging that whether access instruction is complementary with the breakpoint configuration information that said breakpoint arrangement components (1) is preserved, and result of determination is stored in the status field of access instruction execution;
Particularly; Access instruction for each bar execution in the processor; The address information that it is contained, numerical information are respectively with obtaining first result after each item corresponding address mask, the effect of numerical value mask in the breakpoint configuration information table; And the address information of each item, numerical information obtain second result respectively with after each item corresponding address mask, the effect of numerical value mask, compare first result and second result, if two results are consistent; Then breakpoint of this access instruction coupling is saved in the result who judges in the status field of access instruction execution;
Breakpoint trigger parts (3) are used to check the status field of access instruction, when result of determination during for coupling, suspend the normal execution mode of processor, get into debugging mode.
2. the implement device of precise data breakpoint in the microprocessor according to claim 1 is characterized in that:
Said breakpoint configuration information in the said breakpoint arrangement components (1) is organized into the breakpoint configuration information table with the form of complete association look-up table, breakpoint configuration information of each of this table correspondence.
3. the implement device of precise data breakpoint in the microprocessor according to claim 1 and 2 is characterized in that:
Every said breakpoint configuration information comprises a breakpoint content information (11) and a breakpoint control information (12), wherein:
Said breakpoint content information (11) is used to preserve the information of waiting to observe breakpoint, and it comprises:
One data access address territory is used to deposit the address of waiting to observe breakpoint;
One address mask territory, the address of corresponding visit is used to represent whether the corresponding address position participates in the breakpoint matching ratio;
One data access numerical value territory is used to deposit the numerical value of waiting to observe breakpoint;
One numerical value mask field, the numerical value of corresponding visit is used to represent whether the value corresponding position participates in the breakpoint matching ratio;
Said breakpoint control information (12) is used to control the breakpoint matching process, and it comprises:
One enables control domain, is used to control the breakpoint configuration information and whether participates in the breakpoint matching ratio;
One match pattern territory, being used to control breakpoint coupling manner of comparison is only matching ratio to be carried out in the address or to address and numerical value to carry out matching ratio simultaneously;
One address pattern territory is used to identify the corresponding virtual address or the physical address of waiting to observe visit of address information of this breakpoint configuration information.
4. the implementation method of precise data breakpoint in the microprocessor is characterized in that may further comprise the steps successively:
A, breakpoint configuration step (10) are used to preserve one or more breakpoint configuration information;
B, breakpoint coupling determination step (20) are used to judge whether access instruction is complementary with said breakpoint configuration information, and result of determination are stored in the status field of access instruction execution;
Particularly; Access instruction for each bar execution in the processor; The address information that it is contained, numerical information are respectively with obtaining first result after each item corresponding address mask, the effect of numerical value mask in the breakpoint configuration information table; And the address information of each item, numerical information obtain second result respectively with after each item corresponding address mask, the effect of numerical value mask, compare first result and second result, if two results are consistent; Then breakpoint of this access instruction coupling is saved in the result who judges in the status field of access instruction execution;
C, breakpoint trigger step (30) are used to check the status field of access instruction, when result of determination during for coupling, suspend the normal execution mode of processor, get into debugging mode.
5. the implementation method of precise data breakpoint in the microprocessor according to claim 4 is characterized in that:
Said breakpoint configuration information in the said steps A is organized into the breakpoint configuration information table with the form of complete association look-up table, breakpoint configuration information of each of this table correspondence.
6. according to the implementation method of precise data breakpoint in claim 4 or the 5 described microprocessors, it is characterized in that:
Every said breakpoint configuration information comprises a breakpoint content information (11) and a breakpoint control information (12), wherein:
Said breakpoint content information (11) is used to preserve the information of waiting to observe breakpoint, and it comprises:
One data access address territory is used to deposit the address of waiting to observe breakpoint;
One address mask territory, the address of corresponding visit is used to represent whether the corresponding address position participates in the breakpoint matching ratio;
One data access numerical value territory is used to deposit the numerical value of waiting to observe breakpoint;
One numerical value mask field, the numerical value of corresponding visit is used to represent whether the value corresponding position participates in the breakpoint matching ratio;
Said breakpoint control information (12) is used to control the breakpoint matching process, and it comprises:
One enables control domain, is used to control the breakpoint configuration information and whether participates in the breakpoint matching ratio;
One match pattern territory, being used to control breakpoint coupling manner of comparison is only matching ratio to be carried out in the address or to address and numerical value to carry out matching ratio simultaneously;
One address pattern territory is used to identify the corresponding virtual address or the physical address of waiting to observe visit of address information of this breakpoint configuration information.
7. the implementation method of precise data breakpoint in the microprocessor according to claim 6 is characterized in that:
The said breakpoint configuration information of steps A is through hardware curing mode or the typing of software arrangements mode;
Said software arrangements mode comprises memory-mapped and special register read-write dual mode, wherein:
Said memory-mapped mode does, processor is marked as the breakpoint configure dedicated with a good address area of predefined, and the visit to this address area subsequently corresponds to the breakpoint configuration information table;
Said special register mode comprises: directly the breakpoint configuration information table is stored in some appointment special registers and specifies special register as read-write interface the processor storage inside to be operated with utilizing;
Said utilization is specified special register as read-write interface the processor storage inside to be operated and is specially; Each territory in the said breakpoint configuration information table is equipped with a unique addressing; To be converted into read-write to the read-write in each territory to one section continuous space particular address; Definition address interface register and data-interface register carry out read and write access through it to above-mentioned specific continuation address space.
8. the implementation method of precise data breakpoint in the microprocessor according to claim 4 is characterized in that:
The matching ratio of every access instruction is accomplished in a clock period.
9. the implementation method of precise data breakpoint in the microprocessor according to claim 4 is characterized in that:
In said step B,, judgement is mated in the address of its operation for the peek operation; If the address is consistent, then this load instruction is marked as " accurate breakpoint matees successfully " state, when the numerical value of peek operation returns; Carry out values match and judge, if numerical value is consistent, then the command status of this peek operation changes " breakpoint matees successfully " into; Otherwise cancel " accurate breakpoint matees successfully " state of this load instruction, should continue to carry out by the peek operational order.
10. the implementation method of precise data breakpoint in the microprocessor according to claim 4 is characterized in that:
The said step C point of interruption triggers the priority of handling and is lower than the priority that exception triggers in the processor.
CN2010100344646A 2010-01-21 2010-01-21 Implementing device for precise data breakpoint in microprocessor and method thereof Active CN101777021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010100344646A CN101777021B (en) 2010-01-21 2010-01-21 Implementing device for precise data breakpoint in microprocessor and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010100344646A CN101777021B (en) 2010-01-21 2010-01-21 Implementing device for precise data breakpoint in microprocessor and method thereof

Publications (2)

Publication Number Publication Date
CN101777021A CN101777021A (en) 2010-07-14
CN101777021B true CN101777021B (en) 2012-07-04

Family

ID=42513490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010100344646A Active CN101777021B (en) 2010-01-21 2010-01-21 Implementing device for precise data breakpoint in microprocessor and method thereof

Country Status (1)

Country Link
CN (1) CN101777021B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063370B (en) * 2010-12-17 2013-10-16 北京控制工程研究所 Method for extracting actual execution instruction and prefetched instruction from bus instruction flow
CN102117243A (en) * 2010-12-29 2011-07-06 杭州晟元芯片技术有限公司 Method for high efficiently debugging by using software breakpoint in Flash memory
KR20150008447A (en) * 2012-05-07 2015-01-22 마이크로칩 테크놀로지 인코포레이티드 Device having configurable breakpoint based on interrupt status
US10740220B2 (en) * 2018-06-27 2020-08-11 Microsoft Technology Licensing, Llc Cache-based trace replay breakpoints using reserved tag field bits

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5371894A (en) * 1991-05-13 1994-12-06 International Business Machines Corporation Off-chip breakpoint system for a pipelined microprocessor
CN101501650A (en) * 2006-08-09 2009-08-05 高通股份有限公司 Debug circuit comparing processor instruction set operating mode

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5371894A (en) * 1991-05-13 1994-12-06 International Business Machines Corporation Off-chip breakpoint system for a pipelined microprocessor
CN101501650A (en) * 2006-08-09 2009-08-05 高通股份有限公司 Debug circuit comparing processor instruction set operating mode

Also Published As

Publication number Publication date
CN101777021A (en) 2010-07-14

Similar Documents

Publication Publication Date Title
CN105793832B (en) Processor and its operating method and computer readable storage medium
US7840845B2 (en) Method and system for setting a breakpoint
CN105446900B (en) The method of processor and compartment system management mode entry
Johnson Superscalar Processor Design
US7836435B2 (en) Checking for memory access collisions in a multi-processor architecture
TWI431472B (en) Configurable cache for a microprocessor
US20020100020A1 (en) Method for maintaining cache coherency in software in a shared memory system
US20020147965A1 (en) Tracing out-of-order data
CN104221005B (en) For sending a request to the mechanism of accelerator from multithreading
US20090235059A1 (en) Qualification of conditional debug instructions based on address
US20010052053A1 (en) Stream processing unit for a multi-streaming processor
US20050216701A1 (en) Automatic configuration of a microprocessor
US8688910B2 (en) Debug control for snoop operations in a multiprocessor system and method thereof
CN101446918B (en) Method for realizing debugging of single function by user state debugger and system thereof
CN108351830A (en) Hardware device and method for memory damage detection
CN101458725B (en) Microcontroller chip and debug method thereof
GB2329049A (en) A debugger interface unit for identifying selected exceptions
CN109033826B (en) The caching reinforcement means and device of side channel analysis can be resisted
CN101777021B (en) Implementing device for precise data breakpoint in microprocessor and method thereof
US11119925B2 (en) Apparatus and method for managing capability metadata
KR20090096721A (en) Configurable cache for a microprocessor
US8255602B2 (en) Effective mixing real-time software with a non-real-time operating system
CN107003897A (en) Monitor the utilization rate of issued transaction resource
US20080196013A1 (en) System and method for implementing data breakpoints
US9658849B2 (en) Processor simulation environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Patentee after: Loongson Zhongke Technology Co.,Ltd.

Address before: 100080 No. 10 South Road, Haidian District Academy of Sciences, Beijing

Patentee before: LOONGSON TECHNOLOGY Corp.,Ltd.