ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Implementation Status

This document describes the current status of integrated/default supplied Libraries and their implementations of etiss::CPUArch, etiss::JIT and etiss::Plugin.

ETISS's Integrated Library

This library is loaded at startup unless -fno-etiss.load_integrated_libraries was passed to etiss::initialize. Header/Source files are located in include/etiss/IntegratedLibrary/* and src/IntegratedLibrary/*

Name
(as used in etiss::getJIT, etiss::getCPUArch and etiss::getPlugin)
Description Options Class Type
PrintInstruction
(etiss::getPlugin)
Prints instructions in the form:
Executing: <instruction> @ <address>
	Executing: 0x9c605001 @0x0000000000003938

	Executing: 0x9c800000 @0x000000000000393c

	Executing: 0x04001683 @0x0000000000003940 (start of meta instruction)

	Executing: 0x15000000 @0x0000000000003944 (end of meta instruction)
	    
etiss::plugin::PrintInstruction etiss::Plugin
etiss::TranslatorPlugin
gdbserver
(etiss::getPlugin)
Runs a gbd server. This requires support from the used etiss::CPUArch implementation (namely a valid etiss::plugin::gdb::GDBCore implementation). gdb can then connect to a server port to debug the simulated software. The server port is 2222 by default. If this plugin is added to a etiss::CPUCore the execution will wait until a debugger connected and continued execution.
Enter in a terminal:
	gdb
	file <Your Simulated Software>
	target remote localhost:2222
	    
port -> <int> : specify server port
	    
etiss::plugin::gdb::Server etiss::Plugin
etiss::CoroutinePlugin
etiss::TranslatorPlugin
etiss::SystemWrapperPlugin
BlockAccurateHandler
(etiss::getPlugin)
Allows to inject register errors after a block. Errors are read from a file for the specified register.A Error definition consist of a injection time and the index of a flipped bit:
Syntax:
	TIME_IN_NANOSECONDS;AFFECTED_BIT[;ERROR_ID]

NOTE: 	the ";ERROR_ID" part is optional. No spaces may exist inbetween the values

Example:
	1000;3
	2000;0;1234

above example schedules an error at time:
	1000 ns: bit number 3 will be flipped e.g. @999ns: 0x00000000 @1001ns: 0x00000008
	2000 ns: bit number 0 will be flipped e.g. @1999ns: 0x00000008 @2100ns: 0x00000009

NOTE: 	due to the infrequent execution of this plugin (usually only after a block)
	there may be a large delay between scheduled time and application of the error

	    
-r<REGISTERNAME> -> <filepath> : read error definitions from the file for the specified register
	    
etiss::plugin::errorInjection::BlockAccurateHandler etiss::Plugin
etiss::CoroutinePlugin

OR1K example implementation

ETISS has a shared library that provides an example 32bit implementation of the OR1K architecture. The instructions of the ORBIS32 and ORFPX32 group are supported. For detailed information on the implementation refer to https://docs.google.com/spreadsheets/d/1BbbDszsa3vRI0pxGgkrSbvH-ye9bHRmfAEO6OwCqSvU/edit?usp=sharing

To use this implementation call "etiss::CPUCore::create("or1k","YOURCORENAME",options);" where "options" is std::map<std::string,std::string>. The shared library should be located in ArchImpl/OR1K.

Currently supported options are:

Option
Values Description

GCC based just in time compiler

This etiss::JIT implementation writes the passed code to a file and invokes gcc to create a dynamic library which is then loaded into the application with dlopen and the RTLD_LOCAL flag. etiss::JIT::translate returns a library handle and etiss::JIT::getFunction returns a function pointer loaded with dlsym.

gcc get invoked with the flags "-c -Wall -fPIC -march=native -mtune=native -pipe -g -O2" in debug mode and "-c -Wall -fPIC -march=native -mtune=native -pipe -O3" otherwise to create an object file.

Currently supported options are:

Option
Values Description
jit.gcc.cleanup true
false
deletes temporary files (code + shared libraries) after the instance has been deleted

LLVM/Clang based just in time compiler

This etiss::JIT implementation compiles and loads passed code within the memory. Compilation is usually faster than with the GCC based compiler. LLVMs MCJIT engine is used to generate executable functions. etiss::JIT::getFunction can only return function pointers (not any symbol like the dlsym call of the GCC based compiler). This restriction has no relevance for the intended use of etiss::JIT.

For more information refer to http://www.llvm.org and http://clang.llvm.org/ . The execution engine used to create function pointers is described on this site http://llvm.org/docs/MCJITDesignAndImplementation.html

Currently no options are supported.

TCC (Tiny C Compiler) based just in time compiler

TCC can compile code in memory like LLVM/Clang but is much faster. The compiled functions are however considerable less performant that those from GCC or LLVM/Clang. TCC is recommended for use with very large programs where fast compilation and small memory footprint are the main aspect.

For more information refer to http://bellard.org/tcc/

Currently no options are supported.