]> jspc29.x-matter.uni-frankfurt.de Git - mdcoep.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Wed, 15 Sep 2010 14:19:06 +0000 (14:19 +0000)
committerhadeshyp <hadeshyp>
Wed, 15 Sep 2010 14:19:06 +0000 (14:19 +0000)
constraints.lpf
design2/data_handler.vhd
design2/mdc_control.vhd
design2/trigger_handler.vhd
mdc_oepb.prj
mdc_oepb.vhd

index 8f6f726f53b950e5aad6688a2b5e2f50c7726191..959238521ed6d14b637d825ea90d120de1f30198 100644 (file)
@@ -7,6 +7,15 @@
   FREQUENCY NET THE_MED_INTERFACE_ff_txfullclk 25 MHz;
   FREQUENCY NET THE_MED_INTERFACE/ff_rxfullclk 25 MHz;
   FREQUENCY NET THE_MED_INTERFACE_ff_rxfullclk 25 MHz;
+  FREQUENCY NET THE_MED_INTERFACE/ff_txfullclk_c 25 MHz;
+  FREQUENCY NET THE_MED_INTERFACE_ff_txfullclk_c 25 MHz;
+  FREQUENCY NET THE_MED_INTERFACE/ff_rxfullclk_c 25 MHz;
+  FREQUENCY NET THE_MED_INTERFACE_ff_rxfullclk_c 25 MHz;
+
+
 
   BLOCK NET "reset" ;
+
+  GSR_NET NET "gsr_n";
+  GSR_NET NET "pll_locked";
 #  MULTICYCLE FROM CELL reset 2.0 x;
\ No newline at end of file
index fd0ae00023f56e3110ad43e14aabcd004fe59897..d7d41a341bc6cfb83021cc4b3a57e8672534d47d 100644 (file)
@@ -336,7 +336,7 @@ begin
             when STATUS_WRITE =>
               data_i               <= word_status;
               data_write_buf       := '1';
-              statram_din          <= stat_data_diff_i;
+              statram_din          <= STAT_DATA_IN;
               statram_write        <= '1';
               if stat_addr_i = unsigned(NUMBER_OF_STAT_WORDS) - to_unsigned(1,1) then
                 current_state      <= STATUS_FINISHED;
@@ -347,11 +347,13 @@ begin
             when STATUS_FINISHED =>
               stat_addr_i          <= (others => '1');
               data_finished_i      <= '1';
-              current_state        <= IDLE;
+              current_state        <= FINISH;
 
             when FINISH =>
               data_finished_i      <= '1';
-              current_state        <= IDLE;
+              if FINISHED_CYCLE_IN = '1' then
+                current_state        <= IDLE;
+              end if;
 
             when others =>
               current_state        <= IDLE;
index 78bef6553cd62a18d88d8fe091516a50d02ec071..512b65fa776e69d0fbc3f901d3c6e4edcf41d8be 100644 (file)
@@ -452,6 +452,9 @@ begin
       end if;
     end process;
 
+counter_retransmit_received_i <= (others => '0');
+counter_retransmit_sent_i     <= (others => '0');
+
 -- -------------------------------------------------------------------------------
 -- -- Readback FiFo
 -- -------------------------------------------------------------------------------
index 19eaf6f2b37c11c5897eb127b853f9b224658917..eea9c58544d3843036dfe911455d91fd66d8fd43 100644 (file)
@@ -128,6 +128,7 @@ begin
                   current_state              <= TIMING_TRIGGER;
                   timer_clear                <= '1';
                   start_trigger_i            <= '1';
+                  inc_trigger_counter        <= '1';
                 elsif LVL1_VALID_NOTIMING_TRG_IN = '1' and LVL1_TRG_TYPE_IN = x"9" then
                   current_state              <= CALIB_TRIGGER;
                   start_calib_i              <= '1';
@@ -135,6 +136,7 @@ begin
                   current_state              <= WAIT_FOR_FINISHED_STORING;
                   start_send_data_i          <= '1';
                 elsif LVL1_VALID_NOTIMING_TRG_IN = '1' then
+                  start_readout_i            <= '1'; --dummy to get trigger released
                   current_state              <= RELEASE_LVL1;
                 end if;
               elsif LVL1_VALID_NOTIMING_TRG_IN = '1' or LVL1_VALID_TIMING_TRG_IN = '1' then
@@ -169,6 +171,7 @@ begin
             when CALIB_TRIGGER =>
               if CAL1_LOADED_IN = '1' then
                 current_state             <= DO_READOUT;
+                inc_calib_counter         <= '1';
                 start_readout_i           <= '1';
               end if;
 
@@ -198,6 +201,7 @@ begin
 
             when RELEASE_LVL1 =>
               lvl1_release_i              <= '1';
+              finished_readout_i          <= '1';
               if LVL1_TRG_DATA_VALID_IN = '0' then
                 current_state             <= IDLE;
                 finished_cycle_i          <= '1';
index d5539ca8dfc4ea2754201b408ad748c441d3633d..603491b25d109db7154652050875f3eb2966491a 100644 (file)
@@ -47,7 +47,7 @@ add_file -vhdl -lib work "../trbnet/lattice/ecp2m/lattice_ecp2m_fifo_18x1k.vhd"
 add_file -vhdl -lib work "../trbnet/lattice/ecp2m/trb_net16_fifo_arch.vhd"
 add_file -vhdl -lib work "../trbnet/lattice/ecp2m/lattice_ecp2m_fifo_16bit_dualport.vhd"
 add_file -vhdl -lib work "../trbnet/lattice/ecp2m/trb_net_fifo_16bit_bram_dualport.vhd"
-add_file -vhdl -lib work "../trbnet/media_interfaces/trb_net16_med_ecp_fot_old.vhd"
+add_file -vhdl -lib work "../trbnet/media_interfaces/trb_net16_med_ecp_fot.vhd"
 add_file -vhdl -lib work "../trbnet/media_interfaces/trb_net16_lsm_sfp.vhd"
 add_file -vhdl -lib work "../trbnet/media_interfaces/ecp2m_fot/serdes_fot_0.vhd"
 add_file -vhdl -lib work "../trbnet/media_interfaces/trb_net16_tx_control.vhd"
index c13d6062634639cf6bcc6baced88b058258dbb67..cb641396e5148b5d686e9aeb604c61a53fe41dce 100644 (file)
@@ -101,6 +101,7 @@ architecture mdc_oepb_arch of mdc_oepb is
   signal reset_sync              : std_logic;
   signal reset_async             : std_logic;
   signal reset_counter           : unsigned(23 downto 0);
+  signal gsr_n                   : std_logic;
 
   --Media Interface to internal logic
   signal med_data_in             : std_logic_vector(16-1 downto 0);
@@ -280,7 +281,8 @@ begin
         LOCK  => pll_locked
         );
 
-  reset_async <= not pll_locked;
+  reset_async <= not gsr_n;
+  gsr_n       <= pll_locked;
 
 ---------------------------------------------------------------------
 -- Reset handler
@@ -837,14 +839,14 @@ begin
       CLK                        => clk_100,
       RESET                      => reset_internal,
 
-      A_ADD                      => TAD,
-      A_AOD                      => TAOD,
-      A_DST                      => TDST,
-      A_RDM                      => RDYI,
-      A_GDE                      => GDE,
+      A_ADD                      => open,--TAD,
+      A_AOD                      => open,--TAOD,
+      A_DST                      => open,--TDST,
+      A_RDM                      => open,--RDYI,
+      A_GDE                      => open,--GDE,
       A_RDO                      => TRDYO,
-      A_MOD                      => MODD,
-      A_RES                      => RES,
+      A_MOD                      => open,--MODD,
+      A_RES                      => open,--RES,
       A_TOK                      => TOK,
       A_WRM                      => WRM,
       A_RESERVE                  => TRSV,
@@ -901,10 +903,12 @@ begin
 -------------------------------------------------------------------------------
 -- LED
 -------------------------------------------------------------------------------
-  D(4) <= not buf_restart_led;    -- toggle with restart
-  D(3) <= not buf_request_led;    -- toggle with request
-  D(2) <= not buf_reset_led;      -- toggle with network reset
-  D(1) <= med_stat_debug(51); -- not comma locked
+--   D(4) <= not buf_restart_led;    -- toggle with restart
+--   D(3) <= not buf_request_led;    -- toggle with request
+--   D(2) <= not buf_reset_led;      -- toggle with network reset
+--   D(1) <= med_stat_debug(51); -- not comma locked
+
+D <= not MED_STAT_OP(7 downto 4);
 
 
   process(clk_100)
@@ -930,14 +934,20 @@ begin
           buf_request_led <= not buf_request_led;
         end if;
 
---          TAD <= MED_STAT_DEBUG(26 downto 18); --rx data & k
---          TAOD<= MED_STAT_DEBUG(52); --c_reset
---          TDST<= MED_STAT_DEBUG(53); --cnt(4)
---          GDE <= reset_internal;
---          RDYI <= reset_startup;
---          MODD <= MED_STAT_OP(14);
---          RES  <= MED_STAT_OP(15);
---          TOK  <= MED_STAT_OP(13);
+
+
+TAD(3 downto 0) <= MED_STAT_OP(7 downto 4);
+TAD(4)          <= reset_internal;
+TAD(5)          <= reset_startup;
+TAD(6)          <= reset_async;
+TAD(7)          <= MED_STAT_DEBUG(49);
+TAD(8)          <= MED_STAT_DEBUG(50);
+TAOD            <= MED_STAT_DEBUG(51);
+TDST            <= MED_STAT_DEBUG(52);
+RDYI            <= MED_STAT_DEBUG(53);
+GDE             <= MED_STAT_DEBUG(54);
+MODD            <= MED_STAT_DEBUG(55);
+RES             <= MED_STAT_DEBUG(63);
 
       end if;
     end process;