Writing a circuit in Verilog and preparing it for fabrication are different tasks. A small counter is a useful first project because its behavior is easy to state, its outputs are easy to observe, and its corner cases expose several common verification mistakes.

Tiny Tapeout combines multiple designs in shared chip runs and supplies templates and tooling for submissions. This article develops the RTL and a standalone simulation first, then explains what still needs to be checked in the selected shuttle's flow. It is not a claim that the example has been fabricated.

Choose the Template Before the Tools

Begin with the template linked for the shuttle you intend to use. Processes, tile limits, workflows, and submission requirements vary. Do not assume that a command or physical-design result from one shuttle applies to another. The official FAQ specifically discusses the need to harden a project for the correct process.

For a concrete interface reference, the TT10 Verilog template exposes dedicated inputs and outputs, bidirectional IO controls, a clock, and an active-low reset. Follow the chosen template's pin directions and assign every output, including unused ones.

Specify a Four-Bit Counter

  • rst_n = 0 asynchronously clears the counter.
  • ui_in[1] = 1 clears it at the next rising clock edge.
  • Otherwise, ena && ui_in[0] enables counting.
  • The four-bit value wraps from 15 to 0 and appears on uo_out[3:0].
  • The upper outputs and unused bidirectional output controls stay zero.

Save the following as counter.v for the standalone simulation. When integrating it into a template, place it under the template's source directory and make its top-module name match the project configuration.

`default_nettype none
module tt_um_counter (
    input  wire [7:0] ui_in,
    output wire [7:0] uo_out,
    input  wire [7:0] uio_in,
    output wire [7:0] uio_out,
    output wire [7:0] uio_oe,
    input  wire       ena,
    input  wire       clk,
    input  wire       rst_n
);
    reg [3:0] count;

    always @(posedge clk or negedge rst_n) begin
        if (!rst_n)
            count <= 4'd0;
        else if (ui_in[1])
            count <= 4'd0;
        else if (ena && ui_in[0])
            count <= count + 4'd1;
    end

    assign uo_out = {4'b0, count};
    assign uio_out = 8'b0;
    assign uio_oe = 8'b0;
    wire _unused = &{uio_in, ui_in[7:2], 1'b0};
endmodule
`default_nettype wire

The asynchronous and synchronous reset conditions are separate branches. Keeping them distinct makes the timing contract explicit: changing ui_in[1] between clock edges does not immediately reset the counter. Also, omitting an else assignment inside this clocked block means the register holds its value; this is intentional state retention.

Make the Testbench Decide Whether It Passed

A waveform is useful for debugging, but a reproducible check needs expected values and a failure condition. This testbench checks reset, wraparound, the two enables, and unused outputs. Inputs normally change on falling edges, while results are checked just after rising edges, avoiding a race with the sequential update.

`timescale 1ns/1ps
module counter_tb;
    reg clk = 0;
    always #5 clk = ~clk;
    reg rst_n = 0;
    reg ena = 1;
    reg [7:0] ui_in = 0;
    wire [7:0] uo_out, uio_out, uio_oe;

    tt_um_counter dut (
        .ui_in(ui_in), .uo_out(uo_out), .uio_in(8'b0),
        .uio_out(uio_out), .uio_oe(uio_oe),
        .ena(ena), .clk(clk), .rst_n(rst_n)
    );

    task tick;
        begin @(posedge clk); #1; end
    endtask

    initial begin
        tick();
        if (uo_out !== 8'd0) $fatal(1, "initial reset");

        @(negedge clk); rst_n = 1; ui_in = 1;
        repeat (18) tick();
        if (uo_out !== 8'd2) $fatal(1, "count or wraparound");

        @(negedge clk); ui_in = 0;
        repeat (3) tick();
        if (uo_out !== 8'd2) $fatal(1, "disabled counter changed");

        @(negedge clk); ui_in = 3;
        tick();
        if (uo_out !== 8'd0) $fatal(1, "synchronous reset");

        @(negedge clk); ui_in = 1; ena = 0;
        repeat (3) tick();
        if (uo_out !== 8'd0) $fatal(1, "ena should hold the count");

        @(negedge clk); ena = 1;
        tick();
        if (uo_out !== 8'd1) $fatal(1, "resume count");

        @(negedge clk); #2 rst_n = 0; #1;
        if (uo_out !== 8'd0) $fatal(1, "asynchronous reset");
        if (uio_out !== 0 || uio_oe !== 0) $fatal(1, "unused IO");
        $display("PASS: counter behavior and unused outputs");
        $finish;
    end

    initial begin
        #1000;
        $fatal(1, "simulation timeout");
    end
endmodule

With Icarus Verilog installed, save the testbench as counter_tb.v beside the module and run:

iverilog -g2012 -s counter_tb -o counter_tb counter.v counter_tb.v
vvp counter_tb

The successful run prints PASS: counter behavior and unused outputs. The timeout also fails the simulation if progress stops. These local commands test this self-contained example; they do not replace the template's own test workflow.

Integrate, Then Harden

In the TT10 template, the project information includes a top-module name and source-file list; the test Makefile also identifies the sources. Update these consistently, fill in the pin descriptions, and preserve the rest of the template's required metadata. The template configuration is the reference rather than a partial configuration copied from an unrelated project.

Run the selected template's simulation and automated physical-design workflows. Review the reports, not just the existence of a layout preview: check for unexpected latches, unconnected outputs, timing problems, area overflow, and physical verification failures. A picture of a GDS layout cannot establish that the logic or timing is correct.

Prepare the Board-Level Test Too

Before submission, write down how each signal will be driven and observed on the eventual board. A fast counter may be invisible to the eye on LEDs; plan a suitable external clock, capture method, or divided observable signal. Keep asynchronous external controls separate from assumptions about synchronous inputs in the RTL.

Finally, follow the selected shuttle's submission instructions and record the exact source revision and build associated with the submission. Simulation, physical implementation, fabrication, and board validation are separate milestones. Keeping evidence for each one makes a small design much easier to explain and reproduce.

References and Further Reading

  1. Tiny Tapeout: Official getting-started links and submission templates
  2. Tiny Tapeout: Frequently Asked Questions
  3. TinyTapeout: TT10 Verilog template and test workflow
  4. TinyTapeout: TT10 project configuration