use only top bits of the data to display

This commit is contained in:
2020-10-26 22:45:17 -05:00
parent 124d1fff63
commit 92f059ab54
2 changed files with 12 additions and 6 deletions

View File

@@ -14,9 +14,12 @@ module top #(parameter WIDTH=24)(
wire clk_100MHz;
reg buf_led = 0;
wire buf_ready;
wire [5:0] buf_data;
/* verilator lint_off UNUSED */
parameter TDC_COUNTER_WIDTH = 28;
wire [TDC_COUNTER_WIDTH-1:0] buf_data;
assign o_readyN = ~buf_ready;
assign o_dataN = ~buf_data;
assign o_dataN = ~buf_data[TDC_COUNTER_WIDTH-1:TDC_COUNTER_WIDTH-6];
/* verilator lint_on UNUSED */
/* verilator lint_off PINMISSING */
clk_gen #(.DIVISION(26)) clk_gen0 (
@@ -25,7 +28,7 @@ module top #(parameter WIDTH=24)(
.i_clk (i_clk));
/* verilator lint_on PINMISSING */
tdc #(.COUNTER_WIDTH(6)) tdc0 (
tdc #(.COUNTER_WIDTH(TDC_COUNTER_WIDTH)) tdc0 (
// Outputs
.o_ready (buf_ready),
.o_data (buf_data),

View File

@@ -46,9 +46,12 @@ int main(int argc, char **argv) {
for (int k = 0; k < 3; k++)
tick(++tickcount, tb, tfp);
tb->i_startN = 0;
tick(++tickcount, tb, tfp);
tb->i_startN = 1;
for (int i = 0; i < 1000; i++) {
tb->i_startN = 0;
tick(++tickcount, tb, tfp);
tb->i_startN = 1;
tick(++tickcount, tb, tfp);
}
for (int k = 0; k < 15; k++)
tick(++tickcount, tb, tfp);