]> jspc29.x-matter.uni-frankfurt.de Git - trb5sc.git/commitdiff
designs compiling and working
authorMichael Boehmer <mboehmer@ph.tum.de>
Fri, 12 Nov 2021 07:23:12 +0000 (08:23 +0100)
committerMichael Boehmer <mboehmer@ph.tum.de>
Fri, 12 Nov 2021 07:23:12 +0000 (08:23 +0100)
template/config.vhd
template/config_compile_gsi.pl [new file with mode: 0644]
template/nodelist.txt [new file with mode: 0644]
template/par.p2t
template/trb5sc_template.prj
template/trb5sc_template.vhd

index 4757bc0982ad9401ef2eced1d7384527d5a9c57c..5a9fa379712722616448ab30d96f12e458d93a96 100644 (file)
@@ -5,20 +5,17 @@ use work.trb_net_std.all;
 
 package config is
 
-
 ------------------------------------------------------------------------------
 --Begin of design configuration
 ------------------------------------------------------------------------------
-
-
 --set to 0 for backplane serdes, set to 1 for SFP serdes
-    constant SERDES_NUM             : integer := 0;
+  constant SERDES_NUM             : integer := 1;
 
 --TDC settings
   constant FPGA_TYPE               : integer  := 5;  --3: ECP3, 5: ECP5
   constant NUM_TDC_MODULES         : integer range 1 to 4  := 1;  -- number of tdc modules to implement
-  constant NUM_TDC_CHANNELS        : integer range 1 to 65 := 33;  -- number of tdc channels per module
-  constant NUM_TDC_CHANNELS_POWER2 : integer range 0 to 6  := 5;  --the nearest power of two, for convenience reasons 
+  constant NUM_TDC_CHANNELS        : integer range 1 to 65 := 5;  -- number of tdc channels per module
+  constant NUM_TDC_CHANNELS_POWER2 : integer range 0 to 6  := 2;  --the nearest power of two, for convenience reasons 
   constant DOUBLE_EDGE_TYPE        : integer range 0 to 3  := 3;  --double edge type:  0, 1, 2,  3
   -- 0: single edge only,
   -- 1: same channel,
@@ -64,8 +61,6 @@ package config is
 ------------------------------------------------------------------------------
 --End of design configuration
 ------------------------------------------------------------------------------
-
-
   type data_t is array (0 to 1023) of std_logic_vector(7 downto 0);
   constant LCD_DATA : data_t := (others => x"00");
 
@@ -85,7 +80,6 @@ package config is
     constant MEDIA_FREQUENCY      : integer;
     constant INCLUDED_FEATURES      : std_logic_vector(63 downto 0);
     
-    
 end;
 
 package body config is
diff --git a/template/config_compile_gsi.pl b/template/config_compile_gsi.pl
new file mode 100644 (file)
index 0000000..ded4aa6
--- /dev/null
@@ -0,0 +1,23 @@
+Familyname  => 'ECP5UM',
+Devicename  => 'LFE5UM-85F',
+Package     => 'CABGA756',
+Speedgrade  => '8',
+
+TOPNAME                      => "trb5sc_template",
+lm_license_file_for_synplify => "27000\@lxcad04.gsi.de",
+lm_license_file_for_par      => "1702\@hadeb05.gsi.de",
+lattice_path                 => '/opt/lattice/diamond/3.12',
+synplify_path                => '/opt/synplicity/R-2020.09-SP1',
+synplify_command             => "/opt/synplicity/R-2020.09-SP1/bin/synplify_premier",
+
+nodelist_file                => '../nodelist.txt',
+pinout_file                  => 'trb5sc_tdc',
+par_options                  => '../par.p2t',
+    
+include_TDC                  => 1,
+include_GBE                  => 0,
+
+firefox_open                 => 0,
+twr_number_of_errors         => 20,
+no_ltxt2ptxt                 => 1,  #must not be set for ECP5
+
diff --git a/template/nodelist.txt b/template/nodelist.txt
new file mode 100644 (file)
index 0000000..a99f562
--- /dev/null
@@ -0,0 +1,8 @@
+// nodes file for parallel place&route
+
+[hades66]
+system = linux
+corenum = 24
+ENV = /home/compile/bin/diamond_env
+workdir = /home/compile/vhdl/dirich/dirich/workdir
+
index e168739780856e902fadab4bc558dd559c40d98b..722b6fea38ac0e2a441952b9516efafd0bf067c5 100644 (file)
@@ -1,69 +1,65 @@
 -w
-#-y
 -l 5
-#-m nodelist.txt       # Controlled by the compile.pl script.
-#-n 1                          # Controlled by the compile.pl script.
 -s 10
--t 11
+-t 11 # seed setting here!
 -c 2
 -e 2
 -i 10
-#-exp parPlcInLimit=0
-#-exp parPlcInNeighborSize=1
+-exp parHold=ON:parHoldLimit=10000:parCDP=1:parCDR=1:parPathBased=OFF:paruseNBR=1
 #General PAR Command Line Options
-#  -w    With this option, any files generated will overwrite existing files
-#        (e.g., any .par, .pad files).
-#  -y    Adds the Delay Summary Report in the .par file and creates the delay
-#        file (in .dly format) at the end of the par run.
+#  -w     With this option, any files generated will overwrite existing files
+#         (e.g., any .par, .pad files).
+#  -y     Adds the Delay Summary Report in the .par file and creates the delay
+#         file (in .dly format) at the end of the par run.
 #
 #PAR Placement Command Line Options
-#  -l    Specifies the effort level of the design from 1 (simplest designs)
-#        to 5 (most complex designs).
+#  -l     Specifies the effort level of the design from 1 (simplest designs)
+#         to 5 (most complex designs).
 #  -m     Multi-tasking option. Controlled by the compile.pl script.
-#  -n    Sets the number of iterations performed at the effort level
-#        specified by the -l option. Controlled by the compile.pl script.
+#  -n     Sets the number of iterations performed at the effort level
+#         specified by the -l option. Controlled by the compile.pl script.
 #  -s     Save the number of best results for this run.
-#  -t    Start placement at the specified cost table. Default is 1.
+#  -t     Start placement at the specified cost table. Default is 1.
 #
 #PAR Routing Command Line Options
-#  -c    Run number of cost-based cleanup passes of the router.
-#  -e    Run number of delay-based cleanup passes of the router on
-#        completely-routed designs only.
-#  -i    Run a maximum number of passes, stopping earlier only if the routing
-#        goes to 100 percent completion and all constraints are met.
+#  -c     Run number of cost-based cleanup passes of the router.
+#  -e     Run number of delay-based cleanup passes of the router on
+#         completely-routed designs only.
+#  -i     Run a maximum number of passes, stopping earlier only if the routing
+#         goes to 100 percent completion and all constraints are met.
 #
 #PAR Explorer Command Line Options
-#  parCDP            Enable the congestion-driven placement (CDP) algorithm. CDP is
-#                    compatible with all Lattice FPGA device families; however, most
-#                    benefit has been demonstrated with benchmarks targeted to ECP5,
-#                    LatticeECP2/M, LatticeECP3, and LatticeXP2 device families.
-#  parCDR            Enable the congestion-driven router (CDR) algorithm.
-#                    Congestion-driven options like parCDR and parCDP can improve
-#                    performance given a design with multiple congestion “hotspots.” The
-#                    Layer > Congestion option of the Design Planner Floorplan View can
-#                    help visualize routing congestion. Large congested areas may prevent
-#                    the options from finding a successful solution.
-#                    CDR is compatible with all Lattice FPGA device families however most
-#                    benefit has been demonstrated with benchmarks targeted to ECP5,
-#                    LatticeECP2/M,LatticeECP3, and LatticeXP2 device families. 
-#  paruseNBR         NBR Router or Negotiation-based routing option. Supports all
-#                    FPGA device families except LatticeXP and MachXO.
-#                    When turned on, an alternate routing engine from the traditional
-#                    Rip-up-based routing selection (RBR) is used. This involves an
-#                    iterative routing algorithm that routes connections to achieve
-#                    minimum delay cost. It does so by computing the demand on each
-#                    routing resource and applying cost values per node. It will
-#                    complete when an optimal solution is arrived at or the number of
-#                    iterations is reached.
-#  parPathBased              Path-based placement option. Path-based timing driven
-#                    placement will yield better performance and more
-#                    predictable results in many cases. 
-#  parHold           Additional hold time correction option. This option
-#                    forces the router to automatically insert extra wires to compensate for the
-#                    hold time violation. 
-#  parHoldLimit              This option allows you to set a limit on the number of
-#                    hold time violations to be processed by the auto hold time correction option
-#                    parHold. 
-#  parPlcInLimit              Cannot find in the online help
+#  parCDP             Enable the congestion-driven placement (CDP) algorithm. CDP is
+#                     compatible with all Lattice FPGA device families; however, most
+#                     benefit has been demonstrated with benchmarks targeted to ECP5,
+#                     LatticeECP2/M, LatticeECP3, and LatticeXP2 device families.
+#  parCDR             Enable the congestion-driven router (CDR) algorithm.
+#                     Congestion-driven options like parCDR and parCDP can improve
+#                     performance given a design with multiple congestion “hotspots.” The
+#                     Layer > Congestion option of the Design Planner Floorplan View can
+#                     help visualize routing congestion. Large congested areas may prevent
+#                     the options from finding a successful solution.
+#                     CDR is compatible with all Lattice FPGA device families however most
+#                     benefit has been demonstrated with benchmarks targeted to ECP5,
+#                     LatticeECP2/M,LatticeECP3, and LatticeXP2 device families.
+#  paruseNBR          NBR Router or Negotiation-based routing option. Supports all
+#                     FPGA device families except LatticeXP and MachXO.
+#                     When turned on, an alternate routing engine from the traditional
+#                     Rip-up-based routing selection (RBR) is used. This involves an
+#                     iterative routing algorithm that routes connections to achieve
+#                     minimum delay cost. It does so by computing the demand on each
+#                     routing resource and applying cost values per node. It will
+#                     complete when an optimal solution is arrived at or the number of
+#                     iterations is reached.
+#  parPathBased       Path-based placement option. Path-based timing driven
+#                     placement will yield better performance and more
+#                     predictable results in many cases.
+#  parHold            Additional hold time correction option. This option
+#                     forces the router to automatically insert extra wires to compensate for the
+#                     hold time violation.
+#  parHoldLimit       This option allows you to set a limit on the number of
+#                     hold time violations to be processed by the auto hold time correction option
+#                     parHold.
+#  parPlcInLimit               Cannot find in the online help
 #  parPlcInNeighborSize        Cannot find in the online help
--exp parHold=ON:parHoldLimit=10000:parCDP=1:parCDR=1:parPathBased=OFF:paruseNBR=1
+
index af5546521d643fa443aa083cacc280f5a10f0cf5..b420c9d1d3622add2ba48060cba0710d4eeaab20 100644 (file)
@@ -66,8 +66,8 @@ add_file -vhdl -lib work "../../dirich/cores/pll_240_100/pll_240_100.vhd"
 add_file -vhdl -lib work "../../dirich/code/clock_reset_handler.vhd"
 add_file -vhdl -lib work "../../trbnet/special/trb_net_reset_handler.vhd"
 add_file -vhdl -lib work "../../trbnet/special/spi_flash_and_fpga_reload_record.vhd"
-add_file -vhdl -lib work "../../dirich/code/sedcheck.vhd"
-
+#add_file -vhdl -lib work "../../dirich/code/sedcheck.vhd"
+add_file -vhdl -lib work "../../vhdlbasics/ecp5/sedcheck.vhd"
 
 #Fifos
 add_file -vhdl -lib work "../../trbnet/lattice/ecp5/trb_net16_fifo_arch.vhd"
@@ -155,6 +155,9 @@ add_file -vhdl -lib work "../../trbnet/media_interfaces/ecp5/chan0_1/serdes_sync
 add_file -vhdl -lib work "../../trbnet/media_interfaces/ecp5/pcs.vhd"
 add_file -verilog -lib work "../../trbnet/media_interfaces/ecp5/serdes_sync_0_softlogic.v"
 
+add_file -vhdl -lib work "../../trbnet/media_interfaces/ecp5/pcs2.vhd"
+
+add_file -vhdl -lib work "../../trbnet/trb_net16_endpoint_hades_full_gbe.vhd"
 
 #TrbNet Endpoint
 add_file -vhdl -lib work "../../trbnet/trb_net16_term_buf.vhd"
index 36132553a8e029eb8ac0eb9ed1ad18de325b28fc..adc0edaa5c7de5b79affad963e19890c824e76e5 100644 (file)
@@ -43,6 +43,7 @@ entity trb5sc_template is
     ADC_NCS      : out   std_logic;
     ADC_MOSI     : out   std_logic;
     ADC_MISO     : in    std_logic;
+    
     --Flash, Reload
     FLASH_SCLK   : out   std_logic;
     FLASH_NCS    : out   std_logic;
@@ -51,6 +52,7 @@ entity trb5sc_template is
     FLASH_HOLD   : out   std_logic;
     FLASH_WP     : out   std_logic;
     PROGRAMN     : out   std_logic;
+    
     --I2C
     I2C_SDA      : inout std_logic;
     I2C_SCL      : inout std_logic;
@@ -68,10 +70,10 @@ entity trb5sc_template is
     --Other Connectors
     TEST    : inout std_logic_vector(14 downto 1);
     HDR_IO  : inout std_logic_vector(15 downto 0)
-    );
+  );
 
 
-  attribute syn_useioff              : boolean;
+  attribute syn_useioff               : boolean;
   attribute syn_useioff of FLASH_NCS  : signal is true;
   attribute syn_useioff of FLASH_SCLK : signal is true;
   attribute syn_useioff of FLASH_MOSI : signal is true;
@@ -85,10 +87,10 @@ architecture arch of trb5sc_template is
   attribute syn_preserve : boolean;
 
   signal clk_sys, clk_full, clk_full_osc, clk_cal : std_logic;
-  signal GSR_N                           : std_logic;
-  signal reset_i                         : std_logic;
-  signal clear_i                         : std_logic;
-  signal trigger_in_i                    : std_logic;
+  signal GSR_N                       : std_logic;
+  signal reset_i                     : std_logic;
+  signal clear_i                     : std_logic;
+  signal trigger_in_i                : std_logic;
 
   signal debug_clock_reset : std_logic_vector(31 downto 0);
   signal debug_tools       : std_logic_vector(31 downto 0);
@@ -115,13 +117,13 @@ architecture arch of trb5sc_template is
   signal flash_ncs_i       : std_logic;
 
   signal spi_cs, spi_mosi, spi_miso, spi_clk : std_logic_vector(15 downto 0);
-  signal header_io_i      : std_logic_vector(10 downto 1);
-  signal timer            : TIMERS;
-  signal led_off          : std_logic;
+  signal header_io_i       : std_logic_vector(10 downto 1);
+  signal timer             : TIMERS;
+  signal led_off           : std_logic;
   --TDC
-  signal hit_in_i         : std_logic_vector(NUM_TDC_CHANNELS-1 downto 1);
-  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 hit_in_i          : std_logic_vector(NUM_TDC_CHANNELS-1 downto 1);
+  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);
 
 
   attribute syn_keep of GSR_N     : signal is true;
@@ -129,55 +131,45 @@ architecture arch of trb5sc_template is
   
   signal link_stat_in_reg : std_logic;
 
-
-
 begin
 
 trigger_in_i <= (TRIG_IN_BACKPL and IN_SELECT_EXT_CLOCK) or (TRIG_IN_RJ45 and not IN_SELECT_EXT_CLOCK);
 
-
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- Clock & Reset Handling
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
   THE_CLOCK_RESET : entity work.clock_reset_handler
     port map(
       CLOCK_IN       => CLK_200,
       RESET_FROM_NET => med2int(0).stat_op(13),
       SEND_RESET_IN  => med2int(0).stat_op(15),
+      BUS_RX         => bustc_rx,
+      BUS_TX         => bustc_tx,
+      RESET_OUT      => reset_i,
+      CLEAR_OUT      => clear_i,
+      GSR_OUT        => GSR_N,
+      REF_CLK_OUT    => clk_full,
+      SYS_CLK_OUT    => clk_sys,
+      RAW_CLK_OUT    => clk_full_osc,
+      DEBUG_OUT      => debug_clock_reset
+    );
 
-      BUS_RX => bustc_rx,
-      BUS_TX => bustc_tx,
-
-      RESET_OUT => reset_i,
-      CLEAR_OUT => clear_i,
-      GSR_OUT   => GSR_N,
-
-      REF_CLK_OUT => clk_full,
-      SYS_CLK_OUT => clk_sys,
-      RAW_CLK_OUT => clk_full_osc,
-
-      DEBUG_OUT => debug_clock_reset
-      );
-
-
-
-THE_CAL_PLL : entity work.pll_in125_out50
-  port map(
-    CLKI  => CLK_125,
-    CLKOP => clk_cal
+  THE_CAL_PLL : entity work.pll_in125_out50
+    port map(
+      CLKI  => CLK_125,
+      CLKOP => clk_cal
     );
 
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- TrbNet Uplink
----------------------------------------------------------------------------
-
+-------------------------------------------------------------------------------
   THE_MEDIA_INTERFACE : entity work.med_ecp5_sfp_sync
     generic map(
       SERDES_NUM    => 0,
       IS_SYNC_SLAVE => c_YES
-      )
+    )
     port map(
-      CLK_REF_FULL      => clk_full_osc,  --med2int(0).clk_full,
+      CLK_REF_FULL      => clk_full_osc,
       CLK_INTERNAL_FULL => clk_full_osc,
       SYSCLK            => clk_sys,
       RESET             => reset_i,
@@ -185,24 +177,22 @@ THE_CAL_PLL : entity work.pll_in125_out50
       --Internal Connection
       MEDIA_MED2INT     => med2int(0),
       MEDIA_INT2MED     => int2med(0),
-
       --Sync operation
-      RX_DLM      => open,
-      RX_DLM_WORD => open,
-      TX_DLM      => open,
-      TX_DLM_WORD => open,
-
+      RX_DLM            => open,
+      RX_DLM_WORD       => open,
+      TX_DLM            => open,
+      TX_DLM_WORD       => open,
       --SFP Connection
-      SD_PRSNT_N_IN  => sfp_prsnt_i,
-      SD_LOS_IN      => sfp_los_i,
-      SD_TXDIS_OUT   => sfp_txdis_i,
+      SD_PRSNT_N_IN     => sfp_prsnt_i,
+      SD_LOS_IN         => sfp_los_i,
+      SD_TXDIS_OUT      => sfp_txdis_i,
       --Control Interface
-      BUS_RX        => bussci_rx,
-      BUS_TX        => bussci_tx,
+      BUS_RX            => bussci_rx,
+      BUS_TX            => bussci_tx,      
       -- Status and control port
       STAT_DEBUG    => med_stat_debug(63 downto 0),
       CTRL_DEBUG    => open
-      );
+    );
 
   gen_sfp_con : if SERDES_NUM = 1 generate
     sfp_los_i   <= SFP_LOS;
@@ -215,10 +205,9 @@ THE_CAL_PLL : entity work.pll_in125_out50
     BACK_GPIO(0) <= sfp_txdis_i;
   end generate;  
         
-
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- Endpoint
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
   THE_ENDPOINT : entity work.trb_net16_endpoint_hades_full_handler_record
     generic map (
       ADDRESS_MASK              => x"FFFF",
@@ -234,79 +223,69 @@ THE_CAL_PLL : entity work.pll_in125_out50
       TRG_RELEASE_AFTER_DATA    => c_YES,
       HEADER_BUFFER_DEPTH       => 9,
       HEADER_BUFFER_FULL_THRESH => 2**9-16
-      )
-
+    )
     port map(
       --  Misc
-      CLK    => clk_sys,
-      RESET  => reset_i,
-      CLK_EN => '1',
-
+      CLK                        => clk_sys,
+      RESET                      => reset_i,
+      CLK_EN                     => '1',
       --  Media direction port
-      MEDIA_MED2INT => med2int(0),
-      MEDIA_INT2MED => int2med(0),
-
+      MEDIA_MED2INT              => med2int(0),
+      MEDIA_INT2MED              => int2med(0),
       --Timing trigger in
       TRG_TIMING_TRG_RECEIVED_IN => trigger_in_i,
-
-      READOUT_RX => readout_rx,
-      READOUT_TX => readout_tx,
-
+      -- readout
+      READOUT_RX                 => readout_rx,
+      READOUT_TX                 => readout_tx,
       --Slow Control Port
-      REGIO_COMMON_STAT_REG_IN  => common_stat_reg,  --0x00
-      REGIO_COMMON_CTRL_REG_OUT => common_ctrl_reg,  --0x20
-      BUS_RX                    => ctrlbus_rx,
-      BUS_TX                    => ctrlbus_tx,
-      BUS_MASTER_IN             => bus_master_in,
-      BUS_MASTER_OUT            => bus_master_out,
-      BUS_MASTER_ACTIVE         => bus_master_active,
-
-      ONEWIRE_INOUT => open,
-      I2C_SCL       => I2C_SCL,
-      I2C_SDA       => I2C_SDA,
+      REGIO_COMMON_STAT_REG_IN   => common_stat_reg,
+      REGIO_COMMON_CTRL_REG_OUT  => common_ctrl_reg,
+      BUS_RX                     => ctrlbus_rx,
+      BUS_TX                     => ctrlbus_tx,
+      BUS_MASTER_IN              => bus_master_in,
+      BUS_MASTER_OUT             => bus_master_out,
+      BUS_MASTER_ACTIVE          => bus_master_active,
+      --UniqueID
+      ONEWIRE_INOUT              => open,
+      I2C_SCL                    => I2C_SCL,
+      I2C_SDA                    => I2C_SDA,
       --Timing registers
-      TIMERS_OUT    => timer
-      );
+      TIMERS_OUT                 => timer
+    );
 
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- Bus Handler
----------------------------------------------------------------------------
-
-
+-------------------------------------------------------------------------------
   THE_BUS_HANDLER : entity work.trb_net16_regio_bus_handler_record
     generic map(
       PORT_NUMBER      => 4,
       PORT_ADDRESSES   => (0 => x"d000", 1 => x"b000", 2 => x"d300", 3 => x"c000", others => x"0000"),
       PORT_ADDR_MASK   => (0 => 12, 1 => 9, 2 => 1, 3 => 12, others => 0),
       PORT_MASK_ENABLE => 1
-      )
+    )
     port map(
-      CLK   => clk_sys,
-      RESET => reset_i,
-
-      REGIO_RX => ctrlbus_rx,
-      REGIO_TX => ctrlbus_tx,
-
-      BUS_RX(0) => bustools_rx,         --Flash, SPI, UART, ADC, SED
-      BUS_RX(1) => bussci_rx,           --SCI Serdes
-      BUS_RX(2) => bustc_rx,            --Clock switch
-      BUS_RX(3) => bustdc_rx,
-      BUS_TX(0) => bustools_tx,
-      BUS_TX(1) => bussci_tx,
-      BUS_TX(2) => bustc_tx,
-      BUS_TX(3) => bustdc_tx,
-
+      CLK        => clk_sys,
+      RESET      => reset_i,
+      REGIO_RX   => ctrlbus_rx,
+      REGIO_TX   => ctrlbus_tx,
+      BUS_RX(0)  => bustools_rx,         --Flash, SPI, UART, ADC, SED
+      BUS_RX(1)  => bussci_rx,           --SCI Serdes
+      BUS_RX(2)  => bustc_rx,            --Clock switch
+      BUS_RX(3)  => bustdc_rx,
+      BUS_TX(0)  => bustools_tx,
+      BUS_TX(1)  => bussci_tx,
+      BUS_TX(2)  => bustc_tx,
+      BUS_TX(3)  => bustdc_tx,
       STAT_DEBUG => open
-      );
+    );
 
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- Control Tools
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
   THE_TOOLS : entity work.trb3sc_tools
     port map(
-      CLK   => clk_sys,
-      RESET => reset_i,
-
+      CLK               => clk_sys,
+      RESET             => reset_i,
       --Flash & Reload
       FLASH_CS          => flash_ncs_i,
       FLASH_CLK         => FLASH_SCLK,
@@ -344,17 +323,16 @@ THE_CAL_PLL : entity work.pll_in125_out50
       BUS_MASTER_OUT    => bus_master_out,
       BUS_MASTER_ACTIVE => bus_master_active,
       DEBUG_OUT         => debug_tools
-      );
+    );
 
 
 
   FLASH_HOLD <= '1';
   FLASH_WP   <= '1';
 
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- I/O
----------------------------------------------------------------------------
-
+-------------------------------------------------------------------------------
   CS <= spi_cs(3 downto 0);
   spi_miso(3 downto 0) <= MISO;
   
@@ -382,10 +360,9 @@ THE_CAL_PLL : entity work.pll_in125_out50
   TEST(14) <= flash_ncs_i;
   FLASH_NCS <= flash_ncs_i;
   
----------------------------------------------------------------------------
+-------------------------------------------------------------------------------
 -- LED
----------------------------------------------------------------------------
-
+-------------------------------------------------------------------------------
   LED_SFP_GREEN  <= not med2int(0).stat_op(9) or led_off;
   LED_SFP_RED    <= not (med2int(0).stat_op(10) or med2int(0).stat_op(11)) or led_off;
   LED_SFP_YELLOW <= not med2int(0).stat_op(8) or led_off;
@@ -397,20 +374,20 @@ THE_CAL_PLL : entity work.pll_in125_out50
 -------------------------------------------------------------------------------
 -- TDC
 -------------------------------------------------------------------------------
-
   THE_TDC : entity work.TDC_record
     generic map (
-      CHANNEL_NUMBER => NUM_TDC_CHANNELS,  -- Number of TDC channels per module
-      STATUS_REG_NR  => 21,             -- Number of status regs
+      CHANNEL_NUMBER => NUM_TDC_CHANNELS,
+      STATUS_REG_NR  => 21,
       DEBUG          => c_NO,
-      SIMULATION     => c_NO)
+      SIMULATION     => c_NO
+    )
     port map (
       RESET              => reset_i,
       CLK_TDC            => clk_full,
-      CLK_READOUT        => clk_sys,    -- Clock for the readout
-      REFERENCE_TIME     => trigger_in_i,    -- Reference time input
-      HIT_IN             => hit_in_i(NUM_TDC_CHANNELS-1 downto 1),  -- Channel start signals
-      HIT_CAL_IN         => clk_cal,  -- Hits for calibrating the TDC
+      CLK_READOUT        => clk_sys,
+      REFERENCE_TIME     => trigger_in_i,
+      HIT_IN             => hit_in_i(NUM_TDC_CHANNELS-1 downto 1),
+      HIT_CAL_IN         => clk_cal,
       -- Trigger signals from handler
       BUSRDO_RX          => readout_rx,
       BUSRDO_TX          => readout_tx(0),
@@ -420,7 +397,7 @@ THE_CAL_PLL : entity work.pll_in125_out50
       -- Dubug signals
       INFO_IN            => timer,
       LOGIC_ANALYSER_OUT => open
-      );
+    );
 
 
 -------------------------------------------------------------------------------