From: Jan Michel Date: Thu, 20 Jul 2023 14:32:31 +0000 (+0200) Subject: Couple of changes to MDC TDC X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=05070ac100aa3880a37e13f1636bd8a623b931f0;p=mdcupgrade.git Couple of changes to MDC TDC - reset generated with falling edge for better hold time - add debug output pins - add debug uart - switch of serdes ready signal before reboot --- diff --git a/DBO/config.vhd b/DBO/config.vhd index c7abcfd..82ea37a 100644 --- a/DBO/config.vhd +++ b/DBO/config.vhd @@ -36,7 +36,7 @@ package config is constant INCLUDE_SPI : integer := c_NO; --300 slices constant INCLUDE_ADC : integer := c_NO; constant INCLUDE_I2C : integer := c_NO; - constant INCLUDE_DEBUG_INTERFACE: integer := c_NO; --300 slices + constant INCLUDE_DEBUG_INTERFACE: integer := c_YES; --300 slices --input monitor and trigger generation logic constant INCLUDE_TRIGGER_LOGIC : integer := c_NO; --400 slices @32->2 diff --git a/DBO/config_compile_frankfurt.pl b/DBO/config_compile_frankfurt.pl index 1b4ddb9..6d87b62 100644 --- a/DBO/config_compile_frankfurt.pl +++ b/DBO/config_compile_frankfurt.pl @@ -10,7 +10,7 @@ lm_license_file_for_par => "1710\@jspc29", lattice_path => '/d/jspc29/lattice/diamond/3.12', synplify_path => '/d/jspc29/lattice/synplify/S-2021.09-SP2/', -nodelist_file => '../nodelist_frankfurt.txt', +nodelist_file => 'nodelist_frankfurt.txt', pinout_file => 'dbo', par_options => '../par.p2t', mapper_options => ' ', diff --git a/DBO/mdctdc.lpf b/DBO/mdctdc.lpf index 0a07209..e5a15bb 100644 --- a/DBO/mdctdc.lpf +++ b/DBO/mdctdc.lpf @@ -28,7 +28,7 @@ LOCATE UGROUP "THE_MEDIA_INTERFACE/media_interface_group" REGION "MEDIA" # BLKNAME THE_ENDPOINT; #LOCATE UGROUP "REST" REGION "RESTAREA"; - +USE PRIMARY NET reset_i_fast; # USE PRIMARY NET THE_TDC/calibration_pulse ; PRIORITIZE NET THE_TDC/gen_CHANNELS.0.THE_CHANNEL/gated_inp 100; PRIORITIZE NET THE_TDC/gen_CHANNELS.1.THE_CHANNEL/gated_inp 100; diff --git a/DBO/mdctdc.prj b/DBO/mdctdc.prj index 30ace65..1285b56 100644 --- a/DBO/mdctdc.prj +++ b/DBO/mdctdc.prj @@ -170,6 +170,8 @@ add_file -vhdl -lib work "../../trbnet/trb_net16_addresses.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/med_sync_define.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/rx_control.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/tx_control.vhd" +add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/main_rx_reset_RS.vhd" +add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/main_tx_reset_RS.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/rx_reset_fsm.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/tx_reset_fsm.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/sync/sci_reader.vhd" diff --git a/DBO/mdctdc.vhd b/DBO/mdctdc.vhd index 05194b9..99f1c3e 100644 --- a/DBO/mdctdc.vhd +++ b/DBO/mdctdc.vhd @@ -45,9 +45,11 @@ entity mdctdc is I2C_SCL : inout std_logic; --LED - LED : out std_logic_vector(2 downto 0) + LED : out std_logic_vector(2 downto 0); --green(0), orange(1), yellow(2) --Other Connectors + IO : inout std_logic_vector(4 downto 1) + ); @@ -69,6 +71,7 @@ architecture arch of mdctdc is signal GSR_N : std_logic; signal reset_i : std_logic; signal clear_i : std_logic; + signal reset_i_tmp : std_logic; --Media Interface signal med2int : med2int_array_t(0 to 0); @@ -96,8 +99,9 @@ architecture arch of mdctdc is signal monitor_inputs_i : std_logic_vector(MONITOR_INPUT_NUM-1 downto 0); signal trigger_inputs_i : std_logic_vector(TRIG_GEN_INPUT_NUM-1 downto 0); signal calibration_pulse: std_logic; - - signal dummy_i : std_logic; + signal header_io_i : std_logic_vector(10 downto 1); + signal prepare_for_reload_i : std_logic; + signal sd_txdis_i : std_logic; begin @@ -113,7 +117,7 @@ begin BUS_RX => bustc_rx, BUS_TX => bustc_tx, - RESET_OUT => reset_i, + RESET_OUT => reset_i_tmp, CLEAR_OUT => clear_i, GSR_OUT => GSR_N, @@ -124,13 +128,14 @@ begin DEBUG_OUT => open ); - +reset_i <= reset_i_tmp when falling_edge(clk_sys); --------------------------------------------------------------------------- -- TrbNet Uplink --------------------------------------------------------------------------- THE_MEDIA_INTERFACE : entity work.med_ecp5_sfp_sync generic map( + USE_NEW_ECP5_RESET => 0, SERDES_NUM => 0, IS_SYNC_SLAVE => c_YES ) @@ -153,7 +158,7 @@ begin --SFP Connection SD_PRSNT_N_IN => GPIO(0), SD_LOS_IN => GPIO(0), - SD_TXDIS_OUT => GPIO(1), + SD_TXDIS_OUT => sd_txdis_i, --Control Interface BUS_RX => bussci_rx, BUS_TX => bussci_tx, @@ -161,6 +166,8 @@ begin STAT_DEBUG => med_stat_debug(63 downto 0), CTRL_DEBUG => open ); + +GPIO(1) <= sd_txdis_i or prepare_for_reload_i; --------------------------------------------------------------------------- -- Endpoint @@ -168,7 +175,7 @@ begin THE_ENDPOINT : entity work.trb_net16_endpoint_hades_full_handler_record generic map ( ADDRESS_MASK => x"FFFF", - BROADCAST_BITMASK => x"FF", + BROADCAST_BITMASK => x"FB", REGIO_INIT_ENDPOINT_ID => x"0001", REGIO_USE_1WIRE_INTERFACE => c_I2C, TIMING_TRIGGER_RAW => c_YES, @@ -264,6 +271,7 @@ begin FLASH_IN => FLASH_MISO, FLASH_OUT => FLASH_MOSI, PROGRAMN => PROGRAMN, + PREPARE_FOR_RELOAD => prepare_for_reload_i, REBOOT_IN => common_ctrl_reg(15), --SPI --SPI_CS_OUT(1 downto 0) => RSTN, @@ -271,7 +279,9 @@ begin --SPI_MISO_IN(1 downto 0) => MISO, --SPI_CLK_OUT(1 downto 0) => SCK, --Header - HEADER_IO => open, + -- 9 Debug RX + -- 10 Debug TX + HEADER_IO => header_io_i, ADDITIONAL_REG => additional_reg, --LCD @@ -302,7 +312,10 @@ begin led_off <= additional_reg(0); FLASH_OVERRIDE <= not additional_reg(1); - + + header_io_i(9) <= IO(3); + IO(4) <= header_io_i(10); + --------------------------------------------------------------------------- -- I/O --------------------------------------------------------------------------- @@ -342,9 +355,7 @@ THE_TDC : entity work.TDC_FF BUS_TX => bustdc_tx, READOUT_RX => readout_rx, - READOUT_TX => readout_tx(0 to 1), - - DUMMY => dummy_i + READOUT_TX => readout_tx(0 to 1) ); diff --git a/pinout/dbo.lpf b/pinout/dbo.lpf index d32d6d0..a4cbe6e 100644 --- a/pinout/dbo.lpf +++ b/pinout/dbo.lpf @@ -29,7 +29,7 @@ LOCATE COMP "GPIO_1" SITE "C15"; LOCATE COMP "GPIO_2" SITE "A16"; LOCATE COMP "GPIO_3" SITE "B16"; DEFINE PORT GROUP "GPIO_group" "GPIO*"; -IOBUF GROUP "GPIO_group" IO_TYPE=LVCMOS25 ; +IOBUF GROUP "GPIO_group" IO_TYPE=LVCMOS25 PULLMODE=UP; LOCATE COMP "ID_0" SITE "R1"; LOCATE COMP "ID_1" SITE "T1"; @@ -131,5 +131,11 @@ LOCATE COMP "PTEN_2" SITE "B8"; DEFINE PORT GROUP "PTEN_group" "PTEN*"; IOBUF GROUP "PTEN_group" IO_TYPE=LVCMOS25 ; +LOCATE COMP "IO_1" SITE "E1"; +LOCATE COMP "IO_2" SITE "E3"; +LOCATE COMP "IO_3" SITE "D2"; +LOCATE COMP "IO_4" SITE "C2"; +DEFINE PORT GROUP "IO_group" "IO*"; +IOBUF GROUP "IO_group" IO_TYPE=LVCMOS25 ;