ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
RV32IMACFDArchLib.cpp
Go to the documentation of this file.
1
7// define a name for this library. this will be used to avoid name clashes with other libraries. in this example the
8// library is named "X". IMPORTANT this name MUST match the library name: e.g. X -> libX.so
9
10#define ETISS_LIBNAME RV32IMACFD
11#include "etiss/helper/CPUArchLibrary.h" // defines the following functions
12#include "RV32IMACFDArch.h"
13#include <string>
14extern "C"
15{
16
18
20 {
21 // TODO
22 return 1; // number of cpu architectures provided
23 }
24 ETISS_PLUGIN_EXPORT const char *RV32IMACFD_nameCPUArch(unsigned index)
25 {
26 // TODO
27 switch (index)
28 {
29 case 0:
30 return "RV32IMACFD";
31 default:
32 return "";
33 }
34 }
35 // clang-format off
36 ETISS_PLUGIN_EXPORT etiss::CPUArch *RV32IMACFD_createCPUArch(unsigned index, std::map<std::string,std::string> options)
37 // clang-format on
38 {
39 // TODO
40 switch (index)
41 {
42 case 0:
43 {
44 auto it = options.find("coreno");
45 unsigned int coreno = 0;
46 if (it != options.end())
47 coreno = std::stoul(it->second);
48 else
49 etiss::log(etiss::WARNING, "no core number provided for core, using 0");
50
51 return new RV32IMACFDArch(coreno);
52 }
53 default:
54 return 0;
55 }
56 }
58 {
59 delete arch;
60 }
61}
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
ETISS_PLUGIN_EXPORT etiss::CPUArch * RV32IMACFD_createCPUArch(unsigned index, std::map< std::string, std::string > options)
ETISS_PLUGIN_EXPORT void RV32IMACFD_deleteCPUArch(etiss::CPUArch *arch)
ETISS_PLUGIN_EXPORT const char * RV32IMACFD_nameCPUArch(unsigned index)
ETISS_LIBRARYIF_VERSION_FUNC_IMPL ETISS_PLUGIN_EXPORT unsigned RV32IMACFD_countCPUArch()
the interface to translate instructions of and processor architecture
Definition CPUArch.h:116
#define ETISS_PLUGIN_EXPORT
#define ETISS_LIBRARYIF_VERSION_FUNC_IMPL
Definition Misc.h:47
@ WARNING
Definition Misc.h:86
void log(Verbosity level, std::string msg)
write log message at the given level.
Definition Misc.cpp:94