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)[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.

Parameters:

config (librelane.config.config.Config)

Return type:

dict[str, dict[str, tuple[Decimal, Decimal]]]

get_offset(config)[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).

Parameters:

config (librelane.config.config.Config)

Return type:

tuple[Decimal, Decimal]

get_pitch(config)[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).

Parameters:

config (librelane.config.config.Config)

Return type:

tuple[Decimal, Decimal]

get_routing_obstructions(config)[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.

Return type:

list[tuple[str, Decimal, Decimal, Decimal, Decimal]]

Raises:

ValueError – If the entry is not a valid obstruction.

round_die_area(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.

Parameters:

config (librelane.config.config.Config)

Return type:

librelane.config.config.Config

round_up_decimal(value, pitch)[source]

Round up value to the next multiple of pitch.

Parameters:
Return type:

Decimal