Python bindings for CoreIR, an intermediate representation for hardware. This library provides a programmatic interface to build, manipulate, and analyze hardware circuits using Python. Currently at version 2.0.156, it maintains an active development pace with frequent updates, primarily leveraging a Rust-based CoreIR backend.
pip install coreirVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize a CoreIR context, define a module's interface, create a module definition, add an instance of a built-in generator (an adder), and connect the ports, resulting in a simple 16-bit adder module.
Ensure a clean environment and reinstall with `pip install coreir`. Refactor code to use the latest API, consulting `pycoreir.readthedocs.io`.
Always use `pip install coreir` for installation and `import coreir` in your Python code.
Always define types within the CoreIR context using its provided methods (e.g., `context.Bit()`, `context.Array()`, `context.Record()`).
Ensure `context = coreir.Context()` is called once at the start of your program or function that interacts with CoreIR, and that the `context` object remains in scope for all subsequent CoreIR operations.
Change the import statement to `import coreir`. Ensure the package is installed via `pip install coreir`.
Use CoreIR context methods to define all types for ports and instances, e.g., `context.Bit()`, `context.BitIn().Arr(width)`, `context.Record(...)`.
Reinstall `coreir` in a fresh virtual environment (`pip install coreir --force-reinstall`). If the issue persists, verify system PATH and library search paths for the CoreIR shared library (e.g., `.so`, `.dll`, `.dylib`).
Consult the latest CoreIR Python documentation (available at `pycoreir.readthedocs.io`) to update your code to the current API methods and parameter conventions.
No dependency data recorded yet.