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

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-18-2003, 08:17 AM
Max
Guest
 
Posts: n/a
Default useless synthetized blocks

I tried to implement a decoder in two differnet way:
--------------8<-------------------------
entity main is
Generic (w : integer := 12);
Port ( addr : in std_logic_vector(3 downto 0);
ce : in std_logic;
y : out std_logic_vector(w-1 downto 0));
end main;

architecture Behavioral of main is

begin

-- first way
process (addr, ce)
begin
y <= (others => '0');
if (addr < w and ce = '1') then
y(to_integer(unsigned(addr))) <= '1';
end if;
end process;

-- second way
--y <= (others => '0') when ce = '0' else
-- "000000000001" when addr = "0000" else
-- "000000000010" when addr = "0001" else
-- "000000000100" when addr = "0010" else
-- "000000001000" when addr = "0011" else
-- "000000010000" when addr = "0100" else
-- "000000100000" when addr = "0101" else
-- "000001000000" when addr = "0110" else
-- "000010000000" when addr = "0111" else
-- "000100000000" when addr = "1000" else
-- "001000000000" when addr = "1001" else
-- "010000000000" when addr = "1010" else
-- "100000000000" when addr = "1011" else
-- (others => '0');

end Behavioral;
--------------8<-------------------------

I prefer the firsr version since I don't need to rewrite the code if
generic 'w' changes.
After synthesis the device utilization is exacly the same, but looking
at rtl schematics (I use xilinx webpack ise) there is a differce:
in the first way is synthetized a comparator. This is correct but
useless since the other logic can provide its function.

there is another way to avoid the presence of comparator?

thanks
Reply With Quote
  #2 (permalink)  
Old 09-18-2003, 05:44 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: useless synthetized blocks

Max wrote:

>
> I prefer the firsr version since I don't need to rewrite the code if
> generic 'w' changes.


I agree.

> After synthesis the device utilization is exacly the same,


That's all that matters.

> but looking
> at rtl schematics (I use xilinx webpack ise) there is a differce:
> in the first way is synthetized a comparator. This is correct but
> useless since the other logic can provide its function.
>
> there is another way to avoid the presence of comparator?


The RTL schematic is a logical view,
not an optimized netlist.

The comparator is not a real logic block.

The technology schematic shows how
the actual logic blocks will be used.

-- Mike Treseler

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
How do I treat "default" case which is useless? Mr. Ken FPGA 17 08-07-2006 11:17 PM
some virtexII clock pads are useless?? lik FPGA 5 08-22-2005 08:25 AM
Specify Blocks Pankaj Golani Verilog 0 08-19-2004 07:12 AM
Yet Another Altera Online Support Is USELESS Rant... Kenneth Land FPGA 6 04-15-2004 01:06 PM


All times are GMT +1. The time now is 09:50 AM.


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