/tt06-analog-current-comparator

Current Comparator with currents formed by digital input pins for Tiny Tapeout.

Primary LanguageTclApache License 2.0Apache-2.0

Current comparator building block for analog neuron

Digital inputs are used to shape a pair of Excitatory and Inhibitory currents. Resulting currents are summed via current mirrors and passed into current comparator that applies sigmoid non-linearity. In other words, if Excitatory current is larger than Inhibitory the ASIC will produce 1.8 Volt signal and 0 Volt otherwise.

The ASIC is fabricated with Tiny Tapeout 06 and Skywater 130 nm process.

Simulation results

Setup

  • Setup python venv (for example name it .sky130 with python3 -m venv .sky130)
  • Activate python venv (source .sky130/bin/activate)
  • Install volare (pip3 install volare)
  • Install specific PDK version using volare (volare enable --pdk sky130 3af133706e554a740cfe60f21e773d9eaa41838c)
  • Add PDK_ROOT environment variable (add export PDK_ROOT=$(volare path) at the end of .sky130/bin/activate configuration file)
  • Install magic, ngspice, netgen, xschem
  • Download tt_block_1x2_pg_ana.def from https://raw.githubusercontent.com/TinyTapeout/tt-support-tools/tt06/def/analog/tt_block_1x2_pg_ana.def
  • Download tt-analog-draw.tcl from ...
  • Create project and TT06 scaffolding magic -rcfile $PDK_ROOT/sky130A/libs.tech/magic/sky130A.magicrc -noconsole -dnull mag/tt-analog-draw.tcl mag/current_cmp.mag

NOTE: don't forget to activate python venv every time after reboot / restart (source .sky130/bin/activate).

  • Open design magic -rcfile $PDK_ROOT/sky130A/libs.tech/magic/sky130A.magicrc mag/current_cmp.mag

Useful Magic info

Commands

  • what
  • show dimensions of the selected node (the same as b key)
  • copy right 300 copies the selected node by 300um right

Tutorials

  • Example Matt's DAC: https://github.com/mattvenn/tt06-analog-r2r-dac
  • Also Matt's old inverter: https://github.com/mattvenn/magic-inverter
  • Official tutorial
  • Cheatsheet
  • A Step-by-Step Example: Layout of a CMOS Inverter Using SkyWater 130nm Process
    • grid 0.05u 0.05u and snap lambda
    • :paint poly Polysilicon (w:0.15, h:>22.0)
    • :paint pdiff P-diffusion (h:1.0)
    • :paint nwell (h:~20.0)
    • :paint ndiff N-diffusion (h:0.42) PMOS = NMOS x 2.38
    • :paint ndc, :paint pdc contacts between N-diffusion / P-diffusion and local metal interconnect. Diffusion underneath must be larger than contacts (w:0.2).
    • :paint pc contacts between Polysilicon and local metal interconnect (w:0.2 h:0.2).
    • :paint li local metal interconnect, goes over polysilicon, but below metal1. Local interconnect must be larger (±w:0.1) in vertical dimension than contacts to diffusion and (±h:0.1) in horizontal than polysilicon contacts below. Power rails must be twice the size local interonnect lines (h:0.4)
    • :paint nsd N-substrate tap (w:0.5 h:0.2)
    • :paint nsc VPWR power rail contact (w:0.2 h:0.2) to N-substrate tap.
    • :paint psd, :paint psc VGND ground to P-subtrate, tap (w:0.5 h:0.2)
    • :label A temporarily label input & output for early extraction

Draw an Owl

Scaffolding

  • All connections (pins) including power, ground, digital and analog outputs are metal4.
  • Digital input/outputs are on the top from left to right: uio_oe[7..0], uio_out[..], uo_out[..], uio_in[..], ui_in[..], rst_n, clk, ena
  • VPWR is the leftmost, VGND is roughly below and between uio_out[3] and uio_out[2]
  • Analog pins are at the bottom from left to right: ua[7..0]
  • sky 130 https://skywater-pdk.readthedocs.io/en/main/rules/assumptions.html

Plan

  • All unused pins must be tied to VGND
  • Route VPWR to metal3 via via3
  • To connect to li from metal4 need: via3, metal3, via2, metal2, via1, metal1, viali

Layers that can be used in TinyTapeout06 analog designs:

Other Useful Links

Tiny Tapeout Analog Project Template

What is Tiny Tapeout?

TinyTapeout is an educational project that aims to make it easier and cheaper than ever to get your digital designs manufactured on a real chip.

To learn more and get started, visit https://tinytapeout.com.

Analog projects

For specifications and instructions, see the analog specs page.

Note: Analog designs are currently in beta. There's a small chance that the changes will change before the deadline for Tiny Tapeout 6, or that we will have to postpone the analog design support to a future shuttle. If you have any questions, please join the Tiny Tapeout Discord and ask in the #analog channel.

Enable GitHub actions to build the results page

Resources

What next?