Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - synthesis equivalent statement/code/suggestions ?

 
Thread Tools Search this Thread
Old 01-17-2007, 03:58 PM   #1
Default synthesis equivalent statement/code/suggestions ?



Hello,

I have this quesiton - on writing a synthesis equivalent code -

Question on how to write a synthesis equivalent code in VHDL for the
below code -

Counter is a synchronous with Clock and has a synchro. reset inside.

************************************************** *******************************
signal CNT_OUT : unsigned ( 9 downto 0 );

begin

counter_dut : count1 ( clk => CLK,
reset => reset,
cntout => CNT_OUT );

---- this statement is what my question is about really
-- How does the synthesis engine interpret this statement.
-- is it okay to give a decimal integer value here on the right side of
the comparison ?


MISER_PLL_RESETN <= '1' when (CNT_OUT >= 50 and CNT_OUT <= 100) else

'0' ;

Appreciate any help / suggestions on this. Thanks.

Regards,
Rama



Rama
  Reply With Quote
Old 01-19-2007, 04:57 PM   #2
mysticlol
 
Posts: n/a
Default Re: synthesis equivalent statement/code/suggestions ?
use to_integer() or conv_integer()

Regards,
JK

On Jan 17, 8:58 pm, "Rama" <ramachaga...@gmail.com> wrote:
> Hello,
>
> I have this quesiton - on writing a synthesis equivalent code -
>
> Question on how to write a synthesis equivalent code in VHDL for the
> below code -
>
> Counter is a synchronous with Clock and has a synchro. reset inside.
>
> ************************************************** *******************************
> signal CNT_OUT : unsigned ( 9 downto 0 );
>
> begin
>
> counter_dut : count1 ( clk => CLK,
> reset => reset,
> cntout => CNT_OUT );
>
> ---- this statement is what my question is about really
> -- How does the synthesis engine interpret this statement.
> -- is it okay to give a decimal integer value here on the right side of
> the comparison ?
>
> MISER_PLL_RESETN <= '1' when (CNT_OUT >= 50 and CNT_OUT <= 100) else
>
> '0' ;
>
> Appreciate any help / suggestions on this. Thanks.
>
> Regards,
> Rama




mysticlol
  Reply With Quote
Old 01-26-2007, 12:50 AM   #3
Rob Dekker
 
Posts: n/a
Default Re: synthesis equivalent statement/code/suggestions ?

"Rama" <> wrote in message news: ps.com...
......
> signal CNT_OUT : unsigned ( 9 downto 0 );

.....
> MISER_PLL_RESETN <= '1' when (CNT_OUT >= 50 and CNT_OUT <= 100) else '0' ;

......
> -- How does the synthesis engine interpret this statement.


It creates two 10-bit comparators and an AND gate.

> -- is it okay to give a decimal integer value here on the right side of
> the comparison ?


From a language (compilation) point of view, it depends on where you got the 'unsigned' type from.
If you are using the IEEE 'numeric_std' package (and you better!) then the answer is Yes.
It is OK, because the numeric_std package contains a definition for a >= operator (and also a <= operator) which accepts a unsigned
on the left and a natural (integer) on the right :

From the numeric_std package :

function ">=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
..
function "<=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;

So the code should compile as-is.

Now for synthesis, you are fine too. Don't be concerned that there are going to be 32 bit comparators.
10 bit comparators is enough and synthesis tools will know that.

> Appreciate any help / suggestions on this. Thanks.
>
> Regards,
> Rama
>





Rob Dekker
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
image (jpg,bmp,gif, etc.) convert to equivalent binary representation using vb.net? archieSupremo Software 0 09-06-2009 12:20 PM
equivalent function for itoa in Linux gcc compiler suse Software 0 03-06-2009 05:30 AM
Synplicity synthesis error etoktas Hardware 0 07-12-2006 01:52 PM
DVD Verdict reviews: FULLMETAL ALCHEMIST: EQUIVALENT EXCHANGE (VOLUME 3) and more! DVD Verdict DVD Video 0 07-28-2005 09:12 AM
NEED A+ CERTIFIED OR EQUIVALENT EXPERIENCE IN SOUTH FLORIDA Happy_Life A+ Certification 0 12-12-2003 09:14 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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