BLIF parser

The header <lorina/blif.hpp> implements methods to parse the BLIF format.

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

Function Description
on_model(model_name) Callback method for parsed model
on_input(name) Callback method for parsed input
on_gate(inputs, output, cover) Callback method for parsed gate
on_end() Callback method for parsed end
on_comment(comment) Callback method for parsed comment

The following reader functions are available.

Function
Description
read_blif
Reader function for the BLIF format.
read_blif
Reader function for BLIF format.
return_code lorina::read_blif(std::istream &in, const blif_reader &reader, diagnostic_engine *diag = nullptr)

Reader function for the BLIF format.

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

Return
Success if parsing have been successful, or parse error if parsing have failed
Parameters
  • in: Input stream
  • reader: A BLIF reader with callback methods invoked for parsed primitives
  • diag: An optional diagnostic engine with callback methods for parse errors

return_code lorina::read_blif(const std::string &filename, const blif_reader &reader, diagnostic_engine *diag = nullptr)

Reader function for BLIF format.

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

Return
Success if parsing have been successful, or parse error if parsing have failed
Parameters
  • filename: Name of the file
  • reader: A BLIF reader with callback methods invoked for parsed primitives
  • diag: An optional diagnostic engine with callback methods for parse errors