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

Subversion Repositories mips789

[/] [mips789/] [tags/] [arelease/] [rtl/] [verilog/] [mips_top.v] - Blame information for rev 56

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

Line No. Rev Author Line
1 35 mcupro
/******************************************************************
2 31 mcupro
 *                                                                *
3
 *    Author: Liwei                                               *
4
 *                                                                *
5
 *    This file is part of the "mips789" project.                 *
6
 *    Downloaded from:                                            *
7
 *    http://www.opencores.org/pdownloads.cgi/list/mips789        *
8
 *                                                                *
9
 *    If you encountered any problem, please contact me via       *
10
 *    Email:mcupro@opencores.org  or mcupro@163.com               *
11
 *                                                                *
12
 ******************************************************************/
13
 
14
`include "mips789_defs.v"
15 35 mcupro
 
16 31 mcupro
module mips_top (
17 35 mcupro
        input clk,
18
        input rst,
19
        input ser_rxd,
20
        output ser_txd,
21
        output [6:0]seg7led1,
22
        output [6:0]seg7led2,
23
        output [7:0] lcd_data,
24
        output lcd_rs,
25
        output lcd_rw,
26
        output lcd_en,
27
        output led1,
28
        output led2,
29
        input  key1,
30
        input  key2
31
    );
32 31 mcupro
 
33 35 mcupro
    wire [31:0] data2core;
34
    wire [31:0] data2mem;
35
    wire [31:0] ins2core;
36
    wire [31:0] mem_Addr;
37
    wire [31:0] pc;
38
    wire [3:0] wr_en;
39
    wire CLK;
40
    reg r_rst;
41 31 mcupro
 
42
 
43 35 mcupro
    //wire sys_rst=rst;
44
    always @(posedge CLK)
45
            if (rst) r_rst<=1'b1; else r_rst<=1'b0;
46
    //wire sys_rst = r_rst;
47 31 mcupro
 
48 35 mcupro
    reg rr_rst;
49
    always @(posedge CLK)
50
        rr_rst<=r_rst;
51
 
52
    wire sys_rst = rr_rst;
53
 
54
    //assign CLK = clk;
55 31 mcupro
`ifdef ALTERA
56
 
57 35 mcupro
    pll50 Ipll(
58
              .inclk0(clk),
59
              .c0(CLK)
60
          );
61 31 mcupro
`else
62 35 mcupro
    assign CLK = clk;
63 31 mcupro
`endif
64 35 mcupro
 
65 31 mcupro
`ifdef ALTERA
66
 
67 35 mcupro
    mem_array ram_8k
68
              (
69
                  .clk(CLK),
70
                  .din(data2mem),
71
                  .dout(data2core),
72
                  .ins_o(ins2core),
73
                  .pc_i(pc),
74
                  .data_addr_i(mem_Addr),
75
                  .wren(wr_en)
76
              );
77
 
78 31 mcupro
`else
79 35 mcupro
 
80
    sim_mem_array sim_array (
81
                      .clk(CLK),
82
                      .pc_i(pc),
83
                      .ins_o(ins2core),
84
                      .wren(wr_en),
85
                      .din(data2mem),
86
                      .data_addr_i(mem_Addr),
87
                      .dout(data2core)
88
                  );
89 31 mcupro
`endif
90
 
91 35 mcupro
    mips_sys isys
92
             (
93 31 mcupro
 
94 35 mcupro
                 .zz_addr_o(mem_Addr),
95
                 .zz_din(data2core),
96
                 .zz_dout(data2mem),
97
                 .zz_ins_i(ins2core),
98
                 .zz_pc_o(pc),
99
                 .zz_wr_en_o(wr_en),
100 31 mcupro
 
101 35 mcupro
                 .clk(CLK),
102
                 .rst(sys_rst),
103 31 mcupro
 
104 35 mcupro
                 .ser_rxd(ser_rxd),
105
                 .ser_txd(ser_txd),
106 31 mcupro
 
107 35 mcupro
                 .seg7led1(seg7led1),
108
                 .seg7led2(seg7led2),
109 31 mcupro
 
110 35 mcupro
                 .lcd_data(lcd_data),
111
                 .lcd_rs(lcd_rs),
112
                 .lcd_rw(lcd_rw),
113
                 .lcd_en(lcd_en),
114 31 mcupro
 
115 35 mcupro
                 .led1(led1),
116
                 .led2(led2),
117 31 mcupro
 
118 35 mcupro
                 .key1(key1),
119
                 .key2(key2)
120
             );
121
 
122
endmodule

powered by: WebSVN 2.1.0

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