Lambdalib

March 2, 2026 · View on GitHub

A Modular Hardware Abstraction Library for Portable ASIC Design

CI Tests Wheels PyPI Downloads GitHub stars GitHub issues License: MIT

Why Lambdalib?

Lambdalib is a modular hardware abstraction library which decouples design from the manufacturing target. The project was inspired by the Lambda concept invented during the 1978 VLSI revolution by Mead and Conway. Unfortunately, the elegant single value Lambda approach no longer applies to modern CMOS manufacturing. Lambdalib solves the scaling tech porting problem by raising the abstraction level to the cell/block level.

The Problem

  • Synchronizers, clock gating cells, and I/O pads are technology-specific
  • Memory compilers generate different interfaces per foundry
  • Analog blocks require complete redesign for each process
  • Design teams waste months re-implementing the same functionality

The Solution

Lambdalib provides technology-agnostic interfaces for all cells that can't be expressed in pure RTL:

  • Write your design once using Lambdalib cells
  • Target any supported technology through Lambdapdk
  • Automatic porting between process nodes
  • Proven in multiple production tapeouts

Key Features

FeatureBenefit
Technology IndependenceWrite once, fabricate anywhere
Complete Cell Library160+ cells covering all common needs
SiliconCompiler IntegrationSeamless ASIC build flow
Parameterizable CellsFlexible width, depth, and configuration
Production ProvenUsed in real tapeouts
Open SourceMIT licensed, free to use and modify

Architecture

Lambdalib is organized into specialized sub-libraries, each addressing a specific design domain:

lambdalib/
├── stdlib/     # Standard digital cells (97 cells)
├── auxlib/     # Special-purpose cells (22 cells)
├── ramlib/     # Memory modules (6 modules)
├── iolib/      # I/O pad cells (16 cells)
├── padring/    # Padring generator (3 modules)
├── veclib/     # Vectorized datapath (15 cells)
├── fpgalib/    # FPGA primitives (3 cells)
└── analoglib/  # Analog circuits (2 modules)

Integration with Lambdapdk

Lambdalib cells are implemented for the following open source technologies through Lambdapdk, which provides:

  • ASAP7
  • FreePDK45
  • IHP130
  • Skywater130
  • GF180MCU

Design Methodology

  1. One Verilog module per RTL file - Clean separation of concerns
  2. One Python class per cell - Encapsulates Verilog and metadata
  3. Consistent naming - RTL uses la_ prefix, Python removes it and capitalizes
  4. Technology abstraction - Generic interfaces, technology-specific implementations
  5. SiliconCompiler native - All cells are Design subclasses

Quick Start

Installation

git clone https://github.com/siliconcompiler/lambdalib
cd lambdalib
pip install -e .

Creating a Design with Lambdalib Cells

Lambdalib cells are SiliconCompiler Design subclasses. Create your own design and add Lambdalib cells as dependencies:

from siliconcompiler import Design
from lambdalib.padring import Padring
from lambdalib.stdlib import Inv, Dffq
from lambdalib.ramlib import Dpram

class MyChip(Design):
    def __init__(self):
        super().__init__('mychip')

        # Set up your design files
        self.set_topmodule('mychip', 'rtl')
        self.add_file('rtl/mychip.v', 'rtl')

        # Add Lambdalib cells as dependencies
        self.add_depfileset(Padring(), depfileset='rtl', fileset='rtl')
        self.add_depfileset(Inv(), depfileset='rtl', fileset='rtl')
        self.add_depfileset(Dffq(), depfileset='rtl', fileset='rtl')
        self.add_depfileset(Dpram(), depfileset='rtl', fileset='rtl')

Instantiating Cells in Verilog

In your Verilog RTL, instantiate Lambdalib cells using the la_ prefix:

module mychip (
    input  clk,
    input  d,
    output q
);

    // Instantiate a D flip-flop
    la_dffq u_dff (
        .clk(clk),
        .d(d),
        .q(q)
    );

    // Instantiate a dual-port RAM
    la_dpram #(.DW(32), .AW(10)) u_ram (
        .clk(clk),
        // ... port connections
    );

endmodule

Simulation

DISCLAIMER: Lambdalib is a reduced order abstraction library useful for fast technology agnostic RTL design and verifiation. For actual chip tapeouts, designers MUST run signoff quality simulations using target specific implementations of lambdalib and a fully featured four-state verilog simulator (ie. not Verilator).

if __name__ == "__main__":
    chip = MyChip()
    chip.write_fileset("mychip.f", fileset="rtl")
    # Run: iverilog -f mychip.f

Running Synthesis

Generate a fileset and run synthesis with yosys. (or ideally, you should use the free and open source SiliconCompiler, but you do you;-).

if __name__ == "__main__":
    chip = MyChip()
    chip.write_fileset("mychip.f", fileset="rtl")
    # Run: yosys -f mychip.f

Cell Library Reference

stdlib - Standard Cells (97 cells)

The foundation of digital logic design with optimized implementations for each target technology.

Logic Gates

CellDescriptionCellDescription
And22-input ANDNand22-input NAND
And33-input ANDNand33-input NAND
And44-input ANDNand44-input NAND
Or22-input ORNor22-input NOR
Or33-input ORNor33-input NOR
Or44-input ORNor44-input NOR
Xor22-input XORXnor22-input XNOR
Xor33-input XORXnor33-input XNOR
Xor44-input XORXnor44-input XNOR

Buffers and Inverters

CellDescription
BufNon-inverting buffer
InvInverter
DelayDelay element

Complex Logic (AOI/OAI)

CellDescriptionCellDescription
Ao21AND-OR (2-1)Aoi21AND-OR-Invert (2-1)
Ao211AND-OR (2-1-1)Aoi211AND-OR-Invert (2-1-1)
Ao22AND-OR (2-2)Aoi22AND-OR-Invert (2-2)
Ao221AND-OR (2-2-1)Aoi221AND-OR-Invert (2-2-1)
Ao222AND-OR (2-2-2)Aoi222AND-OR-Invert (2-2-2)
Ao31AND-OR (3-1)Aoi31AND-OR-Invert (3-1)
Ao311AND-OR (3-1-1)Aoi311AND-OR-Invert (3-1-1)
Ao32AND-OR (3-2)Aoi32AND-OR-Invert (3-2)
Ao33AND-OR (3-3)Aoi33AND-OR-Invert (3-3)
Oa21OR-AND (2-1)Oai21OR-AND-Invert (2-1)
Oa211OR-AND (2-1-1)Oai211OR-AND-Invert (2-1-1)
Oa22OR-AND (2-2)Oai22OR-AND-Invert (2-2)
Oa221OR-AND (2-2-1)Oai221OR-AND-Invert (2-2-1)
Oa222OR-AND (2-2-2)Oai222OR-AND-Invert (2-2-2)
Oa31OR-AND (3-1)Oai31OR-AND-Invert (3-1)
Oa311OR-AND (3-1-1)Oai311OR-AND-Invert (3-1-1)
Oa32OR-AND (3-2)Oai32OR-AND-Invert (3-2)
Oa33OR-AND (3-3)Oai33OR-AND-Invert (3-3)

Multiplexers

CellDescription
Mux22:1 multiplexer
Mux33:1 multiplexer
Mux44:1 multiplexer
Muxi22:1 inverting multiplexer
Muxi33:1 inverting multiplexer
Muxi44:1 inverting multiplexer
Dmux21:2 one-hot multiplexer
Dmux31:3 one-hot multiplexer
Dmux41:4 one-hot multiplexer
Dmux51:5 one-hot multiplexer
Dmux61:6 one-hot multiplexer
Dmux71:7 one-hot multiplexer
Dmux81:8 one-hot multiplexer

Flip-Flops and Latches

CellDescription
DffqD flip-flop (Q output)
DffqnD flip-flop (Q and QN outputs)
DffnqD flip-flop (negative edge)
DffrqD flip-flop with async reset
DffrqnD flip-flop with async reset (Q and QN)
DffsqD flip-flop with async set
DffsqnD flip-flop with async set (Q and QN)
SdffqScan D flip-flop
SdffqnScan D flip-flop (Q and QN)
SdffrqScan D flip-flop with reset
SdffrqnScan D flip-flop with reset (Q and QN)
SdffsqScan D flip-flop with set
SdffsqnScan D flip-flop with set (Q and QN)
LatqTransparent latch
LatnqTransparent latch (inverted enable)

Clock Tree Cells

CellDescription
ClkbufClock buffer (balanced rise/fall)
ClkinvClock inverter
Clkand2Clock AND gate
Clknand2Clock NAND gate
Clkor2Clock OR gate (2-input)
Clkor4Clock OR gate (4-input)
Clknor2Clock NOR gate
Clkxor2Clock XOR gate

Arithmetic

CellDescription
Csa323:2 carry-save adder
Csa424:2 carry-save adder

Tie Cells

CellDescription
TiehiTie to VDD
TieloTie to VSS

auxlib - Auxiliary Cells (22 cells)

Special-purpose standard cells for clock management, synchronization, and power control.

Synchronizers

CellDescription
DsyncDouble-stage synchronizer for CDC
RsyncReset synchronizer
DrsyncDouble reset synchronizer

Clock Management

CellDescription
Clkmux2Glitchless 2:1 clock multiplexer
Clkmux4Glitchless 4:1 clock multiplexer
ClkicgandIntegrated clock gate (AND-based)
ClkicgorIntegrated clock gate (OR-based)

I/O Buffers

CellDescription
IbufInput buffer
ObufOutput buffer
TbufTri-state buffer
IdiffDifferential input buffer
OdiffDifferential output buffer

DDR Cells

CellDescription
IddrInput DDR register
OddrOutput DDR register

Power Management

CellDescription
IsohiIsolation cell (output high)
IsoloIsolation cell (output low)
HeaderPower header switch
FooterPower footer switch
PwrbufPower distribution buffer

Physical Cells

CellDescription
AntennaAntenna diode for process protection
DecapDecoupling capacitor
KeeperState keeper cell

ramlib - Memory Modules (6 modules)

Parameterizable memory generators with consistent interfaces across technologies.

ModuleDescriptionKey Parameters
SpramSingle-port RAMwidth, depth
DpramDual-port RAMwidth, depth
TdpramTrue dual-port RAMwidth, depth
SpregfileSingle-port register filewidth, depth
SyncfifoSynchronous FIFOwidth, depth
AsyncfifoAsynchronous FIFO (CDC-safe)width, depth

iolib - I/O Cells (16 cells)

Complete I/O pad library for chip periphery.

Digital I/O

CellDescription
IobidirBidirectional I/O pad
IoinputInput-only pad
IoxtalCrystal oscillator pad
IorxdiffDifferential receiver (LVDS)
IotxdiffDifferential transmitter (LVDS)

Analog I/O

CellDescription
IoanalogAnalog pass-through with ESD

Power Pads

CellDescription
IovddCore power (VDD)
IovssCore ground (VSS)
IovddioI/O power (VDDIO)
IovssioI/O ground (VSSIO)
IovddaAnalog power (VDDA)
IovssaAnalog ground (VSSA)
IopocPower-on control
IocornerCorner cell
IoclampESD clamp
IocutPower ring cut

padring - Padring Generator (3 modules)

Automated padring generation with pure Verilog output.

ModuleDescription
PadringMain padring generator

Features:

  • Pure Verilog parameterizable generator
  • Support for all 4 sides (North/East/South/West)
  • Differential pair handling
  • Power section management
  • 40-bit per-cell configuration

veclib - Vectorized Cells (15 cells)

Bus-width scalable cells for efficient datapath design.

Vectorized Logic Gates

CellDescription
VbufVector buffer
VinvVector inverter
VmuxGeneral one-hot vector multiplexer
Vmux22:1 vector multiplexer
Vmux2b2:1 binary vector multiplexer
Vmux33:1 one-hot vector multiplexer
Vmux44:1 one-hot vector multiplexer
Vmux55:1 one-hot vector multiplexer
Vmux66:1 one-hot vector multiplexer
Vmux77:1 one-hot vector multiplexer
Vmux88:1 one-hot vector multiplexer

Vectorized Registers

CellDescription
VdffqVector D flip-flop
VdffnqVector D flip-flop (negative edge)
VlatqVector latch
VlatnqVector latch (inverted enable)

fpgalib - FPGA Primitives (3 cells)

Building blocks for FPGA architectures.

CellDescription
Lut44-input lookup table
Ble4p0Basic logic element
Clb4p0Configurable logic block (4 BLEs)

analoglib - Analog Circuits (2 modules)

Analog and mixed-signal building blocks.

ModuleDescription
PLLPhase-locked loop
RingRing oscillator

Contributing

We welcome contributions! Please see our GitHub Issues for tracking requests and bugs.

License

MIT License

Copyright (c) 2023 Zero ASIC Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.