Changeset 10081 for firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl
- Timestamp:
- 01/05/11 17:19:13 (14 years ago)
- 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 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) … … 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) … … 256 276 & "000" & adc_otr(1) & adc_data_array(1) 257 277 & "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) 259 279 -- & "00010" & conv_std_logic_vector (data_cntr, 11) 260 280 -- & "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 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; -
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/drs_pulser_dummy.vhd
r10072 r10081 61 61 srin_write_ack <= '1'; 62 62 srin_cntr <= 0; 63 SRCLK_EN <= '1';63 --SRCLK_EN <= '1'; 64 64 state_main <= SRIN_WRITE_8B; 65 65 end if; … … 75 75 76 76 when SRIN_WRITE_8B => 77 SRCLK_EN <= '1'; 77 78 srin_out <= srin_data (7 - srin_cntr); 78 79 if (srin_cntr = 7) then 79 SRCLK_EN <= '0';80 --SRCLK_EN <= '0'; 80 81 state_main <= SRIN_WRITE_END; 81 82 else … … 83 84 end if; 84 85 when SRIN_WRITE_END => 85 srin_out <= '0'; 86 SRCLK_EN <= '0'; 87 srin_out <= '1'; 86 88 srin_write_ready <= '1'; 87 89 srin_write_ack <= '0'; -
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_board_struct.vhd
r10078 r10081 3 3 -- Created: 4 4 -- by - dneise.UNKNOWN (E5B-LABOR6) 5 -- at - 1 2:19:0705.01.20115 -- at - 17:46:34 05.01.2011 6 6 -- 7 7 -- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10) … … 79 79 -- Created: 80 80 -- by - dneise.UNKNOWN (E5B-LABOR6) 81 -- at - 1 2:19:0805.01.201181 -- at - 17:46:35 05.01.2011 82 82 -- 83 83 -- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10) … … 124 124 -- status: 125 125 SIGNAL shifting : std_logic := '0'; 126 127 -- Implicit buffer signal declarations 128 SIGNAL SRIN_internal : std_logic; 126 129 127 130 … … 253 256 -- HDL Embedded Text Block 9 eb3 254 257 -- eb3 9 255 A0_T(0) <= CLK50_OUT;256 A0_T(1) <= CLK25_OUT;258 A0_T(0) <= ready; 259 A0_T(1) <= shifting; 257 260 A0_T(2) <= CLK25_PSOUT; 258 261 A0_T(3) <= PS_DIR_IN; … … 262 265 A0_T(7) <= DCM_locked; 263 266 264 A1_T(0) <= ready;265 A1_T(1) <= shifting;266 A1_T(2) <= PS DONE_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); 273 276 274 277 … … 311 314 RSRLOAD => RSRLOAD, 312 315 SRCLK => SRCLK, 313 SRIN_out => SRIN ,316 SRIN_out => SRIN_internal, 314 317 adc_clk_en => adc_clk_en, 315 318 adc_oeb => OE_ADC, … … 337 340 ); 338 341 342 -- Implicit buffered output assignments 343 SRIN <= SRIN_internal; 344 339 345 END struct; -
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_definitions.vhd
r10072 r10081 140 140 constant CMD_PS_RESET : std_logic_vector := X"17"; 141 141 -- DRS Registers 142 constant DRS_CONFIG_REG : std_logic_vector := "1100"; 142 143 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"; 144 146 145 147 -- Declare functions and procedure -
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_definitions.vhd.bak
r9912 r10081 23 23 24 24 -- @ 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); 28 28 29 29 -- @ 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); 33 33 34 34 constant FIRST_PORT : integer := 5000; … … 79 79 80 80 -- 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 82 83 83 84 constant LOG2_OF_RAM_SIZE_64B : integer := 15; … … 119 120 constant CMD_READ : std_logic_vector := X"0A"; 120 121 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 121 125 122 126 constant CMD_DENABLE : std_logic_vector := X"06"; … … 135 139 136 140 constant CMD_PS_RESET : std_logic_vector := X"17"; 137 141 -- DRS Registers 142 constant DRS_WRITE_SHIFT_REG : std_logic_vector := "1101"; 138 143 139 144 -
firmware/FAD/FACT_FAD_20MHz_VAR_PS/FACT_FAD_lib/hdl/fad_main_struct.vhd
r10078 r10081 3 3 -- Created: 4 4 -- by - dneise.UNKNOWN (E5B-LABOR6) 5 -- at - 1 2:19:0605.01.20115 -- at - 17:46:33 05.01.2011 6 6 -- 7 7 -- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10) … … 80 80 -- Created: 81 81 -- by - dneise.UNKNOWN (E5B-LABOR6) 82 -- at - 1 2:19:0705.01.201182 -- at - 17:46:34 05.01.2011 83 83 -- 84 84 -- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10) … … 137 137 SIGNAL drs_read_s_cell : std_logic := '0'; 138 138 SIGNAL drs_read_s_cell_ready : std_logic; 139 SIGNAL drs_readout_started : std_logic; 139 140 SIGNAL drs_s_cell_array : drs_s_cell_array_type; 140 141 SIGNAL drs_srin_data : std_logic_vector(7 DOWNTO 0) := (others => '0'); … … 298 299 drs_srin_write_ready : IN std_logic ; 299 300 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 301 303 ); 302 304 END COMPONENT; … … 596 598 drs_srin_write_ready => srin_write_ready, 597 599 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 599 602 ); 600 603 I_main_drs_pulser : drs_pulser … … 628 631 amber => amber, 629 632 red => red, 630 trigger => trigger_out,633 trigger => drs_readout_started, 631 634 socks_waiting => socks_waiting, 632 635 socks_connected => socks_connected
Note:
See TracChangeset
for help on using the changeset viewer.