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.

Gel scripts try/catch functionality for GEL_TextOut()

Hello CCS experts,

I am using a gel which loops over device register addresses and outputs register values in the console.

The gel code looks like the below excerpt:

address = 0x4a002114;

GEL_TextOut("%x %x\n",,,,,address,*address);

address = 0x4a002118;

GEL_TextOut("%x %x\n",,,,,address,*address);

address = 0x4a00211c;

GEL_TextOut("%x %x\n",,,,,address,*address);

address = 0x4a002120;
...
 ...

Trouble is, this file is generic and tries to dump some addresses which may not exist on certain platforms. For example, on one of our platforms it gives an error
"Target failed to read <address here>". Is there a try/catch statement(or similar) within the gels that I can use? Right now it would crash on first not able to read address and not get the good ones out.
My initial idea was to catch whatever address in not able to read, dump a warning (on just pass), and continue onto the next address?

Thanks for helping,
Alex

  • Alex,

    Unfortunately GEL does not feature exception handling.

    One of the main drawbacks of reading invalid memory addresses is that, in certain devices and configurations, the device/core locks itself up if it considers the operation a security violation.

    The usual approach is to read the device ID from one of the device's registers and apply if/else clauses that will be tailored to the specific device.

    Hope this helps,
    Rafael
  • Rafael,

    OK I see, will handle the issue differently then, thanks for the help.

    Thanks,
    Alex