66 use IEEE.STD_LOGIC_1164.
ALL;
67 use IEEE.STD_LOGIC_ARITH.
ALL;
68 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
75 use WORK.ArpCam_pkg.
all;
107 poDebug : out std_logic_vector(179 downto 0)
122 CLK_IN1 :
IN std_logic;
123 CLK_OUT1 :
OUT std_logic;
124 RESET :
IN std_logic;
125 LOCKED :
OUT std_logic
136 component ARP_IPv4_MAC_CAM
140 InitEnb :
in std_logic;
141 InitDone :
out std_logic;
142 AgingTime :
in std_logic_vector(
31 downto 0);
143 Size :
out std_logic_vector(
14 downto 0);
144 CamSize :
out std_logic_vector(
3 downto 0);
145 LookupReqValid :
in std_logic;
146 LookupReqKey :
in std_logic_vector(gKeyLength
- 1 downto 0);
147 LookupRespValid :
out std_logic;
148 LookupRespHit :
out std_logic;
149 LookupRespKey :
out std_logic_vector(gKeyLength
- 1 downto 0);
150 LookupRespValue :
out std_logic_vector(gValueLength
- 1 downto 0);
151 UpdateAck :
out std_logic;
152 UpdateValid :
in std_logic;
153 UpdateOp :
in std_logic;
154 UpdateKey :
in std_logic_vector(gKeyLength
- 1 downto 0);
155 UpdateStatic :
in std_logic;
156 UpdateValue :
in std_logic_vector(gValueLength
- 1 downto 0)
164 signal sFSM_InitEnb : std_logic := '0';
165 signal sAgingTime : std_logic_vector(31 downto 0) := (others => '1');
167 signal sFSM_LkpReqValid : std_logic := '0';
168 signal sFSM_LkpReqKey : std_logic_vector(gKeyLength - 1 downto 0) := (others => '0');
170 signal sFSM_UpdReqValid : std_logic := '0';
171 signal sFSM_UpdCodReq : std_logic := '0';
172 signal sFSM_UpdKeyReq : std_logic_vector(gKeyLength - 1 downto 0) := (others => '0');
173 signal sFSM_UpdValReq : std_logic_vector(gValueLength - 1 downto 0) := (others => '0');
176 signal sCAM_InitDone : std_logic;
178 signal sCAM_LkpRepValid : std_logic;
179 signal sCAM_LkpRepHit : std_logic;
180 signal sCAM_LkpRepKey : std_logic_vector(gKeyLength - 1 downto 0);
181 signal sCAM_LkpRepValue : std_logic_vector(gValueLength - 1 downto 0);
182 signal sCAM_UpdRepReady : std_logic;
184 signal sFSM_State : std_logic_vector(7 downto 0);
185 signal sValidHappened : std_logic;
186 signal sUpdReqValid : std_logic;
188 signal sDebug : std_logic_vector(179 downto 0 );
189 attribute mark_debug : string;
190 attribute mark_debug of sDebug : signal is "false";
199 CAM: ARP_IPv4_MAC_CAM
port map (
202 InitEnb => sFSM_InitEnb,
203 InitDone => sCAM_InitDone,
204 AgingTime => sAgingTime,
208 LookupReqValid => sFSM_LkpReqValid,
209 LookupReqKey => sFSM_LkpReqKey,
210 LookupRespValid => sCAM_LkpRepValid,
211 LookupRespHit => sCAM_LkpRepHit,
212 LookupRespKey => sCAM_LkpRepKey,
213 LookupRespValue => sCAM_LkpRepValue,
215 UpdateAck => sCAM_UpdRepReady,
216 UpdateValid => sUpdReqValid,
217 UpdateOp => sFSM_UpdCodReq,
218 UpdateKey => sFSM_UpdKeyReq,
220 UpdateValue => sFSM_UpdValReq
223 sAgingTime <= (others => '1');
224 sUpdReqValid <= sFSM_UpdReqValid or (sFSM_State(6) and not sCAM_UpdRepReady);
229 pCamCtl :
process (
piClk,
piRst,sCAM_InitDone)
231 if (piRst = '1') then
232 sFSM_LkpReqValid <= '0';
233 sFSM_LkpReqKey <= (others => '0');
234 sFSM_UpdReqValid <= '0';
235 sFSM_UpdCodReq <= '0';
236 sFSM_UpdKeyReq <= (others => '0');
237 sFSM_UpdValReq <= (others => '0');
245 sFSM_InitEnb <= not sCAM_InitDone;
250 sFSM_LkpReqValid <= '0';
251 sFSM_UpdReqValid <= '0';
252 if (sCAM_InitDone = '1' or sFSM_State > x"00") then
261 sFSM_LkpReqValid <= '1';
268 sFSM_UpdReqValid <= '1';
277 sFSM_UpdReqValid <= '1';
292 sFSM_LkpReqValid <= '0';
293 sValidHappened <= '0';
300 if (sCAM_LkpRepValid = '1') then
311 sFSM_UpdReqValid <= '1';
318 if (sCAM_UpdRepReady = '1') then
319 sFSM_UpdReqValid <= '0';
320 sFSM_UpdCodReq <= '0';
323 sFSM_UpdKeyReq <= (others => '0');
324 sFSM_UpdValReq <= (others => '0');
327 sFSM_UpdReqValid <= '0';
342 sFSM_UpdReqValid <= '1';
351 if (sCAM_UpdRepReady = '1') then
353 sFSM_UpdReqValid <= '0';
354 sFSM_UpdCodReq <= '0';
355 sFSM_UpdKeyReq <= (others => '0');
356 sFSM_UpdValReq <= (others => '0');
359 sFSM_UpdReqValid <= '0';
371 sFSM_State <= sFSM_State;
378 sFSM_State <= sFSM_State + 1;
387 pDebug:
process (
piClk)
391 sDebug( 1) <= sFSM_InitEnb;
392 sDebug( 2) <= sCAM_InitDone;
393 sDebug( 3) <= sFSM_LkpReqValid;
394 sDebug( 4) <= sCAM_LkpRepValid;
395 sDebug( 5) <= sCAM_LkpRepHit;
396 sDebug( 6) <= sFSM_UpdReqValid;
399 sDebug( 15 downto 8) <= sFSM_State;
401 sDebug( 47 downto 16) <= sFSM_LkpReqKey;
403 sDebug( 95 downto 48) <= sCAM_LkpRepValue;
405 sDebug(127 downto 96) <= sFSM_UpdKeyReq;
406 sDebug(175 downto 128) <= sFSM_UpdValReq;
407 sDebug(176) <= sFSM_UpdCodReq;
408 sDebug(177) <= sUpdReqValid;
409 sDebug(178) <= sCAM_UpdRepReady;
out soLkpRep_Validstd_logic
out soUpdRep_Datat_RtlUpdRep
in siLkpReq_Datat_RtlLkpReq
out poDebugstd_logic_vector(179 downto 0)
in siUpdReq_Datat_RtlUpdReq
out soUpdRep_Validstd_logic
in soUpdRep_Readystd_logic
in siLkpReq_Validstd_logic
in siUpdReq_Validstd_logic
out siUpdReq_Readystd_logic
in soLkpRep_Readystd_logic
out siLkpReq_Readystd_logic
out soLkpRep_Datat_RtlLkpRep