leonardt / pycoreir

Python bindings for coreir
BSD 3-Clause "New" or "Revised" License
10 stars 6 forks source link

Loading module without definition and using autocomplete in terminal crashes #33

Closed David-Durst closed 6 years ago

David-Durst commented 6 years ago

Loading a CoreIR c++ module and trying to do autocomplete on it in the terminal when it doesn't have a definition causes the below crash. (Note that this code depends on the import_generator function in this pull request https://github.com/leonardt/pycoreir/pull/32)

>>> from coreir.context import *
>>> from magma.backend.coreir_ import CoreIRBackend
>>> from magma import *
>>> c = Context()
>>> cirb = CoreIRBackend(c)
>>> dehydrate = cirb.context.import_generator("aetherlinglib", "dehydrate")(hydratedType = cirb.get_type(Array(3, Array(5, BitIn)), True))
>>> dehydrate.Assertion failed: (m->hasDef() && "Does not have def!"), function DirectedModule, file directedview.cpp, line 42.
Abort trap: 6
leonardt commented 6 years ago

Fixed in https://github.com/leonardt/pycoreir/commit/e369b4fe01586bd0e7546ee0f8044788b93432f5