Toolchain / 18 of 21
The submission boundary
The Tiny Tapeout wrapper, the pin budget, the `info.yaml`, and a memory on a foundry macro.
Builds on The process
A Tiny Tapeout submission is not a Verilog file. It is a directory: a top module with a fixed port list, an info.yaml describing the pinout, and a documentation page. The port list is fixed because the pads are cut before the design is written, and the module name is fixed by convention because the shuttle documentation indexes the die by it.
Getting any of that wrong is the most common submission failure, and it is a *mechanical* failure: not a design bug, not a timing bug, a shape mismatch. This crate is the generator that makes the shape impossible to get wrong by hand.
Step by step
- 01
Map the design's ports onto the die's pads
A pin map names the core module's ports, and the pin budget is checked when the map is built. The die has eight dedicated inputs, eight dedicated outputs and eight bidirectional pins; the clock, the reset and the power enable are the die's, not the design's. A design that wants twenty-five user pins does not fit, and the error says so by name rather than at the end.
Code sampleuse ferrite_lithic_chip::PinMap; let pins = PinMap::builder() .input("rx", "rx") .output("tx", "tx") .bidirectional("scl", "scl_in", "scl_out", "scl_oe") .build()?; - 02
Generate the wrapper
tt_um_<user>_<project>, with the die's exact port list. The name is legalised, because a GitHub user name may contain a hyphen and a Verilog identifier may not — and telling the submitter to pick a different account name would be worse than rewriting one character.Code sampleuse ferrite_lithic_chip::{top_module_name, wrapper}; let text = wrapper(&chip, &core, &pins)?; assert!(text.contains("module tt_um_ostrium_labs_ferrite (")); assert!(text.contains("input wire [7:0] uio_oe,")); - 03
Let the wrapper do the three things the design must not
It inverts the die's active-low reset into the DSL's active-high synchronous one, so the design is written in one polarity. It ties off every pad the design does not use, because an undriven output pad is an
xin simulation and a warning in every tool downstream. And it turns a bidirectional pad into the three signals a pad really is.Code sample// The reset inversion, at the boundary. assert!(text.contains("wire reset = ~rst_n;")); // The unused pads, tied off. assert!(text.contains("assign uo_out[7] = 1'b0;")); // A bidirectional pad: read, drive, and whether to drive. assert!(text.contains(".scl_in (uio_in[0])")); assert!(text.contains(".scl_out (uio_out[0])")); assert!(text.contains(".scl_oe (uio_oe[0])")); - 04
Build a memory on the macro, with the details in one place
A_DLYmust be tied high — the foundry's own model stops the simulation otherwise, with an error rather than a warning. The eightA_BIST_*pins have to be tied off. A single-port macro has one address and a design wants two, so the two are muxed. And the read is synchronous, so the memory carries a read latency that both backends honour.Code sampleuse ferrite_lithic_chip::sram::{MacroPorts, macro_memory}; use ferrite_lithic_pdk::Pdk; let memory = macro_memory( &design, Pdk::IhpCmos5l, 1024, 8, MacroPorts { write_data: &wdata, write_address: &waddr, write_enable: &wen, read_address: &raddr, read_enable: &ren, clock: &clk, master_enable: &master, }, )?; - 05
Write the whole submission
src/project.v,src/core.v,info.yamlanddocs/info.md, in the layout the Tiny Tapeout template uses. Theinfo.yamlcarries the tile count, the top module name, the source files and the pinout — and the pinout names are the design's, not the port names, because the pinout is what the datasheet is generated from.Code sampleuse ferrite_lithic_chip::{project, write_project}; let files = project(&chip, &core, &pins, &["project.v", "core.v"])?; write_project(std::path::Path::new("./tt-submission"), &files)?;
What bites
A pad is one bit
A pin names a one-bit core port, and a wide port is refused rather than truncated. A design that wants an eight-bit bus across
ui_in[7:0]declares eight pins, or declares one eight-bit core port and unpacks it itself.The output enable is not decoration
It is how a pin becomes an input or an output at run time, which is the whole reason a protocol emulator has bidirectional pins at all: an I2C master has to release the clock line and let the slave pull it low, and only a tri-state pad can do that.
The port names in the map are the core's, and they are legalised
The wrapper connects the identifiers the emitter actually wrote, so a core port called
signedis emitted assigned_and connected assigned_rather than as a name the emitter never wrote.
Notes
- decision
The pin budget is twenty-four user pins, not twenty-six
Twenty-six is the die's total: twenty-four user pins plus the clock, the reset and the power enable. A design that wants twenty-five user pins does not fit.
- trap
A synchronous memory read holds; an array read drives zero
A disabled synchronous read keeps the last value it captured, because a macro's output register holds. A disabled array read drives zero, because an array read is combinational and has no previous value.
Op::ReadPortgrew aholdflag for exactly this, and it is observable. - gap
The tri-state lives in the wrapper, not in the IR
The IR has no
inoutand no open-drain. That is fine for a pad and not fine for I2C's open-drain clock line *inside* the design, which is a real gap for the protocol engine and a different gap from the pad.