Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > How will synthesizers handle these statements?

Reply
Thread Tools

How will synthesizers handle these statements?

 
 
Frank
Guest
Posts: n/a
 
      02-02-2006
I put these conditions in different always and if-else-if statements, will
design compiler & ISE be smart enough to recognise them and reduce
hardware cost accordingly?

I had a tendency to write the conditions with a wire & assign statement
e.g.:
wire cond1; assign cond1 = pop && (process == 8'h25) || kick;
but if synthesizers handles these, then it will save me some thinking.






always @ (posedge clk)
begin
if (pop && (process == 8'h25) || kick)
whatever <= asdf;
else if (pop1 && (process == 8'h25) || kick1)
whatever <= asdf1;
else if (pop2 && (process == 8'h25) || kick2)
whatever <= asdf2;
end

always @ (posedge clk)
begin
if (pop && (process == 8'h25) || kick)
whatever1 <= asdf3;
else if (pop1 && (process == 8'h25) || kick1)
whatever1 <= asdf4;
else if (pop3 && (process == 8'h25) || kick3)
whatever1 <= asdf5;
end



 
Reply With Quote
 
 
 
 
a1_nocrap_exh@hotmail.com
Guest
Posts: n/a
 
      02-02-2006
Try not to cross post. This isnt anything to do with VHDL

 
Reply With Quote
 
 
 
 
Mahmoud
Guest
Posts: n/a
 
      02-02-2006
What about trying yourself?

Frank wrote:
> I put these conditions in different always and if-else-if statements, will
> design compiler & ISE be smart enough to recognise them and reduce
> hardware cost accordingly?
>
> I had a tendency to write the conditions with a wire & assign statement
> e.g.:
> wire cond1; assign cond1 = pop && (process == 8'h25) || kick;
> but if synthesizers handles these, then it will save me some thinking.
>
>
>
>
>
>
> always @ (posedge clk)
> begin
> if (pop && (process == 8'h25) || kick)
> whatever <= asdf;
> else if (pop1 && (process == 8'h25) || kick1)
> whatever <= asdf1;
> else if (pop2 && (process == 8'h25) || kick2)
> whatever <= asdf2;
> end
>
> always @ (posedge clk)
> begin
> if (pop && (process == 8'h25) || kick)
> whatever1 <= asdf3;
> else if (pop1 && (process == 8'h25) || kick1)
> whatever1 <= asdf4;
> else if (pop3 && (process == 8'h25) || kick3)
> whatever1 <= asdf5;
> end


 
Reply With Quote
 
Jason Zheng
Guest
Posts: n/a
 
      02-02-2006
Frank wrote:
> I put these conditions in different always and if-else-if statements, will
> design compiler & ISE be smart enough to recognise them and reduce
> hardware cost accordingly?
>

There's an option in many synthesizers called "resource sharing" that
will optimize for space if logic like these are found, but I think the
default is to treat them as seperate blocks. Why bother with
optimizations like this? IMO these should be the least to worry about.

> but if synthesizers handles these, then it will save me some thinking.


Do save yourself some thinking like this, let the synthesis tools worry
about optimization.
 
Reply With Quote
 
moogyd@yahoo.co.uk
Guest
Posts: n/a
 
      02-03-2006
In general, I don't think that a synthesis tool will share resources
between always blocks.

I find it best to "help" the synthesys tool where possible.

I would re-write the above code (verilog is a bit rusty)

parameter FinalCount := 8'h25 ;
wire AtFinalCount <= (process == FinalCount) ? '1' : '0' ; // or
always block

always @(clk)
begin
if (pop0 && FinalCount) || kick0
whatever <= asdf0 ;
else if
etc etc
end // always

 
Reply With Quote
 
Rob Dekker
Guest
Posts: n/a
 
      02-03-2006
Hi Frank,

The tests that you wrote will create what is called "common sub-expressions".
These are typically eliminated very early in the flow through synthesis.

So, I am convinced that you are free to write the same tests in different processes,
and it should not affect the synthesis result.

Just try to keep them the same as much as possible, so that common subexpression
elimination is guaranteed to work.


Rob



"Frank" <(E-Mail Removed)> wrote in message news:43e176bb$(E-Mail Removed)...
>I put these conditions in different always and if-else-if statements, will
> design compiler & ISE be smart enough to recognise them and reduce
> hardware cost accordingly?
>
> I had a tendency to write the conditions with a wire & assign statement
> e.g.:
> wire cond1; assign cond1 = pop && (process == 8'h25) || kick;
> but if synthesizers handles these, then it will save me some thinking.
>
>
>
>
>
>
> always @ (posedge clk)
> begin
> if (pop && (process == 8'h25) || kick)
> whatever <= asdf;
> else if (pop1 && (process == 8'h25) || kick1)
> whatever <= asdf1;
> else if (pop2 && (process == 8'h25) || kick2)
> whatever <= asdf2;
> end
>
> always @ (posedge clk)
> begin
> if (pop && (process == 8'h25) || kick)
> whatever1 <= asdf3;
> else if (pop1 && (process == 8'h25) || kick1)
> whatever1 <= asdf4;
> else if (pop3 && (process == 8'h25) || kick3)
> whatever1 <= asdf5;
> end
>
>
>
>



 
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
Package to handle table text render (handle space or tab betweenthe columns) ? =?ISO-8859-1?Q?KLEIN_St=E9phane?= Python 3 10-06-2006 08:46 AM
have you got any of these i can have spike240 Case Modding 4 09-14-2005 03:48 AM
Possible to handle web requests without an ASPX page? i.e. have DLL handle request. jdlwright@shaw.ca ASP .Net 2 05-31-2005 05:42 PM
how to handle command line output(not terminal handle) Leon Python 2 11-04-2004 05:16 AM
File Handle Reading Blues: Rereading a File Handle for Input Dietrich Perl 1 07-22-2004 10:02 AM



Advertisments