This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code coverage command

Hi

I am using µVision4 with an ARM Cortex-M processor. I require detailed code coverage output (including each coverage information for each assembly instruction in the whole application or in a module/function. It seems that I cannot use "coverage asm" command and when I use "coverage \module [DETAILS]", it jut outputs the information about branch instructions. How can I obtain the assembly coverage information (in a file instead of checking the disassembly code)?

Thanks,
Ali

Parents
  • An interesting thing with programs - being assembler instructions or high-level constructs - is that they can be seen as chains of commands joined in a lattice of noide points.

    When profiling code, it may be important to profile every single command, to know the total cost in ns - a division instruction is generally more expensive than a ++ instruction.

    But when doing code coverage, you normally don't need to care about the instruction chains. If you ignore the special case of how you permanetly leave the instruction chain because of a fatal exception, then all instructions in a instruction chain will be processed the same number of times. It's just a question of how many times the processor will reach the entry node point for that instruction chain.

    So code coverage analysis don't need to break down the coverage into individual instructions. It's enough to know if code reaches a specific target label or if it has jumped/not jumped at conditional jumps.

    The main exception is processors that has assembler instructions with conditional execution - they need to be seen as having their own node points, since the code coverage needs to figure out if it has happened that the condition was tru - and if it has happened that the condition was false.

Reply
  • An interesting thing with programs - being assembler instructions or high-level constructs - is that they can be seen as chains of commands joined in a lattice of noide points.

    When profiling code, it may be important to profile every single command, to know the total cost in ns - a division instruction is generally more expensive than a ++ instruction.

    But when doing code coverage, you normally don't need to care about the instruction chains. If you ignore the special case of how you permanetly leave the instruction chain because of a fatal exception, then all instructions in a instruction chain will be processed the same number of times. It's just a question of how many times the processor will reach the entry node point for that instruction chain.

    So code coverage analysis don't need to break down the coverage into individual instructions. It's enough to know if code reaches a specific target label or if it has jumped/not jumped at conditional jumps.

    The main exception is processors that has assembler instructions with conditional execution - they need to be seen as having their own node points, since the code coverage needs to figure out if it has happened that the condition was tru - and if it has happened that the condition was false.

Children
  • Thanks a lot Per Westermark for your comment.
    But my main issue is how to save this information (Because I want to process which instruction has been executed or not). So, by seeing the coverage information of branch instructions, I can do it in the uVision IDE. But I have to export this information in a file to be processed offline. So, still I have to save the disassembly of the project (or the trace of instructions) which I don't know how to do.