82 use IEEE.STD_LOGIC_1164.
ALL;
83 use IEEE.STD_LOGIC_ARITH.
ALL;
84 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
142 poDebug : out std_logic_vector(255 downto 0)
162 InitEnb :
in std_logic;
163 InitDone :
out std_logic;
165 AgingTime :
in std_logic_vector(
31 downto 0);
166 Size :
out std_logic_vector(
14 downto 0);
167 CamSize :
out std_logic_vector(
2 downto 0);
169 LookupReqValid :
in std_logic;
170 LookupReqKey :
in std_logic_vector(gKeyLen
-1 downto 0);
171 LookupRespValid :
out std_logic;
172 LookupRespHit :
out std_logic;
173 LookupRespKey :
out std_logic_vector(gKeyLen
-1 downto 0);
174 LookupRespValue :
out std_logic_vector(gValLen
-1 downto 0);
176 UpdateReady :
out std_logic;
177 UpdateValid :
in std_logic;
178 UpdateOp :
in std_logic;
179 UpdateKey :
in std_logic_vector(gKeyLen
-1 downto 0);
180 UpdateStatic :
in std_logic;
181 UpdateValue :
in std_logic_vector(gValLen
-1 downto 0)
188 constant cOP_INSERT : std_logic := '0';
189 constant cOP_DELETE : std_logic := '1';
196 signal sInitEnable : std_logic := '0';
197 signal sAgingTime : std_logic_vector(31 downto 0) := (others => '1');
199 signal sLookupReqValid : std_logic := '0';
200 signal sLookupReqKey : std_logic_vector(gKeyLen-1 downto 0) := (others => '0');
202 signal sUpdateValid : std_logic := '0';
203 signal sUpdateOp : std_logic := '0';
205 signal UpdateKey : std_logic_vector(95 downto 0) := (others => '0');
206 signal UpdateStatic : std_logic := '0';
207 signal UpdateValue : std_logic_vector(13 downto 0) := (others => '0');
210 signal sCAM_InitDone : std_logic;
211 signal Size : std_logic_vector(14 downto 0);
212 signal CamSize : std_logic_vector( 2 downto 0);
213 signal LookupRepValid : std_logic;
214 signal LookupRepHit : std_logic;
215 signal LookupRepKey : std_logic_vector(95 downto 0);
216 signal LookupRepValue : std_logic_vector(13 downto 0);
217 signal UpdateReady : std_logic;
218 signal valid_happened : std_logic;
220 signal cnt1s : std_logic_vector(27 downto 0);
221 signal count : std_logic := '0';
223 signal sRst : std_logic;
224 signal locked : std_logic;
225 signal help_updval : std_logic;
227 signal ctl_fsm : std_logic_vector( 7 downto 0);
240 WRAP: ToeCamWrap
port map (
243 InitEnb => sInitEnable,
244 InitDone => sCAM_InitDone,
245 AgingTime => sAgingTime,
249 LookupReqValid => sLookupReqValid,
250 LookupReqKey => sLookupReqKey,
251 LookupRespValid => LookupRepValid,
252 LookupRespHit => LookupRepHit,
253 LookupRespKey => LookupRepKey,
254 LookupRespValue => LookupRepValue,
256 UpdateReady => UpdateReady,
257 UpdateValid => help_updval,
258 UpdateOp => sUpdateOp,
259 UpdateKey => UpdateKey,
260 UpdateStatic => UpdateStatic,
261 UpdateValue => UpdateValue
264 sAgingTime <= (others => '1');
265 help_updval <= sUpdateValid or (ctl_fsm(6) and not UpdateReady);
270 pCamCtl:
process (
piClk, sRst)
292 sLookupReqValid <= '0';
293 sLookupReqKey <= (others => '0');
296 UpdateKey <= (others => '0');
298 UpdateValue <= (others => '0');
304 sInitEnable <= not sCAM_InitDone;
308 sInitEnable <= not sCAM_InitDone;
313 sLookupReqValid <= '0';
315 if (sCAM_InitDone = '1' or ctl_fsm > x"00") then
325 sLookupReqValid <= '1';
326 sLookupReqKey <= piLkpReqKey;
327 poLkpRepSrc <= piLkpReqSrc;
334 UpdateKey <= piUpdReqKey;
335 UpdateValue <= piUpdReqVal;
336 sUpdateOp <= piUpdReqOpr;
337 poUpdRepSrc <= piUpdReqSrc;
358 sLookupReqValid <= '0';
359 valid_happened <= '0';
366 if (LookupRepValid = '1') then
372 if (LookupRepValid = '1') then
373 valid_happened <= '1';
377 if (LookupRepValid = '1' or valid_happened = '1') then
395 if (UpdateReady = '1') then
399 UpdateKey <= (others => '0');
400 UpdateValue <= (others => '0');
434 if (UpdateReady='1') then
438 UpdateKey <= (others => '0');
439 UpdateValue <= (others => '0');
466 ctl_fsm <= ctl_fsm + 1;
480 pHeartBeat :
process(
piClk)
483 if (cnt1s < x"5F5E0FF") then
487 cnt1s <= (others => '0');
in piTOE_LkpReq_tdatastd_logic_vector(( gSrcLen+ gKeyLen- 1) downto 0)
out poTOE_UpdRep_tdatastd_logic_vector( gOprLen+ gSrcLen+ gValLen- 1 downto 0)
in piTOE_UpdReq_tvalidstd_logic
in piTOE_UpdRep_treadystd_logic
out poTOE_UpdRep_tvalidstd_logic
out poDebugstd_logic_vector(255 downto 0)
in piTOE_LkpReq_tvalidstd_logic
out poTOE_UpdReq_treadystd_logic
out poTOE_LkpRep_tvalidstd_logic
out poTOE_LkpRep_tdatastd_logic_vector( gHitLen+ gSrcLen+ gValLen- 1 downto 0)
in piTOE_LkpRep_treadystd_logic
out poTOE_LkpReq_treadystd_logic
in piTOE_UpdReq_tdatastd_logic_vector( gOprLen+ gSrcLen+ gValLen+ gKeyLen- 1 downto 0)