Exemplo n.º 1
0
def atom(val: Union[str, bool, None]) -> BoolExpr:
    output = cmn._fresh()
    if val is None:
        val = cmn._fresh()

    if isinstance(val, str):
        assert val not in ('True', 'False')
        aig = cmn.identity([val], [output])
    else:
        aig = cmn.source({output: val})

    return BoolExpr(aig)
Exemplo n.º 2
0
def test_dummylatches_aag(circ, ddata):
    circ2 = circ.evolve(latch2init={common._fresh(): False})
    circ3 = circ._to_aag()._to_aig()
    assert circ2.inputs == circ3.inputs
    assert circ3.outputs == circ3.outputs
    assert circ3.latches == circ3.latches
Exemplo n.º 3
0
 def _fresh_output(self, name=None):
     if name is None:
         name = cmn._fresh()
     return self.with_output(name)
Exemplo n.º 4
0
def _binary_gate(gate, expr1, expr2):
    aig = expr1._fresh_output().aig | expr2._fresh_output().aig
    aig >>= gate(inputs=aig.outputs, output=cmn._fresh())
    return type(expr1)(aig=aig)
Exemplo n.º 5
0
 def __invert__(self):
     return type(self)(
         aig=self.aig >> cmn.bit_flipper(self.aig.outputs, [cmn._fresh()]))