move debouncing parts to top module

This commit is contained in:
2020-10-27 07:50:25 -05:00
parent 92f059ab54
commit 5a58da34af
2 changed files with 21 additions and 20 deletions

View File

@@ -28,14 +28,30 @@ module top #(parameter WIDTH=24)(
.i_clk (i_clk));
/* verilator lint_on PINMISSING */
reg db_start, db_stop;
debounce db1 (
// Outputs
.db (db_start),
// Inputs
.clk (clk_100MHz),
.reset (~i_resetN),
.sw (~i_startN));
debounce db2 (
// Outputs
.db (db_stop),
// Inputs
.clk (clk_100MHz),
.reset (~i_resetN),
.sw (~i_stopN));
tdc #(.COUNTER_WIDTH(TDC_COUNTER_WIDTH)) tdc0 (
// Outputs
.o_ready (buf_ready),
.o_data (buf_data),
// Inputs
.i_clk (clk_100MHz),
.i_start (~i_startN),
.i_stop (~i_stopN),
.i_start (db_start),
.i_stop (db_stop),
.i_reset (~i_resetN));
always @(posedge clk_1Hz) begin