USPatent applicationPatented

Debugging data processing systems

Granted 11 Mar 2003 · 1 office action

Application· this page
9407846
filed 29 Sep 1999
Publication
Not published
not published
Patent
US 6,532,553
granted 11 Mar 2003

Life of the application

8 dated events
⤢ drag to zoom20002002200420062008201020122014201620182020ProsecutionOwnershipTerm & fees
ProsecutionOwnershipTerm & feeshover for detail · click to open

Abstract

A data processing system is provided having a main processor 4 and a coprocessor 26. When in a debug mode, the main processor 4 and the coprocessor 26 are supplied with different instructions. The coprocessor 26 is supplied with a coprocessor debug data generation instruction (MCR) whilst the main processor 4 is supplied with a main processor data capture instruction (LDR). The coprocessor 26 responds to the MCR instruction by controlling debug data representing state of the data processing apparatus 2 to be placed upon a data bus 24 from where it is read by the main processor 4 under control of the LDR instruction.

Description

9 parts
›BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to the field of data processing systems. More particularly, this invention relates to debugging data processing systems.

2. Description of the Prior Art

With the advent of increasingly complex data processing systems, and the requirement for shorter development time, it is becoming increasingly important to provide powerful debugging tools to assist in system development. This is particularly the case in deeply embedded systems in which much of the systems state is normally inaccessible.

One way of dealing with the debugging problem is to provide serial scan chains around portions of the circuits of the system to allow input signals to be scanned in and applied to the circuit and output signals to be captured and scanned out of the circuit. This is the JTAG type of debugging scheme.

A problem with the serial scan chain approach to debugging is that the scan chain cells may need to be placed upon critical signal paths within the system slowing the signal paths and limiting the system performance. It is an object of the invention to address the above problems

›SUMMERY OF THE INVENTION · 1 of 2

Viewed from one aspect the present invention provides data processing apparatus responsive to a sequence of processor instructions containing main processor instructions and coprocessor instructions, said data processing apparatus comprising:

(i) a main processor for executing main processor instructions appearing within said sequence of processor instructions;

(ii) a coprocessor coupled to said main processor for executing coprocessor instructions appearing within said sequence of processor instructions; and

(iii) an instruction insertion mechanism operative in a debugging mode for supplying different processor instructions to said main processor and said coprocessor such that said main processor executes a main processor data capture instruction whilst said coprocessor executes a coprocessor debug data generation instruction whereby debug data is generated under control of said coprocessor and said debug data is captured by said main processor.

In a system having both a coprocessor and a main processor, these different elements may be controlled to cooperate while in a debug mode to recover system state information that would otherwise be difficult to obtain without a disadvantageously extensive use of scan chains. More particularly, whilst the same instruction stream is normally fed to both the main processor and the coprocessor, the invention provides that different instructions may be fed to the main processor and the coprocessor in the debug mode with the main processor being responsive to its instruction to capture debug data that is generated under control of the coprocessor in response to a coprocessor instruction executed at the same time (having been triggered to do so by execution of the main processor instruction).

The coprocessor instruction is decoded and interpreted by the coprocessor in the debug mode in a manner chosen by the system designer and is so potentially able to recover any particular items of system state that the system designer decides in advance and for which the circuitry is provided. The capture of the data by the main processor allows it to be subsequently recovered from the main processor via the normal output mechanisms of the system under control of normal main processor instructions.

In preferred embodiments the main processor data capture instruction transfers the debug data into a register of a register bank within the main processor. This data capture mechanism is both rapid and flexible.

The instruction insertion mechanism could take many forms. The mechanisms that feed the standard instructions to the main processor and the coprocessor when not in debug mode could be used to supply one of the main processor and the coprocessor with instructions during this debug mode with the other of the main processor and the coprocessor being supplied from an alternative source by mechanisms only operative in the debug mode. Alternatively, both the main processor and the coprocessor could be provided with special purpose mechanisms for supplying them with instructions during the debug mode. In this case, scan chains for scanning in instructions to the main processor and the coprocessor are preferred.

The state data generated in response to the coprocessor debug data generation instruction could be transferred to the main processor via a special purpose data path. However, in preferred embodiments the standard data bus that is employed in normal operation may also be employed in debug operation for this purpose.

In order to recover state data from the main processor in the context of a debug operation, a register store scan chain can be provided to capture data being read from a register of the main processor and serially clock that data out from the apparatus.

The above system can be used to recover many types of otherwise inaccessible state data from the data processing system. As an example, it is possible to use this approach to recover data from various peripheral devices if the system designer arranges for the coprocessor debug data generation instructions to be interpreted in that way. However, the invention is particularly well suited to the recovery of data from cache memories and memory management units. In particular, the invention can allow the TAG contents of the CAM and the data contents of the RAM of a cache memory and an MMU to be read relatively rapidly from the system and without impacting the normally critical signal paths between the cache, MMU and main processor by inserting scan chains to capture data values on these paths. The contents of a cache memory or an MMU are often highly significant elements of debug information required during system development.

In high performance systems, the main processor will typically have an instruction pipeline. In this case, the instruction insertion mechanism can comprise a scan chain for inserting an instruction into the fetch stage of this pipeline. In such embodiments the coprocessor typically has a pipeline follower and the coprocessor instructions can similarly be inserted into the fetch stage of this coprocessor pipeline.

In the context of a cache memory or an MMU, the problem of how a particular item of data is to be selected for recovery as debug data may be addressed by using the normal victim select circuitry that in standard operation controls which item is replaced when a new item needs to be inserted in the relevant one of the cache memory or the MMU. In the debug mode this victim selection circuitry can be set up in advance to operate to select a specific desired entry for recovery as the debug data.

Viewed from another aspect the present invention provides a data processing method controlled by a sequence of processor instructions containing main processor instructions and coprocessor instructions, said data processing method comprising the steps of:

(i) executing with a main processor main processor instructions appearing within said sequence of processor instructions;

(ii) executing with a coprocessor coprocessor instructions appearing within said sequence of processor instructions; and

›SUMMERY OF THE INVENTION · 2 of 2

(iii) in a debugging mode, supplying different processor instructions to said main processor and said coprocessor such that said main processor executes a main processor data capture instruction whilst said coprocessor executes a coprocessor debug data generation instruction whereby debug data is generated under control of said coprocessor and said debug data is captured by said main processor.

The above, and other objects, features and advantages of this invention will be apparent from the following detailed description of illustrative embodiments which is to be read in connection with the accompanying drawings.

›BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates a data processing system according to one example embodiment of the present invention; and

FIG. 2 schematically illustrates the operation of the main processor and the coprocessor during debug operation.

›DESCRIPTION OF THE PREFERRED EMBODIMENTS · 1 of 2

FIG. 1 shows a data processing system 2 comprising a main processor 4 and a coprocessor 26 . An instruction cache 8 and a data cache 10 are provided for caching instructions and data respectively. A memory management unit may also be provided.

The main processor includes an instruction executer 12 and a register bank 14 . A main processor pipeline 16 is responsive to main processor instructions read from the instruction bus 18 to feed these to the instruction executer 12 for execution. A main processor instruction scan chain 20 is provided on the instruction path for inserting instructions into the instruction pipeline 16 during debug operation. An output scan chain 22 is provided on the data path for capturing data values read out from the register bank 14 onto a data bus 24 during debug operation.

The coprocessor 26 designated as the special purpose coprocessor CP15 is provided for controlling debug operation as well as other system mode and control functions. A coprocessor instruction pipeline 28 is provided within the coprocessor 26 for following the instructions placed on the instruction bus 18 and fed to the main processor 4 . When the coprocessor 26 detects a coprocessor instruction having its matching coprocessor number (i.e. 15 ) at the execute stage of the coprocessor instruction pipeline 28 , then the coprocessor instruction decoder 30 responds to this coprocessor instruction in the manner predetermined by the system designer. In the present example, when in a debug mode, the coprocessor 26 can be made responsive to specific coprocessor instructions to control the data cache 10 or the instruction cache 8 to output either the contents of their CAM portion or their RAM portion onto the data bus 24 . The respective victim selection circuitry 32 , 34 can be configured in advance to point to a specific cache line that it is desired to be recovered onto the data bus 24 . In a round robin mode of operation of the victim select circuitry a sequence of cache lines can be accessed.

At the same time that the coprocessor 26 is controlling the cache memory 8 , 10 to place debug data onto the data bus 24 , the main processor 4 can be reading that debug data into a register of the register bank 14 . Once captured within the register bank 14 , the debug data can be stored out in a subsequent processing cycle into the output scan chain 22 from where it can be recovered from the data processing apparatus 2 .

The main processor instruction scan chain 20 and a coprocessor instruction scan chain 36 are used to together provide the instruction insertion mechanism. More particularly, an appropriate main processor data capture instruction can be inserted into the main processor pipeline 16 whilst a coprocessor debug data generation instruction can be inserted into the coprocessor instruction pipeline 28 . When these respective instructions have advanced along to the execution stage of their pipeline, they will be executed to perform their respective roles. The advance of the main processor instruction to the execute stage triggers a similar advance of the coprocessor instruction such that the main processor instruction and coprocessor instruction are executed at effectively the same time.

It will be appreciated that the main processor pipeline 16 and the coprocessor pipeline 28 normally store the same instructions as they read these from the instruction bus 18 that they share. The present technique breaks this symmetry and causes different instructions to be presented to the coprocessor 26 and the main processor 4 such that they may cooperate together in a highly flexible manner to first trigger generation of the debug data and also the capture of this debug data.

FIG. 2 schematically illustrates the different processing operations being performed in the main processor core 4 and the coprocessor 26 at different points in time. The first operations that occur are that the main processor data capture instruction (LDR) is scanned into the main processor instruction scan chain 20 whilst the interpreted mode control bit and the coprocessor debug data generation instruction (MCR) are scanned into the coprocessor instruction scan chain 36 . The LDR and MCR instructions then advance in parallel down their respective pipelines 16 , 28 (with advances in the main processor triggering advances in the coprocessor).

When the MCR and the LDR instructions reach the execute stages at effectively the same time, the MCR instruction is interpreted by the coprocessor 26 to trigger appropriate debug data to be placed upon the data bus 24 . The MCR instruction may be interpreted in a different way when not operating in the debug mode. At the same time, the LDR instruction is interpreted by the main processor 4 to read this debug data from the data bus 24 and store it within the register bank 14 .

The main processor 14 then continues to execute a store to memory instruction (STR) that writes the contents of the register containing the debug data back onto the data bus 24 from where they are captured into the output scan chain 22 prior to being scanned out.

In the Annex attached hereto an extract of a document describing debug support is given. This extract deals with interpreted access commands in accordance with one example of the present invention.

Further details of debug operations of integrated circuits in the context of which the present invention may be used can be found in the ARM9TDMI Reference Manual (ARM Document DDI 0145A Chapter 5) which was published in November 1998. Further details of boundary scan systems of a type that may be used with the invention are described in IEEE Standard 1149.1—1990 Standard Test Access Port and Boundary Scan Architecture.

Although illustrative embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various changes and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims.

›DESCRIPTION OF THE PREFERRED EMBODIMENTS · 2 of 2

Annex

Debug support

›PCLKBS

This is the update clock, generated in the UPDATE-DR state. Typically the value scanned into the chain will be transferred to the cell output on the rising edge of this signal.

›ICAPCLKBS, ECAPCLKBS

These are the capture clocks used to sample data into the scan cells during INTEST and EXTEST respectively. These clocks are generated in the CAPTURE-DR state.

SHCLK1BS, SHCLK2BS

These are non-overlapping clocks generated in the SHIFT-DR state that are used to clock the master and slave element of the scan cells respectively. When the state machine is not in the SHIFT-DR state, both these clocks are LOW.

nHIGHZ

This signal can be used to drive the outputs of the scan cells to the high impedance state. This signal is driven LOW when the HIGHZ instruction is loaded into the instruction register, and HIGH at all other times.

In addition to these control outputs, SDINBS output and SDOUTBS input are also provided. When an external scan chain is in use, SDOUTBS should be connected to the serial data output and SDINBS should be connected to the serial data input.

8.6.6 Scan Chains 4 and 15—the ARM920T Memory System

On entry to debug state, the debugger should extract and save the state of CP15. It is advisable that the caches and MMUs are then switched off to prevent any debug accesses to memory from altering their state. At this point, the debugger can non-invasively determine the state of the memory system. When in debug state, the debugger is able to see the state of the ARM920T memory system. This includes:

CP15

caches

›MMU

PA tag AM.

Scan chains 15 and 4 are reserved for this use.

Debug Support

Scan Chain 15

This scan chain is 40 bits long, shown below in Table 8-7. With scan chain 15 selected, TDI is connected to bit 39 and TDO is connected to bit 0. An access via this scan chain allows all of CP15's registers to be read and written, the cache CAM and RAM to be read and the TLB CAM and RAM to be read. There are two mechanisms for accesses via scan chain 15, outlined below.

Physical Access

1. In SHIFT-DR, shift in the read/write bit, register address and register value for writing, shown in Table 8-8.

2. Move through UPDATE-DR. For a write, the register will be updated here.

3. For reading, return to SHIFT-DR through CAPTURE-DR and shift out the register value.

Interpreted Access

1. A physical access read-modify-write in C15 (test state) must be done in order to set bit 0, CP15 interpret

2. The required MCR/MRC instruction word is shifted in to scan chain 15.

3. A system-speed LDR(read) or STR(write) is performed on the ARM9TDMI.

4. CP15 will respond to this LDR/STR by executing the coprocessor instruction in its scan chain.

5. In the case of a LDR, the data will be returned to the A3NM9TDMI and can be captured onto scan chain 1 by performing an STR.

6, In the case of an STR, the interpreted MCR will complete with the data that is issued from the ARM9TDMI.

7. A physical access read-modify-write to C15 (test state) must be done in order to clear CP15 interpret, bit 0.

Debug Support

Debug Access to CP15

The mapping of the 6-bit register address field to the CP15 registers for physical access is shown in in Table 8-8.

The mapping of the 32-bit instruction word field to the remaining CP15 registers for interpreted access is shown in Table 8-9. The construction of a CP15 instruction word from ARM assembler is shown in FIG. 2-1 on page 2-3

Debug Access to the MMU

This is achieved through scan chain 15, using the interpreted access mechanism. The supported subset of MMU debug operations is shown in Table 8-10. In order to read the instruction or data TLB the following sequence must be taken:

Debug Support

1. Read-modify-write of C1 to turn off both caches and MMU.

2. Read-modify-write of C15. State to set MMU test and CP15 interpret

3. Interpreted LDR. MRC=read C10.

4. STR of value loaded in (3), captured on scan chain 1 and shifted out

5. Interpreted STR, <address>=victim [=0], base [=0]. MRC=write C10.

6. Interpreted 8 word LDM. MCR=CAM read.

7. 8 word STM of values loaded in (6), captured on scan chain 1 and shifted out.

8. Repeat (6) and (7)×8.

9. Interpreted LDR. MCR=RAM1 read

10. Interpreted LDR. MCR=RAM2 read

11. 2 word STM of values loaded in (9) and (10), captured on scan chain 1 and shifted out.

12. Repeat (9), (10) and (11)×64.

13. Interpreted STR, <address>=victim and base [=value saved in (4)]. MCR=write C10.

14. Read-modify-write of C15. State to clear MMU test and CP15 interpret.

15. Write C1 with value read in (1).

Debug Access to the Caches

This is achieved through scan chain 15, using the interpreted access mechanism. The supported subset of cache debug operations is shown in Table 8-11 on page 8-34. In order to read the instruction or data cache the following sequence must be taken:

1. Read-modify-write of C1 to turn both caches and MMU off and set round-robin mode.

2. Read-modify-write of C15. State to set CP15 interpret.

3. Interpreted LDR, <address>=seg. MCR=CAM read.

4. Read-modify-write of C15. State to clear CP15 interpret

5. Read C15.C.{I/D}.Ind (victim of current segment).

6. Repeat (2)→(5) for each segment.

7. Read-modify-write of C15. State to set CP15 interpret.

8. Interpreted STR, <address>=index [=0], seg. MCR=write C9 victim.

9. Interpreted 8 word LDM, <address>=seg, word [=0]. MCR =RAM read.

10. Interpreted LDR, <address>=seg. MCR=CAM read

11. Read-modify-write to C15. State to clear CP15 interpret

12. 9 word STM of values loaded in (9) and (10), captured on scan chain 1 and shifted out.

Debug Support

14. Repeat (9)→(13)×64.

15. Repeat (8)→(14) for each segment.

16. Interpreted STR, <address>=index [=value read in (5)], seg. MCR=write C9 victim.

17. Repeat (16) for each segment.

18. Read-modify-write to C15. State to clear CP15 interpret.

19. Write the value of C1 read in (1).

›Tables in the description — 5
TABLE 8 — Scan chain 15 format and access modes Scan
chainInterpreted accessPhysical access
bitFunctionRead/WriteFunctionRead/Write
390WritenR/WWrite
38:33000000WriteRegisterWrite
address
32:1InstructionWriteRegisterRead/Write
wordvalue
00Write1Write
TABLE 8 — Physical access mapping to CP15 registers
AddressRegister
[38][37:34][33]NumberNameType
00 × 00C0ID registerRead
00 × 01C0Cache typeRead
00 × 10C1ControlRead/Write
00 × 90C9Data cacheRead
lock-down
00 × 91C9Instruction cacheRead
lock-down
00 × D0C13Process IDRead/Write
00 × F0C15.StateTest stateRead/Write
10 × D1C15.C.I.IndInstruction cacheRead
index
10 × E1C15.C.D.IndData cache indexRead
10 × 11C15.C.1Instruction cacheRead/Write
10 × 21C15.C.DData cacheRead/Write
10 × 50C15.M.IInstruction MMURead
10 × 60C15.M.DData MMURead
TABLE 8 — Interpreted access mapping to CP15 registers
ARM920T InstructionCP15 Instruction Word
WriteReadWriteReadCP15 Register
STR Rd,<Address>LDR Rd,<Address>MCR p15.5,r0,c15,c1,2MRC p15,5,r0,c15,c1,2I TTB
STR Rd,<Address>LDR Rd,<Address>MCR p15,5,r0,c15,c2,2MRC p15,0,r0,c2,c0,0D TTB
STR Rd,<Address>LDR Rd,<Address>MCR p15,5,r0,c15,c1,3MRC p15,5,r0,c15,c1,3I DAC
STR Rd,<Address>LDR Rd,<Address>MCR p15,5,r0,c15,c2,3MRC p15,0,r0,c3,c0,0D DAC
STR Rd,<Address>LDR Rd,<Address>MCR p15,0,r0,c5,c0,0MRC p15,0,r0,c5,c0,0FSR
STR Rd,<Address>LDR Rd,<Address>MCR p15,0,r0,c6,c0,0MRC p15,0,r0,c5,c0,0FAR
STR Rd,<Address>N/AMCR p15,0,r0,c9,c1,1N/AICache lock-down victim
STR Rd,<Address>N/AMCR p15,0,r0,c9,c1,0N/ADCache lock-down victim
STR Rd,<Address>N/AMCR p15,0,r0,c9,c0,1N/AICache lock-down base and victim
STR Rd,<Address>N/AMCR p15,0,r0,c9,c0,0N/ADCache lock-down base and victim
STR Rd,<Address>LDR Rd,<Address>MCR p15,0,r0,c10,c0,1MRC p15,0,r0,c10,c0,1I TLB lock-down
STR Rd,<Address>LDR Rd,<Address>MCR p15,0,r0,c10,c0,0MRC P15,0,r0,c10,c0,0D TLB lock-down
TABLE 8 — Interpreted access mapping to the MMU ARM920T
Instruction WordCP15 Instruction WordMMU Operation
LDR Rd,<address>MCR p15,4,r0,c15,c6,4D CAM read
or LDMIA Rn,<Rlist>
LDR Rd,<address>MCR p15,4,r0,c15,c10,4D RAM1 read
or LDMIA Rn,<Rlist>
LDR Rd,<address>MCR p15,4,r0,c15,c2,5D RAM2 read
or LDMIA Rn,<Rlist>
LDR Rd,<address>MCR p15,4,r0,c15,c5,4I CAM read
or LDMIA Rn,<Rlist>
LDR Rd,<address>MCR p15,4,r0,c15,c9,4I RAM1 read
or LDMIA Rn,<Rlist>
LDR Rd,<address>MCR p15,4,r0,c15,c1,5I RAM2 read
or LDMIA Rn,<Rlist>
TABLE 8 — Interpreted access mapping to the caches ARM920T
instruction wordInstruction wordCache operation
LDR Rd,<address> orMCR p15,2,r0,c15,c6,2D CAM read
LDMIA Rn,<Rlist>
LDR Rd,<address> orMCR p15,2,r0,c15,c10,2D RAM read
LDMIA Rn,<Rlist>
STR Rd,<address>MCR p15,0,r0,c7,c6,0D invalidate all
STR Rd,<address>MCR p15,0,r0,c7,c6,1D invalidate single
by VA
LDR Rd,<address> orMCR p15,2,r0,c15,c5,2I CAM read
LDMIA Rn,<Rlist>
LDR Rd,<address> orMCR p15,2,r0,c15,c9,2I RAM read
LDMIA Rn,<Rlist>
STR Rd,<address>MCR p15,0,r0,c8,c5,0I invalidate all
STR Rd,<address>MCR p15,0,r0,c7,c5,1I Invalidate single
by VA

Claims as granted

24 claims

Log in to read the claims of this application.

Log in to unlock

Classifications

7 codes
IPC · International Patent Classification
Section G — Physics
  • G06F11/36
  • G06F11/28
  • G06F9/30
  • G06F15/177
USPC · US Patent Classification
714/38711/206712/42

Claim changes

Soon
Coming soonHow the claims changed between publication and grant

See which claims were amended, added or cancelled during examination, with every added and removed word marked.

AmendedAddedCancelledUnchanged

The published claims of this application are not paired with the granted ones in what we hold.

File wrapper

⤢ drag to zoomJan 2000Jul 2000Jan 2001Jul 2001Jan 2002Jul 2002Jan 2003USPTOApplicantNon-final rejectionResponse after non-final
USPTOApplicanthover for detail · click to open
Pendency
3.4 y
1,259 days filing → grant
Office actions
1
non-final + final
Responses
1
no RCE
Examiner
Robert Beausoliel
art unit 2184 · TC 2100
Citations: 6 back · 15 forward

See the full prosecution history — every USPTO and applicant action on this file, in order.

Log in to unlock

Documents

Log in to open the documents of this file: the application as filed, every office action and response, the notice of allowance.

Log in to unlock

Chain of title

⤢ drag to zoom20002002200420062008201020122014201620182020Owner 2
Titlehover for detail · click to open

See the full assignment history — every owner this patent has passed through, with recordation dates and reel/frame numbers.

Log in to unlock