def shift_left(value, size, signed=True):
    if isinstance(value, vtypes.Int):
        v = value.value & 0x1
        ret = value
        for i in range(size):
            ret = (ret << 1) | v
        return ret
    
    if isinstance(value, int):
        v = value & 0x1
        ret = value
        for i in range(size):
            ret = (ret << 1) | v
        return ret
    
    if isinstance(value, bool):
        return value << size
    
    if not isinstance(value, vtypes._Variable):
        raise TypeError("shift_left not support type '%s'" % str(type(value)))
    
    if signed:
        return vtypes.Cat(value, vtypes.Repeat(value[0], size))
    
    return vtypes.Sll(value, size)
dataset/ETHPy150Open PyHDI/veriloggen/veriloggen/utils/fixed.py/shift_left/original