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

Subversion Repositories gpio

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

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 37 gorand
// Revision 1.1  2001/08/21 21:39:27  lampret
48
// Changed directory structure, port names and drfines.
49
//
50 8 lampret
// Revision 1.2  2001/07/14 20:37:20  lampret
51
// Test bench improvements.
52
//
53
// Revision 1.1  2001/06/05 07:45:22  lampret
54
// Added initial RTL and test benches. There are still some issues with these files.
55
//
56
//
57
 
58
`include "timescale.v"
59 37 gorand
`include "gpio_defines.v"
60 8 lampret
 
61
module gpio_mon(gpio_aux, gpio_in, gpio_eclk, gpio_out, gpio_oen);
62
 
63 37 gorand
parameter gw = `GPIO_IOS;
64 8 lampret
 
65
//
66
// I/O ports
67
//
68
output  [gw-1:0] gpio_aux;       // Auxiliary
69
output  [gw-1:0] gpio_in;        // GPIO inputs
70
output                  gpio_eclk;      // GPIO external clock
71
input   [gw-1:0] gpio_out;       // GPIO outputs
72
input   [gw-1:0] gpio_oen;       // GPIO output enables
73
 
74
//
75
// Internal regs
76
//
77
reg     [gw-1:0] gpio_aux;
78
reg     [gw-1:0] gpio_in;
79
reg                     gpio_eclk;
80
 
81
initial gpio_eclk = 0;
82
 
83
//
84
// Set gpio_in
85
//
86
task set_gpioin;
87
input   [31:0]   val;
88
begin
89
        gpio_in = val;
90
end
91
endtask
92
 
93
//
94
// Set gpio_aux
95
//
96
task set_gpioaux;
97
input   [31:0]   val;
98
begin
99
        gpio_aux = val;
100
end
101
endtask
102
 
103
//
104
// Set gpio_eclk
105
//
106
task set_gpioeclk;
107
input   [31:0]   val;
108
begin
109
        gpio_eclk = val[0];
110
end
111
endtask
112
 
113
 
114
//
115
// Get gpio_out
116
//
117
task get_gpioout;
118
output  [31:0]   val;
119
reg     [31:0]   val;
120
begin
121
        val = gpio_out;
122
end
123
endtask
124
 
125
//
126
// Get gpio_oen
127
//
128
task get_gpiooen;
129
output  [31:0]   val;
130
begin
131
        val = gpio_oen;
132
end
133
endtask
134
 
135
endmodule

powered by: WebSVN 2.1.0

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