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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [logic/] [ip/] [vga_char_ctrl/] [rtl/] [verilog/] [top.body] - Blame information for rev 134

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
//----------------------------------------------------------------------------
2
// user_logic.v - module
3
//----------------------------------------------------------------------------
4
//
5
//  This program is free software: you can redistribute it and/or modify
6
//  it under the terms of the GNU General Public License as published by
7
//  the Free Software Foundation, either version 3 of the License, or
8
//  (at your option) any later version.
9
//
10
//  This program is distributed in the hope that it will be useful,
11
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
//  GNU General Public License for more details.
14
//
15
//  You should have received a copy of the GNU General Public License
16
//  along with this program.  If not, see .
17
//
18
//----------------------------------------------------------------------------
19
 
20
 
21
wire pixel_on;
22
wire h_synch;
23
wire v_synch;
24
wire blank;
25
 
26
// instantiate the character generator
27
`VARIANT`CHAR_DISPLAY
28
#(.H_ACTIVE(H_ACTIVE))
29
 CHAR_DISPLAY
30
  (
31 134 jt_eaton
  .clk               ( clk               ),
32
  .reset             ( reset             ),
33
  .subchar_line      ( subchar_line      ),
34
  .subchar_pixel     ( subchar_pixel     ),
35
  .pixel_on          ( pixel_on          ),
36
  .char_read_addr    ( char_read_addr    ),
37
  .char_write_addr   ( address           ),
38
  .char_write_data   ( wdata             ),
39
  .char_gen_rom_data ( char_gen_rom_data ),
40
  .char_write_enable ( ascii_load        ),
41
  .ascii_code        ( ascii_code        )
42 131 jt_eaton
 
43
);
44
 
45
// instantiate the video timing generator
46
`VARIANT`SVGA_TIMING_GENERATION
47
 #(.CHARACTER_DECODE_DELAY(CHARACTER_DECODE_DELAY),
48
   .H_ACTIVE(H_ACTIVE),
49
   .H_FRONT_PORCH(H_FRONT_PORCH),
50
   .H_SYNCH(H_SYNCH),
51
   .H_BACK_PORCH(H_BACK_PORCH),
52
   .H_TOTAL(H_TOTAL),
53
   .V_ACTIVE(V_ACTIVE),
54
   .V_FRONT_PORCH(V_FRONT_PORCH),
55
   .V_SYNCH(V_SYNCH),
56
   .V_BACK_PORCH(V_BACK_PORCH),
57
   .V_TOTAL(V_TOTAL)
58
  )
59
 SVGA_TIMING_GENERATION
60
(
61
  .clk            ( clk          ),
62
  .reset          ( reset        ),
63
  .h_synch        ( h_synch      ),
64
  .v_synch        ( v_synch      ),
65
  .blank          ( blank        ),
66
  .pixel_count    ( pixel_count  ),
67
  .line_count     ( line_count   ),
68
  .subchar_pixel  ( subchar_pixel),
69
  .subchar_line   ( subchar_line ),
70
  .char_column    ( char_column  ),
71
  .char_line      ( char_line    )
72
);
73
 
74
// instantiate the video output mux
75
`VARIANT`VIDEO_OUT
76
 VIDEO_OUT
77
(
78
  .clk                ( clk             ),
79
  .reset              ( reset           ),
80
  .h_synch            ( h_synch         ),
81
  .v_synch            ( v_synch         ),
82
  .blank              ( blank           ),
83
  .char_color         ( char_color      ),
84
  .back_color         ( back_color      ),
85
  .cursor_color       ( cursor_color    ),
86
  .pixel_on           ( pixel_on        ),
87
  .cursor_on          ( cursor_on       ),
88
  .hsync_n_out        ( hsync_n_pad_out ),
89
  .vsync_n_out        ( vsync_n_pad_out ),
90
  .red_out            ( red_pad_out     ),
91
  .green_out          ( green_pad_out   ),
92
  .blue_out           ( blue_pad_out    )
93
);
94
 
95
 
96
 
97
always @ (posedge clk )
98
   if (reset)    cursor_on <=  1'b0;
99
   else          cursor_on <= (char_read_addr ==  address) ;
100
 
101
 
102
 
103
always@(posedge clk)
104
  if(reset)       address <= 14'b00000000000000;
105
  else
106
  if(add_l_load)  address[7:0] <= wdata;
107
  else
108
  if(add_h_load)  address[13:8] <= wdata[5:0];
109
  else
110
  if(ascii_load)  address  <= address+ 14'b0000000000001;
111
  else            address  <= address;
112
 
113 134 jt_eaton
always @ (*)
114
     begin
115
     char_read_addr    = (char_line[6:0] * H_ACTIVE / 8 ) + {7'b0000000,char_column[6:0]};
116
     end
117
 
118
 
119
assign   chargen_rom_address = {ascii_code[7:0], subchar_line[2:0]};

powered by: WebSVN 2.1.0

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