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

Subversion Repositories z80control

[/] [z80control/] [trunk/] [CII_Starter_USB_API_v1/] [HW/] [VGA_Controller/] [VGA_OSD_RAM.v] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 tylerapohl
//Legal Notice: (C)2006 Altera Corporation. All rights reserved. Your
2
//use of Altera Corporation's design tools, logic functions and other
3
//software and tools, and its AMPP partner logic functions, and any
4
//output files any of the foregoing (including device programming or
5
//simulation files), and any associated documentation or information are
6
//expressly subject to the terms and conditions of the Altera Program
7
//License Subscription Agreement or other applicable license agreement,
8
//including, without limitation, that your use is for the sole purpose
9
//of programming logic devices manufactured by Altera and sold by Altera
10
//or its authorized distributors.  Please refer to the applicable
11
//agreement for further details.
12
 
13
module  VGA_OSD_RAM     (       //      Read Out Side
14
                                                oRed,
15
                                                oGreen,
16
                                                oBlue,
17
                                                iVGA_ADDR,
18
                                                iVGA_X,
19
                                                iVGA_Y,
20
                                                iVGA_CLK,
21
                                                //      Write In Side
22
                                                iWR_DATA,
23
                                                iWR_ADDR,
24
                                                iWR_EN,
25
                                                iWR_CLK,
26
                                                //      CLUT
27
                                                iON_R,
28
                                                iON_G,
29
                                                iON_B,
30
                                                iOFF_R,
31
                                                iOFF_G,
32
                                                iOFF_B,
33
                                                //      Control Signals
34
                                                iRST_N  );
35
//      Read Out Side
36
output  reg     [9:0]    oRed;
37
output  reg     [9:0]    oGreen;
38
output  reg     [9:0]    oBlue;
39
input   [18:0]           iVGA_ADDR;
40
input   [9:0]            iVGA_X;
41
input   [9:0]            iVGA_Y;
42
input                           iVGA_CLK;
43
//      Write In Side
44
input   [18:0]           iWR_ADDR;
45
input                           iWR_DATA;
46
input                           iWR_EN;
47
input                           iWR_CLK;
48
//      CLUT
49
input   [9:0]    iON_R;
50
input   [9:0]    iON_G;
51
input   [9:0]    iON_B;
52
input   [9:0]    iOFF_R;
53
input   [9:0]    iOFF_G;
54
input   [9:0]    iOFF_B;
55
//      Control Signals
56
input                           iRST_N;
57
//      Internal Registers/Wires
58
reg             [2:0]            ADDR_d;
59
reg             [2:0]            ADDR_dd;
60
wire    [7:0]            ROM_DATA;
61
wire    [18:0]           mVGA_ADDR;
62
 
63
parameter       START_X =       60;
64
parameter       START_Y =       50;
65
parameter       END_X   =       640-60;
66
parameter       END_Y   =       480-30;
67
 
68
assign  mVGA_ADDR       =       iVGA_ADDR-(iVGA_Y*120)-521*50;
69
 
70
always@(posedge iVGA_CLK or negedge iRST_N)
71
begin
72
        if(!iRST_N)
73
        begin
74
                oRed    <=      0;
75
                oGreen  <=      0;
76
                oBlue   <=      0;
77
                ADDR_d  <=      0;
78
                ADDR_dd <=      0;
79
        end
80
        else
81
        begin
82
                ADDR_d  <=      mVGA_ADDR[2:0];
83
                ADDR_dd <=      ~ADDR_d;
84
                oRed    <=      ~(iVGA_X>=START_X && iVGA_X<END_X && iVGA_Y>=START_Y && iVGA_Y<END_Y)   ?       iOFF_R  :
85
                                        ROM_DATA[ADDR_dd]?      iON_R:iOFF_R;
86
                oGreen  <=      ~(iVGA_X>=START_X && iVGA_X<END_X && iVGA_Y>=START_Y && iVGA_Y<END_Y)   ?       iOFF_G  :
87
                                        ROM_DATA[ADDR_dd]?      iON_G:iOFF_G;
88
                oBlue   <=      ~(iVGA_X>=START_X && iVGA_X<END_X && iVGA_Y>=START_Y && iVGA_Y<END_Y)   ?       iOFF_B  :
89
                                        ROM_DATA[ADDR_dd]?      iON_B:iOFF_B;
90
        end
91
end
92
 
93
Img_RAM         u0      (       //      Write In Side
94
                                        .data(iWR_DATA),
95
                                        .wren(iWR_EN),
96
                                        .wraddress({iWR_ADDR[18:3],~iWR_ADDR[2:0]}),
97
                                        .wrclock(iWR_CLK),
98
                                        //      Read Out Side
99
                                        .rdaddress(mVGA_ADDR[18:3]),
100
                                        .rdclock(iVGA_CLK),
101
                                        .q(ROM_DATA));
102
 
103
endmodule

powered by: WebSVN 2.1.0

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