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

Subversion Repositories uart2bus

[/] [uart2bus/] [trunk/] [vhdl/] [rtl/] [uart2BusTop.vhd] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 smuller
-----------------------------------------------------------------------------------------
2
-- uart to internal bus top module 
3
--
4
-----------------------------------------------------------------------------------------
5 11 smuller
library ieee;
6
use ieee.std_logic_1164.all;
7 6 smuller
 
8 11 smuller
library work;
9
use work.uart2BusTop_pkg.all;
10
 
11 6 smuller
entity uart2BusTop is
12
  generic ( AW : integer := 8);
13
  port ( -- global signals
14 11 smuller
         clr          : in  STD_LOGIC;                          -- global reset input
15
         clk          : in  STD_LOGIC;                          -- global clock input
16 6 smuller
         -- uart serial signals
17 11 smuller
         serIn        : in  STD_LOGIC;                          -- serial data input
18
         serOut       : out STD_LOGIC;                          -- serial data output
19 6 smuller
         -- internal bus to register file
20 11 smuller
         intAccessReq : out std_logic;                          --
21
         intAccessGnt : in  std_logic;                          --
22
         intRdData    : in  STD_LOGIC_VECTOR (7 downto 0);      -- data read from register file
23
         intAddress   : out STD_LOGIC_VECTOR (AW - 1 downto 0); -- address bus to register file
24
         intWrData    : out STD_LOGIC_VECTOR (7 downto 0);      -- write data to register file
25
         intWrite     : out STD_LOGIC;                          -- write control to register file
26
         intRead      : out STD_LOGIC);                         -- read control to register file
27 6 smuller
end uart2BusTop;
28
 
29
architecture Behavioral of uart2BusTop is
30
 
31
  -- baud rate configuration, see baudGen.vhd for more details.
32
  -- baud rate generator parameters for 115200 baud on 25MHz clock 
33 11 smuller
  constant baudFreq     : std_logic_vector(11 downto 0) := x"480";
34
  constant baudLimit    : std_logic_vector(15 downto 0) := x"3889";
35
  signal   txData       : std_logic_vector(7 downto 0); -- data byte to transmit
36
  signal   newTxData    : std_logic;                    -- asserted to indicate that there is a new data byte for transmission
37
  signal   txBusy       : std_logic;                    -- signs that transmitter is busy
38
  signal   rxData       : std_logic_vector(7 downto 0); -- data byte received
39
  signal   newRxData    : std_logic;                    -- signs that a new byte was received
40 6 smuller
 
41
  begin
42
    -- uart top module instance
43
    ut : uartTop
44
      port map (
45
        clr => clr,
46
        clk => clk,
47
        serIn => serIn,
48
        txData => txData,
49
        newTxData => newTxData,
50
        baudFreq => baudFreq,
51
        baudLimit => baudLimit,
52
        serOut => serOut,
53
        txBusy => txBusy,
54
        rxData => rxData,
55
        newRxData => newRxData,
56
        baudClk => open);
57
    -- uart parser instance
58
    up : uartParser
59
      generic map (
60
        AW => AW)
61
      port map (
62
        clr => clr,
63
        clk => clk,
64
        txBusy => txBusy,
65
        rxData => rxData,
66
        newRxData => newRxData,
67
        intRdData => intRdData,
68
        txData => txData,
69
        newTxData => newTxData,
70 11 smuller
        intReq => intAccessReq,
71
        intGnt => intAccessGnt,
72 6 smuller
        intAddress => intAddress,
73
        intWrData => intWrData,
74
        intWrite => intWrite,
75
        intRead => intRead);
76 11 smuller
 
77 6 smuller
  end Behavioral;

powered by: WebSVN 2.1.0

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