]> jspc29.x-matter.uni-frankfurt.de Git - tdc.git/commitdiff
Refine calibration timing. Fix montioring inputs for ADA AddOn and NINO input scheme.
authorJan Michel <j.michel@gsi.de>
Mon, 5 Mar 2018 12:40:17 +0000 (13:40 +0100)
committerJan Michel <j.michel@gsi.de>
Mon, 5 Mar 2018 12:40:17 +0000 (13:40 +0100)
releases/tdc_v2.3/TDC_record.vhd
releases/tdc_v2.3/trb3_periph_ADA.vhd

index ad4e12189d9fd68af3a602527b8d0ccb1a8c4dca..bbe33eea15d6f558cd040095ebc29d17b6c911b2 100644 (file)
@@ -243,7 +243,11 @@ begin
   begin
     if rising_edge(HIT_CAL_IN) then     -- rising clock edge
       if cal_cntr_start = '0' then
-        cal_cntr <= "01000";
+        if FPGA_TYPE = 3 then
+          cal_cntr <= "11100";
+        elsif FPGA_TYPE = 5 then
+          cal_cntr <= "01000";
+        end if;  
       else
         cal_cntr <= std_logic_vector(unsigned(cal_cntr) + to_unsigned(1, 5));
       end if;
index 84074a45570efd9af7a2d3e0a85c523dee5c1da6..d3262328adeab074c8a10b3d1826ddb438126484 100644 (file)
@@ -108,6 +108,7 @@ architecture trb3_periph_ADA_arch of trb3_periph_ADA is
   signal clear_i                  : std_logic;
   signal reset_i                  : std_logic;
   signal GSR_N                    : std_logic;
+  signal osc_int                  : std_logic;
   attribute syn_keep of GSR_N     : signal is true;
   attribute syn_preserve of GSR_N : signal is true;
 
@@ -183,7 +184,11 @@ begin
       CLKOK => clk_200_i,               -- 200 MHz, bypass
       LOCK  => pll_lock);
 
-
+pll_calibration: entity work.pll_in125_out33
+  port map (
+    CLK   => CLK_GPLL_LEFT,
+    CLKOP => osc_int,
+    LOCK  => open);
 
 ---------------------------------------------------------------------------
 -- The TrbNet media interface (to other FPGA)
@@ -335,9 +340,9 @@ begin
       DEBUG_TX_OUT  => debug_tx,
 
       --Trigger & Monitor 
-      MONITOR_INPUTS(31 downto 0) => INP(31 downto 0),
+      MONITOR_INPUTS(31 downto 0) => hit_in_i(32 downto 1),
       MONITOR_INPUTS(35 downto 32) => trig_gen_out_i,
-      TRIG_GEN_INPUTS  => INP(31 downto 0),
+      TRIG_GEN_INPUTS  => hit_in_i(32 downto 1),
       TRIG_GEN_OUTPUTS => trig_gen_out_i,
       LCD_OUT => lcd_out,
       --SED
@@ -413,7 +418,7 @@ begin
       CLK_READOUT        => clk_100_i,  -- Clock for the readout
       REFERENCE_TIME     => timing_trg_received_i,  -- Reference time input
       HIT_IN             => hit_in_i(NUM_TDC_CHANNELS-1 downto 1),  -- Channel start signals
-      HIT_CAL_IN         => CLK_GPLL_LEFT,    -- Hits for calibrating the TDC
+      HIT_CAL_IN         => osc_int,    -- Hits for calibrating the TDC
       -- Trigger signals from handler
       BUSRDO_RX          => readout_rx,
       BUSRDO_TX          => readout_tx(0),