TOP

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.1 kB
1
Indexable
Never
`timescale 1ns / 1ps

module Top(
input clk,
input btn_rst, btn_start, btn_play_seq, btn_push, btn_timeup,
output [6:0]seg,
output [3:0]anode,
output pmod_1,
output pmod_2,
output pmod_4);

wire clk_d17;
wire db_rst, rst;
wire db_start, start;
wire db_play_seq, play_seq;
wire db_push, push;
wire db_timeup, timeup; 
wire [2:0]state, cnt;
wire timeout;

clk_div #(17) CD1(.clk(clk), .clk_d(clk_d17));
seven_segment SEVEN_SEG(.state(state), .clk(clk_d17), .point(16'd1234), .cnt(cnt), .seg(seg), .anode(anode));
debounced db1(clk, btn_start, db_start);
debounced db2(clk, btn_play_seq, db_play_seq);
debounced db3(clk, btn_push, db_push);
debounced db4(clk, btn_timeup, db_timeup);
onepulse one1(clk, db_start, start);
onepulse one2(clk, db_play_seq, play_seq);
onepulse one3(clk, db_push, push);
onepulse one4(clk, db_timeup, timeup);
FSM fsm(clk, rst, start, play_seq, push, timeout, state, cnt);
music_TOP MT(.clk(clk), .reset(rst), .state(state), .timeout(timeout), .pmod_1(pmod_1), .pmod_2(pmod_2), .pmod_4(pmod_4));
endmodule