This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use GEL in UBM?

Hi,

In UBM (Unified Breakpoint Manager) both Condition and Action are required to be in GEL format.

However I searched and read many documents:

  1. In CCS help, there is very little content on using UBM except articles like Modifying Breakpoint Properties.
  2. In TI.com or E2E.TI.com, there is also virtually no information on how GEL in these places should be set

Could someone provide examples on their use?

 

Paul

  • Hi Paul,

    Paul Singh said:
    In UBM (Unified Breakpoint Manager) both Condition and Action are required to be in GEL format.

    You can specify a GEL expression for both the Condition and Action.

    Condition: Execute action (i.e. Halt) if a condition is met

    Action: Perform some action.

    ---

    Example 1:

    Say you which to set a breakpoint which halts the target at a specific location ONLY if a variable (int var;) on the target is a specific value (10). Then in the condition field, you can enter:

    var==10

    And leave the action field to its default "Remain Halted"

    ---

    Example 2:

    Say you which to set a breakpoint which will enable the profile clock at a specific location ONLY if a variable (int var;) on the target is a specific value (10). Then in the condition field, you can enter:

    var==10

    And in the action field you can choose to execute a GEL Expression (Execute Expression (GEL)) and enter the following GEL function call:

    GEL_EnableClock();

    ---

    Hope this helps

    ki

  • Ki-Soo,

    I wonder if you set a variable in GEL, how does UBM resolve its scope? For the "var==10" example, in a program there could be many "var"s in places, and UBM essentially programs trigger logic comparators (for hardware breakpoint and data watchpoint), but the comparator of course have no ability to resolve the ambiguities of variables in different scope with the same name.

    Therefore I wonder if you ever set a GEL like this, does it mean that

    (1) Hardware comparator do the major comparison (PC, data bus, either single or range), and halts the CPU each time when there is a match

    (2) whenever the CPU halts it is in a specific context, and GEL then resolves the variable ("var==10") in the specific range. GEL also retrieves the variable value via JTAG's boundary scan chain which is internally connected to different parts within the processor/SoC, rather than loading any instruction that would disrupt the instruction (and data) pipeline

    Is this what GEL does?

    For Actions executed by GEL, I have read http://processors.wiki.ti.com/index.php/How_Do_Breakpoints_Work which includes:

    "Software Breakpoints

    The more popular way of implementing a software breakpoint is also much more complex. In this scenario, there is a specified breakpoint opcode. Typically, the opcode is 8-bits. Whenever a breakpoint is set, the leading 8 bits of the instruction at that location are removed and replaced with this 8-bit breakpoint opcode. The original 8-bits of the instruction are then stored in a breakpoint table. Whenever a breakpoint is encountered, the CPU halts and CCS replaces the breakpoint opcode with the original 8-bits of the instruction. When execution is restarted, CCS must do a bit of trickery because the instruction in the actual CPU pipeline isn't correct. It still has the breakpoint opcode. So CCS flushes the CPU pipeline and then re-fetches the instructions that were pending in them to their original state, with the next function to be executed being the one where the breakpoint was set. At the same time, CCS re-loads the instruction at that location with the breakpoint opcode so that the next time this code is encountered, it will again halt."

    I guess the actions performed by GEL must be different: it would not load any instruction to the CPU to execute the action, but instead performs via the JTAG boundary scan chain so that it could effectively read/write/programs any registers. Is this the way it does

    Paul

  • Paul Singh said:
    I wonder if you set a variable in GEL, how does UBM resolve its scope?

    For the example I used above, it would use whatever "var" is in scope of when the program is halted at that breakpoint/watchpoint location to evaluate the GEL expression. If the condition is not met it will then re-run.

    Paul Singh said:

    Therefore I wonder if you ever set a GEL like this, does it mean that

    (1) Hardware comparator do the major comparison (PC, data bus, either single or range), and halts the CPU each time when there is a match

    (2) whenever the CPU halts it is in a specific context, and GEL then resolves the variable ("var==10") in the specific range. GEL also retrieves the variable value via JTAG's boundary scan chain which is internally connected to different parts within the processor/SoC, rather than loading any instruction that would disrupt the instruction (and data) pipeline

    For #1, it applies to watchpoints and hardware breakpoints. Software breakpoints work differently - as you know.

    For #2, Yes.

    Paul Singh said:
    I guess the actions performed by GEL must be different: it would not load any instruction to the CPU to execute the action, but instead performs via the JTAG boundary scan chain so that it could effectively read/write/programs any registers. Is this the way it does

    Pretty much. It will access the target via JTAG read/write... just like the debugger would to display the contents of a variable in the Expressions view.

    Thanks

    ki

  • Ki-Soo,

    I got it. Thanks a lot.

     

    Paul