Skip to content

Bug: RecursionError while parsing AIG file #2

@pganguli

Description

@pganguli

When the following example code is run with the attached 6s128.aig circuit from the HWMCC'17 dataset,

https://github.com/Ironprop-Stone/python-deepgate/blob/cc91c1f7f9844aabf5d1a4f80b0ca0c5579a97ee/examples/feature_extract.py#L1-L23

the following error is encountered:

deepgate2 $ python feature_extract.py
[INFO] Create and load pretrained DeepGate
[INFO] Parse AIG:  ./6s128.aig
Traceback (most recent call last):
  File "/python-deepgate/examples/feature_extract.py", line 16, in <module>
    graph = parser.read_aiger(aig_path) # Parse AIG into Graph
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python-deepgate/test/lib64/python3.11/site-packages/deepgate/parser.py", line 121, in read_aiger
    x_data, edge_index = aig_to_xdata(aig_path)
                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/python-deepgate/test/lib64/python3.11/site-packages/deepgate/utils/aiger_utils.py", line 288, in aig_to_xdata
    f = str(aiger.BoolExpr(aig))
        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<attrs generated repr aiger.expr.BoolExpr>", line 13, in __repr__
  File "/python-deepgate/test/lib64/python3.11/site-packages/aiger/aig.py", line 112, in __repr__
    return writer.dump(self)
           ^^^^^^^^^^^^^^^^^
  File "/python-deepgate/test/lib64/python3.11/site-packages/aiger/writer.py", line 89, in dump
    omap, lmap = circ(inputs=inputs, latches=latches, lift=lift)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python-deepgate/test/lib64/python3.11/site-packages/aiger/aig.py", line 192, in __call__
    boundary = set(self.node_map.values()) | set(latch_map.values())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  [Previous line repeated 481 more times]
  File "<attrs generated hash aiger.aig.Inverter>", line 2, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  [Previous line repeated 1 more time]
  File "<attrs generated hash aiger.aig.Inverter>", line 2, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  File "<attrs generated hash aiger.aig.Inverter>", line 2, in __hash__
  File "<attrs generated hash aiger.aig.AndGate>", line 3, in __hash__
  File "<attrs generated hash aiger.aig.Inverter>", line 2, in __hash__
  File "<attrs generated hash aiger.aig.Input>", line 2, in __hash__
RecursionError: maximum recursion depth exceeded while calling a Python object

The following is the result of abc:print_stats on the same circuit; note that the circuit only has 1 output, and 0 latches:

6s128                         : i/o =  512/    1  lat =    0  and = 314879  lev =14405

6s128.aig.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions