Skip to content

Commit

Permalink
added external testbench
Browse files Browse the repository at this point in the history
  • Loading branch information
faramire committed Apr 18, 2024
1 parent cc84425 commit a6597e3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stopwatch_top.v
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ module counter_chain (
wire min_0X_ena;
wire min_X0_ena;

wire max; // just something to connect the unused max pin of the last counter to something

counter10 inst_ces_0X ( // counts first digit centiseconds
.clk (clk), // clock in
.ena (ena), // enable
Expand Down Expand Up @@ -257,7 +259,7 @@ module counter_chain (
.clk (clk),
.ena (ena & ces_X0_ena & sec_0X_ena & sec_X0_ena & min_0X_ena & min_X0_ena),
.res (res),
.max (),
.max (max),
.cnt (min_X0)
);

Expand Down
34 changes: 34 additions & 0 deletions test/tb_8bitworkshop.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2024 Fabio Ramirez Stern
* SPDX-License-Identifier: Apache-2.0
*/

`define default_netname none
`include "tt_um_faramire_stopwatch.v"
module stopwatch (
input wire clk,
input wire reset_board,
input wire button_start_stop,
input wire button_lap_time,
input wire button_reset,

output wire mosi,
output wire cs,
output wire sck,
output wire stopwatch_enabled,
output wire display_enabled
);

reg [7:0] sink1;

tt_um_faramire_stopwatch stopwatch1 (
.ui_in({5'b0, button_reset, button_lap_time, button_start_stop}),
.uo_out({3'b0, display_enabled, stopwatch_enabled, sck, cs, mosi}),
.uio_in(8'b0),
.uio_out(sink1),
.uio_oe(sink1),
.ena(1),
.clk(clk),
.rst_n(reset_board)
);
endmodule

0 comments on commit a6597e3

Please sign in to comment.