![]() |
|
|
|||||||
![]() |
VHDL - synthesis equivalent statement/code/suggestions ? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
"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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |