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

Subversion Repositories vga_lcd

[/] [vga_lcd/] [trunk/] [rtl/] [verilog/] [vga_cur_cregs.v] - Blame information for rev 62

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 33 rherveille
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  WISHBONE rev.B2 compliant enhanced VGA/LCD Core            ////
4
////  Hardware Cursor Color Registers                            ////
5
////                                                             ////
6
////  Author: Richard Herveille                                  ////
7
////          richard@asics.ws                                   ////
8
////          www.asics.ws                                       ////
9
////                                                             ////
10
////  Downloaded from: http://www.opencores.org/projects/vga_lcd ////
11
////                                                             ////
12
/////////////////////////////////////////////////////////////////////
13
////                                                             ////
14
//// Copyright (C) 2002 Richard Herveille                        ////
15
////                    richard@asics.ws                         ////
16
////                                                             ////
17
//// This source file may be used and distributed without        ////
18
//// restriction provided that this copyright statement is not   ////
19
//// removed from the file and that any derivative work contains ////
20
//// the original copyright notice and the associated disclaimer.////
21
////                                                             ////
22
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
23
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
24
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
25
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
26
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
27
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
28
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
29
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
30
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
31
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
32
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
33
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
34
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
35
////                                                             ////
36
/////////////////////////////////////////////////////////////////////
37
 
38
//  CVS Log
39
//
40 53 rherveille
//  $Id: vga_cur_cregs.v,v 1.3 2003-05-07 09:48:54 rherveille Exp $
41 33 rherveille
//
42 53 rherveille
//  $Date: 2003-05-07 09:48:54 $
43
//  $Revision: 1.3 $
44 33 rherveille
//  $Author: rherveille $
45
//  $Locker:  $
46
//  $State: Exp $
47
//
48
// Change History:
49
//               $Log: not supported by cvs2svn $
50 53 rherveille
//               Revision 1.2  2002/03/04 16:05:52  rherveille
51
//               Added hardware cursor support to wishbone master.
52
//               Added provision to turn-off 3D cursors.
53
//               Fixed some minor bugs.
54
//
55 34 rherveille
//               Revision 1.1  2002/03/04 11:01:59  rherveille
56
//               Added 64x64pixels 4bpp hardware cursor support.
57 33 rherveille
//
58 34 rherveille
//
59 33 rherveille
 
60 53 rherveille
//synopsys translate_off
61 33 rherveille
`include "timescale.v"
62 53 rherveille
//synopsys translate_on
63 33 rherveille
 
64
module vga_cur_cregs (
65
        clk_i, rst_i, arst_i,
66
        hsel_i, hadr_i, hwe_i, hdat_i, hdat_o, hack_o,
67
        cadr_i, cdat_o
68
        );
69
 
70
        //
71
        // inputs & outputs
72
        //
73
 
74
        // wishbone signals
75
        input         clk_i;         // master clock input
76
        input         rst_i;         // synchronous active high reset
77
        input         arst_i;        // asynchronous active low reset
78
 
79
        // host interface
80
        input         hsel_i;        // host select input
81
        input  [ 2:0] hadr_i;        // host address input
82
        input         hwe_i;         // host write enable input
83
        input  [31:0] hdat_i;        // host data in
84
        output [31:0] hdat_o;        // host data out
85
        output        hack_o;        // host acknowledge out
86
 
87
        reg [31:0] hdat_o;
88
        reg        hack_o;
89
 
90
        // cursor processor interface
91
        input  [ 3:0] cadr_i;        // cursor address in
92
        output [15:0] cdat_o;        // cursor data out
93
 
94
        reg [15:0] cdat_o;
95
 
96
 
97
        //
98
        // variable declarations
99
        //
100 34 rherveille
        reg  [31:0] cregs [7:0];  // color registers
101 33 rherveille
        wire [31:0] temp_cdat;
102
 
103
        //
104
        // module body
105
        //
106
 
107
 
108
        ////////////////////////////
109
        // generate host interface
110
 
111
        // write section
112 34 rherveille
        always@(posedge clk_i)
113 33 rherveille
                if (hsel_i & hwe_i)
114
                        cregs[hadr_i] <= #1 hdat_i;
115
 
116
        // read section
117
        always@(posedge clk_i)
118
                hdat_o <= #1 cregs[hadr_i];
119
 
120
        // acknowledge section
121
        always@(posedge clk_i)
122
                hack_o <= #1 hsel_i & !hack_o;
123
 
124
 
125
        //////////////////////////////
126
        // generate cursor interface
127
 
128
        // read section
129
        assign temp_cdat = cregs[cadr_i[3:1]];
130
 
131
        always@(posedge clk_i)
132
                cdat_o <= #1 cadr_i[0] ? temp_cdat[31:16] : temp_cdat[15:0];
133
 
134
endmodule
135
 

powered by: WebSVN 2.1.0

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