def test_lut1(): target = magma.mantle_target if target == 'coreir': test = mantle.LUT([0, 1], 1) else: test = mantle.LUT1([0, 1]) if target == 'spartan3' or target == 'spartan6': assert ' = LUT1(INIT=0x2)' == repr(test) elif target == 'ice40': assert 'AnonymousCircuitType("I0", .I0, "O", .O)' == repr(test) elif target == 'coreir': assert ' = LUT1_2()' == repr(test)
class Main(m.Circuit): if target == 'coreir': test = mantle.LUT([0, 1], 1) else: test = mantle.LUT1([0, 1]) if target == 'spartan3' or target == 'spartan6': assert 'LUT1(INIT=0x2)' == repr(test) elif target == 'ice40': assert 'AnonymousCircuitType("I0", .I0, "O", .O)' == strip_anonymous_circuits( repr(test)) elif target == 'coreir': assert 'LUT1_2()' == repr(test)