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

Subversion Repositories i2c

[/] [i2c/] [trunk/] [bench/] [verilog/] [i2c_slave_model.v] - Diff between revs 43 and 46

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

Rev 43 Rev 46
Line 34... Line 34...
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
 
 
//  CVS Log
//  CVS Log
//
//
//  $Id: i2c_slave_model.v,v 1.4 2003-09-11 08:25:37 rherveille Exp $
//  $Id: i2c_slave_model.v,v 1.5 2003-12-05 11:05:19 rherveille Exp $
//
//
//  $Date: 2003-09-11 08:25:37 $
//  $Date: 2003-12-05 11:05:19 $
//  $Revision: 1.4 $
//  $Revision: 1.5 $
//  $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.4  2003/09/11 08:25:37  rherveille
 
//               Fixed a bug in the timing section. Changed 'tst_scl' into 'tst_sto'.
 
//
//               Revision 1.3  2002/10/30 18:11:06  rherveille
//               Revision 1.3  2002/10/30 18:11:06  rherveille
//               Added timing tests to i2c_model.
//               Added timing tests to i2c_model.
//               Updated testbench.
//               Updated testbench.
//
//
//               Revision 1.2  2002/03/17 10:26:38  rherveille
//               Revision 1.2  2002/03/17 10:26:38  rherveille
Line 146... Line 149...
        //detect start condition
        //detect start condition
        always @(negedge sda)
        always @(negedge sda)
          if(scl)
          if(scl)
            begin
            begin
                sta <= #1 1'b1;
                sta <= #1 1'b1;
 
                d_sta <= #1 1'b0;
 
                sto   <= #1 1'b0;
 
 
                if(debug)
                if(debug)
                  $display("DEBUG i2c_slave; start condition detected at %t", $time);
                  $display("DEBUG i2c_slave; start condition detected at %t", $time);
            end
            end
          else
          else
Line 160... Line 165...
 
 
        // detect stop condition
        // detect stop condition
        always @(posedge sda)
        always @(posedge sda)
          if(scl)
          if(scl)
            begin
            begin
 
               sta <= #1 1'b0;
               sto <= #1 1'b1;
               sto <= #1 1'b1;
 
 
               if(debug)
               if(debug)
                 $display("DEBUG i2c_slave; stop condition detected at %t", $time);
                 $display("DEBUG i2c_slave; stop condition detected at %t", $time);
            end
            end

powered by: WebSVN 2.1.0

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