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

Reply

VHDL - "simple" problem

 
Thread Tools Search this Thread
Old 11-27-2003, 05:29 PM   #1
Default "simple" problem


Hello!

I'm not programming VHDL now for a long time, so I've got a problem, that is
for sure quite simple:

I've got a vhdl source code that I took from the Xilinx Application Notes.
One of the ports is an inout that has 32 bits. Now what I want is two
16bit-ports. I JUST want to have the two 16bit ports on the entity, but it
doesn't matter if the vhdl code works with the 32bit-signal, so I just want
to put the two 16bit-signals together after declaring the entity.

so what i did was:

entity ... is
port( sys_data: inout std_logic_vector(15 downto 0);
sys_addr: inout std_logic_vector(15 downto 0);
...
);
end entity ...;

architechture behavioural of ... is

signal AD: std_logic_vector(31 downto 0);
...

component (...)
...

begin

%component instantiations%

process(...)
...
end process;

process(...)
...
end process;

AD <= sys_addr(15 downto 0) & sys_data(15 downto 0);
...

end architecture;

WHY doesn't it work?
When I do a behavioural simulation with modelsim, AD is undefined (all the
16 bits) and nearly everything else too.

Please don't *kill* me, because it's a silly question.. i just can't find a
solution!

THANX!

Simone



Simone Winkler
  Reply With Quote
Old 11-27-2003, 06:13 PM   #2
Jonathan Bromley
 
Posts: n/a
Default Re: "simple" problem
"Simone Winkler" <> wrote in
message news:...

> I've got a vhdl source code that I took from the Xilinx Application Notes.
> One of the ports is an inout that has 32 bits. Now what I want is two
> 16bit-ports. I JUST want to have the two 16bit ports on the entity, but it
> doesn't matter if the vhdl code works with the 32bit-signal, so I just

want
> to put the two 16bit-signals together after declaring the entity.
>
> entity ... is
> port( sys_data: inout std_logic_vector(15 downto 0);
> sys_addr: inout std_logic_vector(15 downto 0);
> ...
> );
> end entity ...;
>
> architechture behavioural of ... is
>
> signal AD: std_logic_vector(31 downto 0);
> begin

[...]
> AD <= sys_addr(15 downto 0) & sys_data(15 downto 0);

[...]
> end architecture;


> WHY doesn't it work?
> When I do a behavioural simulation with modelsim, AD is undefined (all the
> 16 bits) and nearly everything else too.


If these were input ports, the code you post would be fine.

In the absence of anything else, the code is *still* fine
even for inout ports.

However, there could easily be some problems about the way you
are driving AD to push data onto the inout ports when your
internal outputs are enabled. Something like this:

AD <= sys_addr(15 downto 0) & sys_data(15 downto 0);
sys_addr <= AD(15 downto 0);
sys_data <= AD(15 downto 0);

Whoops, now we really have a problem - a combinational loop.

So I would have thought the easy solution was to make a
wrapper component that splits the bus for you...

entity wrapper is
port

sys_data: inout std_logic_vector(15 downto 0);
sys_addr: inout std_logic_vector(15 downto 0);
[...] -- pass all the other signals through too
);
end;

architecture W of wrapper is
component the_old_32_bit_version
port (
AD: inout std_logic_vector(31 downto 0);
[...] -- other stuff
);
end component;
begin
guts: AD port map (
AD(15 downto 0) => sys_data,
AD(31 downto 16) => sys_addr);
end;

HTH

--

Jonathan Bromley, Consultant

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

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
Fax: +44 (0)1425 471573 Web: http://www.doulos.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
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
Dial Up Problem smackedass A+ Certification 3 02-02-2007 11:59 PM
Re: Virus Problem ** Help!** David BlandIII A+ Certification 1 03-02-2004 06:00 PM
Pioneer DVR3100S problem with Satellite receiver Samsung DCR 9500 Fredrik Bengtsson DVD Video 0 12-12-2003 02:32 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM
Re: Serious Computer Problem Bret A+ Certification 0 11-19-2003 12:51 AM




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