Ignore:
Timestamp:
01/05/11 17:19:13 (14 years ago)
Author:
neise
Message:
DRS write shift register & write config register
Location:
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/data_generator.vhd

    r10073 r10081  
    6767
    6868      drs_read_s_cell_ready : in std_logic;
    69       drs_s_cell_array : in drs_s_cell_array_type
     69      drs_s_cell_array : in drs_s_cell_array_type;
     70     
     71      drs_readout_started : out std_logic
    7072      );
    7173end data_generator ;
     
    7375architecture Behavioral of data_generator is
    7476
    75 type state_generate_type is (INIT, CONFIG, CONFIG1, CONFIG2,CONFIG3, CONFIG4, CONFIG5, CONFIG6, WRITE_HEADER, WRITE_EXTERNAL_TRIGGER, WRITE_INTERNAL_TRIGGER, WRITE_BOARD_ID, WRITE_TEMPERATURES,
     77type state_generate_type is (INIT, CONFIG, CONFIG1, CONFIG2,CONFIG3, CONFIG4, CONFIG5, CONFIG6, CONFIG7, WRITE_HEADER, WRITE_EXTERNAL_TRIGGER, WRITE_INTERNAL_TRIGGER, WRITE_BOARD_ID, WRITE_TEMPERATURES,
    7678                             WRITE_DAC1, WRITE_DAC2, WRITE_CHANNEL_ID, WRITE_START_CELL, WRITE_ROI, WRITE_ADC_DATA, WRITE_DATA_END, WRITE_DATA_END_WAIT,
    7779                             WRITE_END_FLAG, WRITE_DATA_STOP,
     
    9395signal roi_max_int : roi_max_type;
    9496
     97signal sig_drs_readout_started : std_logic := '0';
     98
    9599begin
    96100 
     101  drs_readout_started <= sig_drs_readout_started;
    97102 
    98103        generate_data : process (clk)
     
    151156          if (drs_srin_write_ready = '1') then
    152157            roi_max_int <= roi_max;
    153             state_generate <= WRITE_DATA_IDLE;
    154           end if;
     158            state_generate <= CONFIG6;
     159          end if;
     160          when CONFIG6 =>
     161            drs_channel_id <= DRS_WRITE_CONFIG_REG;
     162            drs_srin_data <= "11111111";
     163            drs_srin_write_8b <= '1';
     164            if (drs_srin_write_ack = '1') then
     165              drs_srin_write_8b <= '0';
     166              state_generate <= CONFIG7;
     167            end if;
     168          when CONFIG7 =>
     169            if (drs_srin_write_ready = '1') then
     170              roi_max_int <= roi_max;
     171              state_generate <= WRITE_DATA_IDLE;
     172            end if;
    155173        -- end configure DRS
    156174
     
    161179--          if (ram_write_ea = '1' and (trigger_flag = '1' or s_trigger = '1')) then
    162180          if (ram_write_ea = '1' and trigger_flag = '1') then
     181            sig_drs_readout_started <= '1'; -- is set to '0' in state WRITE_DAC1
    163182            -- stop drs, dwrite low
    164183            drs_dwrite <= '0';
     
    193212
    194213        when WRITE_DAC1 =>
     214          sig_drs_readout_started <= '0'; -- is set to '1' in state WRITE_DATA_IDLE
    195215          data_out <= conv_std_logic_vector (dac_array (3), 16)
    196216                    & conv_std_logic_vector (dac_array (2), 16)
     
    256276                      & "000" & adc_otr(1) & adc_data_array(1)
    257277                      & "000" & adc_otr(0) & adc_data_array(0);
    258 --              data_out <= "00000" & conv_std_logic_vector (data_cntr, 11)
     278 --             data_out <= "00000" & conv_std_logic_vector (data_cntr, 11)
    259279--                          & "00010" & conv_std_logic_vector (data_cntr, 11)
    260280--                          & "00100" & conv_std_logic_vector (data_cntr, 11)
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/data_generator.vhd.bak

    r10073 r10081  
    6767
    6868      drs_read_s_cell_ready : in std_logic;
    69       drs_s_cell_array : in drs_s_cell_array_type
     69      drs_s_cell_array : in drs_s_cell_array_type;
     70     
     71      drs_readout_started : out std_logic
    7072      );
    7173end data_generator ;
     
    7375architecture Behavioral of data_generator is
    7476
    75 type state_generate_type is (INIT, CONFIG, CONFIG1, CONFIG2,CONFIG3, CONFIG4, CONFIG5, CONFIG6, WRITE_HEADER, WRITE_EXTERNAL_TRIGGER, WRITE_INTERNAL_TRIGGER, WRITE_BOARD_ID, WRITE_TEMPERATURES,
     77type state_generate_type is (INIT, CONFIG, CONFIG1, CONFIG2,CONFIG3, CONFIG4, CONFIG5, CONFIG6, CONFIG7, WRITE_HEADER, WRITE_EXTERNAL_TRIGGER, WRITE_INTERNAL_TRIGGER, WRITE_BOARD_ID, WRITE_TEMPERATURES,
    7678                             WRITE_DAC1, WRITE_DAC2, WRITE_CHANNEL_ID, WRITE_START_CELL, WRITE_ROI, WRITE_ADC_DATA, WRITE_DATA_END, WRITE_DATA_END_WAIT,
    7779                             WRITE_END_FLAG, WRITE_DATA_STOP,
     
    9395signal roi_max_int : roi_max_type;
    9496
     97signal sig_drs_readout_started : std_logic := '0';
     98
    9599begin
    96100 
     101  drs_readout_started <= sig_drs_readout_started;
    97102 
    98103        generate_data : process (clk)
     
    142147        when CONFIG4 =>
    143148          drs_channel_id <= DRS_WRITE_SHIFT_REG;
    144           drs_srin_data <= "10101010";
     149          drs_srin_data <= "11111111";
    145150          drs_srin_write_8b <= '1';
    146151          if (drs_srin_write_ack = '1') then
     
    151156          if (drs_srin_write_ready = '1') then
    152157            roi_max_int <= roi_max;
    153             state_generate <= WRITE_DATA_IDLE;
    154           end if;
     158            state_generate <= CONFIG6;
     159          end if;
     160          when CONFIG6 =>
     161            drs_channel_id <= DRS_WRITE_CONFIG_REG;
     162            drs_srin_data <= "11111111";
     163            drs_srin_write_8b <= '1';
     164            if (drs_srin_write_ack = '1') then
     165              drs_srin_write_8b <= '0';
     166              state_generate <= CONFIG7;
     167            end if;
     168          when CONFIG7 =>
     169            if (drs_srin_write_ready = '1') then
     170              roi_max_int <= roi_max;
     171              state_generate <= WRITE_DATA_IDLE;
     172            end if;
    155173        -- end configure DRS
    156174
     
    161179--          if (ram_write_ea = '1' and (trigger_flag = '1' or s_trigger = '1')) then
    162180          if (ram_write_ea = '1' and trigger_flag = '1') then
     181            sig_drs_readout_started <= '1'; -- is set to '0' in state WRITE_DAC1
    163182            -- stop drs, dwrite low
    164183            drs_dwrite <= '0';
     
    193212
    194213        when WRITE_DAC1 =>
     214          sig_drs_readout_started <= '0'; -- is set to '1' in state WRITE_DATA_IDLE
    195215          data_out <= conv_std_logic_vector (dac_array (3), 16)
    196216                    & conv_std_logic_vector (dac_array (2), 16)
     
    252272        when WRITE_ADC_DATA =>
    253273          if (data_cntr < roi_max (channel_id)) then
    254             data_out <= "000" & adc_otr(3) & adc_data_array(3)
    255                       & "000" & adc_otr(2) & adc_data_array(2)
    256                       & "000" & adc_otr(1) & adc_data_array(1)
    257                       & "000" & adc_otr(0) & adc_data_array(0);
    258 --              data_out <= "00000" & conv_std_logic_vector (data_cntr, 11)
    259 --                          & "00010" & conv_std_logic_vector (data_cntr, 11)
    260 --                          & "00100" & conv_std_logic_vector (data_cntr, 11)
    261 --                          & "00110" & conv_std_logic_vector (data_cntr, 11) ;
     274--            data_out <= "000" & adc_otr(3) & adc_data_array(3)
     275--                      & "000" & adc_otr(2) & adc_data_array(2)
     276--                      & "000" & adc_otr(1) & adc_data_array(1)
     277--                      & "000" & adc_otr(0) & adc_data_array(0);
     278              data_out <= "00000" & conv_std_logic_vector (data_cntr, 11)
     279                          & "00010" & conv_std_logic_vector (data_cntr, 11)
     280                          & "00100" & conv_std_logic_vector (data_cntr, 11)
     281                          & "00110" & conv_std_logic_vector (data_cntr, 11) ;
    262282            addr_cntr <= addr_cntr + 1;
    263283            state_generate <= WRITE_ADC_DATA;
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/drs_pulser_dummy.vhd

    r10072 r10081  
    6161            srin_write_ack <= '1';
    6262            srin_cntr <= 0;
    63             SRCLK_EN <= '1';
     63            --SRCLK_EN <= '1';
    6464            state_main <= SRIN_WRITE_8B;
    6565          end if;
     
    7575       
    7676        when SRIN_WRITE_8B =>
     77          SRCLK_EN <= '1';
    7778          srin_out <= srin_data (7 - srin_cntr);
    7879          if (srin_cntr = 7) then
    79             SRCLK_EN <= '0';
     80            --SRCLK_EN <= '0';
    8081            state_main <= SRIN_WRITE_END;
    8182          else
     
    8384          end if;
    8485        when SRIN_WRITE_END =>
    85           srin_out <= '0';
     86          SRCLK_EN <= '0';
     87          srin_out <= '1';
    8688          srin_write_ready <= '1';
    8789          srin_write_ack <= '0';
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_board_struct.vhd

    r10078 r10081  
    33-- Created:
    44--          by - dneise.UNKNOWN (E5B-LABOR6)
    5 --          at - 12:19:07 05.01.2011
     5--          at - 17:46:34 05.01.2011
    66--
    77-- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
     
    7979-- Created:
    8080--          by - dneise.UNKNOWN (E5B-LABOR6)
    81 --          at - 12:19:08 05.01.2011
     81--          at - 17:46:35 05.01.2011
    8282--
    8383-- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
     
    124124   -- status:
    125125   SIGNAL shifting        : std_logic                    := '0';
     126
     127   -- Implicit buffer signal declarations
     128   SIGNAL SRIN_internal : std_logic;
    126129
    127130
     
    253256   -- HDL Embedded Text Block 9 eb3
    254257   -- eb3 9                         
    255    A0_T(0) <= CLK50_OUT;
    256    A0_T(1)  <= CLK25_OUT;
     258   A0_T(0) <= ready;
     259   A0_T(1) <= shifting;
    257260   A0_T(2) <= CLK25_PSOUT;
    258261   A0_T(3) <= PS_DIR_IN;
     
    262265   A0_T(7) <= DCM_locked;
    263266   
    264    A1_T(0) <= ready;
    265    A1_T(1) <= shifting;
    266    A1_T(2) <= PSDONE_extraOUT;
    267    A1_T(3) <= PSCLK_OUT;
    268    A1_T(4) <= LOCKED_extraOUT;
    269    
    270    A1_T(5) <= '0';
    271    A1_T(6) <= '0';
    272    A1_T(7) <= '0';
     267   A1_T(0) <= SRIN_internal;
     268   A1_T(1) <= PSDONE_extraOUT;
     269   A1_T(2) <= PSCLK_OUT;
     270   A1_T(3) <= LOCKED_extraOUT;
     271   
     272   A1_T(4) <= drs_channel_id(0);
     273   A1_T(5) <= drs_channel_id(1);
     274   A1_T(6) <= drs_channel_id(2);
     275   A1_T(7) <= drs_channel_id(3);
    273276
    274277
     
    311314         RSRLOAD         => RSRLOAD,
    312315         SRCLK           => SRCLK,
    313          SRIN_out        => SRIN,
     316         SRIN_out        => SRIN_internal,
    314317         adc_clk_en      => adc_clk_en,
    315318         adc_oeb         => OE_ADC,
     
    337340      );
    338341
     342   -- Implicit buffered output assignments
     343   SRIN <= SRIN_internal;
     344
    339345END struct;
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_definitions.vhd

    r10072 r10081  
    140140constant CMD_PS_RESET : std_logic_vector     := X"17";
    141141-- DRS Registers
     142  constant DRS_CONFIG_REG : std_logic_vector := "1100"; 
    142143  constant DRS_WRITE_SHIFT_REG : std_logic_vector := "1101"; 
    143  
     144  constant DRS_WRITE_CONFIG_REG : std_logic_vector := "1110"; 
     145  constant DRS_DISABLE_ALL_OUTS : std_logic_vector := "1111"; 
    144146 
    145147-- Declare functions and procedure
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_definitions.vhd.bak

    r9912 r10081  
    2323 
    2424  -- @ ETH zurich
    25     constant NETMASK : ip_type := (255, 255, 248, 0);
    26     constant IP_ADDRESS : ip_type := (192, 33, 99, 225);
    27     constant GATEWAY : ip_type := (192, 33, 96, 1);
     25--    constant NETMASK : ip_type := (255, 255, 248, 0);
     26--    constant IP_ADDRESS : ip_type := (192, 33, 99, 225);
     27--    constant GATEWAY : ip_type := (192, 33, 96, 1);
    2828
    2929  -- @ TU Dortmund
    30 --  constant NETMASK : ip_type := (255, 255, 255, 0);
    31 --  constant IP_ADDRESS : ip_type := (129, 217, 160, 119);
    32 --  constant GATEWAY : ip_type := (129, 217, 160, 1);
     30  constant NETMASK : ip_type := (255, 255, 255, 0);
     31  constant IP_ADDRESS : ip_type := (129, 217, 160, 119);
     32  constant GATEWAY : ip_type := (129, 217, 160, 1);
    3333
    3434  constant FIRST_PORT : integer := 5000;
     
    7979
    8080--
    81   constant W5300_TX_FIFO_SIZE : integer := (15360 / 2); -- Socket TX FIFO-Size in 16 Bit Words
     81  constant W5300_TX_FIFO_SIZE_8B : integer := 15360; -- Socket TX FIFO-Size in Bytes
     82  constant W5300_TX_FIFO_SIZE : integer := (W5300_TX_FIFO_SIZE_8B / 2); -- Socket TX FIFO-Size in 16 Bit Words
    8283
    8384  constant LOG2_OF_RAM_SIZE_64B : integer := 15;
     
    119120  constant CMD_READ : std_logic_vector        := X"0A";
    120121  constant CMD_WRITE : std_logic_vector       := X"05";
     122-- Config-RAM
     123  constant BADDR_ROI : std_logic_vector := X"00"; -- Baseaddress ROI-Values
     124  constant BADDR_DAC : std_logic_vector := X"24"; -- Baseaddress DAC-Values
    121125
    122126  constant CMD_DENABLE : std_logic_vector     := X"06";
     
    135139
    136140constant CMD_PS_RESET : std_logic_vector     := X"17";
    137 
     141-- DRS Registers
     142  constant DRS_WRITE_SHIFT_REG : std_logic_vector := "1101"; 
    138143 
    139144 
  • firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_main_struct.vhd

    r10078 r10081  
    33-- Created:
    44--          by - dneise.UNKNOWN (E5B-LABOR6)
    5 --          at - 12:19:06 05.01.2011
     5--          at - 17:46:33 05.01.2011
    66--
    77-- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
     
    8080-- Created:
    8181--          by - dneise.UNKNOWN (E5B-LABOR6)
    82 --          at - 12:19:07 05.01.2011
     82--          at - 17:46:34 05.01.2011
    8383--
    8484-- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
     
    137137   SIGNAL drs_read_s_cell        : std_logic                                    := '0';
    138138   SIGNAL drs_read_s_cell_ready  : std_logic;
     139   SIGNAL drs_readout_started    : std_logic;
    139140   SIGNAL drs_s_cell_array       : drs_s_cell_array_type;
    140141   SIGNAL drs_srin_data          : std_logic_vector(7 DOWNTO 0)                 := (others => '0');
     
    298299      drs_srin_write_ready  : IN     std_logic ;
    299300      drs_read_s_cell_ready : IN     std_logic ;
    300       drs_s_cell_array      : IN     drs_s_cell_array_type
     301      drs_s_cell_array      : IN     drs_s_cell_array_type ;
     302      drs_readout_started   : OUT    std_logic
    301303   );
    302304   END COMPONENT;
     
    596598         drs_srin_write_ready  => srin_write_ready,
    597599         drs_read_s_cell_ready => drs_read_s_cell_ready,
    598          drs_s_cell_array      => drs_s_cell_array
     600         drs_s_cell_array      => drs_s_cell_array,
     601         drs_readout_started   => drs_readout_started
    599602      );
    600603   I_main_drs_pulser : drs_pulser
     
    628631         amber           => amber,
    629632         red             => red,
    630          trigger         => trigger_out,
     633         trigger         => drs_readout_started,
    631634         socks_waiting   => socks_waiting,
    632635         socks_connected => socks_connected
Note: See TracChangeset for help on using the changeset viewer.