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

Subversion Repositories uart_plb

[/] [uart_plb/] [trunk/] [pcores/] [uart_plb_v1_00_a/] [hdl/] [vhdl/] [uart_components.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 gavinux
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
use IEEE.STD_LOGIC_ARITH.ALL;
4
use IEEE.STD_LOGIC_UNSIGNED.ALL;
5
 
6
package uart_components is
7
 
8
component uart
9
    generic (DATA_BITS        : integer);
10
    Port (
11
        rst                   : in  std_logic;
12
        clk                   : in  std_logic;
13
        dlw                   : in  std_logic_vector(15 downto 0);
14
        --
15
        -- DLW = round(clk_Hz / (Desired_BaudRate x 16)) - 2
16
        -- For baudrate 115200Hz :
17
        -- 62.5MHz  :  DLW = 0x001F
18
        -- 50.0MHz  :  DLW = 0x0019
19
        --
20
        tx_wr                 : in  std_logic;   -- pulse signal
21
        tx_fifo_reset         : in  std_logic;   -- pulse signal
22
        tx_din                : in  std_logic_vector(DATA_BITS-1 downto 0);
23
        tx_fifo_full          : out std_logic;   -- level signal
24
        tx_fifo_almost_full   : out std_logic;   -- level signal
25
        tx_fifo_empty         : out std_logic;   -- level signal
26
        tx_fifo_almost_empty  : out std_logic;   -- level signal
27
        tx_xmt_empty          : out std_logic;   -- level signal, transmit shift register empty
28
        --
29
        rx_rd                 : in  std_logic;   -- pulse signal
30
        rx_fifo_reset         : in  std_logic;   -- pulse signal
31
        rx_dout               : out std_logic_vector(DATA_BITS-1 downto 0);
32
        rx_fifo_full          : out std_logic;   -- level signal
33
        rx_fifo_almost_full   : out std_logic;   -- level signal
34
        rx_fifo_empty         : out std_logic;   -- level signal
35
        rx_fifo_almost_empty  : out std_logic;   -- level signal
36
        rx_timeout            : out std_logic;   -- pulse signal
37
        --
38
        tx_sout               : out std_logic;
39
        rx_sin                : in  std_logic
40
     );
41
end component;
42
 
43
component baudrate
44
    port(
45
        clk                   : in  std_logic;
46
        rst                   : in  std_logic;
47
        dlw                   : in  std_logic_vector(15 downto 0);
48
        tick                  : out std_logic   -- baudrate * 16 tick
49
    );
50
end component;
51
 
52
component xmt
53
    generic (DATA_BITS : integer);
54
    port (
55
        clk                   : in  std_logic;  -- Clock
56
        rst                   : in  std_logic;  -- Reset
57
        tick                  : in  std_logic;  -- baudrate * 16 tick
58
        wr                    : in  std_logic;  -- write din to transmitter
59
        din                   : in  std_logic_vector(DATA_BITS-1 downto 0);  -- Input data
60
        sout                  : out std_logic;  -- Transmitter serial output
61
        done                  : out std_logic   -- Transmitter operation finished
62
    );
63
end component;
64
 
65
component rcv
66
    generic (DATA_BITS : integer);
67
    port (
68
        clk                   : in  std_logic;  -- Clock
69
        rst                   : in  std_logic;  -- Reset
70
        tick                  : in  std_logic;  -- baudrate * 16 tick
71
        sin                   : in  std_logic;  -- Receiver serial input
72
        dout                  : out std_logic_vector(DATA_BITS-1 downto 0);   -- Output data
73
        done                  : out std_logic   -- Receiver operation finished
74
    );
75
end component;
76
 
77
component tmo
78
    Port (
79
        clk                   : in  std_logic;
80
        clr                   : in  std_logic;
81
        tick                  : in  std_logic;
82
        timeout               : out std_logic
83
    );
84
end component;
85
 
86
COMPONENT fifo_generator_v8_1_8x16
87
    PORT (
88
        clk                   : IN  STD_LOGIC;
89
        srst                  : IN  STD_LOGIC;
90
        din                   : IN  STD_LOGIC_VECTOR(7 DOWNTO 0);
91
        wr_en                 : IN  STD_LOGIC;
92
        rd_en                 : IN  STD_LOGIC;
93
        dout                  : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
94
        full                  : OUT STD_LOGIC;
95
        almost_full           : OUT STD_LOGIC;
96
        empty                 : OUT STD_LOGIC;
97
        almost_empty          : OUT STD_LOGIC
98
  );
99
END COMPONENT;
100
 
101
end uart_components;
102
 
103
package body uart_components is
104
 
105
end uart_components;

powered by: WebSVN 2.1.0

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