memea::lef

Function read_lef

Source
fn read_lef(
    lefin: PathBuf,
    gdsin: Option<PathBuf>,
    dbout: PathBuf,
    verbose: bool,
) -> Result<(), MemeaError>
Expand description

Reads and processes a LEF file to create a component database.

This function parses a LEF file line by line, extracting MACRO names and SIZE information to build component dimensions. If a GDS file is provided, it augments the dimensions with enclosure data computed from the layout geometry.

§Arguments

  • lefin - Path to the input LEF file
  • gdsin - Optional path to GDS file for enclosure computation
  • dbout - Path where the output database should be saved
  • verbose - Whether to show detailed processing information

§Returns

  • Ok(()) - LEF file processed and database saved successfully
  • Err(MemeaError) - File I/O error, parsing error, or database save error

§LEF File Format

The function expects LEF files with MACRO definitions containing SIZE lines:

MACRO cell_name
  SIZE width BY height ;
END cell_name