CIRCT  20.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);
37  static std::unique_ptr<AcceleratorConnection>
38  connect(Context &, std::string connectionString);
39 
40  /// Request the host side channel ports for a particular instance (identified
41  /// by the AppID path). For convenience, provide the bundle type and direction
42  /// of the bundle port.
43  std::map<std::string, ChannelPort &>
45  const ServiceTable &) override;
46 
47 protected:
48  virtual Service *createService(Service::Type service, AppIDPath path,
49  std::string implName,
50  const ServiceImplDetails &details,
51  const HWClientDetails &clients) override;
52 
53 private:
54  std::unique_ptr<Impl> impl;
55 };
56 
57 } // namespace xrt
58 } // namespace backends
59 } // namespace esi
60 
61 #endif // ESI_BACKENDS_XRT_H
Abstract class representing a connection to an accelerator.
Definition: Accelerator.h:78
std::map< std::string, services::Service * > ServiceTable
Definition: Accelerator.h:93
Bundles represent a collection of channels.
Definition: Types.h:44
AcceleratorConnections, Accelerators, and Manifests must all share a context.
Definition: Context.h:31
Connect to an ESI simulation.
Definition: Xrt.h:31
std::map< std::string, ChannelPort & > requestChannelsFor(AppIDPath, const BundleType *, const ServiceTable &) 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:54
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:45
const std::type_info & Type
Definition: Services.h:47
Definition: esi.py:1
std::map< std::string, std::any > ServiceImplDetails
Definition: Common.h:98
std::vector< HWClientDetail > HWClientDetails
Definition: Common.h:97