SURF  1.0
AxiI2cEeprom.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : AxiI2cEeprom.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2016-07-11
5 -- Last update: 2016-07-11
6 -------------------------------------------------------------------------------
7 -- Description: Wrapper for AxiI2cEepromCore
8 --
9 -- Supported Devices:
10 -- 24AA01F/24LC01F/24FC01F (1kb: ADDR_WIDTH_G = 7)
11 -- 24AA02F/24LC02F/24FC02F (2kb: ADDR_WIDTH_G = 8)
12 -- 24AA04F/24LC04F/24FC04F (4kb: ADDR_WIDTH_G = 9)
13 -- 24AA08F/24LC08F/24FC08F (8kb: ADDR_WIDTH_G = 10)
14 -- 24AA16F/24LC16F/24FC16F (16kb: ADDR_WIDTH_G = 11)
15 -- 24AA32F/24LC32F/24FC32F (32kb: ADDR_WIDTH_G = 12)
16 -- 24AA64F/24LC64F/24FC64F (64kb: ADDR_WIDTH_G = 13)
17 -- 24AA128F/24LC128F/24FC128F (128kb: ADDR_WIDTH_G = 14)
18 -- 24AA256F/24LC256F/24FC256F (256kb: ADDR_WIDTH_G = 15)
19 -- 24AA512F/24LC512F/24FC512F (512kb: ADDR_WIDTH_G = 16)
20 -------------------------------------------------------------------------------
21 -- This file is part of 'SLAC Firmware Standard Library'.
22 -- It is subject to the license terms in the LICENSE.txt file found in the
23 -- top-level directory of this distribution and at:
24 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
25 -- No part of 'SLAC Firmware Standard Library', including this file,
26 -- may be copied, modified, propagated, or distributed except according to
27 -- the terms contained in the LICENSE.txt file.
28 -------------------------------------------------------------------------------
29 
30 library ieee;
31 use ieee.std_logic_1164.all;
32 
33 use work.StdRtlPkg.all;
34 use work.AxiLitePkg.all;
35 use work.I2cPkg.all;
36 
37 library unisim;
38 use unisim.vcomponents.all;
39 
40 --! @see entity
41  --! @ingroup protocols_i2c
42 entity AxiI2cEeprom is
43  generic (
44  TPD_G : time := 1 ns;
45  ADDR_WIDTH_G : positive := 16;
46  POLL_TIMEOUT_G : positive := 16;
47  I2C_ADDR_G : slv(6 downto 0) := "1010000";
48  I2C_SCL_FREQ_G : real := 100.0E+3; -- units of Hz
49  I2C_MIN_PULSE_G : real := 100.0E-9; -- units of seconds
50  AXI_CLK_FREQ_G : real := 156.25E+6; -- units of Hz
52  port (
53  -- I2C Ports
54  scl : inout sl;
55  sda : inout sl;
56  -- AXI-Lite Register Interface
61  -- Clocks and Resets
62  axilClk : in sl;
63  axilRst : in sl);
64 end AxiI2cEeprom;
65 
66 architecture mapping of AxiI2cEeprom is
67 
68  signal i2ci : i2c_in_type;
69  signal i2co : i2c_out_type;
70 
71 begin
72 
73  U_AxiI2cEepromCore : entity work.AxiI2cEepromCore
74  generic map (
75  TPD_G => TPD_G,
83  port map (
84  -- I2C Interface
85  i2ci => i2ci,
86  i2co => i2co,
87  -- AXI-Lite Register Interface
92  -- Clocks and Resets
93  axilClk => axilClk,
94  axilRst => axilRst);
95 
96  IOBUF_SCL : IOBUF
97  port map (
98  O => i2ci.scl, -- Buffer output
99  IO => scl, -- Buffer inout port (connect directly to top-level port)
100  I => i2co.scl, -- Buffer input
101  T => i2co.scloen); -- 3-state enable input, high=input, low=output
102 
103  IOBUF_SDA : IOBUF
104  port map (
105  O => i2ci.sda, -- Buffer output
106  IO => sda, -- Buffer inout port (connect directly to top-level port)
107  I => i2co.sda, -- Buffer input
108  T => i2co.sdaoen); -- 3-state enable input, high=input, low=output
109 
110 end mapping;
in axilWriteMasterAxiLiteWriteMasterType
i2c_in_type
Definition: I2cPkg.vhd:34
ADDR_WIDTH_Gpositive := 16
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
I2C_ADDR_Gslv( 6 downto 0) := "1010000"
inout sclsl
in i2cii2c_in_type
inout sdasl
AXI_CLK_FREQ_Greal := 156.25E+6
in axilReadMasterAxiLiteReadMasterType
I2C_MIN_PULSE_Greal := 100.0E-9
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
Definition: AxiLitePkg.vhd:36
I2C_SCL_FREQ_Greal := 100.0E+3
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
i2c_out_type
Definition: I2cPkg.vhd:41
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
I2C_MIN_PULSE_Greal := 100.0E-9
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
AXI_CLK_FREQ_Greal := 156.25E+6
POLL_TIMEOUT_Gpositive := 16
_library_ ieeeieee
I2C_ADDR_Gslv( 6 downto 0) := "1010000"
out i2coi2c_out_type
TPD_Gtime := 1 ns
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in axilReadMasterAxiLiteReadMasterType
out axilReadSlaveAxiLiteReadSlaveType
ADDR_WIDTH_Gpositive := 16
out axilWriteSlaveAxiLiteWriteSlaveType
I2C_SCL_FREQ_Greal := 100.0E+3
POLL_TIMEOUT_Gpositive := 16
out axilReadSlaveAxiLiteReadSlaveType
in axilWriteMasterAxiLiteWriteMasterType
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
out axilWriteSlaveAxiLiteWriteSlaveType