from magma import bits, wire, compile, EndCircuit from mantle import EQ from loam.boards.icestick import IceStick icestick = IceStick() for i in range(2): icestick.J1[i].input().on() icestick.D1.on() main = icestick.main() eq2 = EQ(2) eq2(main.J1, bits([0, 1])) wire(eq2.O, main.D1) EndCircuit()
def eq(I0, I1, **kwargs): width = get_length(I0) return EQ(width, **kwargs)(I0, I1)
from magma import bit, wire, compile, EndCircuit from mantle import EQ from loam.boards.icestick import IceStick icestick = IceStick() icestick.J1[0].rename('I').input().on() icestick.D1.on() main = icestick.main() eq1 = EQ(1) eq1(main.I,bit(1)) wire(eq1.O, main.D1) EndCircuit()
def eq(width, I0, I1, **kwargs): return EQ(width, **kwargs)(I0, I1)
class _Decode(m.Circuit): name = f"Decode{i}{n}" io = m.IO(I=m.In(m.Bits[n]), O=m.Out(m.Bit)) m.wire(io.O, EQ(n)(io.I, m.bits(i, n)))