calib delay?
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
`default_nettype none
|
`default_nettype none
|
||||||
|
|
||||||
|
/* verilator lint_off UNUSED */
|
||||||
module top #(parameter WIDTH=24)(
|
module top #(parameter WIDTH=24)(
|
||||||
input wire i_clk,
|
input wire i_clk,
|
||||||
input wire i_startN,
|
input wire i_startN,
|
||||||
input wire i_stopN,
|
input wire i_stopN,
|
||||||
input wire i_resetN,
|
input wire i_resetN,
|
||||||
|
// input wire [31:0] i_calib_delay,
|
||||||
output wire o_ledN,
|
output wire o_ledN,
|
||||||
output wire o_readyN,
|
output wire o_readyN,
|
||||||
output wire [5:0] o_dataN,
|
output wire [5:0] o_dataN,
|
||||||
@@ -27,10 +29,26 @@ module top #(parameter WIDTH=24)(
|
|||||||
.i_clk (i_clk));
|
.i_clk (i_clk));
|
||||||
/* verilator lint_on PINMISSING */
|
/* verilator lint_on PINMISSING */
|
||||||
reg db_start, db_stop;
|
reg db_start, db_stop;
|
||||||
always @(posedge clk_100MHz) begin
|
reg [31:0] cal_delay = 15000;
|
||||||
db_start <= ~i_startN;
|
wire aa;
|
||||||
db_stop <= ~i_stopN;
|
debounce db1 (
|
||||||
end
|
.db (aa),
|
||||||
|
.clk (clk_100MHz),
|
||||||
|
.reset (~i_resetN),
|
||||||
|
.sw (~i_startN ));
|
||||||
|
tdc_calib tcalib (
|
||||||
|
.o_calib_start (db_start),
|
||||||
|
.o_calib_stop (db_stop),
|
||||||
|
.i_clk (i_clk),
|
||||||
|
// .i_delay (i_calib_delay),
|
||||||
|
.i_delay (cal_delay),
|
||||||
|
.i_start_btn (aa),
|
||||||
|
.i_resetN (i_resetN)
|
||||||
|
);
|
||||||
|
// always @(posedge clk_100MHz) begin
|
||||||
|
// db_start <= ~i_startN;
|
||||||
|
// db_stop <= ~i_stopN;
|
||||||
|
// end
|
||||||
`ifdef DEBOUNCE
|
`ifdef DEBOUNCE
|
||||||
debounce db1 (
|
debounce db1 (
|
||||||
// Outputs
|
// Outputs
|
||||||
|
|||||||
@@ -53,21 +53,14 @@ int main(int argc, char **argv) {
|
|||||||
const unsigned int db_clk_Hz = 10; // 10 ms -> 10 Hz
|
const unsigned int db_clk_Hz = 10; // 10 ms -> 10 Hz
|
||||||
const unsigned int db_ticks = main_clk_Hz / db_clk_Hz;
|
const unsigned int db_ticks = main_clk_Hz / db_clk_Hz;
|
||||||
|
|
||||||
|
// tb->i_calib_delay = 20;
|
||||||
// start pulse
|
// start pulse
|
||||||
|
|
||||||
tb->i_startN = 0;
|
tb->i_startN = 0;
|
||||||
tick(++tickcount, tb, tfp);
|
tick(++tickcount, tb, tfp);
|
||||||
tb->i_startN = 1;
|
tb->i_startN = 1;
|
||||||
|
|
||||||
for (int k = 0; k < 394; k++)
|
// for (int k = 0; k < tb->i_calib_delay + 10; k++)
|
||||||
tick(++tickcount, tb, tfp);
|
tick(++tickcount, tb, tfp);
|
||||||
for (int k = 0; k < (1<<17); k++)
|
|
||||||
tick(++tickcount, tb, tfp);
|
|
||||||
|
|
||||||
// stop pulse
|
|
||||||
tb->i_stopN = 0;
|
|
||||||
tick(++tickcount, tb, tfp);
|
|
||||||
tb->i_stopN = 1;
|
|
||||||
|
|
||||||
for (int k = 0; k < (1<<16); k++)
|
for (int k = 0; k < (1<<16); k++)
|
||||||
tick(++tickcount, tb, tfp);
|
tick(++tickcount, tb, tfp);
|
||||||
|
|||||||
Reference in New Issue
Block a user