GENLIB parser

The header <lorina/genlib.hpp> implements methods to parse the GENLIB format.

The class lorina::genlib_reader provides the following public member functions.

Function

Description

on_gate(name, expression, area, pins, output_pin)

Callback method for parsed gate definition

The following reader functions are available.

Function
Description

read_genlib

Reader function for the GENLIB format.

read_genlib

Reader function for the GENLIB format.
inline return_code lorina::read_genlib(std::istream &in, const genlib_reader &reader, diagnostic_engine *diag = nullptr)

Reader function for the GENLIB format.

Reads GENLIB format from a stream and invokes a callback method for each parsed primitive and each detected parse error.

Parameters
  • in – Input stream

  • reader – GENLIB reader with callback methods invoked for parsed primitives

  • diag – An optional diagnostic engine with callback methods for parse errors

Returns

Success if parsing has been successful, or parse error if parsing has failed

inline return_code lorina::read_genlib(const std::string &filename, const genlib_reader &reader, diagnostic_engine *diag = nullptr)

Reader function for the GENLIB format.

Reads GENLIB format from a file and invokes a callback method for each parsed primitive and each detected parse error.

Parameters
  • filename – Name of the file

  • reader – GENLIB reader with callback methods invoked for parsed primitives

  • diag – An optional diagnostic engine with callback methods for parse errors

Returns

Success if parsing has been successful, or parse error if parsing has failed