*This is an updated version of the former title "Techniques for using DS-5 - Tips for setting breakpoints".
Arm® DS-5 for Intel® SoC FPGA Edition (DS-5) has been replaced by Arm® Development Studio for Intel® SoC FPGA Edition (Arm® DS), the standard software integrated development environment for Intel® SoC FPGAs. Arm® DS is the successor to DS-5 and is not significantly different in usability. Most of the articles in this series are applicable to both Arm® DS and DS-5, but the differences are clearly noted in this update.
** **
Introduction
This article provides additional information on how to use Arm® DS / DS-5, which is available as an integrated software development environment for SoC FPGAs.
In this article, we will introduce the types of "breakpoints" that are always used during software debugging, their differences, and their actual usage. Please refer to the Arm® DS / DS-5 manual for details on how to use the debugger, as this article describes only the basics.
Reference information: Arm® Arm Development Studio documentation page (Arm® Developer site)
Reference Information: DS-5 Documentation Page (Arm® Developer Site)
1. Breakpoint Functionality of Arm® DS / DS-5
1-1. Breakpoint Types
In general, there are two types of breakpoints: hardware (HW) breakpoints and software (SW) breakpoints.
The icons shown in the figure below distinguish between HW and SW breakpoints. Alternatively, the breakpoints can be checked on a dedicated screen (Breakpoint View).
Note:
In Arm® DS, the breakpoint view is not shown on the standard screen layout; it must be added from the Window menu at the top of the Arm® DS screen, then Show View, then Breakpoints.
Figure 1. Displaying Breakpoints
1-2 How to Specify Breakpoints
Figure 2 shows how to specify breakpoints. Basically, it is done by clicking on the left side of the source code (or the left side of the disassembly screen). If you want to check or change all the specified breakpoints at once, it is recommended to use the breakpoint view shown in Figure 3.
NOTES:
The right-click menu for setting breakpoints differs between the Arm® DS and the DS-5.
Figure 2. Breakpoint Designation Method 1 (Operation in Source Code)
Figure 3. Breakpoint Designation Method 2 (Operation on the dedicated screen)
In the operation menu of the breakpoint view, "Disable Breakpoint" and "Move to File" are especially convenient and recommended. Disable Breakpoint" allows you to temporarily disable a registered breakpoint by simply switching the checkbox on the left side of the list ON/OFF. While disabled, the CPU will not break even if the breakpoint is executed.
In addition, the "Go to File" menu allows you to display the corresponding line of source code registered as a breakpoint at once, which is useful when debugging complex programs.
Other useful functions are also provided, so actually operate the debugger to check them (you can also specify complex break conditions by changing breakpoint properties).
1-3. Difference between HW break and SW break
The following table summarizes the differences and characteristics between HW break and SW break.
| Type | Characteristics | Number of possible settings |
| HW break | Operates using the break mechanism of HW (does not involve rewriting the program) ● CPU breaks when it detects execution of an address registered in HW ● There is an HW upper limit to the number of breakpoints (number of addresses that can be registered) |
6 |
| SW break | CPU instruction to be broken is replaced with a dedicated BREAK instruction (involving program rewriting) ● CPU breaks when BREAK instruction is executed ● No upper limit on the number of breakpoints |
No limit |
The most significant difference between HW break and SW break is whether or not it involves rewriting the program.
SW breakpoints involve rewriting the program. Therefore, SW breakpoints cannot handle cases where the program is reloaded during debugging or where the program memory around the breakpoint is destroyed due to a bug. In addition, they cannot be used in systems that do not allow rewriting of the program area, such as memory protection functions or direct execution of the program on Flash (XIP).
HW breakpoints do not involve program rewriting and therefore do not have the same restrictions as SW breakpoints.
Although HW breakpoints are functionally superior, there is an upper limit to the number of breakpoints that can be registered. Therefore, when there are many breakpoints to be registered, SW breakpoints and HW breakpoints should be used together.
2. Example of breakpoint usage
The following are two examples of useful breakpoint usage.
2-1. Use Case 1: Catching the Moment an Exception Occurs
Setting breakpoints on interrupt vectors in preparation for the occurrence of abnormal interrupts such as reset and abort is very useful when investigating the location of a defect.
When software performs an abnormal operation, a read/write access to an illegal address may occur, resulting in an exception interrupt such as a data abort, etc. By setting a breakpoint on the interrupt vector, the moment of exception occurrence can be captured.
By using the trace function introduced in the following article, it is possible to trace back the process that was performed by the software just before the exception occurred.
Reference information: Techniques for using Arm DS - How to use the trace function
The following figure shows how to set a breakpoint on an interrupt vector.
Figure 4. Breakpoint Usage Example 1 (Catching Exceptions)
2-2. Use Case 2: Specifying Break Conditions
The breakpoint function of Arm® DS/DS-5 allows the user to specify a break condition in addition to an unconditional break when the code is executed at a specified point.
This is useful, for example, when you want to debug the behavior of a process after it has been executed 100 times. Specifically, if 99 is specified for the "number of times to ignore" in the stop condition of a breakpoint, the operation will break at the 100th execution.
In addition to the number of times, it is also possible to create complex conditions by giving conditional expressions, so we recommend that you try out the various settings.
The following figure shows how to specify break conditions.
Figure 5. Breakpoint Usage Example 2 (Break Condition Specification)
Conclusion
In this article, we have introduced how to use the breakpoint function. Breakpoints themselves are a common feature of debuggers, but the Arm® DS/DS-5 has many useful functions, such as specifying complex break conditions. We hope that these features will be useful in improving the efficiency of software verification work and defect investigations.
Recommended Articles/Documents
How to Use the Debugger for SoC FPGAs (Arm® DS / DS-5)
Altera® SoC FPGA Summary Page
Development Flow of Altera® FPGAs