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

Subversion Repositories gpio

[/] [gpio/] [trunk/] [bench/] [verilog/] [gpio_mon.v] - Blame information for rev 66

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

Line No. Rev Author Line
1 8 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  GPIO Monitor                                                ////
4
////                                                              ////
5
////  This file is part of the GPIO project                       ////
6
////  http://www.opencores.org/cores/gpio/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Generates and monitors GPIO external signals (+auxiliary)   ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   Nothing                                                    ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47 56 gorand
// Revision 1.2  2003/11/10 23:23:57  gorand
48
// tests passed.
49
//
50 37 gorand
// Revision 1.1  2001/08/21 21:39:27  lampret
51
// Changed directory structure, port names and drfines.
52
//
53 8 lampret
// Revision 1.2  2001/07/14 20:37:20  lampret
54
// Test bench improvements.
55
//
56
// Revision 1.1  2001/06/05 07:45:22  lampret
57
// Added initial RTL and test benches. There are still some issues with these files.
58
//
59
//
60
 
61
`include "timescale.v"
62 37 gorand
`include "gpio_defines.v"
63 8 lampret
 
64
module gpio_mon(gpio_aux, gpio_in, gpio_eclk, gpio_out, gpio_oen);
65
 
66 37 gorand
parameter gw = `GPIO_IOS;
67 8 lampret
 
68
//
69
// I/O ports
70
//
71
output  [gw-1:0] gpio_aux;       // Auxiliary
72
output  [gw-1:0] gpio_in;        // GPIO inputs
73 56 gorand
output  gpio_eclk;      // GPIO external clock
74 8 lampret
input   [gw-1:0] gpio_out;       // GPIO outputs
75
input   [gw-1:0] gpio_oen;       // GPIO output enables
76
 
77
//
78
// Internal regs
79
//
80
reg     [gw-1:0] gpio_aux;
81
reg     [gw-1:0] gpio_in;
82 56 gorand
reg     gpio_eclk;
83 8 lampret
 
84
initial gpio_eclk = 0;
85
 
86
//
87
// Set gpio_in
88
//
89
task set_gpioin;
90
input   [31:0]   val;
91
begin
92
        gpio_in = val;
93
end
94
endtask
95
 
96
//
97
// Set gpio_aux
98
//
99
task set_gpioaux;
100
input   [31:0]   val;
101
begin
102
        gpio_aux = val;
103
end
104
endtask
105
 
106
//
107
// Set gpio_eclk
108
//
109
task set_gpioeclk;
110
input   [31:0]   val;
111
begin
112
        gpio_eclk = val[0];
113
end
114
endtask
115
 
116
//
117
// Get gpio_out
118
//
119
task get_gpioout;
120
output  [31:0]   val;
121
reg     [31:0]   val;
122
begin
123
        val = gpio_out;
124
end
125
endtask
126
 
127
//
128
// Get gpio_oen
129
//
130
task get_gpiooen;
131
output  [31:0]   val;
132
begin
133
        val = gpio_oen;
134
end
135
endtask
136
 
137
endmodule

powered by: WebSVN 2.1.0

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