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

Subversion Repositories uart_block

[/] [uart_block/] [trunk/] [hdl/] [iseProject/] [INTERCON_P2P.vhd] - Blame information for rev 36

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 36 leonardoar
--! @file
2
--! @brief Point to point wishbone interconnection (Sample Master with uart_wishbone_slave)
3
 
4 27 leonardoar
library IEEE;
5
use IEEE.STD_LOGIC_1164.ALL;
6
 
7
entity INTERCON_P2P is
8
port (
9
            -- External (non-WISHBONE) inputs
10
            EXTCLK: in std_logic;
11
            EXTRST: in std_logic;
12
            -- External signals for simulation purposes
13
            byte_out: out std_logic_vector(7 downto 0);
14
                                data_avaible : out std_logic;
15
            tx: out std_logic;
16
                           rx : in std_logic
17
        );
18
end INTERCON_P2P;
19
 
20 36 leonardoar
--! @brief Declaring the components (SYC0001a, SERIALMASTER, uart_wishbone_slave)  
21
--! @details Just instantiate and connect the various components
22 27 leonardoar
architecture Behavioral of INTERCON_P2P is
23
component SYC0001a
24
    port(
25
            -- WISHBONE Interface
26 36 leonardoar
            CLK_O:  out std_logic;      --! Clock output
27
            RST_O:  out std_logic;      --! Reset output
28 27 leonardoar
            -- NON-WISHBONE Signals
29 36 leonardoar
            EXTCLK: in  std_logic;      --! Clock input
30
            EXTRST: in  std_logic       --! Reset input
31 27 leonardoar
         );
32
end component SYC0001a;
33
 
34
component SERIALMASTER is
35
        port(
36
            -- WISHBONE Signals
37 36 leonardoar
            ACK_I:  in  std_logic;                                                              --! Ack input
38
            ADR_O:  out std_logic_vector( 1 downto 0 );  --! Address output
39
            CLK_I:  in  std_logic;                                                              --! Clock input
40
            CYC_O:  out std_logic;                                                              --! Cycle output
41
            DAT_I:  in  std_logic_vector( 31 downto 0 ); --! Data input
42
            DAT_O:  out std_logic_vector( 31 downto 0 ); --! Data output
43
            RST_I:  in  std_logic;                                                              --! Reset input
44
            SEL_O:  out std_logic;                                                              --! Select output
45
            STB_O:  out std_logic;                                                              --! Strobe output (Works like a chip select)
46
            WE_O:   out std_logic;                                                              --! Write enable
47 27 leonardoar
 
48
                                -- NON-WISHBONE Signals
49 36 leonardoar
                                byte_rec : out std_logic_vector(7 downto 0)      --! Signal byte received (Used to debug on the out leds)                        
50 27 leonardoar
         );
51
end component;
52
 
53
component uart_wishbone_slave is
54 36 leonardoar
    Port ( RST_I : in  STD_LOGIC;                                                               --! Reset Input
55
           CLK_I : in  STD_LOGIC;                                                               --! Clock Input
56
           ADR_I0 : in  STD_LOGIC_VECTOR (1 downto 0);   --! Address input
57
           DAT_I0 : in  STD_LOGIC_VECTOR (31 downto 0);  --! Data Input 0
58
           DAT_O0 : out  STD_LOGIC_VECTOR (31 downto 0); --! Data Output 0
59
           WE_I : in  STD_LOGIC;                                                                        --! Write enable input
60
           STB_I : in  STD_LOGIC;                                                               --! Strobe input (Works like a chip select)
61
           ACK_O : out  STD_LOGIC;                                                              --! Ack output
62
 
63
                          -- NON-WISHBONE Signals
64
                          serial_in : in std_logic;                                                     --! Uart serial input
65
                          data_Avaible : out std_logic;                                         --! Flag to indicate data avaible                                       
66
                          serial_out : out std_logic                                                    --! Uart serial output
67 27 leonardoar
                          );
68
end component;
69
signal CLK : std_logic;
70
signal RST : std_logic;
71
signal ACK : std_logic;
72
signal WE  : std_logic;
73
signal STB  : std_logic;
74
signal ADR : std_logic_vector(  1 downto 0 );
75
signal dataI : std_logic_vector (31 downto 0);
76
signal dataO : std_logic_vector (31 downto 0);
77
begin
78 36 leonardoar
        --! Instantiate SYC0001a
79 27 leonardoar
        uSysCon: component SYC0001a
80
    port map(
81
                 CLK_O   =>  CLK,
82
                 RST_O   =>  RST,
83
                 EXTCLK  =>  EXTCLK,
84
                 EXTRST  =>  EXTRST
85
    );
86
 
87 36 leonardoar
        --! Instantiate SERIALMASTER
88 27 leonardoar
        uMasterSerial : component SERIALMASTER
89
        port map(
90
                ACK_I => ACK,
91
                ADR_O => ADR,
92
                CLK_I => CLK,
93
                CYC_O => open,
94
                DAT_I => dataI,
95
                DAT_O => dataO,
96
                RST_I => RST,
97
                SEL_O => open,
98
                STB_O => STB,
99
                byte_rec => byte_out,
100
                WE_O => WE
101
        );
102
 
103 36 leonardoar
        --! Instantiate uart_wishbone_slave
104 27 leonardoar
        uUartWishboneSlave: component uart_wishbone_slave
105
        port map(
106
                RST_I => RST,
107
                CLK_I => CLK,
108
                ADR_I0 => ADR,
109
                DAT_I0 => dataO,
110
                DAT_O0 => dataI,
111
                WE_I => WE,
112
                STB_I => STB,
113
                ACK_O => ACK,
114
                serial_in => rx,
115
                data_Avaible => open,
116
                serial_out => tx
117
   );
118
 
119
end Behavioral;
120
 

powered by: WebSVN 2.1.0

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