# aigverse.io

Provides file import and export functions for logic networks.

The module contains readers and writers for common file formats in the domain.

## Module Contents

### read_aiger_into_aig(filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [NamedAig](../networks/index.html.md#aigverse.networks.NamedAig)

Reads a binary AIGER file into a logic network.

* **Parameters:**
  **filename** – Path to the AIGER file.
* **Returns:**
  The parsed network instance.
* **Raises:**
  [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError) – If parsing the AIGER file fails, or if the file has latches, which this
  network type cannot represent. Read a sequential design with read_aiger_into_sequential_aig
  or read_ascii_aiger_into_sequential_aig instead.

### read_ascii_aiger_into_aig(filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [NamedAig](../networks/index.html.md#aigverse.networks.NamedAig)

Reads an ASCII AIGER file into a logic network.

* **Parameters:**
  **filename** – Path to the ASCII AIGER file.
* **Returns:**
  The parsed network instance.
* **Raises:**
  [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError) – If parsing the ASCII AIGER file fails, or if the file has latches, which this
  network type cannot represent. Read a sequential design with read_aiger_into_sequential_aig
  or read_ascii_aiger_into_sequential_aig instead.

### read_aiger_into_sequential_aig(filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [SequentialAig](../networks/index.html.md#aigverse.networks.SequentialAig)

Reads a binary AIGER file into a logic network.

* **Parameters:**
  **filename** – Path to the AIGER file.
* **Returns:**
  The parsed network instance.
* **Raises:**
  [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError) – If parsing the AIGER file fails.

### read_ascii_aiger_into_sequential_aig(filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [SequentialAig](../networks/index.html.md#aigverse.networks.SequentialAig)

Reads an ASCII AIGER file into a logic network.

* **Parameters:**
  **filename** – Path to the ASCII AIGER file.
* **Returns:**
  The parsed network instance.
* **Raises:**
  [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError) – If parsing the ASCII AIGER file fails.

### write_aiger(ntk: [SequentialAig](../networks/index.html.md#aigverse.networks.SequentialAig), filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [None](https://docs.python.org/3/builtins/constants.html#None)

### write_aiger(ntk: [NamedAig](../networks/index.html.md#aigverse.networks.NamedAig), filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [None](https://docs.python.org/3/builtins/constants.html#None)

### write_aiger(ntk: [Aig](../networks/index.html.md#aigverse.networks.Aig), filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Writes a logic network to a binary AIGER file.

* **Parameters:**
  * **ntk** – The network to serialize.
  * **filename** – Destination path for the AIGER file.

### read_pla_into_aig(filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [Aig](../networks/index.html.md#aigverse.networks.Aig)

Reads a PLA file into a logic network.

* **Parameters:**
  **filename** – Path to the PLA file.
* **Returns:**
  The parsed network instance.
* **Raises:**
  [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError) – If parsing the PLA file fails.

### read_verilog_into_aig(filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [NamedAig](../networks/index.html.md#aigverse.networks.NamedAig)

Reads a synthesized gate-level Verilog netlist into a logic network.

* **Parameters:**
  **filename** – Path to the Verilog file.
* **Returns:**
  The parsed network instance.
* **Raises:**
  [**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError) – If parsing the Verilog file fails.

### write_verilog(ntk: [Aig](../networks/index.html.md#aigverse.networks.Aig), filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Writes a logic network to a Verilog netlist.

* **Parameters:**
  * **ntk** – The network to serialize.
  * **filename** – Destination path for the Verilog file.

### write_dot(ntk: [Aig](../networks/index.html.md#aigverse.networks.Aig), filename: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)) → [None](https://docs.python.org/3/builtins/constants.html#None)

Writes a logic network to a Graphviz DOT file for visualization.

* **Parameters:**
  * **ntk** – The network to serialize.
  * **filename** – Destination path for the DOT file.
