OpenCores
URL https://opencores.org/ocsvn/i2c/i2c/trunk

Subversion Repositories i2c

[/] [i2c/] [trunk/] [rtl/] [verilog/] [i2c_master_bit_ctrl.v] - Diff between revs 57 and 62

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 57 Rev 62
Line 35... Line 35...
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
 
 
//  CVS Log
//  CVS Log
//
//
//  $Id: i2c_master_bit_ctrl.v,v 1.12 2006-09-04 09:08:13 rherveille Exp $
//  $Id: i2c_master_bit_ctrl.v,v 1.13 2009-01-19 20:29:26 rherveille Exp $
//
//
//  $Date: 2006-09-04 09:08:13 $
//  $Date: 2009-01-19 20:29:26 $
//  $Revision: 1.12 $
//  $Revision: 1.13 $
//  $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.12  2006/09/04 09:08:13  rherveille
 
//               fixed short scl high pulse after clock stretch
 
//               fixed slave model not returning correct '(n)ack' signal
 
//
//               Revision 1.11  2004/05/07 11:02:26  rherveille
//               Revision 1.11  2004/05/07 11:02:26  rherveille
//               Fixed a bug where the core would signal an arbitration lost (AL bit set), when another master controls the bus and the other master generates a STOP bit.
//               Fixed a bug where the core would signal an arbitration lost (AL bit set), when another master controls the bus and the other master generates a STOP bit.
//
//
//               Revision 1.10  2003/08/09 07:01:33  rherveille
//               Revision 1.10  2003/08/09 07:01:33  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.
Line 176... Line 180...
        wire slave_wait;
        wire slave_wait;
//      reg [15:0] cnt = clk_cnt;   // clock divider counter (simulation)
//      reg [15:0] cnt = clk_cnt;   // clock divider counter (simulation)
        reg [15:0] cnt;             // clock divider counter (synthesis)
        reg [15:0] cnt;             // clock divider counter (synthesis)
 
 
        // state machine variable
        // state machine variable
        reg [16:0] c_state; // synopsys enum_state
        reg [17:0] c_state; // synopsys enum_state
 
 
        //
        //
        // module body
        // module body
        //
        //
 
 
Line 310... Line 314...
            dout <= #1 sSDA;
            dout <= #1 sSDA;
 
 
        // generate statemachine
        // generate statemachine
 
 
        // nxt_state decoder
        // nxt_state decoder
        parameter [16:0] idle    = 17'b0_0000_0000_0000_0000;
        parameter [17:0] idle    = 18'b0_0000_0000_0000_0000;
        parameter [16:0] start_a = 17'b0_0000_0000_0000_0001;
        parameter [17:0] start_a = 18'b0_0000_0000_0000_0001;
        parameter [16:0] start_b = 17'b0_0000_0000_0000_0010;
        parameter [17:0] start_b = 18'b0_0000_0000_0000_0010;
        parameter [16:0] start_c = 17'b0_0000_0000_0000_0100;
        parameter [17:0] start_c = 18'b0_0000_0000_0000_0100;
        parameter [16:0] start_d = 17'b0_0000_0000_0000_1000;
        parameter [17:0] start_d = 18'b0_0000_0000_0000_1000;
        parameter [16:0] start_e = 17'b0_0000_0000_0001_0000;
        parameter [17:0] start_e = 18'b0_0000_0000_0001_0000;
        parameter [16:0] stop_a  = 17'b0_0000_0000_0010_0000;
        parameter [17:0] stop_a  = 18'b0_0000_0000_0010_0000;
        parameter [16:0] stop_b  = 17'b0_0000_0000_0100_0000;
        parameter [17:0] stop_b  = 18'b0_0000_0000_0100_0000;
        parameter [16:0] stop_c  = 17'b0_0000_0000_1000_0000;
        parameter [17:0] stop_c  = 18'b0_0000_0000_1000_0000;
        parameter [16:0] stop_d  = 17'b0_0000_0001_0000_0000;
        parameter [17:0] stop_d  = 18'b0_0000_0001_0000_0000;
        parameter [16:0] rd_a    = 17'b0_0000_0010_0000_0000;
        parameter [17:0] rd_a    = 18'b0_0000_0010_0000_0000;
        parameter [16:0] rd_b    = 17'b0_0000_0100_0000_0000;
        parameter [17:0] rd_b    = 18'b0_0000_0100_0000_0000;
        parameter [16:0] rd_c    = 17'b0_0000_1000_0000_0000;
        parameter [17:0] rd_c    = 18'b0_0000_1000_0000_0000;
        parameter [16:0] rd_d    = 17'b0_0001_0000_0000_0000;
        parameter [17:0] rd_d    = 18'b0_0001_0000_0000_0000;
        parameter [16:0] wr_a    = 17'b0_0010_0000_0000_0000;
        parameter [17:0] wr_a    = 18'b0_0010_0000_0000_0000;
        parameter [16:0] wr_b    = 17'b0_0100_0000_0000_0000;
        parameter [17:0] wr_b    = 18'b0_0100_0000_0000_0000;
        parameter [16:0] wr_c    = 17'b0_1000_0000_0000_0000;
        parameter [17:0] wr_c    = 18'b0_1000_0000_0000_0000;
        parameter [16:0] wr_d    = 17'b1_0000_0000_0000_0000;
        parameter [17:0] wr_d    = 18'b1_0000_0000_0000_0000;
 
 
        always @(posedge clk or negedge nReset)
        always @(posedge clk or negedge nReset)
          if (!nReset)
          if (!nReset)
            begin
            begin
                c_state <= #1 idle;
                c_state <= #1 idle;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.