Reply by bsdap November 30, 20052005-11-30
>bsdap wrote: > > ... > >> Hello Jerry, >> >> Thanks for the reply. >> I think the simulator for a fixed point DSP processor simulates the >> floating point because I could not figure out any floating point
library
>> in the simulator. But when I saw the Assembly output generated by the >> compiler and while single stepping through it I found that for
floating
>> point arith it refers to some specific memory locations and executes
an
>> assembly language code for respective operations which would do the >> floating point calculation. For example I looked at floating point >> multiplication part. It looks something like this. >> >> ===== >> __float32_mul >> >> SSYNC ; >> [ -- SP ] = ( R7:4 , P5:3 ) ; >> R7 = R0 ^ R1 ; >> P0 = R7 ; >> R4 = 0 ; >> R2 = R0 << 0x1 ; >> R3 = R1 << 0x1 ; >> CC = R2 == R4 ; >> IF CC JUMP RETURN_MULTZERO ; >> CC = R3 == R4 ; >> IF CC JUMP RETURN_MULTZERO ; >> R2 = R2 >> 24 ; >> R3 = R3 >> 24 ; >> R4 = 127 ( X ) ; >> R5 = R2 + R3 ; >> R5 = R5 - R4 ; >> P1 = R5 ; >> R4 <<= 0x1 ; >> CC = R4 < R5 ; >> IF CC JUMP OVERFLOW ; >> >> ===== >> Being unfamilier to assembly I could understand very little of it. >> >> Also after the last posting I could manage to get an emulator hardware
kit
>> (for ADSP BF535) from my friend and tried to execute the Fixed Point >> program on it. And there was not a big difference. The same results
were
>> shown again. >> I dont know why this is happening. As you said may be something very >> simple but I am not able to catch it and that is the fact. :( >> Thanks a lot, > >That's a lot of instructions compared to a single-cycle fixed-point >multiply, even accounting for setup. (There must be even more code that >includes the jump targets and call-and-return code.) That it doesn't >show in the timing is strange. Good luck tracking it down. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >
Well, thanks for the wishes...Jerry. And also for all the help. B.S.D.
Reply by Jerry Avins November 29, 20052005-11-29
bsdap wrote:

   ...

> Hello Jerry, > > Thanks for the reply. > I think the simulator for a fixed point DSP processor simulates the > floating point because I could not figure out any floating point library > in the simulator. But when I saw the Assembly output generated by the > compiler and while single stepping through it I found that for floating > point arith it refers to some specific memory locations and executes an > assembly language code for respective operations which would do the > floating point calculation. For example I looked at floating point > multiplication part. It looks something like this. > > ===== > __float32_mul > > SSYNC ; > [ -- SP ] = ( R7:4 , P5:3 ) ; > R7 = R0 ^ R1 ; > P0 = R7 ; > R4 = 0 ; > R2 = R0 << 0x1 ; > R3 = R1 << 0x1 ; > CC = R2 == R4 ; > IF CC JUMP RETURN_MULTZERO ; > CC = R3 == R4 ; > IF CC JUMP RETURN_MULTZERO ; > R2 = R2 >> 24 ; > R3 = R3 >> 24 ; > R4 = 127 ( X ) ; > R5 = R2 + R3 ; > R5 = R5 - R4 ; > P1 = R5 ; > R4 <<= 0x1 ; > CC = R4 < R5 ; > IF CC JUMP OVERFLOW ; > > ===== > Being unfamilier to assembly I could understand very little of it. > > Also after the last posting I could manage to get an emulator hardware kit > (for ADSP BF535) from my friend and tried to execute the Fixed Point > program on it. And there was not a big difference. The same results were > shown again. > I dont know why this is happening. As you said may be something very > simple but I am not able to catch it and that is the fact. :( > Thanks a lot,
That's a lot of instructions compared to a single-cycle fixed-point multiply, even accounting for setup. (There must be even more code that includes the jump targets and call-and-return code.) That it doesn't show in the timing is strange. Good luck tracking it down. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by bsdap November 29, 20052005-11-29
>> >> Hi Jerry, >> First of all, a million thanks for replying my query and the guidance.
>> The simulator timing is definitely related to real Hardware because
the
>> simulator is selected for the BF535 DSP so it has to load all the
settings
>> for the said DSP. >> I am still confused why this would happen. I was just thinking whether
the
>> issue is related to optimization of the code, but I am not sure.If it
is
>> the issue related to optimization then what steps need to be followed??
Or
>> if I have to use some Blackfin specific libraries (?) then from where I
can
>> get it?? >> Thanks again, >> B.S.D. > >Well then, how does the how does the simulator handle floating-point >arithmetic? It cannot execute it, so the compiler would have to have >used a floating-point library. What does the linker tell you? Have you >looked at the assembly output from the compiler? > >Something simple is happening, but you're making at least one assumption
>that keeps you from seeing it. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >
Hello Jerry, Thanks for the reply. I think the simulator for a fixed point DSP processor simulates the floating point because I could not figure out any floating point library in the simulator. But when I saw the Assembly output generated by the compiler and while single stepping through it I found that for floating point arith it refers to some specific memory locations and executes an assembly language code for respective operations which would do the floating point calculation. For example I looked at floating point multiplication part. It looks something like this. ===== __float32_mul SSYNC ; [ -- SP ] = ( R7:4 , P5:3 ) ; R7 = R0 ^ R1 ; P0 = R7 ; R4 = 0 ; R2 = R0 << 0x1 ; R3 = R1 << 0x1 ; CC = R2 == R4 ; IF CC JUMP RETURN_MULTZERO ; CC = R3 == R4 ; IF CC JUMP RETURN_MULTZERO ; R2 = R2 >> 24 ; R3 = R3 >> 24 ; R4 = 127 ( X ) ; R5 = R2 + R3 ; R5 = R5 - R4 ; P1 = R5 ; R4 <<= 0x1 ; CC = R4 < R5 ; IF CC JUMP OVERFLOW ; ===== Being unfamilier to assembly I could understand very little of it. Also after the last posting I could manage to get an emulator hardware kit (for ADSP BF535) from my friend and tried to execute the Fixed Point program on it. And there was not a big difference. The same results were shown again. I dont know why this is happening. As you said may be something very simple but I am not able to catch it and that is the fact. :( Thanks a lot, B.S.D.
Reply by Jerry Avins November 28, 20052005-11-28
bsdap wrote:
>>On a Blackfin, fixed-point math will be much faster that floating point. > > >>Software floating point is very slow compared to single-cycle fixed >>point, and addition takes longer than multiplication. Is your simulator > > >>timing related to real hardware? >> >>Jerry >>-- >>Engineering is the art of making what you want from things you can get. >>&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >> > > > Hi Jerry, > First of all, a million thanks for replying my query and the guidance. > The simulator timing is definitely related to real Hardware because the > simulator is selected for the BF535 DSP so it has to load all the settings > for the said DSP. > I am still confused why this would happen. I was just thinking whether the > issue is related to optimization of the code, but I am not sure.If it is > the issue related to optimization then what steps need to be followed?? Or > if I have to use some Blackfin specific libraries (?) then from where I can > get it?? > Thanks again, > B.S.D.
Well then, how does the how does the simulator handle floating-point arithmetic? It cannot execute it, so the compiler would have to have used a floating-point library. What does the linker tell you? Have you looked at the assembly output from the compiler? Something simple is happening, but you're making at least one assumption that keeps you from seeing it. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by bsdap November 28, 20052005-11-28
> >On a Blackfin, fixed-point math will be much faster that floating point.
>Software floating point is very slow compared to single-cycle fixed >point, and addition takes longer than multiplication. Is your simulator
>timing related to real hardware? > >Jerry >-- >Engineering is the art of making what you want from things you can get. >&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >
Hi Jerry, First of all, a million thanks for replying my query and the guidance. The simulator timing is definitely related to real Hardware because the simulator is selected for the BF535 DSP so it has to load all the settings for the said DSP. I am still confused why this would happen. I was just thinking whether the issue is related to optimization of the code, but I am not sure.If it is the issue related to optimization then what steps need to be followed?? Or if I have to use some Blackfin specific libraries (?) then from where I can get it?? Thanks again, B.S.D.
Reply by November 26, 20052005-11-26
I don't understand how you are comparing with floating point
operations, since floating point ops won't be supported by your
processor.

For most DSPs multiplication, addition etc. should take only 1 cycle if
you are working within the supported precision for data. So you need to
take care of the precision that is supported for the operations. e.g.
if 16-bit multiplication instruction is supported you can't do
32-multiplication in single cycle. Division would usually take many
more since most fixed point processors don't have a division circuit
and division is supported by algorithms using subtraction.

Reply by Jerry Avins November 25, 20052005-11-25
jmoes@chello.nl wrote:
> ... A > floating point DSP can multiply and accumulate 2 floating point values > within one cycle. A fixed point 16 bit DSP does the same thing but with > two 16 bit values.
I assume you have particular processors in mind. Certainly not all have the data-bus and memory arrangements to fetch four operands in the same cycle. > To perform a multiply and accumulate of two floating
> point values with a 16 bit DSP logically takes more time than with a > floating point DSP. Even a 32 bit DSP will take more time to do the > same operation.
Logically but not in fact? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by November 25, 20052005-11-25
Any DSP can do a multiply and accumulate within a single cycle. A
floating point DSP can multiply and accumulate 2 floating point values
within one cycle. A fixed point 16 bit DSP does the same thing but with
two 16 bit values. To perform a multiply and accumulate of two floating
point values with a 16 bit DSP logically takes more time than with a
floating point DSP. Even a 32 bit DSP will take more time to do the
same operation.

Reply by Jerry Avins November 25, 20052005-11-25
bsdap wrote:
>>A floating point DSP sometimes has floating point multipliers but not >>fixed point. >> >>Then, a compiler will sometimes convert fixed point to floating point, >>use the floating point multiplier, and convert back to fixed point. >>This takes longer. >> >>As Jerry says, it is probably a question of what hardware there is, and >>what the compiler tries to do with it. >> >>Chris >>====================== >>Chris Bore >>BORES Signal Processing >>www.bores.com >> >> > > > Hi, > Thank you very much for the replies. > I am extremely sorry I forgot to give the details. > Actually I am not using any hardware but simulating the code for Blackfin > processor (BF535) which is supposed to be a fixed point processor in > Visual DSP++ and that is why I am more concerned about the above query. > The fixed point functions that I have used are all from the standard fixed > point library (dsp_fx). > Now can you please help me out. > B.S.D.
On a Blackfin, fixed-point math will be much faster that floating point. Software floating point is very slow compared to single-cycle fixed point, and addition takes longer than multiplication. Is your simulator timing related to real hardware? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by bsdap November 25, 20052005-11-25
>A floating point DSP sometimes has floating point multipliers but not >fixed point. > >Then, a compiler will sometimes convert fixed point to floating point, >use the floating point multiplier, and convert back to fixed point. >This takes longer. > >As Jerry says, it is probably a question of what hardware there is, and >what the compiler tries to do with it. > >Chris >====================== >Chris Bore >BORES Signal Processing >www.bores.com > >
Hi, Thank you very much for the replies. I am extremely sorry I forgot to give the details. Actually I am not using any hardware but simulating the code for Blackfin processor (BF535) which is supposed to be a fixed point processor in Visual DSP++ and that is why I am more concerned about the above query. The fixed point functions that I have used are all from the standard fixed point library (dsp_fx). Now can you please help me out. B.S.D.