Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   connecting std_logic inout ports and std_logic_vector inout port (http://www.velocityreviews.com/forums/t549836-connecting-std_logic-inout-ports-and-std_logic_vector-inout-port.html)

=?ISO-8859-15?Q?Fr=E9d=E9ric_Lochon?= 11-06-2007 09:47 PM

connecting std_logic inout ports and std_logic_vector inout port
 
Hi,

I'm looking for a (nice) way to connect std_logic_vector and several
std_logic in order to avoid modifying UCF files in ISE.

My simplified problem:
I have a top entity with two "inout" ports (let's say Data_0 and Data_1)
with type std_logic.
I want to map these two signals on an "inout" port of a component with
type std_logic_vector(1 downto 0).

My first idea was to use an alias, but I can't make it work. I tried
several ways:
- alias Data : std_logic_vector(1 downto 0) is (Data_0, Data_1);
- alias Data : std_logic_vector(1 downto 0) is (Data_0 & Data_1);
- alias Data : std_logic_vector(1 downto 0) is Data_0, Data_1;
- alias Data : std_logic_vector(1 downto 0) is Data_0 & Data_1;
ISE gives me an error in every case.

My second idea was to map directly.
port map ( Data => Data_0 & Data_1);
But ISE doesn't want to do that with inout ports.


For now, I'm lacking of ideas because I would really appreciate to solve
this issue without modifying my top entity.

Thanks in advance.

Duane Clark 11-06-2007 10:03 PM

Re: connecting std_logic inout ports and std_logic_vector inout port
 
Frédéric Lochon wrote:
>
> My second idea was to map directly.
> port map ( Data => Data_0 & Data_1);


port map ( Data(0) => Data_0, Data(1) => Data_1 );

Tricky 11-08-2007 01:35 AM

Re: connecting std_logic inout ports and std_logic_vector inout port
 
On Nov 6, 10:03 pm, Duane Clark <junkm...@junkmail.com> wrote:
> Frédéric Lochon wrote:
>
> > My second idea was to map directly.
> > port map ( Data => Data_0 & Data_1);

>
> port map ( Data(0) => Data_0, Data(1) => Data_1 );


Or, maybe less elegent in the top level entity

signal temp_data : std_logic_vector(1 downto 0);
begin

temp_data <= data_1 & data_0;

--port map
data => temp_data,


KJ 11-08-2007 03:55 AM

Re: connecting std_logic inout ports and std_logic_vector inout port
 

"Tricky" <Trickyhead@gmail.com> wrote in message
news:1194455996.100802.202830@y27g2000pre.googlegr oups.com...
On Nov 6, 10:03 pm, Duane Clark <junkm...@junkmail.com> wrote:
> > Frédéric Lochon wrote:
> >
> > > My second idea was to map directly.
> > > port map ( Data => Data_0 & Data_1);

> >
> > port map ( Data(0) => Data_0, Data(1) => Data_1 );

>
> Or, maybe less elegent in the top level entity
>
> signal temp_data : std_logic_vector(1 downto 0);
> begin
>
> temp_data <= data_1 & data_0;
>
> --port map
> data => temp_data,


What you've suggested will only work if 'Data' is an input to the entity.

A similar (but reversed) approach of defining a temporary vector would work
if 'Data' was an output.

No such trick that I know of will work if 'Data' is an inout...mapping each
bit as Duane suggested will work in all situations.

KJ




All times are GMT. The time now is 11:47 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, 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 47 48 49 50 51 52 53 54 55 56 57