]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
change size of memory for circullar buffer.
authorTobias Weber <toweber86@gmail.com>
Thu, 30 Aug 2018 07:40:52 +0000 (09:40 +0200)
committerTobias Weber <toweber86@gmail.com>
Thu, 30 Aug 2018 07:40:52 +0000 (09:40 +0200)
mupix/Mupix8/sources/Datapath/CircularMemory.vhd
mupix/Mupix8/sources/Datapath/MupixTRBReadout.vhd
mupix/Mupix8/sources/MupixBoard.vhd

index ea0d02d75da86dedbfba575b35d0d230858f5014..143b2c6164e9e681555b616c66df7831d38febb7 100644 (file)
@@ -37,7 +37,7 @@ end entity CircularMemory;
 
 architecture RTL of CircularMemory is
 
-  component RAM_DP_4096_32 is
+  component RAM_DP_8192_32 is
     port (
       WrAddress : in  std_logic_vector(11 downto 0);
       RdAddress : in  std_logic_vector(11 downto 0);
@@ -49,7 +49,7 @@ architecture RTL of CircularMemory is
       WrClock   : in  std_logic;
       WrClockEn : in  std_logic;
       Q         : out std_logic_vector(31 downto 0));
-  end component RAM_DP_4096_32;
+  end component RAM_DP_8192_32;
 
   --counters for write/read frequency
   signal ticks_counter                   : unsigned(f_log2(g_clockspeed) - 1 downto 0) := (others => '0');
@@ -78,7 +78,7 @@ architecture RTL of CircularMemory is
 
 begin
 
-  RAM_DP_4096_32_1: entity work.RAM_DP_4096_32
+  RAM_DP_4096_32_1: entity work.RAM_DP_8192_32
     port map (
       WrAddress => WrAddr_mem,
       RdAddress => ReAddr_mem,
index d0bf9be805ef40f4d332bc324f6a2d63e5b6b6ce..79940c6f8b02912443e7920922f28ffba156f425 100644 (file)
@@ -138,6 +138,8 @@ architecture rtl of MupixTRBReadout is
       data_out          : out std_logic_vector(g_datawidth - 1 downto 0)
       );
   end component ReadoutController;
+  
+  signal reset_reg : std_logic := '0';
 
   signal readout_mode_i          : std_logic_vector(1 downto 0)                           := "00";
   signal readout_writes_aft_trig : std_logic_vector(g_cyc_mem_address_width - 1 downto 0) := (others => '0');
@@ -187,6 +189,13 @@ architecture rtl of MupixTRBReadout is
 
 begin
 
+  reset_proc : process(clk)
+  begin
+    if rising_edge(clk) then
+        reset_reg <= rst;
+    end if;
+  end process reset_proc;
+
   start_readout <= start_readout_slow_to_buffer or trb_trigger;
 
   FiFoDataMux_1 : entity work.FiFoDataMux
@@ -196,7 +205,7 @@ begin
       g_clockspeed => 1e8)
     port map (
       clk         => clk,
-      rst         => rst,
+      rst         => reset_reg,
       fifo_empty  => fifo_empty,
       fifo_full   => fifo_full,
       fifo_datain => fifo_datain,
@@ -213,7 +222,7 @@ begin
       Clock => clk,
       WrEn  => fifo_data_width_wr_i,
       RdEn  => fifo_data_width_rd_i,
-      Reset => rst,
+      Reset => reset_reg,
       WCNT  => fifo_data_width_cnt_i,
       Q     => fifo_data_width_dataout_i,
       Empty => fifo_data_width_empty_i,
@@ -225,7 +234,7 @@ begin
       g_datawidthtrb  => g_datawidthtrb)
     port map (
       clk         => clk,
-      reset       => rst,
+      reset       => reset_reg,
       fifo_empty  => fifo_data_width_empty_i,
       fifo_wrcnt  => fifo_data_width_cnt_i,
       fifo_datain => fifo_data_width_dataout_i,
@@ -242,7 +251,7 @@ begin
       )
     port map(
       clk          => clk,
-      rst          => rst,
+      rst          => reset_reg,
       wr_en        => fifo_mux_wren,
       data_in      => fifo_mux_data_out,
       rd_en        => readout_controller_rd_en,
@@ -265,7 +274,7 @@ begin
       )
     port map(
       clk               => clk,
-      rst               => rst,
+      rst               => reset_reg,
       start             => start_readout,
       mode              => readout_mode_i,
       writes_after_trig => readout_writes_aft_trig,
@@ -284,7 +293,7 @@ begin
   data_read_slow : process (clk) is
   begin
     if rising_edge(clk) then
-      if rst = '1' then
+      if reset_reg = '1' then
         slow_readout_fsm             <= idle;
         slow_read_done               <= '0';
         slow_read_busy               <= '0';
@@ -334,7 +343,7 @@ begin
   slv_bus_handler : process(clk) is
   begin
     if rising_edge(clk) then
-      if rst = '1' then
+      if reset_reg = '1' then
         SLV_DATA_OUT         <= (others => '0');
         SLV_ACK_OUT          <= '0';
         SLV_NO_MORE_DATA_OUT <= '0';
index f2fbe5a51454fa23b0a42654c0fe2c7a9eb67450..2234a22fcdc1f01c0e445026580a8dd98b0fba9a 100644 (file)
@@ -538,7 +538,7 @@ begin  -- Behavioral
   mupixreadout1 : entity work.MupixTRBReadout
     generic map(
       g_mupix_links           => c_links,
-      g_cyc_mem_address_width => 12,
+      g_cyc_mem_address_width => 13,
       g_datawidthfifo         => c_mupixhitsize,
       g_datawidthtrb          => 32
       )