counterA_in : in std_logic_vector(DWidth - 1 downto 0); -- last counter value link A
counterB_in : in std_logic_vector(DWidth - 1 downto 0); -- last counter value link B
counterC_in : in std_logic_vector(DWidth - 1 downto 0); -- last counter value link B
-
+
dataout : out std_logic_vector(DWidth - 1 downto 0); -- decoded data word
dataout_valid : out std_logic; -- valid output data
counterA_out : out std_logic_vector(DWidth - 1 downto 0); -- last counter value link A
begin
ctrs_in_i <= counterA_in & counterB_in & counterC_in;
-
+
-- ***********************************
-- * decode data (address & hit info)*
-- ***********************************
gray_in => datain(DWidth - 2*PixWidth - 1 downto TSWidth),
bin_out => dataout(DWidth - 2*PixWidth - 1 downto TSWidth)
);
-
+
TS_decoder_data : gray_to_binary
generic map (
NBITS => TSWidth
gray_in => datain(TSWidth - 1 downto 0),
bin_out => dataout(TSWidth - 1 downto 0)
);
-
-
+
+
-- ***********************************
-- * decode counters (w/o addrresses)*
-- ***********************************
decode_counters: for J in 1 to (LINKS - 1) generate
gray_decode: gray_to_binary
generic map (
- NBITS => (ToTWidth + TSWidth)
+ NBITS => (2*PixWidth + ToTWidth + TSWidth)
)
port map (
clk => clk,
reset => reset,
bypass => bypass,
- gray_in => ctrs_in_i(J*DWidth - 2*PixWidth - 1 downto (J-1)*DWidth),
- bin_out => ctrs_out_i(J*DWidth - 2*PixWidth - 1 downto (J-1)*DWidth)
+ gray_in => ctrs_in_i(J*DWidth - 1 downto (J-1)*DWidth),
+ bin_out => ctrs_out_i(J*DWidth - 1 downto (J-1)*DWidth)
);
end generate;
-
+
-- split counters back up to individual outputs
counterA_out <= ctrs_out_i((LINKS - 1)*DWidth - 1 downto (LINKS - 2)*DWidth);
counterB_out <= ctrs_out_i((LINKS - 2)*DWidth - 1 downto (LINKS - 3)*DWidth);
counterC_out <= ctrs_out_i((LINKS - 3)*DWidth - 1 downto (LINKS - 4)*DWidth);
end RTL;
-