1 ------------------------------------------------------------------------------- 2 -- File : AxiI2cCxpCore.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-10-21 5 -- Last update: 2016-09-20 6 ------------------------------------------------------------------------------- 7 -- Description: AXI-Lite interface to CXP 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;
28 use unisim.vcomponents.
all;
31 --! @ingroup devices_transceivers_cxp 44 -- AXI-Lite Register Interface 56 -- Note: PRESCALE_G = (clk_freq / (5 * i2c_freq)) - 1 57 -- FILTER_G = (min_pulse_time / clk_period) + 1 78 O => i2ci.scl,
-- Buffer output 79 IO => cxpInOut.scl,
-- Buffer inout port (connect directly to top-level port) 80 I => i2co.scl,
-- Buffer input 81 T => i2co.scloen
);
-- 3-state enable input, high=input, low=output 85 O => i2ci.sda,
-- Buffer output 86 IO => cxpInOut.sda,
-- Buffer inout port (connect directly to top-level port) 87 I => i2co.sda,
-- Buffer input 88 T => i2co.sdaoen
);
-- 3-state enable input, high=input, low=output 93 IO => cxpInOut.irqRstL,
-- Buffer inout port (connect directly to top-level port) 94 I => '0',
-- Buffer input 95 T =>
oeL);
-- 3-state enable input, high=input, low=output 108 -- I2C Register Interface 111 -- AXI-Lite Register Interface 116 -- Register Inputs/Outputs 130 -- I2C Port Interface 133 -- I2C Register Interface in regInI2cRegMasterInType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
real := 5.0* I2C_SCL_FREQ_G I2C_SCL_5xFREQ_C
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
OUTPUT_EN_POLARITY_Ginteger range 0 to 1:= 0
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
out i2cRegMasterInI2cRegMasterInType
I2cRegMasterOutType i2cRegMasterOut
out axiWriteSlaveAxiLiteWriteSlaveType
inout cxpInOutAxiI2cCxpInOutType
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
out axiReadSlaveAxiLiteReadSlaveType
AxiI2cCxpConfigType config
I2C_SCL_FREQ_Greal := 100.0E+3
I2C_MIN_PULSE_Greal := 100.0E-9
AxiI2cCxpStatusType status
in axiWriteMasterAxiLiteWriteMasterType
I2cRegMasterInType i2cRegMasterIn
in i2cRegMasterOutI2cRegMasterOutType
natural := natural( AXI_CLK_FREQ_G* I2C_MIN_PULSE_G)+ 1 FILTER_C
in axiReadMasterAxiLiteReadMasterType
in axiWriteMasterAxiLiteWriteMasterType
in axiReadMasterAxiLiteReadMasterType
in statusAxiI2cCxpStatusType
out axiReadSlaveAxiLiteReadSlaveType
AXI_CLK_FREQ_Greal := 200.0E+6
FILTER_Ginteger range 2 to 512:= 8
out regOutI2cRegMasterOutType
natural :=( getTimeRatio( AXI_CLK_FREQ_G, I2C_SCL_5xFREQ_C))- 1 PRESCALE_C
out configAxiI2cCxpConfigType
PRESCALE_Ginteger range 0 to 655535:= 62
out axiWriteSlaveAxiLiteWriteSlaveType