Hello,
Following are the details of our software development environment.
IDE : CCS Version 4.2.4.00033
Target Processor : TMS320F28335
CGT Version : TI v5.2.1
RTS : rts2800_fpu32.lib
I am working on Tool Qualification for RTRT tool (Vendor is IBM ). We use this tool for verification and validation of our software.
IBM has developed TDP (Target Deployment Port) Editor to work with various IDE and targets using RTRT. We are provided with IBM developed TDP for TMS320f28335.
This TDP allows to integrate the RTRT tool and CCS IDE to run the test scripts from RTRT on to Target.
As a part of software process, we need to qualify RTRT tool. IBM has provided tool kit to qualify. This tool kit is same for any IDE and target.
When we run this tool Kit, some of the test cases are failing on TMS320F28335 target. The corresponding RTRT test script checks for NaN, +Inf and –Inf.
Please find the source file which is used for testing these. The source file multiplies two double constants till the result of computation is +Inf and –Inf.
And NaN value is obtained by dividing +inf/-Inf.
When I execute the corresponding RTRT test script on our processor using CCS, -1.000000E+00 is displayed in CCS debugger instead of NaN (which was displayed as NaN in Linux environment, this is expected result).
While debugging, we entered the expression v3.f/v2.f in watch window (variables are available in source.c, where v3.f = 1.#INF and v2.f = -1.#INF) and we observed that result is displayed as -1.#IND (which is NaN as expected).
But the same expression value is assigned to local variable. And this local variable (*pNaN(line 77 in source.c) value is displayed as -1 in watch window. Let me know the reason for showing the value as -1 instead of -1.#IND in the watch window ?
As the variable (myNan) returns -1, RTRT test case is failing.
Can anybody let me know, How the NaN’s are handled in Code Composer Studio ?
Please provide the response.
Reproduction Steps :
1. Create a Hello world program from CCS V4.
2. Add the source.c file to the project.
3. Call the cfloat(&mynan,&infp,&infn) from the main.
4. After flasing on to target, during stepping, the above mentioned issue can be observed.
Thank you.
/* * Licensed Materials - Property of IBM * Use Restricted Material of IBM * IBM Rational Test RealTime * (c) Copyright IBM Corp. 2006-2007 All Rights Reserved. * * US Governement Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ #include <math.h> #include <float.h> //#define PRINT /* comment this line to disable printf lines */ #ifdef PRINT #include <stdio.h> #endif #define type float #define typename "###INFO: float" void cfloat(type *pNaN,type *pINF, type *pINFn) { typedef union CONV { type f; unsigned char dmp[sizeof(type)]; } t_conv; t_conv v1,v2,v3; int i; v1.f=10.0; v2.f=100.0; while ( memcmp (&v1,&v2,sizeof(t_conv))) { v1.f=v2.f; v2.f = v2.f * v2.f; } #ifdef PRINT printf(typename); printf(" +inf : "); for (i=0;i<sizeof(type);++i) { printf("%02x",v2.dmp[i]); } printf(" %f \n",v2.f); #endif *pINF=v2.f; v3.f=v2.f; v1.f=-10.0; v2.f=-100.0; while ( memcmp (&v1,&v2,sizeof(t_conv))) { v1.f=v2.f; v2.f = v2.f * 100.0; } #ifdef PRINT printf(typename); printf(" -inf : "); for (i=0;i<sizeof(type);++i) { printf("%02x",v2.dmp[i]); } printf(" %f \n",v2.f); #endif *pINFn=v2.f; v3.f/= v2.f; #ifdef PRINT printf(typename); printf(" nan : "); for (i=0;i<sizeof(type);++i) { printf("%02x",v3.dmp[i]); } printf(" %f \n",v3.f); #endif *pNaN=v3.f; }