1 ------------------------------------------------------------------------------- 2 -- File : AxiI2cSfpCore.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-18 5 -- Last update: 2016-09-20 6 ------------------------------------------------------------------------------- 7 -- Description: AXI-Lite interface to SFP 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_sfp 46 -- AXI-Lite Register Interface 58 -- Note: PRESCALE_G = (clk_freq / (5 * i2c_freq)) - 1 59 -- FILTER_G = (min_pulse_time / clk_period) + 1 77 O => i2ci.scl,
-- Buffer output 78 IO => sfpInOut.scl,
-- Buffer inout port (connect directly to top-level port) 79 I => i2co.scl,
-- Buffer input 80 T => i2co.scloen
);
-- 3-state enable input, high=input, low=output 84 O => i2ci.sda,
-- Buffer output 85 IO => sfpInOut.sda,
-- Buffer inout port (connect directly to top-level port) 86 I => i2co.sda,
-- Buffer input 87 T => i2co.sdaoen
);
-- 3-state enable input, high=input, low=output 91 O =>
open,
-- Buffer output 92 IO => sfpInOut.rateSel
(0),
-- Buffer inout port (connect directly to top-level port) 93 I => config.rateSel
(0),
-- Buffer input 94 T => '0'
);
-- 3-state enable input, high=input, low=output 96 IOBUF_RATE1 : IOBUF -- Reserved
for future
use 98 O =>
open,
-- Buffer output 99 IO => sfpInOut.rateSel
(1),
-- Buffer inout port (connect directly to top-level port) 100 I => '0',
-- Buffer input 101 T => '1'
);
-- 3-state enable input, high=input, low=output 116 -- I2C Register Interface 119 -- AXI-Lite Register Interface 124 -- Register Inputs/Outputs 138 -- I2C Port Interface 141 -- I2C Register Interface in regInI2cRegMasterInType
I2C_SCL_FREQ_Greal := 100.0E+3
out sfpOutAxiI2cSfpOutType
out configAxiI2cSfpConfigType
out axiReadSlaveAxiLiteReadSlaveType
in axiWriteMasterAxiLiteWriteMasterType
AxiI2cSfpConfigType config
inout sfpInOutAxiI2cSfpInOutType
in axiReadMasterAxiLiteReadMasterType
natural := natural( AXI_CLK_FREQ_G* I2C_MIN_PULSE_G)+ 1 FILTER_C
in axiWriteMasterAxiLiteWriteMasterType
in axiReadMasterAxiLiteReadMasterType
I2cRegMasterInType i2cRegMasterIn
OUTPUT_EN_POLARITY_Ginteger range 0 to 1:= 0
in i2cRegMasterOutI2cRegMasterOutType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
real := 5.0* I2C_SCL_FREQ_G I2C_SCL_5xFREQ_C
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
natural :=( getTimeRatio( AXI_CLK_FREQ_G, I2C_SCL_5xFREQ_C))- 1 PRESCALE_C
AXI_CLK_FREQ_Greal := 200.0E+6
out axiWriteSlaveAxiLiteWriteSlaveType
out i2cRegMasterInI2cRegMasterInType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
I2cRegMasterOutType i2cRegMasterOut
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
out axiReadSlaveAxiLiteReadSlaveType
out axiWriteSlaveAxiLiteWriteSlaveType
FILTER_Ginteger range 2 to 512:= 8
out regOutI2cRegMasterOutType
ALLOW_TX_DISABLE_Gboolean := false
AxiI2cSfpStatusType status
ALLOW_TX_DISABLE_Gboolean := false
in statusAxiI2cSfpStatusType
PRESCALE_Ginteger range 0 to 655535:= 62
I2C_MIN_PULSE_Greal := 100.0E-9