OpenCores
URL https://opencores.org/ocsvn/igor/igor/trunk

Subversion Repositories igor

[/] [igor/] [trunk/] [processor/] [pl/] [bidirbus.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 atypic
library IEEE;
2
use ieee.std_logic_1164.all;
3
use work.leval2_package.all;
4
 
5
entity bidirbus is
6
        port (
7
                bidir : inout std_logic_vector(WORD_BITS - 1 downto 0);
8
                oe : in std_logic;
9
                clk : in std_logic;
10
                inp : in std_logic_vector(WORD_BITS - 1 downto 0);
11
                outp : out std_logic_vector(WORD_BITS - 1 downto 0)
12
        );
13
end entity;
14
 
15
architecture rtl of bidirbus is
16
        signal a : std_logic_vector(WORD_BITS - 1 downto 0);
17
        signal b : std_logic_vector(WORD_BITS - 1 downto 0);
18
begin
19
        busback : process(clk)
20
        begin
21
                if rising_edge(clk) then
22
                        a <= inp;
23
                        outp <= b;
24
                end if;
25
        end process;
26
 
27
        process(oe, bidir, a)
28
        begin
29
                if oe = '0' then -- write operation
30
                        bidir <= (others => 'Z');
31
                        b <= bidir;
32
                else
33
                        bidir <= a;
34
                        b <= bidir;
35
                end if;
36
        end process;
37
end architecture;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.