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

Subversion Repositories gpio

[/] [gpio/] [tags/] [rel_1/] [bench/] [verilog/] [gpio_mon.v] - Blame information for rev 67

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

powered by: WebSVN 2.1.0

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