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.

profiling functions using DM816x/C6A816x/AM389x EVM board

I am trying to setup profiling of a C routine running on the EVM board, to collect CPU cycle stats for the routine.

According to CCS help, I have to activate Trace Analyzer>Open or Trace Analyzer>connect to, and then setup profiling via Trace Analyzer>Profiling etc.

The problem that I have is my Trace Analyzer Open Connection menu is disabled.. Is this because I am using 90-day evaluation version of the CCS, or am I missing certain BIOS/RTDX/RTA etc. packages? What do I need to do profiling?

Thanks in advance!

Fernando

  • Are you trying to use ETB to collect PC trace and then derive profiling from that?  If you are trying to use ETB then you need to go to Tools -> Trace Control and configure ETB as the Trace Receiver.  Then you need to setup breakpoints that turn trace on and off via the breakpoint view.  Once you have collected trace data then you can view the information in the trace analyzer.  If you are just trying to count cycles then you can use the profiler clock (Run -> Clock).

    The 90 day license is full featured.

    john

  • Hi John,

    I was trying both Trace analyzer, and System Analyzer, to no avail.

    I am running a simple file I/O application, only on DSP, while  and not on Cortex.

    In the user manual for System Analyzer, it says I need to run something on Cortex, if I understand it correctly. But at this point I dont have anything to run on cortex.

    Regarding Trace Analyzer: when I tried your suggestion, after I connected Cortex and DSP and then clicked on Trace Control->ETB->Apply/Ok, I got error message in a window:

    Cannot initialize ETB. Invalid or un-connected device

    I tried it before and after loading the code to the DSP.

    If you could explain/point me to to how to use either Trace Analyzer or System Analyzer for my situation I'd appreciate. At this point I would like to see CPU/Task Load, and be able to profile routines.

    Fernando.

  • Fernando,

    I will have to run through this tomorrow.  I don't have anything with an ETB on it at home.

    With ETB I believe you have to connect to the ETB first.  It won't show up be default so you have to go into the Debug View.  Right click on the top most node in the tree.  Select Edit <Session> where session will be the name of your debug session.  This will open a big dialog box.  On the right will be a list something like: CPUs, Non Debuggable Devices and Routers.  Check the box beside Non Debuggable Devices.  Click Apply.  If ETB doesn't show up in the Debug view then restart the debug session and then it should be there.  Select it and connect.  Then try to run the Trace Control tool.   I will give this a try myself tomorrow.

    For System Analyzer there are some tutorials but they are done with C6678.  However you can probably look through them to get a better idea of how it works.  Tutorial 3 is the one that covers cpu load and task load. http://processors.wiki.ti.com/index.php/System_Analyzer_Tutorials

    Regards,

    John

  • Fernando,

    I used a DM8168/C6A8168 board this morning.

    This is what I did.

    Setup:

    Installed CCSv5.1.1

    Added in the Integra device support package from here so that I would have a C6A8168 device listed

    Attempt 1:

    Launched the debug session.

    Connected to the A8

    Opened the Trace Control Tool from Tools -> Trace Control

    Clicked on the Receiver button and selected ETB

    Applied the settings and ended up with the same "un-connected" error that you saw

    Attempt 2:

    Launched the debug session

    Connected to the A8

    Right clicked on the top most node in the debug view and selected "show all cores"

    Now there is a node that says "Non Debuggable Devices".  The other instructions I gave will work too but this is easier.

    Expand it and select the "CSETB" node

    Click the connect button.

    Now I went back to Trace Control.  It comes up with ETB selected already since we did it in #1.  Click OK

    I get a "Cannot get a status register value" error.

    Attempt 3: (Using some extra info and connecting to the DSP instead as that is what you wanted)

    One of other other team members mentioned a GEL file that is needed.  He pointed me to this: http://processors.wiki.ti.com/index.php/C6A816x,_AM389x,_DM816x,_DM814x_Debug_and_Trace_Tools

    I opened my ccxml file.  Clicked on the advanced tab at the bottom.  Selected "CS_DAP_DebugSS" in the tree on the left and then specified the "TI816x_trace_dapdebugss.gel" as the initialization script.  You can the GEL file from the link above.

    Saved my config and launched the debug session.

    Right clicked and selected "show all cores"

    Connected to CS_DAP_DebugSS

    From the Script menu I ran Enable_Trace -> Enable_ETB_C64XP_Trace

    Connect to the ETB 

    Connected to the A8 

    Connected to the C674x 

    Now go to Trace Control

    Clicked on the Receiver button

    Selected ETB

    Clicked OK in the dialogs

    Now the ETB is configured!

    Then to actually get Data into ETB you need to open the breakpoints view.  You can then add a Trace breakpoint.  After it is added right click on it and select properties.  You can then configure what you want to trace.  Probably want Program Address and Time stamp.

    Then afterwards check the box beside the breakpoint to enable it.

    To then view the data you would go to Tools -> Trace Analyzer -> Open Trace Connection in New View -> select your session

    Regards,

    John

  • John,

    This still gave me no trace info; here are my steps:

    I added non-debuggable devices, so now ETB, and CSSTM, is now showing up, together with CortexA8 and C674x.

    I right clicked and connected non-debuggable devices (inncluding ETB), then I connected Cortex, ran C674x script from menu,  and then connected DSP

    While my cursor pointing to C674x_0 in Debug session, I went to Trace Control, selected ETB as a receiver and clicked Apply. An error window came up:

    "Cannot get status register value."

    Another time, it gave me no window but a lot of warnings in Error Log, such as "A handler conflict occurred", "Conflict for com.ti.dvt.ui.vew.GroupNew", etc.. I ran the code until it hit the break point near the end, and saw no trace info in Trace display.

    Do you think I am still missing some config? should I disable RTSC?

    Thanks,

    Fernando

  • Please disregard my last post; I am going to try with GEL file now..

  • Fernando,

    I get that when I try to enable the A8 but not with the DSP.  Although I did disable trace inbetween switching.

    Lets try from scratch.

    After you get the error:

    There should be a dialog that gives you the option to disable trace:

    Select the option to disable trace and the click ok.

    Then lets kill the debug session.  Click on the Red box in the debug view

    Lets confirm that the GEL script is setup for the DAP.  This is what mine looks like, your path to the GEL would be different.

    Then launch the session again.

    Right click on the session in the debug view and select to view all cores

    Click on the CS_DAP_DebugSS and click connect.

    The select the menu item from the scripts menu to enable trace to ETB for the DSP

    Select the CSETB in the Debug View and click Connect

    Select the DSP in the Debug View and click Connect

    Now go to the trace control dialog

    When the dialog comes up click on the Receiver... button and then select ETB and click ok

    Your trace control dialog should look like this now.  The tab at the top should have a DSP name in it like C674x:

    Click OK.

    You should briefly see a status progress window that says initializing ETB

    After a couple seconds it should go away.

    John

  • Continuing from the previous post I was able to capture data from ETB and display it.

    Sometimes for me the TraceDisplay opens automatically after I exit trace control.  I think that depends on if I have setup the connection before or not.  If it doesn't open for you don't worry as I will show how to do it later.

    Open the breakpoints view from View -> Breakpoints

    Then select to create a new Trace breakpoint

    There will now be a disabled trace breakpoint in the breakpoint view.  Right click on it and select breakpoint properties.

    Select what you want to capture.  I selected PC and Time stamp.  Click OK.

    The breakpoint is still disabled so check the box beside it to enable it.

    Load a program onto the DSP.

    If Trace Analyzer didn't open automatically then you need to open a connection to it:

    Run the DSP.

    Halt the DSP.

    The trace Data should show up in the trace view.

    Once you have data their are various analysis options you can perform.  Here is how to get to the profiling ones.

    The analysis can take a while depending on how big your trace sample was.

    Regards,

    John

  • Hi John,

    I think I am almost there, but few questions remain:

    1. After connecting CS_DAP_DebugSS and running Enable_ETB_C64XP_Trace script, I connected ETB, Cortex, ran C674x script, and then connected DSP, in this order.

    Is this Ok?

    2. Then, when I open Trace Control, I see not only C674x_0 but also Cortex at the top. This is different from your case, as you see DSP only. For me, I need to connect Cortex and run the C674x script before connecting DSP. From this point, I clicked on C674x in Trace Control window, set Receiver to ETB, click Ok, then Ok in the Trace Control window, which caused Save Receiver Changes window to pop up and offer me to Apply, Dont apply changes or Disable Trace for Cortex. If I press Ok there, I get Cannot get status register info error. If I press cancel, then cancel in Trace Control window, then I get out of Trace Control and continue with your steps.

    Is this Ok?

    3. After setting up Trace break point and running till the almost end of my code, I see stuff in the Trace window (routine names, cycles), but when I go to Trace Analysis the function profiling i not available, all the features are greyed out (except for basic Trace window)

    So I think there may still be a flaw in what I do - what would you recommend?

    Thanks,

    Fernando

  • Fernando,

    In my last attempt that worked I didn't connect the CortexA8.  When you go into trace control it will show tabs for each core that is connected.  Since I only connected the DSP I only had the one tab.  I was having issues when trying to get the ETB working with the A8 (I still get that register error).  For me I don't need to connect the A8 in-order to connect the DSP.  I guess our power up sequences are different, mine must be automatically enabling the DSP whereas in your case you need to run the GEL script on the A8 to release the DSP.  There is definitely a bug regarding the A8 and ETB.  I plan on chasing that down with the trace team next week.  I am hoping it is a minor issue in the trace definition file that can be tweaked.  

    Could you try disconnecting from the A8 after you have the DSP connected and before you open trace control.  That should get rid of the register error.  However since you are getting data it may not be a big deal but it is worth trying.

    As far as getting function profiling did you select to collect both PC and timing with your trace breakpoint?  I think you need both to use the function profiler.  I selected both in my case.

    Regards,

    John

  • John,

    I tried disconnecting CortexA8 after connecting DSP - in the Trace Control, it still shows both Cortex and DSP, with the same results.

    I am still not able to do function profiling or any other feature listed in Trace Analyzer window after collecting the data. I am also not sure if the data that I see in Trace window after stopping debugger is valid - is there any way to verify this?

    I am also planning to switch from EVM to the real target - would Trace still work, or should I get the System/UIA analyzer working (which would be useful even for EVM).

    If you could point me to a sequence of steps to set it up I would appreciate.

    Thanks

    Fernando

  • Fernando,

    Sorry for the delay, I am pretty stumped.  For me the sequence of steps works.  I suppose you could try create a new target config (ccxml) to see if the session information is being cached and that is why you still see the A8 listed.

    Trace to ETB should work on the EVM and your real target as for ETB it is all contained within the device and is accessed via JTAG.  For streamed trace over pins that has requirements for your board.

    A couple of us are trying out ETB on various targets and attempting to get some more of these support GEL files into CCSv5.2 as well as updating the instructions.  Hopefully we can get some of the issues fixed.

    Regards,

    John

  • Hi John,

    The sequence of steps that you described still does not work for me, even after creating new .ccxml target config.

    Can I try your .ccxml and gel file?

    Trace Analyzer and System Analyzer/UIA are still not working for me.

    Fernando

  • Fernando,

    My .ccxml file is in this zip.

    5344.DM8168.zip

    The name of the file is DM8168 and the the device I have selected is C6A8168.  That should not make a difference.  The DM8168 is the superset.

    As far as GEL files I am only using the trace one for the DAP and don't have anything loaded for the A8.  Here is the trace GEL file it goes in /ccsv5/ccs_base/emulation/gel

    5775.TI816x_trace_dapdebugss.zip

    John