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.

Problem when using TestProbe with float data (I think)

Other Parts Discussed in Thread: TMS320C6411, CCSTUDIO

Hello All,

I using simulator of TMS320C64+, little endian. I tried to load data into program by using test probe (exactly like in tutorial "volume").

in example the data is declared like this:

int inp_buffer[BUFSIZE];       /* processing data buffers */
int out_buffer[BUFSIZE];
...

and data from file sine.dat is loaded into inp_buffer and referred to by "input" pointer:

int *input = &inp_buffer[0];
int *output = &out_buffer[0];

the sine.dat look like this:

0x00000000
0x0000000f
0x0000001e
0x0000002d
0x0000003a
0x00000046
0x00000050
0x00000059
...

And it works. The problem occures when I try to load the float data from a different file, that includes float data. First I change the declaration of the variables:

double inp_buffer[BUFSIZE];       /* processing data buffers */
...

double *input = &inp_buffer[0];

The file that loaded looks like this:

-0.132683459
-0.130372237
-0.128074536
-0.126085288
-0.124143473
-0.121914215
-0.119524508
-0.117318421
...

The problem is that the data now is not loaded (stays 0.0). When I redeclare variable to float, the data is shown incorrectly.

Please help.

Regards

Arye

 

  • Both your sine.dat file and your float.dat file must have proper header information. I will assume you just left that off or else you would have received an error loading the file. This header information must be correct to correctly load the data. The easiest way to get the right information in the header is to save inp_buffer to a file selecting the correct format, then retain the first line of the file and just replace the data contents with what you want.

    If your .dat header information does not match the format of the data in the file, it will not load correctly.

    Using proper files, I was able to load float data just fine.

    If this is still insufficient to solve your problem, please include the following in your next posting:

    • exactly which simulator you are using
    • full path to the tutorial project you are referencing (where you copied it from, not your MyProjects path)
    • CCS version information
    • first few lines of the .dat files, including the first line
    • explain the difference between "not loaded (stays 0.0)" and "float ... data is shown incorrectly"

    When you show the data in the memory window, the type declaration of the array is not important, only the type with which you decide to show the memory. This is the best way to view your data so you can look at the raw data, instead of the watch window which may take liberties with the display based on type information.

  • Hello, thank You for reply,

    I tried already to copy a header of the file, while editing it in Notepad.

    I've created new data file in float format, using "write to file" breakpoint. the start of the file looks like this from Notepad:

    1651 4 2a20 0 190
    0.0
    0.0
    0.0
    0.0
    0.0

    I've copied the first few rows into input file and it look like this now:

    1651 4 2a20 0 190
    0.0
    0.0
    0.0
    0.0
    0.0
    -0.132683459
    -0.130372237
    -0.128074536
    -0.126085288
    -0.124143473
    -0.121914215
    -0.119524508
    -0.117318421

    what my program does is multiplies the data from input file by 10 and outputs it to output file. The output file after running the program the output looks like this:

    1651 4 2a20 0 190
    0.0
    0.0
    0.0
    0.0
    0.0
    ......

    all the data is 0, regardless of what kind of output format I choose (among hex,float,integer and long)

    I am using C6411 Device Cycle Accurate Simulator, Proccesor type is: TMS320C6411.

    The tutorial path is: C:\CCStudio_v3.3\tutorial\sim64xx\volume1.

    I use a breakpoint with "read from file" action placed in dataIO() to load values to inp_buffer array, and I use another empty function after dataIO(), in which I create a breakpoint with "write to file" action and write data to output file from out_buffer.

    The CCS version is 3.3.38.2

    Unfortunately I am not able to recreate the error, now it allways shows output data as 0.0, no matter what the type of the data is.

     

    Thank You

  • Ok, Thank You - got it finelly.

    The problem was really a data format as You said. A number of  rows was less that expected.

    It is easy to check the validity of the format when loading the data file from Files->Data->Load.

    Thank You Very Much! [:H][:Y]