|
Packit |
534379 |
// Copyright(c) 2018, Intel Corporation
|
|
Packit |
534379 |
//
|
|
Packit |
534379 |
// Redistribution and use in source and binary forms, with or without
|
|
Packit |
534379 |
// modification, are permitted provided that the following conditions are met:
|
|
Packit |
534379 |
//
|
|
Packit |
534379 |
// * Redistributions of source code must retain the above copyright notice,
|
|
Packit |
534379 |
// this list of conditions and the following disclaimer.
|
|
Packit |
534379 |
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
Packit |
534379 |
// this list of conditions and the following disclaimer in the documentation
|
|
Packit |
534379 |
// and/or other materials provided with the distribution.
|
|
Packit |
534379 |
// * Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
534379 |
// may be used to endorse or promote products derived from this software
|
|
Packit |
534379 |
// without specific prior written permission.
|
|
Packit |
534379 |
//
|
|
Packit |
534379 |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
534379 |
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
534379 |
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
Packit |
534379 |
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
Packit |
534379 |
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
Packit |
534379 |
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
Packit |
534379 |
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
Packit |
534379 |
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
Packit |
534379 |
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
Packit |
534379 |
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
Packit |
534379 |
// POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
534379 |
#pragma once
|
|
Packit |
534379 |
#include <Python.h>
|
|
Packit |
534379 |
|
|
Packit |
534379 |
#include <opae/cxx/core/properties.h>
|
|
Packit |
534379 |
#include <opae/cxx/core/pvalue.h>
|
|
Packit |
534379 |
#include <opae/cxx/core/token.h>
|
|
Packit |
534379 |
#include <opae/cxx/core/handle.h>
|
|
Packit |
534379 |
#include <pybind11/pybind11.h>
|
|
Packit |
534379 |
#include <tuple>
|
|
Packit |
534379 |
|
|
Packit |
534379 |
template <typename T>
|
|
Packit |
534379 |
static inline void kwargs_to_props(opae::fpga::types::pvalue<T> &prop,
|
|
Packit |
534379 |
pybind11::kwargs kwargs, const char *key) {
|
|
Packit |
534379 |
if (kwargs.contains(key)) {
|
|
Packit |
534379 |
prop = kwargs[key].cast<T>();
|
|
Packit |
534379 |
}
|
|
Packit |
534379 |
}
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc();
|
|
Packit |
534379 |
const char *properties_doc_get();
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t properties_get(pybind11::kwargs kwargs);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_get_token();
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t properties_get_token(
|
|
Packit |
534379 |
opae::fpga::types::token::ptr_t tok);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_get_handle();
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t properties_get_handle(
|
|
Packit |
534379 |
opae::fpga::types::handle::ptr_t hndl);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_parent();
|
|
Packit |
534379 |
opae::fpga::types::token::ptr_t properties_get_parent(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_parent(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
opae::fpga::types::token::ptr_t parent);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_guid();
|
|
Packit |
534379 |
std::string properties_get_guid(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_guid(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
const std::string &guid_str);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_type();
|
|
Packit |
534379 |
fpga_objtype properties_get_type(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_type(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
fpga_objtype type);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_segment();
|
|
Packit |
534379 |
uint16_t properties_get_segment(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_segment(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint16_t segment);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_bus();
|
|
Packit |
534379 |
uint8_t properties_get_bus(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_bus(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint8_t bus);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_device();
|
|
Packit |
534379 |
uint8_t properties_get_device(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_device(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint8_t device);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_function();
|
|
Packit |
534379 |
uint8_t properties_get_function(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_function(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint8_t function);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_socket_id();
|
|
Packit |
534379 |
uint8_t properties_get_socket_id(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_socket_id(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint8_t socket_id);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_object_id();
|
|
Packit |
534379 |
uint64_t properties_get_object_id(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_object_id(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint64_t object_id);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_num_errors();
|
|
Packit |
534379 |
uint32_t properties_get_num_errors(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_num_errors(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint32_t num_errors);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_num_slots();
|
|
Packit |
534379 |
uint32_t properties_get_num_slots(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_num_slots(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint32_t num_slots);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_bbs_id();
|
|
Packit |
534379 |
uint64_t properties_get_bbs_id(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_bbs_id(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint64_t bbs_id);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_bbs_version();
|
|
Packit |
534379 |
std::tuple<uint8_t, uint8_t, uint16_t> properties_get_bbs_version(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_bbs_version(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
pybind11::tuple bbs_version);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_vendor_id();
|
|
Packit |
534379 |
uint32_t properties_get_vendor_id(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_vendor_id(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint32_t vendor_id);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_device_id();
|
|
Packit |
534379 |
uint32_t properties_get_device_id(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_device_id(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint32_t device_id);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_model();
|
|
Packit |
534379 |
std::string properties_get_model(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_model(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
char *model);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_local_memory_size();
|
|
Packit |
534379 |
uint64_t properties_get_local_memory_size(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_local_memory_size(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props, uint64_t size);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_capabilities();
|
|
Packit |
534379 |
uint64_t properties_get_capabilities(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_capabilities(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint64_t caps);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_num_mmio();
|
|
Packit |
534379 |
uint32_t properties_get_num_mmio(opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_num_mmio(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint32_t num_mmio);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_num_interrupts();
|
|
Packit |
534379 |
uint32_t properties_get_num_interrupts(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_num_interrupts(opae::fpga::types::properties::ptr_t props,
|
|
Packit |
534379 |
uint32_t num_interrupts);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
const char *properties_doc_accelerator_state();
|
|
Packit |
534379 |
fpga_accelerator_state properties_get_accelerator_state(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props);
|
|
Packit |
534379 |
void properties_set_accelerator_state(
|
|
Packit |
534379 |
opae::fpga::types::properties::ptr_t props, fpga_accelerator_state state);
|