How to use inout ports????

Discussion in 'VHDL' started by Jasper, Apr 28, 2004.

  1. Jasper

    Jasper Guest

    Hi everybody,

    I have to use bidirectional ports in my VHDL design, but it only gives
    me problems till so far. In my design I have 2 different blocks.
    Because I'm a starter, I will begin simple. In both blocks there is a
    counter running on the clock.
    In the first one, when the counter runs from 0 to 4, this first block
    inout is used as output and the second block is reading this data, so
    his inout is used as an input. When both counters are exactly 5, the
    inouts of both blocks become 'Z'. From 6 to 10 the direction is the
    other way round.
    Here is my VHDL code for both blocks, I made a schematic, and linked
    the two blocks, clk, rst, and the both inout ports with each other.
    After that we runned a functional simulation and the compilation of
    this all gave te following error: Does anyone know how to use a
    bidirectional port to exchange data between 2 VHDL modules, using
    inout?

    I hope anyone could help me,

    Thanx,

    Jasper.

    --------------
    error
    --------------
    Logical Error 3509: Output 'N_1' in upper-level source 'bikanten'
    can't be redriven to functional_block 'module_2'
    Logical Error 3509: Output 'N_1.OE' in upper-level source 'bikanten'
    can't be redriven to functional_block 'module_2'

    -------------
    VHDL CODE
    -------------

    library ieee;
    use ieee.std_logic_1164.all;

    entity module_1 is
    port(
    rst: in std_logic;
    clk: in std_logic;
    data_1:inout std_logic);

    end;

    architecture inoutlink of module_1 is
    variable count: integer range 0 to 10;
    signal int: std_logic;
    begin
    process (rst, clk)
    begin
    if rst = '1' then
    count := 0;
    data_1 <= 'Z';
    int <= '0';
    elsif rising_edge(clk) then
    count := count + 1;
    if count < 5 then
    data_1 <= '1';
    elsif count = 5 then
    data_1 <= 'Z';
    elsif count > 5 then
    int <= data_1;
    elsif count = 10 then
    count := 0;
    end if;
    end if;
    end process;
    end inoutlink;

    ---------------------------------
    second block...
    ---------------------------------

    library ieee;
    use ieee.std_logic_1164.all;

    entity module_2 is
    port(
    rst: in std_logic;
    clk: in std_logic;
    data_1:inout std_logic);

    end;

    architecture inoutlink of module_2 is

    variable count: integer range 0 to 10;
    signal int: std_logic;

    begin
    process (rst, clk)
    begin

    if rst = '1' then
    count := 0;
    int <= '0';
    data_1 <= 'Z';
    elsif rising_edge(clk) then
    count := count + 1;
    if count < 5 then
    int <= data_1;
    elsif count = 5 then
    data_1 <= 'Z';
    elsif count > 5 then
    data_1 <= '1';
    elsif count = 10 then
    count := 0;
    end if;
    end if;
    end process;
    end inoutlink;
    ------------------------------
    end
    ------------------------------
    Jasper, Apr 28, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Nicklas

    Driving INOUT ports

    Mike Nicklas, Feb 23, 2004, in forum: VHDL
    Replies:
    0
    Views:
    571
    Mike Nicklas
    Feb 23, 2004
  2. Replies:
    2
    Views:
    700
    Jonathan Bromley
    Jul 10, 2006
  3. =?ISO-8859-15?Q?Fr=E9d=E9ric_Lochon?=

    connecting std_logic inout ports and std_logic_vector inout port

    =?ISO-8859-15?Q?Fr=E9d=E9ric_Lochon?=, Nov 6, 2007, in forum: VHDL
    Replies:
    3
    Views:
    843
  4. Ken

    inout to inout

    Ken, May 9, 2008, in forum: VHDL
    Replies:
    2
    Views:
    584
    Aiken
    May 9, 2008
  5. THurkmans
    Replies:
    14
    Views:
    1,781
    Mike Treseler
    Aug 11, 2009
Loading...

Share This Page