Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > VHDL function synthesis

Reply
Thread Tools

VHDL function synthesis

 
 
Thanga
Guest
Posts: n/a
 
      08-30-2006
Hi all,
I have doubt on VHDL function synthesis....

my code structure is

entity rtl is
generic (

parameter : interger := [value];
);
port(
portlist
);

architecture
begin
function1;
function2;
function3;
function4;
end architecture;

All the fucntions are defined in package.
Depend on the generic parameter, one of four functions will be
invoked.
I have to optimize this logic for only one function.

Now my doubt is,
If I freeze the parameter to a constant value, during synthesis what
will happen?
ie) only the selected fuction will be synthesized or all the four
funcions will be synthesized?

I know one direct way is removing other functions.
Since i don't want disturb the code but have to optimize the logic,
asking this doubt....

Thanks in advance,
Thanga.

 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      08-30-2006

Thanga wrote:
What you have listed is a bit sketchy but.
> Now my doubt is,
> If I freeze the parameter to a constant value, during synthesis what
> will happen?
> ie) only the selected fuction will be synthesized or all the four
> funcions will be synthesized?

If the synthesis tool can determine, based on the parameter that the
other functions can not possibly be called then they will be optomized
away. An example would be
entity Foo is generic(Xyz: integer)
end Foo;
architecture FooFoo of Foo is
begin
case Xyz is
when 1 => -- Do something
when 2 => -- Do something else
when 3 => -- Do something different
when others => -- Do something really different
end case;
end FooFoo;

If you then instantiate Foo(1) then in the synthesis output the entire
case statement will collapse down to the "-- Do something" code.

KJ

 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      08-30-2006
Thanga wrote:

> architecture
> begin
> function1;
> function2;
> function3;
> function4;
> end architecture;


Note also that a function
represents a value, not a process,
so better make that something like:


begin
myport <= function1;


-- Mike Treseler
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      08-30-2006
Thanga,

There are several issues with what you want to do:

First, vhdl functions are not statements; they are expressions, and
they must return a value which has to be handled (i.e. assigned to
something, or evaluated in a condition). They cannot be called
stand-alone.

Procedures, on the other hand, are statements, and can be called
stand-alone, as in a concurrent procedure call.

However, all synthesis tools I'm aware of do not permit a procedure or
function to pass time (i.e. have a wait statement). Therefore, unless
the procedure defines purely combinatorial logic, it is not
synthesizable.

Finally, with no outputs or inputs, a concurrent procedure call will
not synthesize to anything, regardless of what happens inside.

>From a simulation point of view, a concurrent procedure call is an

implied process with a sensitivity list made up of all the procedure's
parameters of mode in or inout. If the procedure does not have
parameters, then it will be executed exactly once. The re-execution
normally associated with concurrent procedure calls would have to be
handled with a loop internal to the process (i.e. never let it exit).

As to optimizations, constants, generics, and for loop indices are all
treated as static values and optimized out, to the extent possible.

Andy


KJ wrote:
> Thanga wrote:
> What you have listed is a bit sketchy but.
> > Now my doubt is,
> > If I freeze the parameter to a constant value, during synthesis what
> > will happen?
> > ie) only the selected fuction will be synthesized or all the four
> > funcions will be synthesized?

> If the synthesis tool can determine, based on the parameter that the
> other functions can not possibly be called then they will be optomized
> away. An example would be
> entity Foo is generic(Xyz: integer)
> end Foo;
> architecture FooFoo of Foo is
> begin
> case Xyz is
> when 1 => -- Do something
> when 2 => -- Do something else
> when 3 => -- Do something different
> when others => -- Do something really different
> end case;
> end FooFoo;
>
> If you then instantiate Foo(1) then in the synthesis output the entire
> case statement will collapse down to the "-- Do something" code.
>
> KJ


 
Reply With Quote
 
Thanga
Guest
Posts: n/a
 
      08-31-2006

Mike Treseler wrote:
> Thanga wrote:
>
> > architecture
> > begin
> > function1;
> > function2;
> > function3;
> > function4;
> > end architecture;

>
> Note also that a function
> represents a value, not a process,
> so better make that something like:
>
>
> begin
> myport <= function1;
>
>
> -- Mike Treseler



Hi All,
The code i have shown is just to adderss the issue. please ignore
syntax...
All I want to know is, if the parameter is fixed to constant value then
how synthesis tool will react?
Only the intended function for given parameter would be synthsized or
all functions would be synthsized?

Regards,
Thanga.

 
Reply With Quote
 
KJ
Guest
Posts: n/a
 
      08-31-2006

"Thanga" <> wrote in message
news: oups.com...
> Hi All,
> The code i have shown is just to adderss the issue. please ignore
> syntax...
> All I want to know is, if the parameter is fixed to constant value then
> how synthesis tool will react?

Read my first post, the short answer is that given a particular parameter
value everything that can't happen will be optomized away

> Only the intended function for given parameter would be synthsized or
> all functions would be synthsized?

Correct

KJ


 
Reply With Quote
 
KJ
Guest
Posts: n/a
 
      08-31-2006

KJ wrote:
> > Only the intended function for given parameter would be synthsized or
> > all functions would be synthsized?

> Correct


Oops, kinda confusing I was...what is correct is that "Only the
intended function for given parameter would be synthsized"

KJ

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
SPARK C-to-VHDL Synthesis tool now supports Windows & Xilinx XST S Gupta VHDL 0 01-13-2004 07:50 AM
Release of SPARK C-to-VHDL Parallelizing High Level Synthesis tool S Gupta VHDL 0 12-28-2003 07:04 PM
SOS! newbie question about synthesizable VHDL : synthesis run successfully but post-synthesis failed... walala VHDL 4 09-09-2003 08:41 AM
what are the possible reasons that successful pre-synthesis simulation + successful synthesis = failed post-synthes walala VHDL 4 09-08-2003 01:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57