aboutsummaryrefslogtreecommitdiff
path: root/rtl/src/top.v
blob: d21f807b57d3274e4e7be6958dce44aebacc972c (plain)
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
// top:
// Top module, maps signals to fpga.

module top (
	input clk,
	input key,
  input rst,
  output [5:0] led
);

wire rstn, rstn_async, clk_cpu;
assign rstn_async = rst;

wire [31:0] io_in;
wire [31:0] io_out;

reset_synchronizer reset_synchronizer (
  .clk(clk),
  .rstn_async(rstn_async),
  .rstn(rstn)
);

clock_divider #(.N(1)) clkdiv (
  .clk(clk),
  .rstn(rstn),
  .clk_div(clk_cpu)
);

assign led[0] = ~clk_cpu;
assign led[5:1] = ~io_out[4:0];
assign io_in[0] = key;


cpu cpu (
  .clk(clk_cpu),
  .rstn(rstn),
  .io_in(io_in),
  .io_out(io_out)
);

endmodule