Topic : Code Coverage Listing and Reports

Forum : 8051

Original Post
Post Information Post
September 22, 2009 - 9:51pm
Guest

Dear Raisonance Forums,

My company is using the RIDE IDE version 6.1.6 for development of an 8052 Microcontroller application. I am using the RIDE IDE to validate this code.

I have written several unit tests to evaluate all code paths within developed functions. During debug in simulation mode, I am able to view Code Coverage statistics by selecting the "View (menu)->Functions/Code Coverage (item)". This brings up a nice Multi-column List Box Window that identifies Function, File, %Coverage, Calls, and Total Duration".

I would like to capture this original information in a spreadsheet as it appears in the Multi-Column List Box? Generating a report seems to truncate function names. Is there any way to export this information so that I can bring it into an application like Excel? If not, is there any way to define the final format including function name length.

Lastly, the report option shows executed lines of code in assembly. Is there any way to get the executed or unexecuted lines of code in its original C source?

Thank You,

Bob Bamberg

Replies
Post Information Post
+1
0
-1
September 23, 2009 - 4:32pm
Guest

In the source view (editor), you have (popup menu) a command that allows to display code coverage, and also another command that creates another report. This report will be a copy of the source file, with the code coverage information on the left side. Don't know if it could help...

Another possibility would be to create a small script to generate a customized report.

+1
0
-1
September 23, 2009 - 8:55pm
Guest

Thank you for your response Francis. I am still somewhat confused on the advice you have given.

While my application is running in debug mode, I am able to view a source file and step through my code. With this source file if I right mouse click I see the context/popup menu you describe in your response. This menu has the following menu items: "Open document", "Go to Line", "View Code", "Add Watch", "Evaluate\Modify", "Indent", "Inspect", menu item separator, "Run to cursor", "Set PC to cursor", and "Toggle Flag...". The menu item "Toggle Flag..." opens a sub-menu with items: "Toggle breakpoint", "Toggle trace", "Toggle refresh", "Toggle switch", and "Toggle trigger".

While viewing my source code, I can select the "View Code" menu item that brings up a new window that includes both C source and assembly code. On the right hand side of this window under the heading "Code Coverage" there is a number, which appears to be a counter of how many times an actual line of assembly code has been executed. This really isn't the information I am looking for. Also, I see no additional way to create a report from this popup menu. Could you please explain the alternate way to create a report other than the way I have described in my original post?

Lastly, when you say "Another possibility would be to create a small script to generate a customizable report.", I am not sure what you mean. Where would my script read the data from? Please explain.

Thank You,

Bob Bamberg

I would be happy if I could simply save the

+1
0
-1
September 24, 2009 - 2:59pm
Guest

No, the only way to create a report is using the Create Report command from the Code Coverage window, but as you said it truncates the name of the functions.

+1
0
-1
September 24, 2009 - 3:51pm
Guest

Thank you Behnaz.

+1
0
-1
September 25, 2009 - 3:22pm
Guest

Bob,

Behnaz is not at the office this afternoon and I cannot check with her. I read what you wrote, checked with the RIDE 6 version installed on my computer, and I see an extra command 'Code Coverage' (that opens a sub-menu') in the popup menu of the editor view. The sub-menu provides the commands "Show", "Create a Report" and "Reset".
The 'Create Report' opens a text file that looks like:

     [0x0001]        for (i = 0; i <= SIZE; i++)
                        {
     [0x1491]           if (flags[i])      /* found a prime */
                           {
     [0x0506]              prime = i + i + 3;   /* twice index + 3 */
               
     [0x0506]              for (k = i + prime; k <= SIZE; k += prime)
                              {
     [0x3A97]                 flags[k] = FALSE;   /* kill all multiples */
                              }
               
     [0x0506]              count++;      /* primes found */
                           }
                        }

I don't if it could help.

I believe that, for RIDE6) script files can be executed for some packages only (RKit Entreprise).
Could you let me know if you can (in debug mode) load the following script (and if it is properly executed).

void main ()
   {
   int i;
   i = 0;
   while ( i < 10 ) 
      {
      DebugStepInto(1);
      i = i+1;
      }
   }

To execute it, save the contents into a file named test.wsc, then execute the command RideScript | Load file.
If it works, I will try to write for you a small script that creates a simple report.