- Timestamp:
- 01/05/11 17:19:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/data_generator.vhd.bak
r10073 r10081 67 67 68 68 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 70 72 ); 71 73 end data_generator ; … … 73 75 architecture Behavioral of data_generator is 74 76 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,77 type 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, 76 78 WRITE_DAC1, WRITE_DAC2, WRITE_CHANNEL_ID, WRITE_START_CELL, WRITE_ROI, WRITE_ADC_DATA, WRITE_DATA_END, WRITE_DATA_END_WAIT, 77 79 WRITE_END_FLAG, WRITE_DATA_STOP, … … 93 95 signal roi_max_int : roi_max_type; 94 96 97 signal sig_drs_readout_started : std_logic := '0'; 98 95 99 begin 96 100 101 drs_readout_started <= sig_drs_readout_started; 97 102 98 103 generate_data : process (clk) … … 142 147 when CONFIG4 => 143 148 drs_channel_id <= DRS_WRITE_SHIFT_REG; 144 drs_srin_data <= "1 0101010";149 drs_srin_data <= "11111111"; 145 150 drs_srin_write_8b <= '1'; 146 151 if (drs_srin_write_ack = '1') then … … 151 156 if (drs_srin_write_ready = '1') then 152 157 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; 155 173 -- end configure DRS 156 174 … … 161 179 -- if (ram_write_ea = '1' and (trigger_flag = '1' or s_trigger = '1')) then 162 180 if (ram_write_ea = '1' and trigger_flag = '1') then 181 sig_drs_readout_started <= '1'; -- is set to '0' in state WRITE_DAC1 163 182 -- stop drs, dwrite low 164 183 drs_dwrite <= '0'; … … 193 212 194 213 when WRITE_DAC1 => 214 sig_drs_readout_started <= '0'; -- is set to '1' in state WRITE_DATA_IDLE 195 215 data_out <= conv_std_logic_vector (dac_array (3), 16) 196 216 & conv_std_logic_vector (dac_array (2), 16) … … 252 272 when WRITE_ADC_DATA => 253 273 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) ; 262 282 addr_cntr <= addr_cntr + 1; 263 283 state_generate <= WRITE_ADC_DATA;
Note:
See TracChangeset
for help on using the changeset viewer.