Is There a Way to Disable Code Optimization in VectorCast?

  • Thread starter Thread starter rdsingh
  • Start date Start date
  • Tags Tags
    Vector
Click For Summary
SUMMARY

The discussion centers on disabling code optimization in the VectorCast tool while unit testing C code. Users report that the function ffx_ScheduleInsertCCEvent() is experiencing automatic optimization, causing critical code segments, such as the if condition checking FFX_Scheduler.PendingCCFreeList, to be omitted from the disassembly. This results in the FM_ASSERTION_RESET_FAULT not being triggered, leading to abnormal test case termination. The consensus is to explore VectorCast documentation for flags that can disable optimization during compilation.

PREREQUISITES
  • Familiarity with C programming language
  • Understanding of unit testing concepts
  • Basic knowledge of the VectorCast tool
  • Experience with debugging techniques in disassembly
NEXT STEPS
  • Consult the VectorCast documentation for compiler flags to disable code optimization
  • Research techniques for debugging C code in disassembly
  • Learn about unit testing best practices in C
  • Explore alternative unit testing tools that may offer better control over optimization settings
USEFUL FOR

Software developers, particularly those working with C language unit testing, and quality assurance engineers seeking to troubleshoot issues related to code optimization in VectorCast.

rdsingh
Messages
1
Reaction score
0
I am using VectorCast tool to Unit Test the code written in C language.

Brief Description:-The following piece of code (which is present in source code) is getting optimized in VectorCast at Disassembly Level. Hence, the code is not even visible in VectorCast Disassembly.

Details:-

In Function ffx_ScheduleInsertCCEvent() :- The Following Code is getting Optimized in VectorCast automatically and hence, the If condition is not getting hit.

if ( FFX_Scheduler.PendingCCFreeList == NULL )
{
#ifdef SIMULATION_BUILD
TRAP();
#else
FM_ASSERTION_RESET_FAULT( AF_FFX_PCCLIST_OVERFLOW, (UINT32) Signal, callers_address() );
#endif
}

Due to the Code Optimization by VectorCast, the piece of code is not visible in the Disassembly while debugging. Plus, the FM_ASSERTION_RESET_FAULT is not getting hit and the Test case is getting terminated Abnormally.

Does anybode has a solution to this problem.
 
Technology news on Phys.org
I'm not familiar with VectorCast, but is there some way to turn off code optimization? I would think there's a flag you could set when the code is compiled. I would take a look at the documentation for this tool to see if that is a possibility.
 

Similar threads

  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K