ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Classes | Functions
ETISS_Frontend

Classes

class  etiss::Initializer
 Wrapper for the initialize and shutdown of the ETISS environment. More...
 

Functions

std::set< std::string > etiss::listCPUArchs ()
 Create a set with all identifier names of the known CPUArch plug-ins.
 
std::set< std::string > etiss::listJITs ()
 Create a set with all identifier names of the known JIT plug-ins.
 
std::set< std::string > etiss::listPlugins ()
 Create a set with all identifier names of the known plug-ins.
 
void etiss::preloadLibraries ()
 Search and try to load libraries.
 
std::shared_ptr< JITetiss::getJIT (std::string name, std::map< std::string, std::string > options=std::map< std::string, std::string >())
 Get a present JIT plug-in by name.
 
std::shared_ptr< CPUArchetiss::getCPUArch (std::string name, std::map< std::string, std::string > options=std::map< std::string, std::string >())
 Get a present CPUArch plug-in by name.
 
std::shared_ptr< Pluginetiss::getPlugin (std::string name, std::map< std::string, std::string > options=std::map< std::string, std::string >())
 Get a present Plugin plug-in by name.
 
bool etiss::loadLibrary (std::string path, std::string name)
 Load a library.
 
void etiss::addLibrary (std::shared_ptr< etiss::LibraryInterface > libInterface)
 Add a LibraryInterface to the ETISS environment.
 
std::set< std::string > etiss::listLibraries ()
 Create a set with strings of the library names and some information appended in square brackets.
 
std::set< std::string > etiss::listLibraryPrefixes ()
 Create a set with strings of the library names.
 
void etiss::initialize (std::vector< std::string > &args)
 Initialize and configure ETISS.
 
std::shared_ptr< etiss::JITetiss::getDefaultJIT ()
 Get the default JIT implementation.
 
void etiss::initialize_virtualstruct (std::shared_ptr< etiss::CPUCore > cpu_core)
 Initialize and configure etiss::VirtualStruct root with etiss::CPUCore cpu_core.
 
void etiss::initialize_virtualstruct (std::shared_ptr< etiss::CPUCore > cpu_core, std::function< bool(const etiss::fault::Fault &, const etiss::fault::Action &, std::string &)> const &fcustom_action)
 Extension of etiss::initialize_virtualstruct( std::shared_ptr<etiss::CPUCore>) to allow direct setting of custom action for cpu_core etiss::VirtualStruct with fcustom_action.
 
void etiss::shutdown ()
 Shutdown ETISS.
 
std::string etiss::errorMessage (etiss::int32 code, CPUArch *arch=0)
 Get the error message for an error code for a specific CPUArch plug-in.
 

Detailed Description

Function Documentation

◆ addLibrary()

void etiss::addLibrary ( std::shared_ptr< etiss::LibraryInterface libInterface)

Add a LibraryInterface to the ETISS environment.

Before a library can be use within ETISS the library needs to be added to ETISS.

Parameters
interfacePointer to the LibraryInterface of the library to be added.
See also
LibraryInteface.h

Definition at line 283 of file ETISS.cpp.

References etiss_defaultjit_, etiss_libraries_, etiss_libraries_mu_, and etiss::forceInitialization().

Referenced by etiss_initialize(), and etiss::loadLibrary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ errorMessage()

std::string etiss::errorMessage ( etiss::int32  code,
CPUArch arch = 0 
)

Get the error message for an error code for a specific CPUArch plug-in.

Todo:
add error message interface to etiss::CPUArch

TODO: cpu arch error message function

Definition at line 1041 of file ETISS.cpp.

References etiss::CPUArch::getName().

Here is the call graph for this function:

◆ getCPUArch()

std::shared_ptr< CPUArch > etiss::getCPUArch ( std::string  name,
std::map< std::string, std::string >  options = std::map<std::string, std::string>() 
)

Get a present CPUArch plug-in by name.

Parameters
nameString of the plug-in name.
optionsA key value map with the options required to load the plug-in.
Returns
Pointer to the plug-in.

Definition at line 179 of file ETISS.cpp.

References etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, etiss::log(), and options.

Referenced by etiss::CPUCore::create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultJIT()

std::shared_ptr< etiss::JIT > etiss::getDefaultJIT ( )

Get the default JIT implementation.

The default JIT implementation, is the first loaded JIT plug-in.

Returns
Pointer to the JIT plug-in.

Definition at line 326 of file ETISS.cpp.

References etiss_defaultjit_, and etiss::getJIT().

Referenced by etiss::Initializer::loadIniJIT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getJIT()

std::shared_ptr< JIT > etiss::getJIT ( std::string  name,
std::map< std::string, std::string >  options = std::map<std::string, std::string>() 
)

Get a present JIT plug-in by name.

Parameters
nameString of the plug-in name.
optionsA key value map with the options required to load the plug-in.
Returns
Pointer to the plug-in.

Definition at line 135 of file ETISS.cpp.

References etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, etiss::log(), and options.

Referenced by etiss::getDefaultJIT(), and etiss::Initializer::loadIniJIT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPlugin()

std::shared_ptr< Plugin > etiss::getPlugin ( std::string  name,
std::map< std::string, std::string >  options = std::map<std::string, std::string>() 
)

Get a present Plugin plug-in by name.

Parameters
nameString of the plug-in name.
optionsA key value map with the options required to load the plug-in.
Returns
Pointer to the plug-in.

Definition at line 223 of file ETISS.cpp.

References etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, etiss::INFO, etiss::log(), and options.

Referenced by etiss::Initializer::loadIniPlugins().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void etiss::initialize ( std::vector< std::string > &  args)

Initialize and configure ETISS.

Attention
It is recommended to use etiss::Initializer instead of calling etiss::initialize / etiss::shutdown manually

Definition at line 877 of file ETISS.cpp.

References etiss_initialize().

Referenced by etiss::Initializer::Initializer(), etiss::Initializer::Initializer(), etiss::Initializer::Initializer(), etiss::Initializer::Initializer(), and etiss::Initializer::Initializer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize_virtualstruct() [1/2]

void etiss::initialize_virtualstruct ( std::shared_ptr< etiss::CPUCore cpu_core)

Initialize and configure etiss::VirtualStruct root with etiss::CPUCore cpu_core.

This function also initializes configured faults which require a mounted core etiss::VirtualStruct. Add the virtual structure of the cpu to the VirtualStruct root. This allows to access the field of the cpu from a global context. See etiss::VirtualStruct::getVirtualStruct() and etiss::VirtualStruct::getResolvedField(). In this case e.g. the instructionPointer can be read from a global context by calling etiss::VirtualStruct::root()->getResolvedField("core0.instructionPointer") ->read().

Definition at line 910 of file ETISS.cpp.

References etiss::cfg(), etiss::FATALERROR, etiss::Configuration::get(), etiss::fault::Stressor::loadXML(), etiss::log(), etiss::VirtualStruct::root(), etiss::split(), and etiss::VERBOSE.

Referenced by etiss::initialize_virtualstruct(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize_virtualstruct() [2/2]

void etiss::initialize_virtualstruct ( std::shared_ptr< etiss::CPUCore cpu_core,
std::function< bool(const etiss::fault::Fault &, const etiss::fault::Action &, std::string &)> const &  fcustom_action 
)

Extension of etiss::initialize_virtualstruct( std::shared_ptr<etiss::CPUCore>) to allow direct setting of custom action for cpu_core etiss::VirtualStruct with fcustom_action.

Definition at line 956 of file ETISS.cpp.

References etiss::initialize_virtualstruct().

Here is the call graph for this function:

◆ listCPUArchs()

std::set< std::string > etiss::listCPUArchs ( )

Create a set with all identifier names of the known CPUArch plug-ins.

See also
CPUArch
Returns
A set with the identifier strings.

Definition at line 51 of file ETISS.cpp.

References etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, and etiss::log().

Here is the call graph for this function:

◆ listJITs()

std::set< std::string > etiss::listJITs ( )

Create a set with all identifier names of the known JIT plug-ins.

See also
JIT
Returns
A set with the identifier strings.

Definition at line 79 of file ETISS.cpp.

References etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, and etiss::log().

Here is the call graph for this function:

◆ listLibraries()

std::set< std::string > etiss::listLibraries ( )

Create a set with strings of the library names and some information appended in square brackets.

Note
Use etiss::listLibraryPrefixes to get the raw library names.
Returns
A set with the strings.

Definition at line 304 of file ETISS.cpp.

References etiss_libraries_, and etiss_libraries_mu_.

◆ listLibraryPrefixes()

std::set< std::string > etiss::listLibraryPrefixes ( )

Create a set with strings of the library names.

The library names are also required to be used as prefixes to symbols (library name + '_': e.g. ETISSINCLUDED_exportedSymbol).

Returns
A set with the strings.

Definition at line 315 of file ETISS.cpp.

References etiss_libraries_, and etiss_libraries_mu_.

◆ listPlugins()

std::set< std::string > etiss::listPlugins ( )

Create a set with all identifier names of the known plug-ins.

See also
Plugin
Returns
A set with the identifier strings.

Definition at line 107 of file ETISS.cpp.

References etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, and etiss::log().

Here is the call graph for this function:

◆ loadLibrary()

bool etiss::loadLibrary ( std::string  path,
std::string  name 
)

Load a library.

The library needs to be an implementation of etiss::CPUArch, etiss::JIT or etiss::Plugin. A Library interface is created for the library with etiss::LibraryInterface::openSharedLibrary and added to the ETISS environment with etiss::addLibrary.

Parameters
pathString of the library location. E.g. "/path/to/lib"
nameString of the library name. The library name is the file name of the library without the lib prefix and the file extension. E.g. for libOR1KArch.so the name is OR1KArch.
Returns
True if the operation was successful or false otherwise.

Definition at line 270 of file ETISS.cpp.

References etiss::addLibrary(), and etiss::LibraryInterface::openSharedLibrary().

Referenced by loadLibraryList(), and etiss::preloadLibraries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preloadLibraries()

void etiss::preloadLibraries ( )

Search and try to load libraries.

This function is called automatically by CPUCore::create(1).

See also
ETISSInit.cpp

Definition at line 154 of file ETISSInit.cpp.

References etiss::cfg(), etiss_preload_libraries, findLibs(), etiss::Configuration::get(), etiss::installDir(), etiss::loadLibrary(), and loadLibraryList().

Referenced by etiss_initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown()

void etiss::shutdown ( )

Shutdown ETISS.

This function shutsdown the ETISS environment. All used libraries are unloaded and the used resources are released.

Attention
It is recommende to use etiss::Initializer instead of calling etiss::initialize / etiss::shutdown manually

Definition at line 964 of file ETISS.cpp.

References etiss::fault::Stressor::clear(), etiss::ERROR, etiss_libraries_, etiss_libraries_mu_, etiss_shutdownOk, etiss::CPUCore::list(), etiss::log(), and etiss::py::shutdown().

Referenced by etiss_shutdown(), and etiss::Initializer::~Initializer().

Here is the call graph for this function:
Here is the caller graph for this function: