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)
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
def _fresh_output(self, name=None): if name is None: name = cmn._fresh() return self.with_output(name)
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)
def __invert__(self): return type(self)( aig=self.aig >> cmn.bit_flipper(self.aig.outputs, [cmn._fresh()]))