CIRCT  19.0.0git
Xrt.h
Go to the documentation of this file.
1 //===- Xrt.h - ESI XRT device backend ---------------------------*- 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 // This is a specialization of the ESI C++ API (backend) for connection into
10 // hardware on an XRT device. Requires XRT C++ library.
11 //
12 // DO NOT EDIT!
13 // This file is distributed as part of an ESI package. The source for this file
14 // should always be modified within CIRCT (lib/dialect/ESI/runtime/cpp).
15 //
16 //===----------------------------------------------------------------------===//
17 
18 // NOLINTNEXTLINE(llvm-header-guard)
19 #ifndef ESI_BACKENDS_XRT_H
20 #define ESI_BACKENDS_XRT_H
21 
22 #include "esi/Accelerator.h"
23 
24 #include <memory>
25 
26 namespace esi {
27 namespace backends {
28 namespace xrt {
29 
30 /// Connect to an ESI simulation.
32 public:
33  struct Impl;
34 
35  XrtAccelerator(Context &, std::string xclbin, std::string kernelName);
36  static std::unique_ptr<AcceleratorConnection>
37  connect(Context &, std::string connectionString);
38 
39  /// Request the host side channel ports for a particular instance (identified
40  /// by the AppID path). For convenience, provide the bundle type and direction
41  /// of the bundle port.
42  std::map<std::string, ChannelPort &>
43  requestChannelsFor(AppIDPath, const BundleType *) override;
44 
45 protected:
46  virtual Service *createService(Service::Type service, AppIDPath path,
47  std::string implName,
48  const ServiceImplDetails &details,
49  const HWClientDetails &clients) override;
50 
51 private:
52  std::unique_ptr<Impl> impl;
53 };
54 
55 } // namespace xrt
56 } // namespace backends
57 } // namespace esi
58 
59 #endif // ESI_BACKENDS_XRT_H
Abstract class representing a connection to an accelerator.
Definition: Accelerator.h:78
Bundles represent a collection of channels.
Definition: Types.h:44
AcceleratorConnections, Accelerators, and Manifests must all share a context.
Definition: Context.h:30
Connect to an ESI simulation.
Definition: Xrt.h:31
std::map< std::string, ChannelPort & > requestChannelsFor(AppIDPath, const BundleType *) override
Request the host side channel ports for a particular instance (identified by the AppID path).
Definition: Xrt.cpp:103
XrtAccelerator(Context &, std::string xclbin, std::string kernelName)
Construct and connect to a cosim server.
Definition: Xrt.cpp:76
static std::unique_ptr< AcceleratorConnection > connect(Context &, std::string connectionString)
Parse the connection std::string and instantiate the accelerator.
Definition: Xrt.cpp:38
std::unique_ptr< Impl > impl
Definition: Xrt.h:52
virtual Service * createService(Service::Type service, AppIDPath path, std::string implName, const ServiceImplDetails &details, const HWClientDetails &clients) override
Called by getServiceImpl exclusively.
Definition: Xrt.cpp:108
Parent class of all APIs modeled as 'services'.
Definition: Services.h:42
const std::type_info & Type
Definition: Services.h:44
Definition: esi.py:1
std::map< std::string, std::any > ServiceImplDetails
Definition: Common.h:81
std::vector< HWClientDetail > HWClientDetails
Definition: Common.h:80