CIRCT  19.0.0git
Manifest.h
Go to the documentation of this file.
1 //===- Manifest.h - Metadata on the accelerator -----------------*- 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 // Manifest parsing and API creation.
10 //
11 // DO NOT EDIT!
12 // This file is distributed as part of an ESI package. The source for this file
13 // should always be modified within CIRCT.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 // NOLINTNEXTLINE(llvm-header-guard)
18 #ifndef ESI_MANIFEST_H
19 #define ESI_MANIFEST_H
20 
21 #include "esi/Common.h"
22 #include "esi/Context.h"
23 #include "esi/Types.h"
24 
25 #include <any>
26 #include <memory>
27 #include <optional>
28 #include <string>
29 #include <vector>
30 
31 namespace esi {
32 
33 // Forward declarations.
34 class AcceleratorConnection;
35 class Accelerator;
36 
37 /// Class to parse a manifest. It also constructs the dynamic API for the
38 /// accelerator.
39 class Manifest {
40 public:
41  class Impl;
42 
43  Manifest(const Manifest &) = delete;
44  Manifest(Context &ctxt, const std::string &jsonManifest);
45  ~Manifest();
46 
47  uint32_t getApiVersion() const;
48  // Modules which have designer specified metadata.
49  std::vector<ModuleInfo> getModuleInfos() const;
50 
51  // Build a dynamic design hierarchy from the manifest.
52  std::unique_ptr<Accelerator>
54 
55  /// The Type Table is an ordered list of types. The offset can be used to
56  /// compactly and uniquely within a design. It does not include all of the
57  /// types in a design -- just the ones listed in the 'types' section of the
58  /// manifest.
59  const std::vector<const Type *> &getTypeTable() const;
60 
61 private:
63 };
64 
65 } // namespace esi
66 
67 std::ostream &operator<<(std::ostream &os, const esi::AppID &id);
68 std::ostream &operator<<(std::ostream &, const esi::AppIDPath &);
69 std::ostream &operator<<(std::ostream &, const esi::ModuleInfo &);
70 
71 #endif // ESI_MANIFEST_H
std::ostream & operator<<(std::ostream &os, const esi::AppID &id)
Definition: Manifest.cpp:625
Abstract class representing a connection to an accelerator.
Definition: Accelerator.h:78
AcceleratorConnections, Accelerators, and Manifests must all share a context.
Definition: Context.h:30
Class to parse a manifest.
Definition: Manifest.h:39
std::unique_ptr< Accelerator > buildAccelerator(AcceleratorConnection &acc) const
Definition: Manifest.cpp:538
std::vector< ModuleInfo > getModuleInfos() const
Definition: Manifest.cpp:530
uint32_t getApiVersion() const
Definition: Manifest.cpp:526
const std::vector< const Type * > & getTypeTable() const
The Type Table is an ordered list of types.
Definition: Manifest.cpp:542
Manifest(const Manifest &)=delete
Impl * impl
Definition: Manifest.h:62
Definition: esi.py:1