inire/README.md

3.3 KiB

inire: Auto-Routing for Photonic and RF Integrated Circuits

inire is a high-performance auto-router designed specifically for the physical constraints of photonic and RF integrated circuits. It uses a Hybrid State-Lattice A* search combined with negotiated congestion to route multiple nets while maintaining strict geometric fidelity and clearance.

Key Features

  • Hybrid State-Lattice Search: Routes using discrete 90° bends and parametric S-bends, ensuring manufacturing-stable paths.
  • Negotiated Congestion: Iteratively resolves multi-net bottlenecks by inflating costs in high-traffic regions.
  • Analytic Correctness: Every move is verified against an R-Tree spatial index of obstacles and other paths.
  • 1nm Precision: All coordinates and ports are snapped to a 1nm manufacturing grid.
  • Safety & Proximity: Incorporates a "Danger Map" (pre-computed distance transform) to maintain optimal spacing and reduce crosstalk.
  • Locked Routes: Supports treating prior routed nets as fixed obstacles in later runs.

Installation

inire requires Python 3.11+. You can install the dependencies using uv (recommended) or pip:

# Using uv
uv sync

# Using pip
pip install numpy scipy shapely rtree matplotlib

Quick Start

from inire import NetSpec, ObjectiveWeights, Port, RoutingOptions, RoutingProblem, SearchOptions, route

problem = RoutingProblem(
    bounds=(0, 0, 1000, 1000),
    nets=(
        NetSpec("net1", Port(0, 0, 0), Port(100, 50, 0), width=2.0),
    ),
)
options = RoutingOptions(
    search=SearchOptions(
        bend_radii=(50.0, 100.0),
        greedy_h_weight=1.2,
    ),
    objective=ObjectiveWeights(
        bend_penalty=10.0,
    ),
)

run = route(problem, options=options)

if run.results_by_net["net1"].is_valid:
    print("Successfully routed net1!")

For incremental workflows, feed prior routed results back into a new RoutingProblem via locked_routes using RoutingResult.as_locked_route().

Usage Examples

For detailed visual demonstrations and architectural deep-dives, see the Examples README.

Check the examples/ directory for ready-to-run scripts. To run an example:

python3 examples/01_simple_route.py

Documentation

Full documentation for all user-tunable parameters, cost functions, and collision models can be found in DOCS.md.

Architecture

inire operates on a State-Lattice defined by (x, y, \theta). From any state, the router expands via three primary "Move" types:

  1. Straights: Variable-length segments.
  2. 90° Bends: Fixed-radius PDK cells.
  3. Parametric S-Bends: Procedural arcs for bridging small lateral offsets (O < 2R).

For multi-net problems, the negotiated-congestion loop handles rip-up and reroute logic, ensuring that paths find the globally optimal configuration without crossings.

Configuration

inire is highly tunable. The public API is RoutingProblem plus RoutingOptions, routed via route(problem, options=...). Search internals remain available only for internal tests and development work; they are not a supported integration surface. See DOCS.md for a full parameter reference.

License

This project is licensed under the GNU Affero General Public License v3. See LICENSE.md for details.