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

Subversion Repositories i2c_to_wb

[/] [i2c_to_wb/] [trunk/] [sim/] [tests/] [debug/] [the_test.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2009 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27 2 qaztronic
 
28 4 qaztronic
 
29 2 qaztronic
`timescale 1ns/10ps
30
 
31
 
32
module the_test(
33
                input tb_clk,
34
                input tb_rst
35
              );
36
 
37
 
38
  task run_the_test;
39
    begin
40
 
41
// --------------------------------------------------------------------
42
// insert test below
43
 
44
      dut.i2c.start();
45 4 qaztronic
      dut.i2c.write_byte( 8'hf1 );
46
      dut.i2c.read_byte(0);
47
      dut.i2c.read_byte(0);
48
      dut.i2c.read_byte(0);
49
      dut.i2c.read_byte(0);
50
      dut.i2c.read_byte(0);
51
      dut.i2c.read_byte(0);
52
      dut.i2c.read_byte(1);
53
 
54
      dut.i2c.start();
55 3 qaztronic
      dut.i2c.write_byte( 8'h10 );
56 4 qaztronic
      dut.i2c.write_byte( 8'hab );
57
      dut.i2c.write_byte( 8'hba );
58 2 qaztronic
 
59
      dut.i2c.start();
60 4 qaztronic
      dut.i2c.write_byte( 8'hf0 );
61
      dut.i2c.write_byte( 8'hbe );
62
      dut.i2c.write_byte( 8'hef );
63
 
64
      dut.i2c.start();
65 3 qaztronic
      dut.i2c.write_byte( 8'hcb );
66 4 qaztronic
      dut.i2c.read_byte(0);
67
      dut.i2c.read_byte(1);
68 2 qaztronic
 
69 4 qaztronic
      dut.i2c.start();
70
      dut.i2c.write_byte( 8'hf1 );
71
      dut.i2c.read_byte(0);
72
      dut.i2c.read_byte(1);
73
 
74
      dut.i2c.start();
75
      dut.i2c.write_byte( 8'hdb );
76
      dut.i2c.read_byte(0);
77
      dut.i2c.read_byte(1);
78 2 qaztronic
      dut.i2c.stop();
79
 
80
 
81
      repeat(100) @(posedge tb_clk);
82
 
83
    end
84
  endtask
85
 
86
 
87
endmodule
88
 

powered by: WebSVN 2.1.0

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