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 302

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 290 hellwig
`timescale 1ns/10ps
7
`default_nettype none
8
 
9
 
10
module dsp(clk, rst,
11
           stb, we, addr,
12 27 hellwig
           data_in, data_out,
13 290 hellwig
           ack,
14 27 hellwig
           hsync, vsync,
15
           r, g, b);
16 123 hellwig
    // internal interface
17 27 hellwig
    input clk;
18 290 hellwig
    input rst;
19
    input stb;
20
    input we;
21 27 hellwig
    input [13:2] addr;
22
    input [15:0] data_in;
23
    output [15:0] data_out;
24 290 hellwig
    output ack;
25 123 hellwig
    // external interface
26 27 hellwig
    output hsync;
27
    output vsync;
28
    output [2:0] r;
29
    output [2:0] g;
30
    output [2:0] b;
31
 
32
  reg state;
33
 
34 290 hellwig
  display display_1(
35 123 hellwig
    .clk(clk),
36
    .dsp_row(addr[13:9]),
37
    .dsp_col(addr[8:2]),
38 290 hellwig
    .dsp_en(stb),
39
    .dsp_wr(we),
40 123 hellwig
    .dsp_wr_data(data_in[15:0]),
41
    .dsp_rd_data(data_out[15:0]),
42
    .hsync(hsync),
43
    .vsync(vsync),
44
    .r(r[2:0]),
45
    .g(g[2:0]),
46
    .b(b[2:0])
47
  );
48 27 hellwig
 
49
  always @(posedge clk) begin
50 290 hellwig
    if (rst) begin
51 27 hellwig
      state <= 1'b0;
52
    end else begin
53
      case (state)
54
        1'b0:
55
          begin
56 290 hellwig
            if (stb & ~we) begin
57 27 hellwig
              state <= 1'b1;
58
            end
59
          end
60
        1'b1:
61
          begin
62
            state <= 1'b0;
63
          end
64
      endcase
65
    end
66
  end
67
 
68 290 hellwig
  assign ack = stb & (we | state);
69 27 hellwig
 
70
endmodule

powered by: WebSVN 2.1.0

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