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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [mc/] [src/] [dsp/] [bpp9/] [dsp.v] - Blame information for rev 123

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 123 hellwig
//
2
// dsp.v -- character display interface
3
//
4
 
5
 
6 27 hellwig
module dsp(clk, reset,
7
           addr, en, wr, wt,
8
           data_in, data_out,
9
           hsync, vsync,
10
           r, g, b);
11 123 hellwig
    // internal interface
12 27 hellwig
    input clk;
13
    input reset;
14
    input [13:2] addr;
15
    input en;
16
    input wr;
17
    output wt;
18
    input [15:0] data_in;
19
    output [15:0] data_out;
20 123 hellwig
    // external interface
21 27 hellwig
    output hsync;
22
    output vsync;
23
    output [2:0] r;
24
    output [2:0] g;
25
    output [2:0] b;
26
 
27
  reg state;
28
 
29 123 hellwig
  display display1(
30
    .clk(clk),
31
    .dsp_row(addr[13:9]),
32
    .dsp_col(addr[8:2]),
33
    .dsp_en(en),
34
    .dsp_wr(wr),
35
    .dsp_wr_data(data_in[15:0]),
36
    .dsp_rd_data(data_out[15:0]),
37
    .hsync(hsync),
38
    .vsync(vsync),
39
    .r(r[2:0]),
40
    .g(g[2:0]),
41
    .b(b[2:0])
42
  );
43 27 hellwig
 
44
  always @(posedge clk) begin
45
    if (reset == 1) begin
46
      state <= 1'b0;
47
    end else begin
48
      case (state)
49
        1'b0:
50
          begin
51
            if (en == 1 && wr == 0) begin
52
              state <= 1'b1;
53
            end
54
          end
55
        1'b1:
56
          begin
57
            state <= 1'b0;
58
          end
59
      endcase
60
    end
61
  end
62
 
63
  assign wt = (en == 1 && wr == 0 && state == 1'b0) ? 1 : 0;
64
 
65
endmodule

powered by: WebSVN 2.1.0

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