]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
wrong width for counter decoder.
authorTobias Weber <toweber86@gmail.com>
Wed, 19 Dec 2018 12:48:23 +0000 (13:48 +0100)
committerTobias Weber <toweber86@gmail.com>
Wed, 19 Dec 2018 12:48:23 +0000 (13:48 +0100)
mupix/Mupix8/sources/Datapath/DataDecoder.vhd

index 15f67c6aba1405f534304fe312cc3acafa6233ba..48161724485222046444c35884470c61394e067e 100644 (file)
@@ -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;
-