1 ------------------------------------------------------------------------------- 2 -- File : XadcSimpleCore.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-01-10 5 -- Last update: 2016-12-08 6 ------------------------------------------------------------------------------- 7 -- Description: This core only measures internal voltages and temperature 8 ------------------------------------------------------------------------------- 9 -- This file is part of 'SLAC Firmware Standard Library'. 10 -- It is subject to the license terms in the LICENSE.txt file found in the 11 -- top-level directory of this distribution and at: 12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 13 -- No part of 'SLAC Firmware Standard Library', including this file, 14 -- may be copied, modified, propagated, or distributed except according to 15 -- the terms contained in the LICENSE.txt file. 16 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
26 use unisim.vcomponents.
all;
29 --! @ingroup xilinx_7Series_xadc 38 -- Global XADC configurations 40 -- SIMULTANEOUS, INDEPENDENT 42 MUX_EN_G : := false;
-- Enable external multiplexer 45 COEF_AVG_EN_G : := true;
-- Enable averaging for calibration coefficients 47 -- Configurations for single channel operation 52 -- Alarm configuration 79 -- Calibration coefficient configuration 85 -- Sequencer configurations 154 function convTemp (temp : )
return slv is 155 variable ret : slv(11 downto 0);
157 return slv(to_unsigned(((temp + 273.
15) * (4096.
0 / 503.
975)), 12));
158 end function convTemp;
160 function convPwr (pwr : )
return slv is 161 variable ret : slv(11 downto 0);
163 return slv(to_unsigned(((pwr / 3.
0) * 4096.
0), 12));
164 end function convPwr;
166 ------------------------------------------------------------------------------------------------- 167 -- Global config registers 168 ------------------------------------------------------------------------------------------------- 169 function INIT_40_C return is 170 variable ret : slv(15 downto 0);
173 ret(7 downto 5) := (others => '0');
187 return to_bitvector(ret);
188 end function INIT_40_C;
190 function INIT_41_C return is 191 variable ret : slv(15 downto 0) := (others => '0');
206 ret(15 downto 12) := "0000";
208 ret(15 downto 12) := "0001";
210 ret(15 downto 12) := "0010";
212 ret(15 downto 12) := "0011";
214 ret(15 downto 12) := "0100";
216 ret(15 downto 12) := "1000";
218 ret(15 downto 12) := "0000";
220 return to_bitvector(ret);
221 end function INIT_41_C;
223 function INIT_42_C return is 224 variable ret : slv(15 downto 0) := (others => '0');
226 ret(5 downto 4) := (others => '0');
-- Powerdown 228 return to_bitvector(ret);
229 end function INIT_42_C;
231 ------------------------------------------------------------------------------------------------- 232 -- Sequencer registers 233 ------------------------------------------------------------------------------------------------- 234 function INIT_48_C return is 235 variable ret : slv(15 downto 0) := (others => '0');
248 return to_bitvector(ret);
249 end function INIT_48_C;
253 function INIT_4A_C return is 254 variable ret : slv(15 downto 0) := (others => '0');
267 return to_bitvector(ret);
268 end function INIT_4A_C;
272 function INIT_4C_C return is 273 variable ret : slv(15 downto 0) := (others => '0');
276 return to_bitvector(ret);
277 end function INIT_4C_C;
281 function INIT_4E_C return is 282 variable ret : slv(15 downto 0) := (others => '0');
295 return to_bitvector(ret);
296 end function INIT_4E_C;
299 ------------------------------------------------------------------------------------------------- 301 ------------------------------------------------------------------------------------------------- 302 constant INIT_50_C : (15 downto 0) := to_bitvector(convTemp(TEMP_UPPER_G) & "0000");
303 constant INIT_51_C : (15 downto 0) := to_bitvector(convPwr(VCCINT_UPPER_G) & "0000");
304 constant INIT_52_C : (15 downto 0) := to_bitvector(convPwr(VCCAUX_UPPER_G) & "0000");
305 constant INIT_53_C : (15 downto 0) := to_bitvector(convTemp(OVERTEMP_LIMIT_G) & 307 constant INIT_54_C : (15 downto 0) := to_bitvector(convTemp(TEMP_LOWER_G) & "0000");
308 constant INIT_55_C : (15 downto 0) := to_bitvector(convPwr(VCCINT_LOWER_G) & "0000");
309 constant INIT_56_C : (15 downto 0) := to_bitvector(convPwr(VCCAUX_LOWER_G) & "0000");
310 constant INIT_57_C : (15 downto 0) := to_bitvector(convTemp(OVERTEMP_RESET_G) & "0000");
311 constant INIT_58_C : (15 downto 0) := to_bitvector(convPwr(VCCBRAM_UPPER_G) & "0000");
312 constant INIT_59_C : (15 downto 0) := to_bitvector(convPwr(VCCPINT_UPPER_G) & "0000");
313 constant INIT_5A_C : (15 downto 0) := to_bitvector(convPwr(VCCPAUX_UPPER_G) & "0000");
314 constant INIT_5B_C : (15 downto 0) := to_bitvector(convPwr(VCCODDR_UPPER_G) & "0000");
315 constant INIT_5C_C : (15 downto 0) := to_bitvector(convPwr(VCCBRAM_LOWER_G) & "0000");
316 constant INIT_5D_C : (15 downto 0) := to_bitvector(convPwr(VCCPINT_LOWER_G) & "0000");
317 constant INIT_5E_C : (15 downto 0) := to_bitvector(convPwr(VCCPAUX_LOWER_G) & "0000");
318 constant INIT_5F_C : (15 downto 0) := to_bitvector(convPwr(VCCODDR_LOWER_G) & "0000");
320 ------------------------------------------------------------------------------------------------- 322 ------------------------------------------------------------------------------------------------- 323 signal drpAddr : slv(6 downto 0);
325 signal drpDi : slv(15 downto 0);
326 signal drpDo : slv(15 downto 0);
329 signal drpUsrRst : sl;
352 drpEn => drpEn,
-- [out] 353 drpWe => drpWe,
-- [out] 356 drpDi => drpDi,
-- [out] 357 drpDo => drpDo
);
-- [in] 361 INIT_40 => INIT_40_C,
362 INIT_41 => INIT_41_C,
363 INIT_42 => INIT_42_C,
369 INIT_48 => INIT_48_C,
370 INIT_49 => INIT_49_C,
371 INIT_4A => INIT_4A_C,
372 INIT_4B => INIT_4B_C,
373 INIT_4C => INIT_4C_C,
374 INIT_4D => INIT_4D_C,
375 INIT_4E => INIT_4E_C,
376 INIT_4F => INIT_4F_C,
377 INIT_50 => INIT_50_C,
378 INIT_51 => INIT_51_C,
379 INIT_52 => INIT_52_C,
380 INIT_53 => INIT_53_C,
381 INIT_54 => INIT_54_C,
382 INIT_55 => INIT_55_C,
383 INIT_56 => INIT_56_C,
384 INIT_57 => INIT_57_C,
385 INIT_58 => INIT_58_C,
386 INIT_59 => INIT_59_C,
387 INIT_5A => INIT_5A_C,
388 INIT_5B => INIT_5B_C,
389 INIT_5C => INIT_5C_C,
390 INIT_5D => INIT_5D_C,
391 INIT_5E => INIT_5E_C,
392 INIT_5F => INIT_5F_C,
415 JTAGMODIFIED =>
open,
SEQ_VCCINT_AVG_EN_Gboolean := true
VCCAUX_LOWER_Greal := 1.7
SEQUENCER_MODE_Gstring := "DEFAULT"
ADDR_WIDTH_Gpositive range 1 to 32:= 16
SEQ_VCCAUX_ACQ_EN_Gboolean := false
SIM_DEVICE_Gstring := "7SERIES"
SING_ACQ_EN_Gboolean := false
VCCPINT_UPPER_Greal := 1.1
OVERTEMP_AUTO_SHDN_Gboolean := true
SEQ_VCCBRAM_AVG_EN_Gboolean := true
OVERTEMP_RESET_Greal := 50.0
AXIL_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
SEQ_VCCPAUX_SEL_EN_Gboolean := false
out drpAddrslv( ADDR_WIDTH_G- 1 downto 0)
in vAuxPslv( 15 downto 0) :=( others => '0')
SEQ_VREFP_ACQ_EN_Gboolean := false
VCCBRAM_LOWER_Greal := 0.9
SEQ_TEMPERATURE_SEL_EN_Gboolean := false
VCCODDR_UPPER_Greal := 1.9
out channelslv( 4 downto 0)
EN_ARBITRATION_Gboolean := false
SEQ_VREFP_SEL_EN_Gboolean := false
DATA_WIDTH_Gpositive range 1 to 32:= 16
out axilReadSlaveAxiLiteReadSlaveType
SEQ_VAUX_AVG_EN_GbooleanArray( 15 downto 0) :=( others => true)
SEQ_VREFP_AVG_EN_Gboolean := true
SEQ_VCCPAUX_ACQ_EN_Gboolean := false
SEQ_VPVN_BIPOLAR_Gboolean := false
SUPPLY_OFFSET_CORR_EN_Gboolean := true
SING_ADC_CH_SEL_Gslv( 4 downto 0) := "00000"
TEMP_ALM_EN_Gboolean := false
in drpDoslv( DATA_WIDTH_G- 1 downto 0)
COMMON_CLK_Gboolean := false
SEQ_VCCINT_SEL_EN_Gboolean := false
VCCPAUX_LOWER_Greal := 1.7
VCCPAUX_UPPER_Greal := 1.9
out muxAddrslv( 4 downto 0)
SAMPLING_MODE_Gstring := "CONTINUOUS"
OVERTEMP_LIMIT_Greal := 125.0
SEQ_VCCPAUX_AVG_EN_Gboolean := true
VCCINT_LOWER_Greal := 0.9
SEQ_VCCODDR_ACQ_EN_Gboolean := false
SEQ_VCCAUX_SEL_EN_Gboolean := false
SEQ_VAUX_SEL_EN_GbooleanArray( 15 downto 0) :=( others => false)
out axilWriteSlaveAxiLiteWriteSlaveType
SEQ_VCCODDR_SEL_EN_Gboolean := false
SEQ_TEMPERATURE_AVG_EN_Gboolean := true
VCCINT_UPPER_Greal := 1.1
SEQ_VCCODDR_AVG_EN_Gboolean := true
in axilReadMasterAxiLiteReadMasterType
VCCODDR_ALM_EN_Gboolean := false
SEQ_VREFN_SEL_EN_Gboolean := false
SEQ_VPVN_AVG_EN_Gboolean := true
SEQ_XADC_CAL_AVG_EN_Gboolean := true
SEQ_VPVN_ACQ_EN_Gboolean := false
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
SEQ_VCCINT_ACQ_EN_Gboolean := false
in axilReadMasterAxiLiteReadMasterType
VCCPAUX_ALM_EN_Gboolean := false
SUPPLY_GAIN_CORR_EN_Gboolean := true
VCCPINT_LOWER_Greal := 0.9
SEQ_VREFN_ACQ_EN_Gboolean := false
ADCCLK_RATIO_Ginteger range 2 to 255:= 7
SIM_MONITOR_FILE_Gstring := "design.txt"
in axilWriteMasterAxiLiteWriteMasterType
ADC_OFFSET_CORR_EN_Gboolean := true
TIMEOUT_Gpositive := 4096
SING_BIPOLAR_Gboolean := false
SEQ_VCCPINT_ACQ_EN_Gboolean := false
in vAuxNslv( 15 downto 0) :=( others => '0')
COEF_AVG_EN_Gboolean := true
VCCBRAM_UPPER_Greal := 1.1
VCCODDR_LOWER_Greal := 1.7
SEQ_VCCPINT_AVG_EN_Gboolean := true
in axilWriteMasterAxiLiteWriteMasterType
out axilReadSlaveAxiLiteReadSlaveType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
SEQ_VCCBRAM_SEL_EN_Gboolean := false
SEQ_VCCAUX_AVG_EN_Gboolean := true
out axilWriteSlaveAxiLiteWriteSlaveType
VCCAUX_ALM_EN_Gboolean := false
SEQ_VAUX_BIPOLAR_GBooleanArray( 15 downto 0) :=( others => false)
ADC_GAIN_CORR_EN_Gboolean := true
SEQ_VCCBRAM_ACQ_EN_Gboolean := false
SEQ_XADC_CAL_SEL_EN_Gboolean := true
OVERTEMP_ALM_EN_Gboolean := false
array(natural range <> ) of boolean BooleanArray
SAMPLE_AVG_Gslv( 1 downto 0) := "11"
SEQ_VREFN_AVG_EN_Gboolean := true
SEQ_TEMPERATURE_ACQ_EN_Gboolean := false
VCCINT_ALM_EN_Gboolean := false
SEQ_XADC_CAL_ACQ_EN_Gboolean := false
VCCAUX_UPPER_Greal := 1.9
SEQ_VAUX_ACQ_EN_GBooleanArray( 15 downto 0) :=( others => false)
SEQ_VPVN_SEL_EN_Gboolean := false
VCCBRAM_ALM_EN_Gboolean := false
VCCPINT_ALM_EN_Gboolean := false
out drpDislv( DATA_WIDTH_G- 1 downto 0)
SEQ_VCCPINT_SEL_EN_Gboolean := false