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

Reply

VHDL - Unconstrained array ports - Good or Bad?

 
Thread Tools Search this Thread
Old 01-28-2007, 06:08 PM   #1
Default Unconstrained array ports - Good or Bad?


As a newbie to this area I am confused as to the status/views on
unconstrained array ports.

They appear to be legal, in the VHDL language and "The Designers Guide
to VHDL" by Peter Ashenden makes them out to be a great thing for
producing re-usable entities. However, the Xilinx synthesizer does not
allow them and other reports I've read on the topic seem to indicate
either implicitly or explicitly that they are a Very Bad Thing.

Can the experts who visit this newsgroup provide some insight to clarify
the position?

Thanks!


Anon Anon
  Reply With Quote
Old 01-28-2007, 07:25 PM   #2
Jonathan Bromley
 
Posts: n/a
Default Re: Unconstrained array ports - Good or Bad?
On Sun, 28 Jan 2007 18:08:57 +0000, Anon Anon <> wrote:

>As a newbie to this area I am confused as to the status/views on
>unconstrained array ports.
>
>They appear to be legal, in the VHDL language and "The Designers Guide
>to VHDL" by Peter Ashenden makes them out to be a great thing for
>producing re-usable entities. However, the Xilinx synthesizer does not
>allow them


I don't know where you get the idea that XST can't do unconstrained
vector ports. Any synthesiser with a sensible understanding of VHDL
will handle them.

Of course, you can't put unconstrained ports on your top-level
entity, because you're not connecting anything to the port that
would specify its vector range. Within a design, though, they
can make some simple modules much easier to code. Try this...

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
entity decoder is
port (
code: in std_logic_vector;
onehot: out std_logic_vector
);
end decoder;
architecture RTL of decoder is
begin
assert onehot'length = 2**code'length; -- avoid abuse
process(code)
begin
onehot <= (onehot'range=>'0');
onehot(to_integer(unsigned(code))) <= '1';
end process;
end RTL;

Now we have a decoder, we can make use of it in an
enclosing module:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity decoder3to8 is
port (
code : in std_logic_vector(2 downto 0);
onehot: out std_logic_vector(7 downto 0)
);
end decoder3to8;
architecture RTL of decoder3to8 is
begin
the_decoder: entity work.decoder port map (code, onehot);
end RTL;

No problem for XST.

> and other reports I've read on the topic seem to indicate
>either implicitly or explicitly that they are a Very Bad Thing.


Really? Do they offer any cogent reasoning to support
their position? Or are they just creating apologia for some
tool that doesn't know how to handle this immensely
useful construct?

Note that many of the more interesting uses for
unconstrained *ports*can be more cleanly coded
by using unconstrained *function parameters*.
Synthesis tools that lack support for unconstrained
ports typically atone for their sins by
supporting unconstrained function parameters.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK

http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.


Jonathan Bromley
  Reply With Quote
Old 01-28-2007, 07:39 PM   #3
Anon Anon
 
Posts: n/a
Default Re: Unconstrained array ports - Good or Bad?
Jonathan Bromley wrote:
> On Sun, 28 Jan 2007 18:08:57 +0000, Anon Anon <> wrote:
>
>> As a newbie to this area I am confused as to the status/views on
>> unconstrained array ports.
>>
>> They appear to be legal, in the VHDL language and "The Designers Guide
>> to VHDL" by Peter Ashenden makes them out to be a great thing for
>> producing re-usable entities. However, the Xilinx synthesizer does not
>> allow them

>
> I don't know where you get the idea that XST can't do unconstrained
> vector ports. Any synthesiser with a sensible understanding of VHDL
> will handle them.
>
> Of course, you can't put unconstrained ports on your top-level
> entity, because you're not connecting anything to the port that
> would specify its vector range. Within a design, though, they
> can make some simple modules much easier to code. Try this...
>
> library IEEE;
> use IEEE.STD_LOGIC_1164.ALL;
> use IEEE.numeric_std.ALL;
> entity decoder is
> port (
> code: in std_logic_vector;
> onehot: out std_logic_vector
> );
> end decoder;
> architecture RTL of decoder is
> begin
> assert onehot'length = 2**code'length; -- avoid abuse
> process(code)
> begin
> onehot <= (onehot'range=>'0');
> onehot(to_integer(unsigned(code))) <= '1';
> end process;
> end RTL;
>
> Now we have a decoder, we can make use of it in an
> enclosing module:
>
> library IEEE;
> use IEEE.STD_LOGIC_1164.ALL;
> entity decoder3to8 is
> port (
> code : in std_logic_vector(2 downto 0);
> onehot: out std_logic_vector(7 downto 0)
> );
> end decoder3to8;
> architecture RTL of decoder3to8 is
> begin
> the_decoder: entity work.decoder port map (code, onehot);
> end RTL;
>
> No problem for XST.
>
>> and other reports I've read on the topic seem to indicate
>> either implicitly or explicitly that they are a Very Bad Thing.

>
> Really? Do they offer any cogent reasoning to support
> their position? Or are they just creating apologia for some
> tool that doesn't know how to handle this immensely
> useful construct?
>
> Note that many of the more interesting uses for
> unconstrained *ports*can be more cleanly coded
> by using unconstrained *function parameters*.
> Synthesis tools that lack support for unconstrained
> ports typically atone for their sins by
> supporting unconstrained function parameters.


Thanks for your feedback, which sort-of confirms my own feeling, that
they really *are* a good feature. Incidentally, (hint) I do actually use
them in my other current posting, which relates to some problems I'm
having with the Xilinx Floating-Point IP

Unfortunately, I can't pin-down the site which criticised them - but
I've looked at so many sites in the past few days it's hard to remember
where I've been!

Thanks


Anon Anon
  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
Need examples of GOOD Anime Geo H DVD Video 84 05-20-2008 06:04 AM
Re: USB issue ... some USB 2 ports working only in USB 1 mode hungsolo2005@yahoo.com A+ Certification 0 06-14-2006 08:26 PM
alot of open ports leno bob A+ Certification 8 03-27-2005 11:44 PM
Re: recommend a good interactive cdrom/online training course? Anthony A+ Certification 2 09-04-2004 08:35 AM
Re: Need examples of GOOD Anime Wade365 DVD Video 12 06-30-2003 02:35 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