FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-23-2006, 03:40 PM
gst
Guest
 
Posts: n/a
Default testing overflow on ti c28x DSPs...

hi,

i'm a dsp programming newcomer, i was wondering what's the cleanest way
to read the V flag in the ST0 register using C...

i quickly searched through the optimizing compiler docs and ccs headers
and haven't found a directly suitable intrinsic yet...

what's your suggestion?

should i go to asm level?
maybe should i copy the status register in a safe place and then mask
it to expose the bit?

....thank you in advance

gst

Reply With Quote
  #2 (permalink)  
Old 01-23-2006, 04:14 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: testing overflow on ti c28x DSPs...

gst wrote:
> hi,
>
> i'm a dsp programming newcomer, i was wondering what's the cleanest way
> to read the V flag in the ST0 register using C...
>
> i quickly searched through the optimizing compiler docs and ccs headers
> and haven't found a directly suitable intrinsic yet...
>
> what's your suggestion?
>
> should i go to asm level?
> maybe should i copy the status register in a safe place and then mask
> it to expose the bit?
>
> ...thank you in advance


HLLs deal with flags poorly if at all. For one thing, they're supposed
to insulate the programmer from grungy details. For another, such code
wouldn't be portable. (Flag sets differ among processors. E.g., alpha
doesn't have a carry flag.) Assembly is the way. A C-callable routine
pretties up the code.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #3 (permalink)  
Old 01-24-2006, 03:56 AM
Alex
Guest
 
Posts: n/a
Default Re: testing overflow on ti c28x DSPs...

Hi,
The C and asm both produce exectly same code if you do the V flag
polling, the AND instruction. No difference from performance, but code
in C is more readable and more portable.
Good luck
Alex

Reply With Quote
  #4 (permalink)  
Old 01-24-2006, 04:03 AM
Alex
Guest
 
Posts: n/a
Default Re: testing overflow on ti c28x DSPs...

Too quick post. Why do you need for V polling if you can implement
algorithms to avoid overflow at all? If you check out Cirrus Logic'
modems (good old days!) I developed some DSP routines for them and OV
flag was not there in the HW. All ariphmetic was done without OV even
for V90 modulation .
Good luck,
Alex

Reply With Quote
  #5 (permalink)  
Old 02-10-2006, 11:31 AM
gst
Guest
 
Posts: n/a
Default Re: testing overflow on ti c28x DSPs...

(warning: horrible english writing ahead)

First of all, thank you to both of you for replying!

Sorry for having been disappeared for so long; anyway: you have been
read :-)

But I'm a still newbie, so: I can't find anything in the standard
headers that points to the overflow flag (or the whole registry), so,
to summarize, if I understand correctly, the suggestion is:

"do the operation in C, write a function intended to be used in C but
written in ASM to check the flag only"?

thank you again!

(operations without overflows: unfortunately i'm not that skilled, but
someday maybe i'll be able to do that kind of things, or at least
understand them ;-)) )

gst

Reply With Quote
  #6 (permalink)  
Old 02-10-2006, 10:44 PM
Alex
Guest
 
Posts: n/a
Default Re: testing overflow on ti c28x DSPs...

Hi,
Does your question mean 'How OV status flag is detected?' or "How OV
flag is toggled?'.
The 1st questions normally ask a person who develops high level code,
like C/asm programmers. The 2nd question usually comes from hardware a
developer, who wants to implement arithmetic in Verilog/VHDL. Look like
you are from first group, means you have to poll OV all time you want
to get values exceeding your data format limits. You may poll one in
asm or in C, just check your hardware manual for software developers to
understand what kind of overhead C command has for OV polling on your
platform. May be, that is acceptable for you.
The 2nd question actually is an algorithm selection answer. Some
algorithms toggle OV flag before arithmetic is actually executed, the
other ones do it right after result of calculation is saved or in
parallel with write. You need to reference your hardware design
specification to understand which one is more appropriate for you.
Good luck,
Alex

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SV assertion to check for overflow? [email protected] Verilog 0 06-19-2007 02:15 PM
Using FFT C28X Library with eZdsp f2812 on real data vik DSP 0 12-14-2005 08:14 PM
Overflow detector Lilmiss VHDL 1 08-02-2005 07:43 PM
Signed Adder without overflow Nemesis VHDL 4 05-25-2005 09:31 PM
fft overflow on ti dsp tms3200c54 seb DSP 0 02-10-2005 12:24 PM


All times are GMT +1. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved