Esempio n. 1
0
 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
Esempio n. 2
0
 def __call__(self, value, is_signed=False):
     return _kratos.constant(value, width, is_signed)
Esempio n. 3
0
def const(value: int, width: int, is_signed: bool = False):
    return _kratos.constant(value, width, is_signed)