Line 35... |
Line 35... |
---- ----
|
---- ----
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
|
|
-- CVS Log
|
-- CVS Log
|
--
|
--
|
-- $Id: i2c_master_top.vhd,v 1.7 2004-03-14 10:17:03 rherveille Exp $
|
-- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $
|
--
|
--
|
-- $Date: 2004-03-14 10:17:03 $
|
-- $Date: 2009-01-20 10:38:45 $
|
-- $Revision: 1.7 $
|
-- $Revision: 1.8 $
|
-- $Author: rherveille $
|
-- $Author: rherveille $
|
-- $Locker: $
|
-- $Locker: $
|
-- $State: Exp $
|
-- $State: Exp $
|
--
|
--
|
-- Change History:
|
-- Change History:
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.7 2004/03/14 10:17:03 rherveille
|
|
-- Fixed simulation issue when writing to CR register
|
|
--
|
-- Revision 1.6 2003/08/09 07:01:13 rherveille
|
-- Revision 1.6 2003/08/09 07:01:13 rherveille
|
-- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line.
|
-- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line.
|
-- Fixed a potential bug in the byte controller's host-acknowledge generation.
|
-- Fixed a potential bug in the byte controller's host-acknowledge generation.
|
--
|
--
|
-- Revision 1.5 2003/02/01 02:03:06 rherveille
|
-- Revision 1.5 2003/02/01 02:03:06 rherveille
|
Line 76... |
Line 79... |
port (
|
port (
|
-- wishbone signals
|
-- wishbone signals
|
wb_clk_i : in std_logic; -- master clock input
|
wb_clk_i : in std_logic; -- master clock input
|
wb_rst_i : in std_logic := '0'; -- synchronous active high reset
|
wb_rst_i : in std_logic := '0'; -- synchronous active high reset
|
arst_i : in std_logic := not ARST_LVL; -- asynchronous reset
|
arst_i : in std_logic := not ARST_LVL; -- asynchronous reset
|
wb_adr_i : in unsigned(2 downto 0); -- lower address bits
|
wb_adr_i : in std_logic_vector(2 downto 0); -- lower address bits
|
wb_dat_i : in std_logic_vector(7 downto 0); -- Databus input
|
wb_dat_i : in std_logic_vector(7 downto 0); -- Databus input
|
wb_dat_o : out std_logic_vector(7 downto 0); -- Databus output
|
wb_dat_o : out std_logic_vector(7 downto 0); -- Databus output
|
wb_we_i : in std_logic; -- Write enable input
|
wb_we_i : in std_logic; -- Write enable input
|
wb_stb_i : in std_logic; -- Strobe signals / core select signal
|
wb_stb_i : in std_logic; -- Strobe signals / core select signal
|
wb_cyc_i : in std_logic; -- Valid bus cycle input
|
wb_cyc_i : in std_logic; -- Valid bus cycle input
|
Line 244... |
Line 247... |
cr <= (others => '0');
|
cr <= (others => '0');
|
elsif (wb_clk_i'event and wb_clk_i = '1') then
|
elsif (wb_clk_i'event and wb_clk_i = '1') then
|
if (wb_rst_i = '1') then
|
if (wb_rst_i = '1') then
|
cr <= (others => '0');
|
cr <= (others => '0');
|
elsif (wb_wacc = '1') then
|
elsif (wb_wacc = '1') then
|
if ( (core_en = '1') and (wb_adr_i = 4) ) then
|
if ( (core_en = '1') and (wb_adr_i = "100") ) then
|
-- only take new commands when i2c core enabled
|
-- only take new commands when i2c core enabled
|
-- pending commands are finished
|
-- pending commands are finished
|
cr <= wb_dat_i;
|
cr <= wb_dat_i;
|
end if;
|
end if;
|
else
|
else
|