-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtop.v
More file actions
45 lines (38 loc) · 994 Bytes
/
top.v
File metadata and controls
45 lines (38 loc) · 994 Bytes
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
module nanoV_top (
input clk12MHz,
input cpu_clk,
input rstn,
input i,
output led1,
output led2,
output led3,
output led4,
output led5,
output led6,
output led7,
output led8,
output lcol1,
output lcol2,
output lcol3,
output lcol4);
reg [31:0] instr;
wire [31:0] data;
nanoV_core nano(cpu_clk, rstn, instr, 2'b00, data);
always @(posedge cpu_clk) begin
instr <= {instr[30:0],i};
end
// map the output of ledscan to the port pins
wire [7:0] leds_out;
wire [3:0] lcol;
assign { led8, led7, led6, led5, led4, led3, led2, led1 } = leds_out[7:0];
assign { lcol4, lcol3, lcol2, lcol1 } = lcol[3:0];
LedScan scan (
.clk12MHz(clk12MHz),
.leds1(data[31:24]),
.leds2(data[23:16]),
.leds3(data[15:8]),
.leds4(data[7:0]),
.leds(leds_out),
.lcol(lcol)
);
endmodule