CIRCT 22.0.0git
Loading...
Searching...
No Matches
esiCppAccel.cpp
Go to the documentation of this file.
1//===- esiaccel.cpp - ESI runtime python bindings ---------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Simply wrap the C++ API into a Python module called 'esiaccel'.
10//
11//===----------------------------------------------------------------------===//
12
13#include "esi/Accelerator.h"
14#include "esi/Services.h"
15
16#include "esi/backends/Cosim.h"
17
18#include <ranges>
19#include <sstream>
20
21// nanobind includes.
22// Python world does not respect constness. So it doesn't make sense to have
23// const checks. Disable related warnings.
24#if defined(__GNUC__)
25#pragma GCC diagnostic push
26#pragma GCC diagnostic ignored "-Wcast-qual"
27#endif
28#include <nanobind/nanobind.h>
29#include <nanobind/stl/function.h>
30#include <nanobind/stl/map.h>
31#include <nanobind/stl/optional.h>
32#include <nanobind/stl/pair.h>
33#include <nanobind/stl/string.h>
34#include <nanobind/stl/unique_ptr.h>
35#include <nanobind/stl/vector.h>
36#if defined(__GNUC__)
37#pragma GCC diagnostic pop
38#endif
39
40namespace nb = nanobind;
41
42using namespace esi;
43using namespace esi::services;
44
45namespace nanobind {
46namespace detail {
47
48template <>
49struct type_hook<ChannelPort> {
50 static const std::type_info *get(const ChannelPort *port) {
51 if (dynamic_cast<const WriteChannelPort *>(port))
52 return &typeid(WriteChannelPort);
53 if (dynamic_cast<const ReadChannelPort *>(port))
54 return &typeid(ReadChannelPort);
55 return &typeid(ChannelPort);
56 }
57};
58
59template <>
60struct type_hook<Service> {
61 static const std::type_info *get(const Service *svc) {
62 if (dynamic_cast<const MMIO *>(svc))
63 return &typeid(MMIO);
64 if (dynamic_cast<const SysInfo *>(svc))
65 return &typeid(SysInfo);
66 if (dynamic_cast<const HostMem *>(svc))
67 return &typeid(HostMem);
68 if (dynamic_cast<const TelemetryService *>(svc))
69 return &typeid(TelemetryService);
70 return &typeid(Service);
71 }
72};
73
74/// Nanobind doesn't have a built-in type caster for std::any.
75/// We must provide one which knows about all of the potential types which the
76/// any might be.
77template <>
78struct type_caster<std::any> {
79 NB_TYPE_CASTER(std::any, const_name("object"))
80
81 static handle from_cpp(const std::any &src, rv_policy /* policy */,
82 cleanup_list * /* cleanup */) {
83 const std::type_info &t = src.type();
84 if (t == typeid(std::string))
85 return nb::str(std::any_cast<std::string>(src).c_str()).release();
86 else if (t == typeid(int64_t))
87 return nb::int_(std::any_cast<int64_t>(src)).release();
88 else if (t == typeid(uint64_t))
89 return nb::int_(std::any_cast<uint64_t>(src)).release();
90 else if (t == typeid(double))
91 return nb::float_(std::any_cast<double>(src)).release();
92 else if (t == typeid(bool))
93 return nb::bool_(std::any_cast<bool>(src)).release();
94 else if (t == typeid(std::nullptr_t))
95 return nb::none().release();
96 return nb::none().release();
97 }
98};
99} // namespace detail
100} // namespace nanobind
101
102/// Resolve a Type to the Python wrapper object.
103nb::object getPyType(std::optional<const Type *> t) {
104 nb::object typesModule = nb::module_::import_("esiaccel.types");
105 if (!t)
106 return nb::none();
107 return typesModule.attr("_get_esi_type")(*t);
108}
109
110// NOLINTNEXTLINE(readability-identifier-naming)
111NB_MODULE(esiCppAccel, m) {
112 nb::class_<Type>(m, "Type")
113 .def(nb::init<const Type::ID &>(), nb::arg("id"))
114 .def_prop_ro("id", &Type::getID)
115 .def("__repr__", [](Type &t) { return "<" + t.getID() + ">"; });
116 nb::class_<ChannelType, Type>(m, "ChannelType")
117 .def(nb::init<const Type::ID &, const Type *>(), nb::arg("id"),
118 nb::arg("inner"))
119 .def_prop_ro("inner", &ChannelType::getInner, nb::rv_policy::reference);
120 nb::enum_<BundleType::Direction>(m, "Direction")
121 .value("To", BundleType::Direction::To)
122 .value("From", BundleType::Direction::From)
123 .export_values();
124 nb::class_<BundleType, Type>(m, "BundleType")
125 .def(nb::init<const Type::ID &, const BundleType::ChannelVector &>(),
126 nb::arg("id"), nb::arg("channels"))
127 .def_prop_ro("channels", &BundleType::getChannels,
128 nb::rv_policy::reference);
129 nb::class_<VoidType, Type>(m, "VoidType")
130 .def(nb::init<const Type::ID &>(), nb::arg("id"));
131 nb::class_<AnyType, Type>(m, "AnyType")
132 .def(nb::init<const Type::ID &>(), nb::arg("id"));
133 nb::class_<BitVectorType, Type>(m, "BitVectorType")
134 .def(nb::init<const Type::ID &, uint64_t>(), nb::arg("id"),
135 nb::arg("width"))
136 .def_prop_ro("width", &BitVectorType::getWidth);
137 nb::class_<BitsType, BitVectorType>(m, "BitsType")
138 .def(nb::init<const Type::ID &, uint64_t>(), nb::arg("id"),
139 nb::arg("width"));
140 nb::class_<IntegerType, BitVectorType>(m, "IntegerType")
141 .def(nb::init<const Type::ID &, uint64_t>(), nb::arg("id"),
142 nb::arg("width"));
143 nb::class_<SIntType, IntegerType>(m, "SIntType")
144 .def(nb::init<const Type::ID &, uint64_t>(), nb::arg("id"),
145 nb::arg("width"));
146 nb::class_<UIntType, IntegerType>(m, "UIntType")
147 .def(nb::init<const Type::ID &, uint64_t>(), nb::arg("id"),
148 nb::arg("width"));
149 nb::class_<StructType, Type>(m, "StructType")
150 .def(nb::init<const Type::ID &, const StructType::FieldVector &, bool>(),
151 nb::arg("id"), nb::arg("fields"), nb::arg("reverse") = true)
152 .def_prop_ro("fields", &StructType::getFields, nb::rv_policy::reference)
153 .def_prop_ro("reverse", &StructType::isReverse);
154 nb::class_<ArrayType, Type>(m, "ArrayType")
155 .def(nb::init<const Type::ID &, const Type *, uint64_t>(), nb::arg("id"),
156 nb::arg("element_type"), nb::arg("size"))
157 .def_prop_ro("element", &ArrayType::getElementType,
158 nb::rv_policy::reference)
159 .def_prop_ro("size", &ArrayType::getSize);
160
161 nb::class_<Constant>(m, "Constant")
162 .def_prop_ro("value", [](Constant &c) { return c.value; })
163 .def_prop_ro("type", [](Constant &c) { return getPyType(*c.type); });
164
165 nb::class_<AppID>(m, "AppID")
166 .def(nb::init<std::string, std::optional<uint32_t>>(), nb::arg("name"),
167 nb::arg("idx") = std::nullopt)
168 .def_prop_ro("name", [](AppID &id) { return id.name; })
169 .def_prop_ro("idx",
170 [](AppID &id) -> nb::object {
171 if (id.idx)
172 return nb::cast(id.idx);
173 return nb::none();
174 })
175 .def("__repr__",
176 [](AppID &id) {
177 std::string ret = "<" + id.name;
178 if (id.idx)
179 ret = ret + "[" + std::to_string(*id.idx) + "]";
180 ret = ret + ">";
181 return ret;
182 })
183 .def("__eq__", [](AppID &a, AppID &b) { return a == b; })
184 .def("__hash__", [](AppID &id) {
185 return utils::hash_combine(std::hash<std::string>{}(id.name),
186 std::hash<uint32_t>{}(id.idx.value_or(-1)));
187 });
188 nb::class_<AppIDPath>(m, "AppIDPath").def("__repr__", &AppIDPath::toStr);
189
190 nb::class_<ModuleInfo>(m, "ModuleInfo")
191 .def_prop_ro("name", [](ModuleInfo &info) { return info.name; })
192 .def_prop_ro("summary", [](ModuleInfo &info) { return info.summary; })
193 .def_prop_ro("version", [](ModuleInfo &info) { return info.version; })
194 .def_prop_ro("repo", [](ModuleInfo &info) { return info.repo; })
195 .def_prop_ro("commit_hash",
196 [](ModuleInfo &info) { return info.commitHash; })
197 .def_prop_ro("constants", [](ModuleInfo &info) { return info.constants; })
198 // TODO: "extra" field.
199 .def("__repr__", [](ModuleInfo &info) {
200 std::string ret;
201 std::stringstream os(ret);
202 os << info;
203 return os.str();
204 });
205
206 nb::enum_<Logger::Level>(m, "LogLevel")
207 .value("Debug", Logger::Level::Debug)
208 .value("Info", Logger::Level::Info)
209 .value("Warning", Logger::Level::Warning)
210 .value("Error", Logger::Level::Error)
211 .export_values();
212 nb::class_<Logger>(m, "Logger");
213
214 nb::class_<services::Service>(m, "Service")
215 .def("get_service_symbol", &services::Service::getServiceSymbol);
216
217 nb::class_<SysInfo, services::Service>(m, "SysInfo")
218 .def("esi_version", &SysInfo::getEsiVersion)
219 .def("json_manifest", &SysInfo::getJsonManifest);
220
221 nb::class_<MMIO::RegionDescriptor>(m, "MMIORegionDescriptor")
222 .def_prop_ro("base", [](MMIO::RegionDescriptor &r) { return r.base; })
223 .def_prop_ro("size", [](MMIO::RegionDescriptor &r) { return r.size; });
224 nb::class_<services::MMIO, services::Service>(m, "MMIO")
225 .def("read", &services::MMIO::read)
226 .def("write", &services::MMIO::write)
227 .def_prop_ro("regions", &services::MMIO::getRegions,
228 nb::rv_policy::reference);
229
230 nb::class_<services::HostMem::HostMemRegion>(m, "HostMemRegion")
231 .def_prop_ro("ptr",
233 return reinterpret_cast<uintptr_t>(mem.getPtr());
234 })
235 .def_prop_ro("size", &services::HostMem::HostMemRegion::getSize);
236
237 nb::class_<services::HostMem::Options>(m, "HostMemOptions")
238 .def(nb::init<>())
239 .def_rw("writeable", &services::HostMem::Options::writeable)
240 .def_rw("use_large_pages", &services::HostMem::Options::useLargePages)
241 .def("__repr__", [](services::HostMem::Options &opts) {
242 std::string ret = "HostMemOptions(";
243 if (opts.writeable)
244 ret += "writeable ";
245 if (opts.useLargePages)
246 ret += "use_large_pages";
247 ret += ")";
248 return ret;
249 });
250
251 nb::class_<services::HostMem, services::Service>(m, "HostMem")
252 .def("allocate", &services::HostMem::allocate, nb::arg("size"),
253 nb::arg("options") = services::HostMem::Options(),
254 nb::rv_policy::take_ownership)
255 .def(
256 "map_memory",
257 [](HostMem &self, uintptr_t ptr, size_t size, HostMem::Options opts) {
258 return self.mapMemory(reinterpret_cast<void *>(ptr), size, opts);
259 },
260 nb::arg("ptr"), nb::arg("size"),
261 nb::arg("options") = services::HostMem::Options())
262 .def(
263 "unmap_memory",
264 [](HostMem &self, uintptr_t ptr) {
265 return self.unmapMemory(reinterpret_cast<void *>(ptr));
266 },
267 nb::arg("ptr"));
268 nb::class_<services::TelemetryService, services::Service>(m,
269 "TelemetryService");
270
271 nb::class_<std::future<MessageData>>(m, "MessageDataFuture")
272 .def("valid", [](std::future<MessageData> &f) { return f.valid(); })
273 .def("wait",
274 [](std::future<MessageData> &f) {
275 // Yield the GIL while waiting for the future to complete, in case
276 // of python callbacks occurring from other threads while waiting.
277 nb::gil_scoped_release release{};
278 f.wait();
279 })
280 .def("get", [](std::future<MessageData> &f) {
281 std::optional<MessageData> data;
282 {
283 // Yield the GIL while waiting for the future to complete, in case of
284 // python callbacks occurring from other threads while waiting.
285 nb::gil_scoped_release release{};
286 data.emplace(f.get());
287 }
288 return nb::bytearray((const char *)data->getBytes(), data->getSize());
289 });
290
291 nb::class_<ChannelPort::ConnectOptions>(m, "ConnectOptions")
292 .def(nb::init<>())
293 .def_rw("buffer_size", &ChannelPort::ConnectOptions::bufferSize,
294 nb::arg("buffer_size").none())
295 .def_rw("translate_message",
297
298 nb::class_<ChannelPort>(m, "ChannelPort")
299 .def("connect", &ChannelPort::connect, nb::arg("options"),
300 "Connect with specified options")
301 .def("disconnect", &ChannelPort::disconnect)
302 .def_prop_ro("type", &ChannelPort::getType, nb::rv_policy::reference);
303
304 nb::class_<WriteChannelPort, ChannelPort>(m, "WriteChannelPort")
305 .def("write",
306 [](WriteChannelPort &p, nb::bytearray data) {
307 std::vector<uint8_t> dataVec((const uint8_t *)data.c_str(),
308 (const uint8_t *)data.c_str() +
309 data.size());
310 p.write(dataVec);
311 })
312 .def("tryWrite", [](WriteChannelPort &p, nb::bytearray data) {
313 std::vector<uint8_t> dataVec((const uint8_t *)data.c_str(),
314 (const uint8_t *)data.c_str() +
315 data.size());
316 return p.tryWrite(dataVec);
317 });
318 nb::class_<ReadChannelPort, ChannelPort>(m, "ReadChannelPort")
319 .def(
320 "read",
321 [](ReadChannelPort &p) -> nb::bytearray {
322 MessageData data;
323 p.read(data);
324 return nb::bytearray((const char *)data.getBytes(), data.getSize());
325 },
326 "Read data from the channel. Blocking.")
327 .def("read_async", &ReadChannelPort::readAsync);
328
329 nb::class_<BundlePort>(m, "BundlePort")
330 .def_prop_ro("id", &BundlePort::getID)
331 .def_prop_ro("channels", &BundlePort::getChannels,
332 nb::rv_policy::reference)
333 .def("getWrite", &BundlePort::getRawWrite, nb::rv_policy::reference)
334 .def("getRead", &BundlePort::getRawRead, nb::rv_policy::reference);
335
336 nb::class_<ServicePort, BundlePort>(m, "ServicePort");
337
338 nb::class_<MMIO::MMIORegion, ServicePort>(m, "MMIORegion")
339 .def_prop_ro("descriptor", &MMIO::MMIORegion::getDescriptor)
340 .def("read", &MMIO::MMIORegion::read)
341 .def("write", &MMIO::MMIORegion::write);
342
343 nb::class_<FuncService::Function, ServicePort>(m, "Function")
344 .def("call",
345 [](FuncService::Function &self,
346 nb::bytearray msg) -> std::future<MessageData> {
347 std::vector<uint8_t> dataVec((const uint8_t *)msg.c_str(),
348 (const uint8_t *)msg.c_str() +
349 msg.size());
350 MessageData data(dataVec);
351 return self.call(data);
352 })
353 .def("connect", &FuncService::Function::connect);
354
355 nb::class_<CallService::Callback, ServicePort>(m, "Callback")
356 .def("connect", [](CallService::Callback &self,
357 std::function<nb::object(nb::object)> pyCallback) {
358 // TODO: Under certain conditions this will cause python to crash. I
359 // don't remember how to replicate these crashes, but IIRC they are
360 // deterministic.
361 self.connect([pyCallback](const MessageData &req) -> MessageData {
362 nb::gil_scoped_acquire acquire{};
363 std::vector<uint8_t> arg(req.getBytes(),
364 req.getBytes() + req.getSize());
365 nb::bytes argObj((const char *)arg.data(), arg.size());
366 auto ret = pyCallback(argObj);
367 if (ret.is_none())
368 return MessageData();
369 nb::bytes retBytes = nb::cast<nb::bytes>(ret);
370 std::vector<uint8_t> dataVec((const uint8_t *)retBytes.c_str(),
371 (const uint8_t *)retBytes.c_str() +
372 retBytes.size());
373 return MessageData(dataVec);
374 });
375 });
376
377 nb::class_<TelemetryService::Metric, ServicePort>(m, "Metric")
378 .def("connect", &TelemetryService::Metric::connect)
379 .def("read", &TelemetryService::Metric::read)
380 .def("readInt", &TelemetryService::Metric::readInt);
381
382 // Store this variable (not commonly done) as the "children" method needs for
383 // "Instance" to be defined first.
384 auto hwmodule =
385 nb::class_<HWModule>(m, "HWModule")
386 .def_prop_ro("info", &HWModule::getInfo)
387 .def_prop_ro("ports", &HWModule::getPorts, nb::rv_policy::reference)
388 .def_prop_ro("services", &HWModule::getServices,
389 nb::rv_policy::reference);
390
391 // In order to inherit methods from "HWModule", it needs to be defined first.
392 nb::class_<Instance, HWModule>(m, "Instance")
393 .def_prop_ro("id", &Instance::getID);
394
395 nb::class_<Accelerator, HWModule>(m, "Accelerator");
396
397 // Since this returns a vector of Instance*, we need to define Instance first
398 // or else stubgen complains.
399 hwmodule.def_prop_ro("children", &HWModule::getChildren,
400 nb::rv_policy::reference);
401
402 auto accConn = nb::class_<AcceleratorConnection>(m, "AcceleratorConnection");
403
404 nb::class_<Context>(
405 m, "Context",
406 "An ESI context owns everything -- types, accelerator connections, and "
407 "the accelerator facade (aka Accelerator) itself. It MUST NOT be garbage "
408 "collected while the accelerator is still in use. When it is destroyed, "
409 "all accelerator connections are disconnected.")
410 .def(nb::init<>(), "Create a context with a default logger.")
411 .def("connect", &Context::connect, nb::rv_policy::reference)
412 .def("set_stdio_logger", [](Context &ctxt, Logger::Level level) {
413 ctxt.setLogger(std::make_unique<StreamLogger>(level));
414 });
415
416 accConn
417 .def(
418 "sysinfo",
419 [](AcceleratorConnection &acc) {
420 return acc.getService<services::SysInfo>({});
421 },
422 nb::rv_policy::reference)
423 .def(
424 "get_service_mmio",
425 [](AcceleratorConnection &acc) {
426 return acc.getService<services::MMIO>({});
427 },
428 nb::rv_policy::reference)
429 .def(
430 "get_service_hostmem",
431 [](AcceleratorConnection &acc) {
432 return acc.getService<services::HostMem>({});
433 },
434 nb::rv_policy::reference)
435 .def("get_accelerator", &AcceleratorConnection::getAccelerator,
436 nb::rv_policy::reference);
437
438 nb::class_<Manifest>(m, "Manifest")
439 .def(nb::init<Context &, std::string>())
440 .def_prop_ro("api_version", &Manifest::getApiVersion)
441 .def(
442 "build_accelerator",
443 [&](Manifest &m, AcceleratorConnection &conn) -> Accelerator * {
444 auto *acc = m.buildAccelerator(conn);
445 conn.getServiceThread()->addPoll(*acc);
446 return acc;
447 },
448 nb::rv_policy::reference)
449 .def_prop_ro("type_table",
450 [](Manifest &m) {
451 std::vector<nb::object> ret;
452 std::ranges::transform(m.getTypeTable(),
453 std::back_inserter(ret), getPyType);
454 return ret;
455 })
456 .def_prop_ro("module_infos", &Manifest::getModuleInfos);
457}
Abstract class representing a connection to an accelerator.
Definition Accelerator.h:79
ServiceClass * getService(AppIDPath id={}, std::string implName={}, ServiceImplDetails details={}, HWClientDetails clients={})
Get a typed reference to a particular service type.
Accelerator & getAccelerator()
AcceleratorServiceThread * getServiceThread()
Return a pointer to the accelerator 'service' thread (or threads).
Top level accelerator class.
Definition Accelerator.h:60
std::string toStr() const
Definition Manifest.cpp:781
uint64_t getWidth() const
Definition Types.h:161
Unidirectional channels are the basic communication primitive between the host and accelerator.
Definition Ports.h:36
const Type * getType() const
Definition Ports.h:130
virtual void connect(const ConnectOptions &options=ConnectOptions())=0
Set up a connection to the accelerator.
virtual void disconnect()=0
AcceleratorConnections, Accelerators, and Manifests must all share a context.
Definition Context.h:34
void setLogger(std::unique_ptr< Logger > logger)
Register a logger with the accelerator. Assumes ownership of the logger.
Definition Context.h:64
const std::map< AppID, BundlePort & > & getPorts() const
Access the module's ports by ID.
Definition Design.h:80
const std::map< AppID, Instance * > & getChildren() const
Access the module's children by ID.
Definition Design.h:71
const std::vector< services::Service * > & getServices() const
Access the services provided by this module.
Definition Design.h:82
std::optional< ModuleInfo > getInfo() const
Access the module's metadata, if any.
Definition Design.h:62
AppID getID() const
Get the instance's ID, which it will always have.
Definition Design.h:124
Class to parse a manifest.
Definition Manifest.h:39
A logical chunk of data representing serialized data.
Definition Common.h:113
const uint8_t * getBytes() const
Definition Common.h:124
size_t getSize() const
Get the size of the data in bytes.
Definition Common.h:138
A ChannelPort which reads data from the accelerator.
Definition Ports.h:318
virtual std::future< MessageData > readAsync()
Asynchronous read.
Definition Ports.cpp:126
Root class of the ESI type system.
Definition Types.h:34
ID getID() const
Definition Types.h:40
A ChannelPort which sends data to the accelerator.
Definition Ports.h:206
void write(const MessageData &data)
A very basic blocking write API.
Definition Ports.h:222
bool tryWrite(const MessageData &data)
A basic non-blocking write API.
Definition Ports.h:241
A function call which gets attached to a service port.
Definition Services.h:329
A function call which gets attached to a service port.
Definition Services.h:277
virtual std::unique_ptr< HostMemRegion > allocate(std::size_t size, Options opts) const =0
Allocate a region of host memory in accelerator accessible address space.
virtual void unmapMemory(void *ptr) const
Unmap memory which was previously mapped with 'mapMemory'.
Definition Services.h:263
virtual bool mapMemory(void *ptr, std::size_t size, Options opts) const
Try to make a region of host memory accessible to the accelerator.
Definition Services.h:258
virtual uint64_t read(uint32_t addr) const
Read a 64-bit value from this region, not the global address space.
Definition Services.cpp:132
virtual void write(uint32_t addr, uint64_t data)
Write a 64-bit value to this region, not the global address space.
Definition Services.cpp:137
virtual RegionDescriptor getDescriptor() const
Get the offset (and size) of the region in the parent (usually global) MMIO address space.
Definition Services.h:180
virtual uint64_t read(uint32_t addr) const =0
Read a 64-bit value from the global MMIO space.
virtual void write(uint32_t addr, uint64_t data)=0
Write a 64-bit value to the global MMIO space.
const std::map< AppIDPath, RegionDescriptor > & getRegions() const
Get the regions of MMIO space that this service manages.
Definition Services.h:150
Parent class of all APIs modeled as 'services'.
Definition Services.h:59
virtual std::string getServiceSymbol() const =0
Information about the Accelerator system.
Definition Services.h:113
virtual std::string getJsonManifest() const
Return the JSON-formatted system manifest.
Definition Services.cpp:40
virtual uint32_t getEsiVersion() const =0
Get the ESI version number to check version compatibility.
void connect()
Connect to a particular telemetry port. Offset should be non-nullopt.
Definition Services.cpp:378
std::future< MessageData > read()
Definition Services.cpp:385
Service for retrieving telemetry data from the accelerator.
Definition Services.h:376
nb::object getPyType(std::optional< const Type * > t)
Resolve a Type to the Python wrapper object.
NB_MODULE(esiCppAccel, m)
size_t hash_combine(size_t h1, size_t h2)
C++'s stdlib doesn't have a hash_combine function. This is a simple one.
Definition Utils.h:32
Definition esi.py:1
std::optional< unsigned > bufferSize
The buffer size is optional and should be considered merely a hint.
Definition Ports.h:45
bool translateMessage
If the type of this port is a window, translate the incoming/outgoing data into its underlying ('into...
Definition Ports.h:104
std::any value
Definition Common.h:68
std::optional< const Type * > type
Definition Common.h:69
RAII memory region for host memory.
Definition Services.h:223
virtual void * getPtr() const =0
Get a pointer to the host memory.
virtual std::size_t getSize() const =0
Options for allocating host memory.
Definition Services.h:241
Describe a region (slice) of MMIO space.
Definition Services.h:135
static const std::type_info * get(const ChannelPort *port)
static const std::type_info * get(const Service *svc)