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

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-ip/] [core/] [gpif_com.vhd] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 nussgipfel
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.std_logic_arith.all;
4
 
5
library work;
6
use work.USB_TMC_IP_Defs.all;
7
use work.USB_TMC_cmp.all;
8
 
9
 
10
entity USB_TMC_IP is
11
  port (
12
    i_nReset,
13
    i_IFCLK,                                                                     -- GPIF CLK (is Master)
14
         i_SYSCLK,                                                                       -- FPGA System CLK
15
    i_WRU,                              -- write from GPIF
16
    i_RDYU        : in          std_logic;        -- GPIF is ready
17
--       i_ENAIP          : in          std_logic;               -- enable the IP core
18
--       i_RDYD2IP : in         std_logic;                       -- data RDY 2 the IP core   
19
--       i_d2USB   : in         std_logic_vector(SIZE_DBUS_FPGA-1 downto 0);  -- FPGA DBUS
20
--       i_RxD    : in          std_logic;
21
--       o_TxD     : out                std_logic;
22
--       i_Switches: in         std_logic_vector(NUMBER_OF_SW-1 downto 0);
23
    o_WRX,                              -- To write to GPIF
24
    o_RDYX    : out     std_logic;      -- Core is ready
25
--       o_RDYIP   : out        std_logic;               -- IP ready FPGA site
26
--       o_DAVIP   : out        std_logic;               -- Data available for FPGA
27
         o_LEDrx,                            -- controll LED rx __DEB_INFO__
28
         o_LEDtx : out          std_logic;               -- controll LED tx __DEB_INFO__
29
         o_LEDrun  : out        std_logic;      -- controll LED running signalisation __DEB_INFO__
30
--       o_d2FPGA  : out        std_logic_vector(SIZE_DBUS_FPGA-1 downto 0);  -- FPGA DBUS
31
    b_dbus        : inout       std_logic_vector(SIZE_DBUS_GPIF-1 downto 0));  -- bidirect data bus
32
end USB_TMC_IP;
33
 
34
 
35
 
36
architecture top_core of USB_TMC_IP is
37
 
38
 
39
  -- interconection signals
40
 
41
  signal s_FIFOrst           : std_logic;
42
 
43
     -- U2X
44 12 nussgipfel
  signal s_U2X_WR_EN,
45
         s_U2X_RD_EN,
46 11 nussgipfel
         s_U2X_FULL,
47
         s_U2X_AM_FULL,
48
         s_U2X_EMPTY,
49
         s_U2X_AM_EMPTY : std_logic;
50
 
51
     -- X2U
52 12 nussgipfel
  signal s_X2U_WR_EN,
53
         s_X2U_RD_EN,
54 11 nussgipfel
         s_X2U_FULL,
55
         s_X2U_AM_FULL,
56
         s_X2U_EMPTY,
57
         s_X2U_AM_EMPTY : std_logic;
58
 
59
  -------------------------------------------------------------------------------
60
  -- data bus
61
  -------------------------------------------------------------------------------
62
 
63
  -- data signals
64
        signal s_dbus_in  : std_logic_vector(SIZE_DBUS_GPIF-1 downto 0);
65
        signal s_dbus_out : std_logic_vector(SIZE_DBUS_GPIF-1 downto 0);
66
 
67
        signal s_opb_in : std_logic_vector(SIZE_DBUS_FPGA-1 downto 0);
68
        signal s_opb_out        : std_logic_vector(SIZE_DBUS_FPGA-1 downto 0);
69
 
70
--  -------------------------------------------------------------------------------
71
--  -- UART 
72
--  -------------------------------------------------------------------------------
73
--      signal s_UART_RD        : std_logic;
74
--      signal s_UART_WR        : std_logic;
75
--      signal s_CS                     : std_logic;
76
--      signal s_uart_data: std_logic_vector(BYTE-1 downto 0);
77
 
78
 
79
 
80
  -----------------------------------------------------------------------------
81
  -- COMPONENTS
82
  -----------------------------------------------------------------------------
83
 
84
--COMPONENT miniUART
85
--  port (
86
--     SysClk   : in  Std_Logic;  -- System Clock
87
--     Reset    : in  Std_Logic;  -- Reset input
88
--     CS_N     : in  Std_Logic;
89
--     RD_N     : in  Std_Logic;
90
--     WR_N     : in  Std_Logic;
91
--     RxD      : in  Std_Logic;
92
--     TxD      : out Std_Logic;
93
--     IntRx_N  : out Std_Logic;  -- Receive interrupt
94
--     IntTx_N  : out Std_Logic;  -- Transmit interrupt
95
--     Addr     : in  Std_Logic_Vector(1 downto 0); -- 
96
--     DataIn   : in  Std_Logic_Vector(7 downto 0); -- 
97
--     DataOut  : out Std_Logic_Vector(7 downto 0)); -- 
98
--end COMPONENT miniUART;
99
 
100
 
101
begin
102
 
103
  -----------------------------------------------------------------------------
104
  -- Port map
105
  -----------------------------------------------------------------------------
106
 
107
F_IN : fifo_U2X_2C_1024B
108
                port map (
109
                        din          => s_dbus_in,
110
                        rd_clk       => i_SYSCLK,
111 12 nussgipfel
                        rd_en        => s_U2X_RD_EN,
112 11 nussgipfel
                        rst          => s_FIFOrst,
113
                        wr_clk       => i_IFCLK ,
114 12 nussgipfel
                        wr_en        => s_U2X_WR_EN,
115 11 nussgipfel
                        almost_empty => s_U2X_AM_EMPTY,
116
                        almost_full  => s_U2X_AM_FULL,
117
                        dout         => s_opb_in,
118
                        empty        => s_U2X_EMPTY,
119
                        full         => s_U2X_FULL
120
                        );
121
 
122
 
123
F_OUT : fifo_X2U_2C_1024B
124
                port map (
125
                        din          => s_opb_out,
126
                        rd_clk       => i_IFCLK,
127 12 nussgipfel
                        rd_en        => s_X2U_RD_EN,
128 11 nussgipfel
                        rst          => s_FIFOrst,
129
                        wr_clk       => i_SYSCLK,
130 12 nussgipfel
                        wr_en        => s_X2U_WR_EN,
131 11 nussgipfel
                        almost_empty => s_X2U_AM_EMPTY,
132
                        almost_full  => s_X2U_AM_FULL,
133 12 nussgipfel
                        dout         => s_dbus_out,
134 11 nussgipfel
                        empty        => s_X2U_EMPTY,
135
                        full         => s_X2U_FULL
136
                        );
137
 
138 12 nussgipfel
 
139 11 nussgipfel
FSM_GPIF : gpif_com
140
                                port map (
141
                                        i_nReset                        => i_nReset,
142
                                        i_IFCLK                 =>      i_IFCLK,
143
                                        i_WRU                           => i_WRU,
144
                                        i_RDYU                  => i_RDYU,
145
                                        i_U2X_FULL              => s_U2X_FULL,
146
                                        i_U2X_AM_FULL   => s_U2X_AM_FULL,
147
                                        i_X2U_AM_EMPTY  => s_X2U_AM_EMPTY,
148
                                        i_X2U_EMPTY             => s_X2U_EMPTY,
149 12 nussgipfel
                                        i_dbus                  => s_dbus_out,
150
                                        o_U2X_WR_EN             => s_U2X_WR_EN,
151
                                        o_X2U_RD_EN             => s_X2U_RD_EN,
152
                                        o_FIFOrst               => s_FIFOrst,
153 11 nussgipfel
                                        o_WRX                           => o_WRX,
154
                                        o_RDYX                  => o_RDYX,
155
                                        o_LEDrx                    => o_LEDrx,
156
                                        o_LEDtx                    => o_LEDtx,
157
                                        o_LEDrun                => o_LEDrun,
158 12 nussgipfel
                                        o_dbus                  => s_dbus_in,
159 11 nussgipfel
                                        b_dbus                  => b_dbus
160
                                );
161
 
162
 
163
Loopback : USB_TMC_IP_loopback
164
                port map (
165
                        i_nReset                        => i_nReset,
166
                        i_SYSCLK                        => i_SYSCLK,                                                                     -- FPGA System CLK
167
                        i_U2X_EMPTY             => s_U2X_EMPTY,
168
                        i_U2X_AM_EMPTY     => s_U2X_AM_EMPTY,
169
                        i_X2U_AM_FULL      => s_X2U_AM_FULL,
170
                        i_X2U_FULL                 => s_X2U_FULL,
171
                        i_U2X_DATA                 => s_opb_in,
172 12 nussgipfel
                        o_U2X_RD_EN             => s_U2X_RD_EN,
173
                        o_X2U_WR_EN             => s_X2U_WR_EN,
174
                        o_X2U_DATA        => s_opb_out
175 11 nussgipfel
                );
176 12 nussgipfel
 
177
 
178
 
179 11 nussgipfel
--
180
--uart : miniUART
181
--                      port map (
182
--                      SysClk  => i_SYSCLK,
183
--                      Reset   => i_nReset,
184
--                      CS_N    => s_CS,
185
--                      RD_N    => s_UART_RD,
186
--                      WR_N    => s_UART_WR,
187
--                      RxD     => i_RxD,
188
--                      TxD      => o_TxD,
189
--                      IntRx_N  => open,
190
--                      IntTx_N  => open,
191
--                      Addr     => "00",
192
--                      DataIn   => (others => 'Z'),
193
--                      DataOut  => s_uart_data
194
--                      );          
195
 
196
 
197
 
198
 
199
end top_core;

powered by: WebSVN 2.1.0

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