From b999aca3117c2696c7ee809838ca8968b0638cdf Mon Sep 17 00:00:00 2001 From: Tobias Weber Date: Wed, 19 Dec 2018 13:48:23 +0100 Subject: [PATCH] wrong width for counter decoder. --- mupix/Mupix8/sources/Datapath/DataDecoder.vhd | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mupix/Mupix8/sources/Datapath/DataDecoder.vhd b/mupix/Mupix8/sources/Datapath/DataDecoder.vhd index 15f67c6..4816172 100644 --- a/mupix/Mupix8/sources/Datapath/DataDecoder.vhd +++ b/mupix/Mupix8/sources/Datapath/DataDecoder.vhd @@ -26,7 +26,7 @@ entity DataDecoder is 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 @@ -70,7 +70,7 @@ signal ctrs_out_i : std_logic_vector((LINKS - 1)*DWidth - 1 downto 0) := (othe begin ctrs_in_i <= counterA_in & counterB_in & counterC_in; - + -- *********************************** -- * decode data (address & hit info)* -- *********************************** @@ -102,7 +102,7 @@ begin 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 @@ -114,29 +114,28 @@ begin 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; - -- 2.43.0