Selene-Core
Selene is designed to be extensible through the use of plugins, in the form of compiled libraries and lightweight python interfaces that provide configuration for the selene-sim frontend. We achieve this through this selene-core crate and python module.
Each plugin should comprise a python component and a compiled library component. The compiled library implements the Selene plugin API, and the python component provides configuration, link information and the path to the compiled library to the selene frontend.
The selene-core python module provides interfaces for plugins to adhere to. It also provides a bundled include directory, containing C headers for the Selene plugin API for each type of component.
To access the C headers in the build stage of a python package, depend on selene-core
as a build dependency and call selene_core.get_include_directory(). The resulting
path can be provided to a build system for C or C++ and the plugin APIs can be included
through:
#include <selene/simulator.h> # for the simulator API
#include <selene/error_model.h> # for the error model API
#include <selene/runtime.h> # for the runtime API
Each header defines a descriptor structure and a packed current-version constant:
SELENE_SIMULATOR_CURRENT_API_VERSIONSELENE_ERROR_MODEL_CURRENT_API_VERSIONSELENE_RUNTIME_CURRENT_API_VERSION
Populate struct_size with sizeof the descriptor, use the corresponding version
constant for api_version, and populate every function pointer that is not documented
as optional. A plugin must export either the descriptor symbol documented in its header
or, preferably, the accessor function. For example, a simulator plugin should export:
static const SeleneSimulatorPluginDescriptorV1 descriptor = {
.struct_size = sizeof(SeleneSimulatorPluginDescriptorV1),
.api_version = SELENE_SIMULATOR_CURRENT_API_VERSION,
/* function pointers */
};
const SeleneSimulatorPluginDescriptorV1 *
selene_simulator_get_plugin_descriptor_v1(void) {
return &descriptor;
}
The equivalent runtime and error-model accessor names are declared in their respective headers.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file selene_core-0.3.0-py3-none-any.whl.
File metadata
- Download URL: selene_core-0.3.0-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a118cd5e30fe57ddf93ade785b952fda1cd56c7ce5aeaec9b0fcd324565f400
|
|
| MD5 |
35541aa15093ace7c3bf57819da6ea4f
|
|
| BLAKE2b-256 |
55f0968a85bf4fddcbce0a14032d371819648a067880dc1ba7b5c89be1385ae4
|