source: PlatformSupport/Deprecated/pcores/linkport_v1_00_a/hdl/vhdl/rx_ll_pdu_datapath.vhd

Last change on this file was 408, checked in by haijiang, 18 years ago
File size: 8.8 KB
Line 
1    -------------------------------------------------------------------------------
2--
3--      Project:  Aurora Module Generator version 2.4
4--
5--         Date:  $Date: 2005/11/07 21:30:54 $
6--          Tag:  $Name: i+IP+98818 $
7--         File:  $RCSfile: rx_ll_pdu_datapath_vhd.ejava,v $
8--          Rev:  $Revision: 1.1.2.4 $
9--
10--      Company:  Xilinx
11-- Contributors:  R. K. Awalt, B. L. Woodard, N. Gulstone
12--
13--   Disclaimer:  XILINX IS PROVIDING THIS DESIGN, CODE, OR
14--                INFORMATION "AS IS" SOLELY FOR USE IN DEVELOPING
15--                PROGRAMS AND SOLUTIONS FOR XILINX DEVICES.  BY
16--                PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
17--                ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,
18--                APPLICATION OR STANDARD, XILINX IS MAKING NO
19--                REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
20--                FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE
21--                RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY
22--                REQUIRE FOR YOUR IMPLEMENTATION.  XILINX
23--                EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH
24--                RESPECT TO THE ADEQUACY OF THE IMPLEMENTATION,
25--                INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
26--                REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
27--                FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES
28--                OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29--                PURPOSE.
30--
31--                (c) Copyright 2004 Xilinx, Inc.
32--                All rights reserved.
33--
34-------------------------------------------------------------------------------
35--
36--  RX_LL_PDU_DATAPATH
37--
38--  Author: Nigel Gulstone
39--          Xilinx - Embedded Networking System Engineering Group
40--
41--  Description: the RX_LL_PDU_DATAPATH module takes regular PDU data in Aurora format
42--               and transforms it to LocalLink formatted data
43--
44--               This module supports 1 2-byte lane designs
45--             
46--
47
48library IEEE;
49use IEEE.STD_LOGIC_1164.all;
50use IEEE.STD_LOGIC_ARITH.all;
51use IEEE.STD_LOGIC_UNSIGNED.all;
52use WORK.AURORA.all;
53
54entity RX_LL_PDU_DATAPATH is
55
56    port (
57
58    -- Traffic Separator Interface
59
60            PDU_DATA     : in std_logic_vector(0 to 15);
61            PDU_DATA_V   : in std_logic;
62            PDU_PAD      : in std_logic;
63            PDU_SCP      : in std_logic;
64            PDU_ECP      : in std_logic;
65
66    -- LocalLink PDU Interface
67
68            RX_D         : out std_logic_vector(0 to 15);
69            RX_REM       : out std_logic;
70            RX_SRC_RDY_N : out std_logic;
71            RX_SOF_N     : out std_logic;
72            RX_EOF_N     : out std_logic;
73
74    -- Error Interface
75
76            FRAME_ERROR  : out std_logic;
77
78    -- System Interface
79
80            USER_CLK     : in std_logic;
81            RESET        : in std_logic
82
83         );
84
85end RX_LL_PDU_DATAPATH;
86
87
88architecture RTL of RX_LL_PDU_DATAPATH is
89
90--****************************Parameter Declarations**************************
91
92    constant DLY : time := 1 ns;
93
94   
95--****************************External Register Declarations**************************
96
97    signal RX_D_Buffer                      : std_logic_vector(0 to 15);
98    signal RX_REM_Buffer                    : std_logic;
99    signal RX_SRC_RDY_N_Buffer              : std_logic;
100    signal RX_SOF_N_Buffer                  : std_logic;
101    signal RX_EOF_N_Buffer                  : std_logic;
102    signal FRAME_ERROR_Buffer               : std_logic;
103
104
105--****************************Internal Register Declarations**************************
106    signal storage_r                        : std_logic_vector(0 to 15);
107    signal storage_v_r                      : std_logic;
108    signal in_frame_r                       : std_logic;
109    signal sof_in_storage_r                 : std_logic;
110    signal pad_in_storage_r                 : std_logic;
111   
112
113
114
115--*********************************Wire Declarations**********************************
116    signal src_rdy_n_c                      : std_logic;
117    signal storage_ce_c                     : std_logic;
118   
119   
120
121begin   
122   
123--*********************************Main Body of Code**********************************
124   
125    -- VHDL Helper Logic
126    RX_D         <= RX_D_Buffer;
127    RX_REM       <= RX_REM_Buffer;
128    RX_SRC_RDY_N <= RX_SRC_RDY_N_Buffer;
129    RX_SOF_N     <= RX_SOF_N_Buffer;
130    RX_EOF_N     <= RX_EOF_N_Buffer;
131    FRAME_ERROR  <= FRAME_ERROR_Buffer;
132   
133   
134
135
136    --All input goes into a storage register before it is sent on to the output
137    process(USER_CLK)
138    begin
139        if(USER_CLK 'event and USER_CLK = '1') then
140            if(storage_ce_c = '1') then
141                storage_r   <=  PDU_DATA after DLY;
142            end if;
143        end if;
144    end process;   
145       
146   
147    --Keep track of whether or not there is data in storage
148    process(USER_CLK)
149    begin
150        if(USER_CLK 'event and USER_CLK = '1') then
151            if(RESET= '1') then
152                storage_v_r <=  '0' after DLY;
153            elsif(storage_ce_c = '1') then
154                storage_v_r <=  '1' after DLY;
155            elsif(storage_v_r = '1') then
156                storage_v_r <=  src_rdy_n_c after DLY;
157            end if;
158        end if;
159    end process;   
160   
161   
162    --Output data is registered
163    process(USER_CLK)
164    begin
165        if(USER_CLK 'event and USER_CLK = '1') then
166            RX_D_Buffer    <=  storage_r after DLY;
167        end if;
168    end process;   
169       
170       
171    --Assert the SRC_RDY_N signal when there is data in storage and incomiming data or the
172    -- end of a frame
173    src_rdy_n_c <=   not (storage_v_r and (storage_ce_c or PDU_ECP));
174   
175   
176    --Register the SRC_RDY_N signal
177    process(USER_CLK)
178    begin
179        if(USER_CLK 'event and USER_CLK = '1') then
180            if(RESET = '1') then
181                RX_SRC_RDY_N_Buffer   <=  '1' after DLY;
182            else       
183                RX_SRC_RDY_N_Buffer   <=  src_rdy_n_c after DLY;
184            end if;
185        end if;
186    end process;   
187   
188   
189    --Load data into storage when there is valid incoming data
190    storage_ce_c    <=   in_frame_r and PDU_DATA_V;
191   
192   
193    --Data is in a frame when it is preceded by an SOF followed by any number of non-ecp characters
194    process(USER_CLK)
195    begin
196        if(USER_CLK 'event and USER_CLK = '1') then
197            if(RESET = '1') then
198                in_frame_r  <=  '0' after DLY;   
199            elsif(PDU_SCP = '1') then
200                in_frame_r  <=  '1' after DLY;
201            elsif(PDU_ECP = '1') then
202                in_frame_r  <=  '0' after DLY;
203            end if;
204        end if;
205    end process;   
206       
207   
208    --Hold start of frame until it can be asserted with data
209    process(USER_CLK)
210    begin
211        if(USER_CLK 'event and USER_CLK = '1') then
212            if(PDU_SCP = '1') then
213                sof_in_storage_r    <=  '1' after DLY;
214            elsif(sof_in_storage_r = '1') then
215                sof_in_storage_r    <=  src_rdy_n_c after DLY;
216            end if;
217        end if;
218    end process;   
219       
220       
221    --Register sof_in_storage for use on the LocalLink Interface
222    process(USER_CLK)
223    begin
224        if(USER_CLK 'event and USER_CLK = '1') then
225            RX_SOF_N_Buffer    <=  not sof_in_storage_r after DLY;
226        end if;
227    end process;   
228       
229       
230    --Register eof for use on the LocalLink Interface
231    process(USER_CLK)
232    begin
233        if(USER_CLK 'event and USER_CLK = '1') then
234            RX_EOF_N_Buffer    <=  not PDU_ECP after DLY;
235        end if;
236    end process;
237   
238       
239       
240    --Store the pad signal for any data that gets moved into storage
241    process(USER_CLK)
242    begin
243        if(USER_CLK 'event and USER_CLK = '1') then
244            if(storage_ce_c = '1') then
245                pad_in_storage_r    <=   PDU_PAD after DLY;
246            end if;
247        end if;
248    end process;   
249       
250       
251    --Register the pad signal for use on the LocalLink inteface   
252    process(USER_CLK)
253    begin
254        if(USER_CLK 'event and USER_CLK = '1') then
255            RX_REM_Buffer  <=  not pad_in_storage_r after DLY;
256        end if;
257    end process;   
258       
259       
260    --Indicate a frame error when a start arrives inframe, and end arrives out
261    -- of frame, or an end arrives with no data in storage, indicating an empty
262    -- frame
263    process(USER_CLK)
264    begin
265        if(USER_CLK 'event and USER_CLK = '1') then
266            FRAME_ERROR_Buffer <=   (PDU_SCP and in_frame_r) or
267                                    (PDU_ECP and not in_frame_r) or
268                                    (PDU_ECP and not storage_v_r) after DLY;
269        end if;
270    end process;   
271
272
273
274
275end RTL;
276
277
Note: See TracBrowser for help on using the repository browser.