DSPRelated.com
Forums

Long long datatype in C5510 device simulator vs DSK5510

Started by Aditi Akula October 6, 2010
Hi,

I am runnning a project on both on the C5510 Device simulator(no board)
and on the DSK5510 board.

Both use CCSv3.3.

I have an array of type "long long int" declared in the project.

In the "TMS320C55x Optimizing C/C++ Compiler Users Guide" (Literature
Number: SPRU281F),

on page 122 Table 5-1, it says the size of "long long" datatype takes 40
bits.

When I look at the variable in the Device simulator project, it shows as a
64-bit number. On the DSK board, it shows as 32-bit number.

Note that neither of these match SPRU281F.

My question: assuming the DSK board results are correct, then how do I
configure the C55x simulator to exactly match the hardware?

Thanks,
Regards,
Aditi.
On Sep 29, 2010, at 15:55, Aditi Akula wrote:
> I am runnning a project on both on the C5510 Device simulator(no
> board)
> and on the DSK5510 board.
>
> Both use CCSv3.3.
>
> I have an array of type "long long int" declared in the project.
>
> In the "TMS320C55x Optimizing C/C++ Compiler Users Guide" (Literature
> Number: SPRU281F),
>
> on page 122 Table 5-1, it says the size of "long long" datatype
> takes 40
> bits.
>
> When I look at the variable in the Device simulator project, it
> shows as a
> 64-bit number. On the DSK board, it shows as 32-bit number.
>
> Note that neither of these match SPRU281F.
>
> My question: assuming the DSK board results are correct, then how do I
> configure the C55x simulator to exactly match the hardware?
First of all, have you checked the disassembly of your code to
confirm the size of the data? The actual instructions that are
emitted by the compiler should prove whether the code is 40-bit or not.

As for CCSv3.3, it is running on your host computer, where 40-bit is
not a valid data size. I'm just guessing here, but perhaps there is
a bug and the GUI is reporting the local size and not the target
size. In either case, 32-bit should be too small to hold a 40-bit
value, of course. As mentioned above, the crucial information is the
actual DSP opcodes, so if I were you I would dig a little deeper there.

Brian Willoughby

Sound Consulting
Aditi,

40 bits is the size of the accumulator, so the long long operations have
that much resolution. When storing the words, the compiler generates 64
bit storage to preserve correct alignment. It may then sign extend the
40 bit result to 64 bits for storage.

I recommend using the long long type only sparingly, as it is expensive
both in time and space.

Regards,
Bill Finger

> -----Original Message-----
> From: c... [mailto:c...] On
> Behalf Of Aditi Akula
> Sent: Wednesday, September 29, 2010 6:55 PM
> To: c...
> Subject: [c55x] Long long datatype in C5510 device simulator
> vs DSK5510
>
> Hi,
>
> I am runnning a project on both on the C5510 Device
> simulator(no board)
> and on the DSK5510 board.
>
> Both use CCSv3.3.
>
> I have an array of type "long long int" declared in the project.
>
> In the "TMS320C55x Optimizing C/C++ Compiler User's Guide" (Literature
> Number: SPRU281F),
>
> on page 122 Table 5-1, it says the size of "long long"
> datatype takes 40
> bits.
>
> When I look at the variable in the Device simulator project,
> it shows as a
> 64-bit number. On the DSK board, it shows as 32-bit number.
>
> Note that neither of these match SPRU281F.
>
> My question: assuming the DSK board results are correct,
> then how do I
> configure the C55x simulator to exactly match the hardware?
>
> Thanks,
> Regards,
> Aditi.
>
Bill-

> 40 bits is the size of the accumulator, so the long long operations have
> that much resolution. When storing the words, the compiler generates 64
> bit storage to preserve correct alignment. It may then sign extend the
> 40 bit result to 64 bits for storage.
>
> I recommend using the long long type only sparingly, as it is expensive
> both in time and space.

I think Aditi's question is "why do simulator and DSK 5510 board results not match?"; i.e. long long produces
different answers and different amount of storage.

Seems that TI persons don't know either, so for the time being the answer is to avoid long long types on 55x.

-Jeff

>> -----Original Message-----
>> From: c... [mailto:c...] On
>> Behalf Of Aditi Akula
>> Sent: Wednesday, September 29, 2010 6:55 PM
>> To: c...
>> Subject: [c55x] Long long datatype in C5510 device simulator
>> vs DSK5510
>>
>> Hi,
>>
>> I am runnning a project on both on the C5510 Device
>> simulator(no board)
>> and on the DSK5510 board.
>>
>> Both use CCSv3.3.
>>
>> I have an array of type "long long int" declared in the project.
>>
>> In the "TMS320C55x Optimizing C/C++ Compiler User's Guide" (Literature
>> Number: SPRU281F),
>>
>> on page 122 Table 5-1, it says the size of "long long"
>> datatype takes 40
>> bits.
>>
>> When I look at the variable in the Device simulator project,
>> it shows as a
>> 64-bit number. On the DSK board, it shows as 32-bit number.
>>
>> Note that neither of these match SPRU281F.
>>
>> My question: assuming the DSK board results are correct,
>> then how do I
>> configure the C55x simulator to exactly match the hardware?
>>
>> Thanks,
>> Regards,
>> Aditi.
>>
>