]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
define standard values of mupix readout control signals in readout state machine...
authorTobias Weber <webert@kph.uni-mainz.de>
Thu, 26 Feb 2015 09:19:34 +0000 (10:19 +0100)
committerTobias Weber <webert@kph.uni-mainz.de>
Thu, 26 Feb 2015 09:32:24 +0000 (10:32 +0100)
mupix/sources/MuPix3_interface.vhd

index 010e8c671cc1149450e15df4767b8331b44d23bb..3eaa123efe2e31b411a9124f98bd61bc7fb787d5 100644 (file)
@@ -288,10 +288,14 @@ begin
       else
         testoutro     <= (others => '0');
         testoutro(31) <= priout;
-        memwren     <= '0';
-        memdata     <= (others => '0');
-        endofevent  <= '0';
-        ro_busy_int <= '0';
+        memwren       <= '0';
+        memdata       <= (others => '0');
+        endofevent    <= '0';
+        ro_busy_int   <= '0';
+        ldpix         <= '0';
+        pulldown      <= '0';
+        ldcol         <= '0';
+        rdcol         <= '0';
         case state is
           when pause =>
             pausecounter <= pausecounter +1;
@@ -299,10 +303,6 @@ begin
               state        <= waiting;
               pausecounter <= (others => '0');
             end if;
-            ldpix       <= '0';
-            ldcol       <= '0';
-            rdcol       <= '0';
-            pulldown    <= '0';
           when waiting =>
             testoutro(1) <= '1';
             delcounter   <= (others => '0');
@@ -311,10 +311,6 @@ begin
             if(reseteventcount = '1') then
               eventcounter <= (others => '0');
             end if;
-            ldpix    <= '0';
-            ldcol    <= '0';
-            rdcol    <= '0';
-            pulldown <= '0';
             if(readmanual = '1') then
               state <= readman;
             elsif(continousread = '1' or readnow = '1' or(triggering = '1' and trigger_ext = '1' and generatetriggeredhits = '0')) then
@@ -349,7 +345,6 @@ begin
           when loadpix =>
             ro_busy_int  <= '1';
             testoutro(2) <= '1';
-            ldpix        <= '0';
             delcounter   <= delcounter - 1;
             state        <= loadpix;
             if(delcounter = "00000100") then     -- write event header
@@ -370,9 +365,6 @@ begin
           when pulld =>
             ro_busy_int  <= '1';
             testoutro(3) <= '1';
-            if unsigned(delaycounters1(15 downto 8)) = delcounter then
-              pulldown <= '0';
-            end if;
             delcounter <= delcounter - 1;
             state      <= pulld;
             if(delcounter = "00000000") then
@@ -383,9 +375,6 @@ begin
           when loadcol =>
             ro_busy_int  <= '1';
             testoutro(4) <= '1';
-            if(delcounter = unsigned(delaycounters1(23 downto 16))) then
-              ldcol <= '0';
-            end if;
             delcounter <= delcounter - 1;
             state      <= loadcol;
             if(delcounter = "00000000") then
@@ -403,8 +392,8 @@ begin
           when readcol =>
             ro_busy_int  <= '1';
             testoutro(5) <= '1';
-            if(delcounter = unsigned(delaycounters1(31 downto 24)) - unsigned(delaycounters2(15 downto 8))) then
-              rdcol <= '0';
+            if(delcounter > unsigned(delaycounters1(31 downto 24)) - unsigned(delaycounters2(15 downto 8))) then
+              rdcol <= '1';
             end if;
             delcounter <= delcounter - 1;
             state      <= readcol;
@@ -426,14 +415,16 @@ begin
               memdata    <= "10111110111011111011111011101111";    --0xBEEFBEEF
               endofevent <= '1';
               state      <= pause;
-            elsif(delcounter = "00000000" and (priout = '1' or (delaycounters2(23 downto 16) /= "00000000" and priout_reg = '1'))) then
-              state      <= readcol;
-              rdcol      <= '1';
-              delcounter <= unsigned(delaycounters1(31 downto 24));
             elsif(delcounter = "00000000") then
-              state      <= pulld;
-              pulldown   <= '1';
-              delcounter <= unsigned(delaycounters2(7 downto 0));
+              if (priout = '1' or (delaycounters2(23 downto 16) /= "00000000" and priout_reg = '1')) then
+                state      <= readcol;
+                rdcol      <= '1';
+                delcounter <= unsigned(delaycounters1(31 downto 24));
+              else
+                state      <= pulld;
+                pulldown   <= '1';
+                delcounter <= unsigned(delaycounters2(7 downto 0));  
+              end if;
             end if;
             
           when hitgenerator =>