This repository has been archived by the owner on Dec 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNJU_MIPS.v
executable file
·130 lines (105 loc) · 2.77 KB
/
NJU_MIPS.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//=======================================================
// This code is generated by Terasic System Builder
//=======================================================
module NJU_MIPS(
//////////// CLOCK //////////
input CLOCK2_50,
input CLOCK3_50,
input CLOCK4_50,
input CLOCK_50,
//////////// KEY //////////
input [3:0] KEY,
//////////// SW //////////
input [9:0] SW,
//////////// LED //////////
output [9:0] LEDR,
//////////// Seg7 //////////
output [6:0] HEX0,
output [6:0] HEX1,
output [6:0] HEX2,
output [6:0] HEX3,
output [6:0] HEX4,
output [6:0] HEX5,
//////////// VGA //////////
output VGA_BLANK_N,
output [7:0] VGA_B,
output VGA_CLK,
output [7:0] VGA_G,
output VGA_HS,
output [7:0] VGA_R,
output VGA_SYNC_N,
output VGA_VS,
//////////// Audio //////////
input AUD_ADCDAT,
inout AUD_ADCLRCK,
inout AUD_BCLK,
output AUD_DACDAT,
inout AUD_DACLRCK,
output AUD_XCK,
//////////// PS2 //////////
inout PS2_CLK,
inout PS2_CLK2,
inout PS2_DAT,
inout PS2_DAT2,
//////////// I2C for Audio and Video-In //////////
output FPGA_I2C_SCLK,
inout FPGA_I2C_SDAT
);
//=======================================================
// REG/WIRE declarations
//=======================================================
//=======================================================
// Structural coding
//=======================================================
wire [11:0] vga_rdaddress;
wire [7:0] vga_q;
wire [7:0] kb_ascii;
wire [7:0] kb_code;
wire kb_en;
wire audio_en;
sopc cpu(
.CLOCK_50(CLOCK_50),
.rst(!KEY[0]),
.debug(),
.vga_q(vga_q),
.vga_rdaddress(vga_rdaddress),
.input_ascii(kb_ascii),
.input_en(kb_en),
.audio_en(audio_en)
);
vga video_output(
.CLOCK_50(CLOCK_50),
.VGA_BLANK_N(VGA_BLANK_N),
.VGA_B(VGA_B),
.VGA_CLK(VGA_CLK),
.VGA_G(VGA_G),
.VGA_HS(VGA_HS),
.VGA_R(VGA_R),
.VGA_SYNC_N(VGA_SYNC_N),
.VGA_VS(VGA_VS),
.q(vga_q),
.rdaddress(vga_rdaddress)
);
keyboard kb(
.clk(CLOCK_50),
.ps2_clk(PS2_CLK),
.ps2_data(PS2_DAT),
.ascii_out(kb_ascii),
.en(kb_en),
.kb_code(kb_code)
);
audio player(
.clk(CLOCK_50),
.DACLRCLK(AUD_DACLRCK),
.DACDAT(AUD_DACDAT),
.XCK(AUD_XCK),
.BCLK(AUD_BCLK),
.I2C_SCLK(AUD_ADCLRCK),
.I2C_SDAT(AUD_ADCDAT),
.ch_n(KEY[3]),
.dirs(SW[9]),
.ken(kb_en),
.kb_code(kb_code),
.en(audio_en)
);
endmodule