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

Subversion Repositories i2cslave

[/] [i2cslave/] [trunk/] [syn/] [Altera/] [i2cSlaveTopAltera.v] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 sfielding
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// i2cSlaveTopAltera.v                                          ////
4
////                                                              ////
5
//// This file is part of the i2cSlave opencores effort.
6
//// <http://www.opencores.org/cores//>                           ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
//// You will need to modify this file to implement your 
10
//// interface.
11
////                                                              ////
12
//// To Do:                                                       ////
13
//// 
14
////                                                              ////
15
//// Author(s):                                                   ////
16
//// - Steve Fielding, sfielding@base2designs.com                 ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2008 Steve Fielding and OPENCORES.ORG          ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE. See the GNU Lesser General Public License for more  ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from <http://www.opencores.org/lgpl.shtml>                   ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
//
45
`include "i2cSlave_define.v"
46
 
47
 
48
module i2cSlaveTopAltera (
49
  clk,
50
  sda,
51
  scl,
52
  LED
53
);
54
input clk;
55
inout sda;
56
input scl;
57
output LED;
58
 
59
//local wires and regs
60
reg [1:0] rstReg;
61
wire rst;
62
wire pll_locked;
63
wire [7:0] myReg0;
64
 
65
assign LED = myReg0[0];
66
 
67
i2cSlave u_i2cSlave(
68
  .clk(clk),
69
  .rst(rst),
70
  .sda(sda),
71
  .scl(scl),
72
  .myReg0(myReg0),
73
  .myReg1(),
74
  .myReg2(),
75
  .myReg3(),
76
  .myReg4(8'h12),
77
  .myReg5(8'h34),
78
  .myReg6(8'h56),
79
  .myReg7(8'h78)
80
 
81
);
82
 
83
pll_48MHz       pll_48MHz_inst (
84
        .inclk0 ( clk ),
85
        .locked( pll_locked)
86
        );
87
 
88
//generate sync reset from pll lock signal
89
always @(posedge clk) begin
90
  rstReg[1:0] <= {rstReg[0], ~pll_locked};
91
end
92
assign rst = rstReg[1];
93
 
94
endmodule
95
 
96
 
97
 

powered by: WebSVN 2.1.0

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