ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
IntegratedLibraryHelper.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// This file is part of ETISS. It is licensed under the BSD 3-Clause License; you may not use this file except in
4// compliance with the License. You should have received a copy of the license along with this project. If not, see the
5// LICENSE file.
17
18#define ETISS_LIBNAME ETISSINCLUDED
19
23#include "etiss/CPUArch.h"
24#include "etiss/JIT.h"
25
32{
33 public:
34 IntegratedLibrary() : etiss::LibraryInterface("ETISSINCLUDED") {}
35 virtual std::string versionInfo() { return ETISS_VERSION_FULL; }
36 virtual unsigned countPlugins() { return ETISSINCLUDED_countPlugin(); }
37 virtual unsigned countCPUArchs() { return ETISSINCLUDED_countCPUArch(); }
38 virtual unsigned countJITs() { return ETISSINCLUDED_countJIT(); }
39
40 virtual std::string nameJIT(unsigned index)
41 {
42 const char *name = ETISSINCLUDED_nameJIT(index);
43 if (name != 0)
44 {
45 return std::string(name);
46 }
47 return std::string();
48 }
49 virtual std::string namePlugin(unsigned index)
50 {
51 const char *name = ETISSINCLUDED_namePlugin(index);
52 if (name != 0)
53 {
54 return std::string(name);
55 }
56 return std::string();
57 }
58 virtual std::string nameCPUArch(unsigned index)
59 {
60 const char *name = ETISSINCLUDED_nameCPUArch(index);
61 if (name != 0)
62 {
63 return std::string(name);
64 }
65 return std::string();
66 }
67
68 virtual etiss::JIT *createJIT(unsigned index, std::map<std::string, std::string> options)
69 {
70 return ETISSINCLUDED_createJIT(index, options);
71 }
72 virtual etiss::CPUArch *createCPUArch(unsigned index, std::map<std::string, std::string> options)
73 {
75 }
76 virtual etiss::Plugin *createPlugin(unsigned index, std::map<std::string, std::string> options)
77 {
79 }
80
81 virtual void deleteJIT(etiss::JIT *o) { delete o; }
82 virtual void deleteCPUArch(etiss::CPUArch *o) { delete o; }
83 virtual void deletePlugin(etiss::Plugin *o) { delete o; }
84};
85
86std::shared_ptr<etiss::LibraryInterface> etiss::LibraryInterface::openIntegratedLibrary()
87{
88 return std::shared_ptr<etiss::LibraryInterface>(new IntegratedLibrary());
89}
defines the functions needed for a library that provides etiss::CPUArch implementations
ETISS_PLUGIN_EXPORT etiss::CPUArch std::map< std::string, std::string > options
create new instance of the CPUArch type at index
contains neccesary interfaces for instruction translation.
ETISS_LIBRARYIF_VERSION_FUNC_IMPL unsigned ETISSINCLUDED_countJIT()
const char * ETISSINCLUDED_nameJIT(unsigned index)
unsigned ETISSINCLUDED_countCPUArch()
unsigned ETISSINCLUDED_countPlugin()
etiss::Plugin * ETISSINCLUDED_createPlugin(unsigned index, std::map< std::string, std::string > options)
etiss::CPUArch * ETISSINCLUDED_createCPUArch(unsigned index, std::map< std::string, std::string > options)
etiss::JIT * ETISSINCLUDED_createJIT(unsigned index, std::map< std::string, std::string > options)
const char * ETISSINCLUDED_namePlugin(unsigned index)
const char * ETISSINCLUDED_nameCPUArch(unsigned index)
defines the functions needed for a library that provides etiss::JIT implementations
JIT compiler interface definition.
class for simple library access.
defines the functions needed for a library that provides etiss::CPUArch implementations
LibraryInterface implementation for integrated JIT/CPUArch/Plugin implementations.
virtual etiss::Plugin * createPlugin(unsigned index, std::map< std::string, std::string > options)
virtual std::string versionInfo()
simple version info string. intended to present information in a human readable way.
virtual std::string nameCPUArch(unsigned index)
virtual etiss::JIT * createJIT(unsigned index, std::map< std::string, std::string > options)
virtual void deleteCPUArch(etiss::CPUArch *o)
virtual unsigned countJITs()
virtual void deleteJIT(etiss::JIT *o)
virtual etiss::CPUArch * createCPUArch(unsigned index, std::map< std::string, std::string > options)
virtual std::string nameJIT(unsigned index)
virtual unsigned countCPUArchs()
virtual unsigned countPlugins()
virtual std::string namePlugin(unsigned index)
virtual void deletePlugin(etiss::Plugin *o)
the interface to translate instructions of and processor architecture
Definition CPUArch.h:116
compiler interface for just in time compilation of generated C code
Definition JIT.h:29
interface class for libraries.
static std::shared_ptr< LibraryInterface > openIntegratedLibrary()
LibraryInterface(std::string name)
base plugin class that provides access to different plugin functions if present
Definition Plugin.h:38
#define ETISS_VERSION_FULL
Definition config.h:29
forwards: include/jit/*
Definition Benchmark.h:17