helper

Helper utilities for GDS generation: die area rounding and pitch parsing.

This module exposes utilities used by the GDS generator flows.

Functions

get_layer_info(config)

Read the FP_TRACKS_INFO file and return layer information.

get_offset(config)

Read the FP_TRACKS_INFO file and return track offsets for X and Y.

get_pitch(config)

Read the FP_TRACKS_INFO file and return min pitches for X and Y.

get_routing_obstructions(config)

Get the routing obstructions from the config.

round_die_area(config)

Round the DIE_AREA to multiples of the minimum pitch.

round_up_decimal(value, pitch)

Round up value to the next multiple of pitch.

Module Contents

get_layer_info(config) dict[str, dict[str, tuple[Decimal, Decimal]]][source]

Read the FP_TRACKS_INFO file and return layer information.

Returns a dictionary mapping layer names to their cardinal directions and corresponding (offset, pitch) tuples.

get_offset(config) tuple[Decimal, Decimal][source]

Read the FP_TRACKS_INFO file and return track offsets for X and Y.

Returns a tuple (x_offset, y_offset) where x_offset is the track offset along X-axis (IO_PIN_V_LAYER X direction) and y_offset is the track offset along Y-axis (IO_PIN_H_LAYER Y direction). The cardinal field in FP_TRACKS_INFO is expected to be ‘X’ or ‘Y’ (case-insensitive).

get_pitch(config) tuple[Decimal, Decimal][source]

Read the FP_TRACKS_INFO file and return min pitches for X and Y.

Returns a tuple (x_pitch, y_pitch) where x_pitch is the minimum pitch along X-axis (IO_PIN_V_LAYER X direction) and y_pitch is minimum pitch along Y-axis (IO_PIN_H_LAYER Y direction). The cardinal field in FP_TRACKS_INFO is expected to be ‘X’ or ‘Y’ (case-insensitive).

get_routing_obstructions(config) list[tuple[str, Decimal, Decimal, Decimal, Decimal]][source]

Get the routing obstructions from the config.

Returns a list of tuples (layer, x1, y1, x2, y2) representing the obstructions in the routing area.

Parameters:

config (Config) – The configuration object from liberlane.

Returns:

A list of obstruction tuples.

Raises:

ValueError – If the entry is not a valid obstruction.

round_die_area(config) librelane.config.config.Config[source]

Round the DIE_AREA to multiples of the minimum pitch.

This reads the minimum pitch from FP_TRACKS_INFO and updates the config DIE_AREA to start at (0,0) with width/height rounded up to the next multiple of that pitch.

round_up_decimal(value, pitch) Decimal[source]

Round up value to the next multiple of pitch.