ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
RV64IMACFDArchLib.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 library is named "X".
8 // IMPORTANT this name MUST match the library name: e.g. X -> libX.so
9 
10 #define ETISS_LIBNAME RV64IMACFD
11 #include "etiss/helper/CPUArchLibrary.h" // defines the following functions
12 #include "RV64IMACFDArch.h"
13 #include <string>
14 extern "C" {
15 
17 
19  {
20 //TODO
21  return 1; // number of cpu architectures provided
22  }
23  ETISS_PLUGIN_EXPORT const char * RV64IMACFD_nameCPUArch(unsigned index)
24  {
25 //TODO
26  switch (index)
27  {
28  case 0:
29  return "RV64IMACFD";
30  default:
31  return "";
32  }
33  }
34  ETISS_PLUGIN_EXPORT etiss::CPUArch* RV64IMACFD_createCPUArch(unsigned index,std::map<std::string,std::string> options)
35  {
36 //TODO
37  switch (index)
38  {
39  case 0:
40  {
41  auto it = options.find("coreno");
42  unsigned int coreno = 0;
43  if (it != options.end())
44  coreno = std::stoul(it->second);
45  else
46  etiss::log(etiss::WARNING, "no core number provided for core, using 0");
47 
48  return new RV64IMACFDArch(coreno);
49  }
50  default:
51  return 0;
52  }
53  }
55  {
56  delete arch;
57  }
58 }
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_LIBRARYIF_VERSION_FUNC_IMPL ETISS_PLUGIN_EXPORT unsigned RV64IMACFD_countCPUArch()
ETISS_PLUGIN_EXPORT etiss::CPUArch * RV64IMACFD_createCPUArch(unsigned index, std::map< std::string, std::string > options)
ETISS_PLUGIN_EXPORT const char * RV64IMACFD_nameCPUArch(unsigned index)
ETISS_PLUGIN_EXPORT void RV64IMACFD_deleteCPUArch(etiss::CPUArch *arch)
the interface to translate instructions of and processor architecture
Definition: CPUArch.h:162
#define ETISS_PLUGIN_EXPORT
Definition: pluginexport.h:15
#define ETISS_LIBRARYIF_VERSION_FUNC_IMPL
Definition: Misc.h:85
@ WARNING
Definition: Misc.h:128
void log(Verbosity level, std::string msg)
write log message at the given level.
Definition: Misc.cpp:125