Line 176... |
Line 176... |
signal Strobe2xSN, Strobe2xSP : std_logic := '0';
|
signal Strobe2xSN, Strobe2xSP : std_logic := '0';
|
signal HistBufLen2xDN, HistBufLen2xDP : integer range 0 to HIST_BUF_LEN := 0;
|
signal HistBufLen2xDN, HistBufLen2xDP : integer range 0 to HIST_BUF_LEN := 0;
|
signal Candidate2xDN, Candidate2xDP : std_logic_vector(LOOK_AHEAD_LEN*8-1 downto 0) := (others => '0');
|
signal Candidate2xDN, Candidate2xDP : std_logic_vector(LOOK_AHEAD_LEN*8-1 downto 0) := (others => '0');
|
signal NextWrAdr2xDN, NextWrAdr2xDP : integer range 0 to LOOK_AHEAD_LEN := 0;
|
signal NextWrAdr2xDN, NextWrAdr2xDP : integer range 0 to LOOK_AHEAD_LEN := 0;
|
signal CandAddr2xDN, CandAddr2xDP : std_logic_vector(11 downto 0) := (others => '0');
|
signal CandAddr2xDN, CandAddr2xDP : std_logic_vector(11 downto 0) := (others => '0');
|
signal CandLen2xD : integer range 0 to LOOK_AHEAD_LEN;
|
signal CandLen2xDN, CandLen2xDP : integer range 0 to LOOK_AHEAD_LEN;
|
signal EndOfData2xSN, EndOfData2xSP : std_logic := '0';
|
signal EndOfData2xSN, EndOfData2xSP : std_logic := '0';
|
signal OffsetIntxD : integer range -HIST_BUF_LEN to HIST_BUF_LEN;
|
signal OffsetIntxD : integer range -HIST_BUF_LEN to HIST_BUF_LEN;
|
signal OffsetxD : std_logic_vector(11 downto 0);
|
signal OffsetxD : std_logic_vector(11 downto 0);
|
signal HashTableEntry2xDN, HashTableEntry2xDP : std_logic_vector(11 downto 0) := (others => '0');
|
signal HashTableEntry2xDN, HashTableEntry2xDP : std_logic_vector(11 downto 0) := (others => '0');
|
signal MaxCandLenxD : integer range 0 to LOOK_AHEAD_LEN;
|
signal MaxCandLenxD : integer range 0 to LOOK_AHEAD_LEN;
|
Line 398... |
Line 398... |
|
|
-- limit the max candidate length
|
-- limit the max candidate length
|
MaxCandLenxD <= LOOK_AHEAD_LEN;
|
MaxCandLenxD <= LOOK_AHEAD_LEN;
|
|
|
-- use a shifter to implement the last two bytes of the address
|
-- use a shifter to implement the last two bytes of the address
|
process (CandAddr1xDP, CandAddr2xDP, Candidate2xDP, HistBufLen1xDP,
|
process (CandAddr1xDP, CandAddr2xDP, CandLen2xDP, Candidate2xDP,
|
HistBufLen2xDP, HistBufOutxD, LookAheadBuf1xDP, LookAheadBuf2xDP,
|
HistBufLen1xDP, HistBufLen2xDP, HistBufOutxD, LookAheadBuf1xDP,
|
LookAheadLen1xDP, LookAheadLen2xDP, LookAheadPtr1xDP, MaxCandLenxD,
|
LookAheadBuf2xDP, LookAheadLen1xDP, LookAheadLen2xDP,
|
Strobe1xSP)
|
LookAheadPtr1xDP, LookAheadPtr2xDP, MaxCandLenxD, Strobe1xSP)
|
begin
|
begin
|
Candidate2xDN <= Candidate2xDP;
|
Candidate2xDN <= Candidate2xDP;
|
LookAheadBuf2xDN <= LookAheadBuf2xDP;
|
LookAheadBuf2xDN <= LookAheadBuf2xDP;
|
LookAheadLen2xDN <= LookAheadLen2xDP;
|
LookAheadLen2xDN <= LookAheadLen2xDP;
|
CandAddr2xDN <= CandAddr2xDP;
|
CandAddr2xDN <= CandAddr2xDP;
|
|
LookAheadPtr2xDN <= LookAheadPtr2xDP;
|
HistBufLen2xDN <= HistBufLen2xDP;
|
HistBufLen2xDN <= HistBufLen2xDP;
|
|
CandLen2xDN <= CandLen2xDP;
|
|
-- send data through pipeline when strobe is high
|
if Strobe1xSP = '1' then
|
if Strobe1xSP = '1' then
|
|
-- note: the history buffer can't load data only from addresses where the
|
|
-- last two bits are zero. If this was not the case we shift the candidate
|
|
-- (which makes it shorter) to correct that
|
case CandAddr1xDP(1 downto 0) is
|
case CandAddr1xDP(1 downto 0) is
|
when "00" => Candidate2xDN <= HistBufOutxD; -- no shifting
|
when "00" => Candidate2xDN <= HistBufOutxD; -- no shifting
|
CandLen2xD <= MaxCandLenxD;
|
CandLen2xDN <= MaxCandLenxD;
|
when "01" => Candidate2xDN <= x"00" & HistBufOutxD(LOOK_AHEAD_LEN*8-1 downto 8); -- shift one byte
|
when "01" => Candidate2xDN <= x"00" & HistBufOutxD(LOOK_AHEAD_LEN*8-1 downto 8); -- shift one byte
|
CandLen2xD <= MaxCandLenxD-1; -- we shifted one byte out -> candidate is one byte shorter
|
CandLen2xDN <= MaxCandLenxD-1; -- we shifted one byte out -> candidate is one byte shorter
|
when "10" => Candidate2xDN <= x"0000" & HistBufOutxD(LOOK_AHEAD_LEN*8-1 downto 16); -- shift 2 bytes
|
when "10" => Candidate2xDN <= x"0000" & HistBufOutxD(LOOK_AHEAD_LEN*8-1 downto 16); -- shift 2 bytes
|
CandLen2xD <= MaxCandLenxD-2;
|
CandLen2xDN <= MaxCandLenxD-2;
|
when "11" => Candidate2xDN <= x"000000" & HistBufOutxD(LOOK_AHEAD_LEN*8-1 downto 24); -- shift 3 bytes
|
when "11" => Candidate2xDN <= x"000000" & HistBufOutxD(LOOK_AHEAD_LEN*8-1 downto 24); -- shift 3 bytes
|
CandLen2xD <= MaxCandLenxD-3;
|
CandLen2xDN <= MaxCandLenxD-3;
|
when others => null;
|
when others => null;
|
end case;
|
end case;
|
|
|
LookAheadBuf2xDN <= LookAheadBuf1xDP;
|
LookAheadBuf2xDN <= LookAheadBuf1xDP;
|
LookAheadLen2xDN <= LookAheadLen1xDP;
|
LookAheadLen2xDN <= LookAheadLen1xDP;
|
Line 455... |
Line 460... |
comparatorInst : comparator
|
comparatorInst : comparator
|
port map (
|
port map (
|
LookAheadxDI => CompLAIn3xD,
|
LookAheadxDI => CompLAIn3xD,
|
LookAheadLenxDI => LookAheadLen2xDP,
|
LookAheadLenxDI => LookAheadLen2xDP,
|
CandidatexDI => Candidate2xDP,
|
CandidatexDI => Candidate2xDP,
|
CandidateLenxDI => CandLen2xD,
|
CandidateLenxDI => CandLen2xDP,
|
MatchLenxDO => MatchLenxD);
|
MatchLenxDO => MatchLenxD);
|
|
|
-- calculate the offset
|
-- calculate the offset
|
process (CandAddr2xDP, LookAheadPtr2xDP, OffsetIntxD)
|
process (CandAddr2xDP, LookAheadPtr2xDP, OffsetIntxD)
|
begin
|
begin
|
Line 572... |
Line 577... |
HistBufLen2xDP <= HistBufLen2xDN;
|
HistBufLen2xDP <= HistBufLen2xDN;
|
NextWrAdr2xDP <= NextWrAdr2xDN;
|
NextWrAdr2xDP <= NextWrAdr2xDN;
|
LookAheadPtr2xDP <= LookAheadPtr2xDN;
|
LookAheadPtr2xDP <= LookAheadPtr2xDN;
|
CandAddr2xDP <= CandAddr2xDN;
|
CandAddr2xDP <= CandAddr2xDN;
|
Candidate2xDP <= Candidate2xDN;
|
Candidate2xDP <= Candidate2xDN;
|
|
CandLen2xDP <= CandLen2xDN;
|
HashTableEntry2xDP <= HashTableEntry2xDN;
|
HashTableEntry2xDP <= HashTableEntry2xDN;
|
EndOfData0xSP <= EndOfData0xSN;
|
EndOfData0xSP <= EndOfData0xSN;
|
EndOfData1xSP <= EndOfData1xSN;
|
EndOfData1xSP <= EndOfData1xSN;
|
EndOfData2xSP <= EndOfData2xSN;
|
EndOfData2xSP <= EndOfData2xSN;
|
Done3xSP <= Done3xSN;
|
Done3xSP <= Done3xSN;
|