Install & Compatibility
Where this runs
tested against v2.0.21 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 34.2s · import 1.704s · 405MB
563MB installed
● package 563MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
mantle
✓ import mantle
Standard import; used to access mantle primitives like mantle.Register, mantle.DefineCounter, etc.
Register
✓ from mantle import Register
✗ from mantle.coreir import Register
In earlier versions (pre-2.0), mantle was structured differently; direct import from mantle is the current pattern.
DefineCounter
✓ from mantle import DefineCounter
Commonly used for counter circuits.
Basic circuit using mantle primitives.
import magma
import mantle
# Define a simple circuit: incrementer using a register and adder
class Incrementer(magma.Circuit):
name = "Incrementer"
io = magma.IO(I=magma.In(magma.Bits[4]), O=magma.Out(magma.Bits[4]))
reg = mantle.Register(4, init=0)
adder = mantle.DefineAdd(4)
# Connect: reg_out -> adder b, I -> adder a, adder out -> reg in
magma.wire(reg.O, adder.b)
magma.wire(io.I, adder.a)
magma.wire(adder.out, reg.I)
magma.wire(reg.O, io.O)
# Compile and simulate (requires fault or other backend)
# magma.compile("build/Incrementer", Incrementer)
print("Circuit defined successfully.")
Upgrade
Version history
2.0.21latest on PyPI · released Dec 20, 2022
Audit
Dependencies
magmarequiredMantle is the standard library for Magma; requires magma >= 2.0
faultoptionalUsed for testing / simulation in some patterns