add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x64_OutReg.vhd"
add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x32_OutReg.vhd"
add_file -vhdl -lib work "../../tdc/base/cores/ecp3/PLL/pll_in125_out33.vhd"
+add_file -vhdl -lib work "../../tdc/base/cores/ecp3/PLL/pll_in240_out50.vhd"
#TDC Calibration
add_file -vhdl -lib work "./code_EBR/Calibration.vhd"
signal reset_via_cri_long, reset_via_cri_timer, last_reset_via_cri_long, make_reset : std_logic;
signal reset_via_cri : std_logic := '0';
signal last_cri_resetPulse : std_logic;
+
+ signal clk_cal : std_logic;
attribute syn_keep of bus_mbs_rx : signal is true;
attribute syn_preserve of bus_mbs_rx : signal is true;
end if;
last_reset_via_cri_long <= reset_via_cri_long;
make_reset <= last_reset_via_cri_long and not reset_via_cri_long;
- end process;
+ end process;
+
+
+
+-- generation of TDC calibration clock from recovered clock
+THE_CAL_PLL : entity work.pll_in240_out50
+ port map(
+ CLK => med2int(INTERFACE_NUM).clk_full, -- recovered 240MHz clk
+ CLKOP => clk_cal, -- 50MHz calibration Clock (multiple of 5ns)
+ LOCK => open
+ );
+
---------------------------------------------------------------------------
-- TrbNet Uplink
---------------------------------------------------------------------------
CLK_READOUT => clk_sys, -- Clock for the readout
REFERENCE_TIME => cts_trigger_out, -- Reference time input
HIT_IN => hit_in_i(NUM_TDC_CHANNELS-1 downto 1), -- Channel start signals
- HIT_CAL_IN => clk_full_osc,--clk_cal, -- Hits for calibrating the TDC --FIXME: here we need a good cal clock!
+ HIT_CAL_IN => clk_cal, -- Hits for calibrating the TDC
-- Trigger signals from handler
BUSRDO_RX => cts_rdo_rx,
BUSRDO_TX => cts_rdo_additional(INCLUDE_ETM),--_TDCcal