]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
Removed async reset input in graycounter since this was not used anymore.
authorTobias Weber <webert@kph.uni-mainz.de>
Tue, 24 Mar 2015 16:16:23 +0000 (17:16 +0100)
committerTobias Weber <webert@kph.uni-mainz.de>
Tue, 24 Mar 2015 16:16:23 +0000 (17:16 +0100)
mupix/sources/MuPix3_interface.vhd
mupix/sources/graycounter.vhd
mupix/sources/mupix_components.vhd

index 3eaa123efe2e31b411a9124f98bd61bc7fb787d5..6d18329958ab2c078e9aaf28feb3655aa4c573aa 100644 (file)
@@ -513,7 +513,7 @@ begin
     end if;
   end process;
 
-  resetgraycounter <= rst or timestampreset_in;
+  resetgraycounter <= rst or timestampreset_in or timestampcontrolbits(9);
 
   grcount : Graycounter
     generic map(
@@ -522,7 +522,6 @@ begin
     port map(
       clk            => clk,
       reset          => resetgraycounter,
-      sync_reset     => timestampcontrolbits(9),
       clk_divcounter => graycounter_clkdiv_counter(7 downto 0),
       counter        => graycount
       );
index 894501430019df21b2d5c3582eb4746e1c984750..a15ad76cf97c7acb86bd9bfc8ccb2cf6cd99a796 100644 (file)
@@ -13,22 +13,21 @@ entity Graycounter is
     COUNTWIDTH : integer := 8
     );
   port (
-    clk        : in std_logic;          -- clock
-    reset      : in std_logic;          -- asynchronous reset
-    sync_reset : in std_logic;          -- synchronous reset
-    clk_divcounter : in std_logic_vector(7 downto 0); -- clockdivider for
-                                                      -- graycounter clock
-    counter : out std_logic_vector(COUNTWIDTH-1 downto 0)  -- counter
+    clk            : in  std_logic;     -- clock
+    reset          : in  std_logic;     -- reset
+    clk_divcounter : in  std_logic_vector(7 downto 0);  -- clockdivider for
+                                                        -- graycounter clock
+    counter        : out std_logic_vector(COUNTWIDTH-1 downto 0)  -- counter
     );
 end Graycounter;
 
 architecture rtl of Graycounter is
   
-  signal msb           : std_logic := '0';
+  signal msb           : std_logic                             := '0';
   signal counter_reg   : std_logic_vector(COUNTWIDTH downto 0) := (others => '0');
   signal no_ones_below : std_logic_vector(COUNTWIDTH downto 0) := "000000001";
-  signal clk_enable : std_logic := '0';
-  signal divcounter : unsigned(7 downto 0) := (others => '0');
+  signal clk_enable    : std_logic                             := '0';
+  signal divcounter    : unsigned(7 downto 0)                  := (others => '0');
   
 begin
   
@@ -36,7 +35,7 @@ begin
 
   msb <= counter_reg(COUNTWIDTH) or counter_reg(COUNTWIDTH-1);
 
-  clock_divider_proc: process (clk) is
+  clock_divider_proc : process (clk) is
   begin  -- process clock_divider_proc
     if rising_edge(clk) then
       if reset = '1' then
@@ -56,19 +55,19 @@ begin
   process(clk, reset)
   begin
     if (clk'event and clk = '1') then
-      if (sync_reset = '1') then
+      if (reset = '1') then
         no_ones_below(0) <= '1';
-        counter_reg    <= (others => '0');
-        counter_reg(0) <= '1';
+        counter_reg      <= (others => '0');
+        counter_reg(0)   <= '1';
       else
         if clk_enable = '1' then
           counter_reg(0) <= not counter_reg(0);
-        for i in 1 to COUNTWIDTH-1 loop
-          counter_reg(i) <= counter_reg(i) xor (counter_reg(i-1) and no_ones_below(i-1));
-        end loop;
-        counter_reg(COUNTWIDTH) <= counter_reg(COUNTWIDTH) xor (msb and no_ones_below(COUNTWIDTH-1));
+          for i in 1 to COUNTWIDTH-1 loop
+            counter_reg(i) <= counter_reg(i) xor (counter_reg(i-1) and no_ones_below(i-1));
+          end loop;
+          counter_reg(COUNTWIDTH) <= counter_reg(COUNTWIDTH) xor (msb and no_ones_below(COUNTWIDTH-1));
         else
-          counter_reg <=  counter_reg;
+          counter_reg <= counter_reg;
         end if;
       end if;
     end if;
index 7eebcbeae51ab41a61154f7cd58f04eb80f6bb70..4dabb4472e6748a2c4b78b995eb3643035186d7a 100644 (file)
@@ -156,7 +156,6 @@ package mupix_components is
     port (
       clk            : in  std_logic;
       reset          : in  std_logic;
-      sync_reset     : in  std_logic;
       clk_divcounter : in  std_logic_vector(7 downto 0);
       counter        : out std_logic_vector(COUNTWIDTH-1 downto 0));
   end component;