def METHOD_NAME(self, memory_size):
    try:
        from . import cmodel
    except:
        import cmodel
    if self.device == Device.BM1684X:
        _cmodel = cmodel.BM1684X(memory_size)
    elif self.device == Device.BM1684:
        _cmodel = cmodel.BM1684(memory_size)
    elif self.device == Device.BM1686:
        _cmodel = cmodel.BM1686(memory_size, self.base_addr)
    else:
        raise ValueError(f"device: {self.device} is not supported.")
    self.__bind_resource(_cmodel)
    return _cmodel