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.
Hello!
I currently have this Piccolo TMS320F28035 Isolated controlCARD, and I am in the process of buying a docking station/baseboard for it.
Card:
http://www.ti.com/tool/TMDSCNCD28035ISO
Docking Station:
https://www.ti.com/tool/TMDSDOCK28035
Micro Inverter Baseboard:
http://www.ti.com/tool/TMDSSOLARUINVKIT#technicaldocuments
I also have this LaunchPad XL using a TMS320F28379D chip:
http://www.ti.com/tool/LAUNCHXL-F28379D#0
I want to know if there is anyway to read Hardware Performance Counters from the microcontroller. I plan to write some code through code composer studio and run it on the board. While doing this, I would like to read any available HPC values. I'm not sure how to approach this. Any advice or suggestions would be appreciated. Thanks!
Hi Abraham,
If you want to profile your code, you can use the CPU timers available in the device. The module allows you to start and stop the counters and read the counter value.
Another option is to use the Profile clock feature available in CCS (Run->Clock).
Thanks and Regards,
Veena
Hi Veena,
Sorry for the delayed response. Can you please elaborate more on utilizing the CPU timers? I found the "Run->Clock", and I enabled it, but I am unsure where the timing would show, or where I can setup which HPCs to track.
Thanks,
Abraham Kuruvila
Hi Abraham,
Please refer to the device TRM on more details on CPU timer hardware. C2000ware includes driver support for CPU timer and includes an example showcasing how to configure timers.
The clock feature in CCS can be viewed on the bottom right corner of CCS.
Regards,
Veena
Hi Veena,
I went through the CPU timer example, and I am still confused on how I am reading hardware performance counters? If I am understanding you correctly, you are telling me to use CPU timers/interrupts to be able to read variable values in the program? Ideally, I would like to run some code, and then be able to check every few milliseconds what the number of cache-miss,branch-misses, LLL-load-misses etc. are, I do not care about the actual program variable values (I am not debugging code). Is this even possible through code composer studio? If you are familiar with the "perf stat" command in linux, I am trying to do the same thing on the TI board I am using.
Thanks,
Abraham Kuruvila
Hi Abraham,
The CPU timer is just a counter that increments every cycle. It can be used to compute the cycles spend by your application. For example, if your want to profile an ISR, you can start the timer at the start of ISR and stop the timer at the end of ISR. The counter value will provide the cycles spent by the ISR.
I will get back to you on if there is a way to get the information you are looking for.
Regards,
Veena
Hi Veena,
Thanks for the update. While the CPU timer seems interesting, it's only a small part of what I need. I plan to train a machine learning classifier with many features which is why I need access to as many performance counters as possible. Looking forward to your update.
Thanks,
Abraham Kuruvila
Hi Veena,
Is there any update on reading performance counters?
Thanks,
Abraham Kuruvila
Abraham,
We need some additional clarity on your request. Our interpretation of performance counters is something to give a count of how many CPU cycles a particular section or sections of code take. I'll expand on those options below, but let me know if my understanding is incorrect.
The manual option that Veena mentioned is to use breakpoints and the "profiler" clock inside of CCS.
This feature is accessable through the DSS(Debug Server Scripting) that can access the CCS root functions via external scripting such as PERL. This would allow you to profile multiple functions and have the results recorded programmatically so long as you have a JTAG connection to the device(this is the data transport)
The specific section on Profiling is here https://software-dl.ti.com/ccs/esd/documents/users_guide/sdto_dss_handbook.html#profiling athough it may be good to read about DSS in general to see the examples and syntax.
The other option Veena has given, was more from a standalone POV, using the 3 CPU timers we have on the C28x core to act as counters. This would need to be controlled through C code written/built to run on the C28x itself, not related to CCS or DSS mentioned above.
Best,
Matthew
Hi Matthew,
I looked through the link you sent me, and I believe this is exactly what I was looking for. I have a few questions though. For profiling many events, is there any function or documentation that shows all the available events? I saw those events in the documentation("Events.L1D.hit.summary", "Events.L1D.miss.summary", ... "Events.L1P.hit"), but are there more events I can utilize? For using DDS, it seems I would write a script that calls my C code I want to execute and sets up the profile setup for the events I want monitored for that C code, is this correct? Lastly, I wanted to know what JTAG connection I would need to procure. I currently have:
Card:
http://www.ti.com/tool/TMDSCNCD28035ISO
Docking Station:
https://www.ti.com/tool/TMDSDOCK28035
Best,
Abraham Kuruvila
Abraham,
I need to look into your first question a bit more; but for the question on JTAG, since you have a control CARD the JTAG probe is built into the card itself via the USB connection.
This particular card has a XDS100v1 type emulator. The docking station you have also has this same implementation, but due to the isolation on the 28035ISO you'll need to use the USB connector on the card itself(USB mini) vs the USB on the dock(USB Type B connector). Power will still come from the docking station.
Best,
Matthew
Abraham,
Once clarification after looking back at the original posts; you mention cache misses/branch miss, etc. The F2803x MCU does not have a program or data cache like a C6000 DSP. There is a flash prefetch buffer, but this is only a few words long.
This may explain the lack of the tool sets you are seeing in the DSS tool. Let me know if this is the case, or there is still value in clarifying what other options exist in the server and I'll pull in some folks from our SW tools team.
Best,
Matthew
Hi Matthew,
I am interested in reading as many hardware events as possible. Please see this link for a better explanation:
https://en.wikipedia.org/wiki/Hardware_performance_counter
It doesn't necessarily have to be branch-misses or cache-misses. In that DSS scripting/profiling section you sent me, I noticed we could profile events like "Events.L1D.miss.summary" which is what I am looking for. Are you saying this won't work for my card?
Thanks,
Abraham Kuruvila
For others following this thread, please check the continuation of the discussion about the Profiler at:
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/884278
Rafael