]> jspc29.x-matter.uni-frankfurt.de Git - mdcupgrade.git/commitdiff
Couple of changes to MDC TDC
authorJan Michel <michel@physik.uni-frankfurt.de>
Thu, 20 Jul 2023 14:32:31 +0000 (16:32 +0200)
committerJan Michel <michel@physik.uni-frankfurt.de>
Thu, 20 Jul 2023 14:32:31 +0000 (16:32 +0200)
- reset generated with falling edge for better hold time
- add debug output pins
- add debug uart
- switch of serdes ready signal before reboot

DBO/config.vhd
DBO/config_compile_frankfurt.pl
DBO/mdctdc.lpf
DBO/mdctdc.prj
DBO/mdctdc.vhd
pinout/dbo.lpf

index c7abcfdc0225f2cd9ee9f4f9aa4e1b00f03f9883..82ea37a0695c9d402b23b683fe7117602361fd42 100644 (file)
@@ -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
index 1b4ddb995079c2df62bc1fe1b95c0dd4e0fbcf21..6d87b6234d19b157f69a9f8bdd60323dd7972d91 100644 (file)
@@ -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               => ' ',
index 0a072099cef6d7faeca41348b91126dd31b95d3b..e5a15bb76611086a638e5d6512aa352e9b8a2156 100644 (file)
@@ -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;
index 30ace65ba61ee2275c789e808fa89e73df7b4931..1285b56ec48973fcfc987f2db6c33dc8e94a26ed 100644 (file)
@@ -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"
index 05194b973607be00854448518a2fc81e92638064..99f1c3e4ac823ef5b54804a679b0665d0aba21fc 100644 (file)
@@ -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)
     
     );
 
index d32d6d04f0b93372509820bbbb56ed45d7f2f42c..a4cbe6eef768717ac443423724b07737df5fe107 100644 (file)
@@ -29,7 +29,7 @@ LOCATE COMP "GPIO_1" SITE "C15";
 LOCATE COMP "GPIO_2" SITE "A16";\r
 LOCATE COMP "GPIO_3" SITE "B16";\r
 DEFINE PORT GROUP "GPIO_group" "GPIO*";\r
-IOBUF GROUP "GPIO_group" IO_TYPE=LVCMOS25 ;\r
+IOBUF GROUP "GPIO_group" IO_TYPE=LVCMOS25  PULLMODE=UP;\r
 \r
 LOCATE COMP "ID_0" SITE "R1";\r
 LOCATE COMP "ID_1" SITE "T1";\r
@@ -131,5 +131,11 @@ LOCATE COMP "PTEN_2" SITE "B8";
 DEFINE PORT GROUP "PTEN_group" "PTEN*";\r
 IOBUF GROUP "PTEN_group" IO_TYPE=LVCMOS25 ;\r
 \r
+LOCATE COMP "IO_1" SITE "E1";\r
+LOCATE COMP "IO_2" SITE "E3";\r
+LOCATE COMP "IO_3" SITE "D2";\r
+LOCATE COMP "IO_4" SITE "C2";\r
+DEFINE PORT GROUP "IO_group" "IO*";\r
+IOBUF GROUP "IO_group" IO_TYPE=LVCMOS25 ;\r
 \r
 \r