def assert_(self, value, f_ln=None, **kargs): assert isinstance(value, (_kratos.Var, int)) if isinstance(value, int): assert value == 0 value = _kratos.constant(0, 1, False) stmt = _kratos.AssertValueStmt(value) if self.generator.debug: stmt.add_fn_ln((self.filename, f_ln + self.ln - 1), True) if self.add_local: # obtain the previous call frame info __local = get_frame_local() add_scope_context(stmt, __local) # this is additional info passed in add_scope_context(stmt, kargs) return stmt
def __call__(self, value, is_signed=False): return _kratos.constant(value, width, is_signed)
def const(value: int, width: int, is_signed: bool = False): return _kratos.constant(value, width, is_signed)