]> jspc29.x-matter.uni-frankfurt.de Git - trb3sc.git/commitdiff
updating TDC projects with some VHDL changes / new tools, new clock input to media...
authorJan Michel <j.michel@gsi.de>
Fri, 16 Oct 2015 13:13:57 +0000 (15:13 +0200)
committerJan Michel <j.michel@gsi.de>
Fri, 16 Oct 2015 13:13:57 +0000 (15:13 +0200)
padiwa/trb3sc_padiwa.prj
padiwa/trb3sc_padiwa.vhd
tdctemplate/trb3sc_tdctemplate.prj
tdctemplate/trb3sc_tdctemplate.vhd

index cf089ce163dbb7b21c6e2b470a5493ec761227b0..48801652e1c282dfa37b5bc3832d126abac51d18 100644 (file)
@@ -72,7 +72,6 @@ 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 "../../trb3/base/code/sedcheck.vhd"
 
-
 #Fifos
 add_file -vhdl -lib work "../../trbnet/lattice/ecp3/spi_dpram_32_to_8.vhd"
 add_file -vhdl -lib work "../../trbnet/lattice/ecp3/lattice_ecp3_fifo_18x1k.vhd"
index 19d9c65d927486cf9afa591c43c433685b763738..ab61d7d66e8506c9243dd67ae3b8ce81fb49ee74 100644 (file)
@@ -204,7 +204,8 @@ begin
       IS_SYNC_SLAVE => c_YES
       )
     port map(
-      CLK           => clk_full_osc,
+      CLK_REF_FULL       => med2int(0).clk_full,
+      CLK_INTERNAL_FULL  => clk_full_osc,
       SYSCLK        => clk_sys,
       RESET         => reset_i,
       CLEAR         => clear_i,
index ef3b94b40c2bb064ed8f1d20ab63b9df421f6864..128a7f820de97fa339edf330057cd9be581d6bbf 100644 (file)
@@ -73,6 +73,7 @@ add_file -vhdl -lib work "../../trbnet/special/spi_flash_and_fpga_reload_record.
 add_file -vhdl -lib work "../../trb3/base/code/sedcheck.vhd"
 
 
+
 #Fifos
 add_file -vhdl -lib work "../../trbnet/lattice/ecp3/spi_dpram_32_to_8.vhd"
 add_file -vhdl -lib work "../../trbnet/lattice/ecp3/lattice_ecp3_fifo_18x1k.vhd"
@@ -113,6 +114,8 @@ add_file -vhdl -lib work "../../trbnet/special/uart_rec.vhd"
 add_file -vhdl -lib work "../../trbnet/special/uart_trans.vhd"
 add_file -vhdl -lib work "../../trbnet/special/spi_ltc2600.vhd"
 add_file -vhdl -lib work "../../trbnet/optical_link/f_divider.vhd"
+add_file -vhdl -lib work "../../trb3sc/code/load_settings.vhd"
+add_file -vhdl -lib work "../../trb3sc/code/spi_master_generic.vhd"
 
 #SlowControl files
 add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler.vhd"
index d683dfe77d736aefe986269954f45f3e686673d6..6e6521eea607fac948a07da146c6439cceb94806 100644 (file)
@@ -132,14 +132,14 @@ architecture trb3sc_arch of trb3sc_tdctemplate is
   signal readout_rx : READOUT_RX;
   signal readout_tx : readout_tx_array_t(0 to 0);
 
-  signal ctrlbus_rx, bussci_rx, bustools_rx, bustc_rx, bustdc_rx : CTRLBUS_RX;
-  signal ctrlbus_tx, bussci_tx, bustools_tx, bustc_tx, bustdc_tx : CTRLBUS_TX;
+  signal ctrlbus_rx, bussci_rx, bustools_rx, bustc_rx, bustdc_rx, bus_master_out, handlerbus_rx : CTRLBUS_RX;
+  signal ctrlbus_tx, bussci_tx, bustools_tx, bustc_tx, bustdc_tx, bus_master_in : CTRLBUS_TX;
 
   signal common_stat_reg : std_logic_vector(std_COMSTATREG*32-1 downto 0) := (others => '0');
   signal common_ctrl_reg : std_logic_vector(std_COMCTRLREG*32-1 downto 0);
 
   signal sed_error_i  : std_logic;
-  signal clock_select : std_logic;
+  signal bus_master_active : std_logic;
 
   signal spi_cs, spi_mosi, spi_miso, spi_clk : std_logic_vector(15 downto 0);
 
@@ -205,7 +205,8 @@ begin
       IS_SYNC_SLAVE => c_YES
       )
     port map(
-      CLK           => clk_full_osc,
+      CLK_REF_FULL       => med2int(0).clk_full,
+      CLK_INTERNAL_FULL  => clk_full_osc,
       SYSCLK        => clk_sys,
       RESET         => reset_i,
       CLEAR         => clear_i,
@@ -284,7 +285,6 @@ begin
       TIMERS_OUT                => timer
       );
 
-      
 
 ---------------------------------------------------------------------------
 -- Bus Handler
@@ -300,7 +300,7 @@ begin
       CLK   => clk_sys,
       RESET => reset_i,
 
-      REGIO_RX => ctrlbus_rx,
+      REGIO_RX => handlerbus_rx,
       REGIO_TX => ctrlbus_tx,
 
       BUS_RX(0) => bustools_rx,         --Flash, SPI, UART, ADC, SED
@@ -315,6 +315,8 @@ begin
       STAT_DEBUG => open
       );
 
+  handlerbus_rx <= ctrlbus_rx when bus_master_active = '0' else bus_master_out;         
+      
 ---------------------------------------------------------------------------
 -- Control Tools
 ---------------------------------------------------------------------------
@@ -349,7 +351,10 @@ begin
       --Slowcontrol
       BUS_RX        => bustools_rx,
       BUS_TX        => bustools_tx,
-
+      --Control master for default settings
+      BUS_MASTER_IN  => ctrlbus_tx,
+      BUS_MASTER_OUT => bus_master_out,
+      BUS_MASTER_ACTIVE => bus_master_active, 
       DEBUG_OUT => open
       );