ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Macros | Functions
ReturnCode.h File Reference

contains exception/return codes used to control execution of an etiss::CPUCore More...

#include "etiss/jit/types.h"
Include dependency graph for ReturnCode.h:

Go to the source code of this file.

Macros

#define etiss__toString_(X)   #X
 
#define etiss_toString(X)   etiss__toString_(X)
 
#define etiss__merge2_(X, Y)   X##Y
 
#define etiss_merge2(X, Y)   etiss__merge2_(X, Y)
 
#define defineReturnCode(NAME, VALUE, MSG)   static const etiss_int32 ETISS_RETURNCODE_##NAME = VALUE
 define RETURNCODE definition template for easy use with c and c++ More...
 
#define ETISS_RETURNCODE_TEMPORARY_COUNT   8
 

Functions

int32_t etiss_returncode_setTemporary (const char *msg)
 sets the message of a temporary return code and returns the returncode. More...
 
 defineReturnCode (NOERROR, 0, "No error.")
 
 defineReturnCode (GENERALERROR, -1, "General error.")
 
 defineReturnCode (RELOADBLOCKS, -2, "Clear cached translated blocks.")
 
 defineReturnCode (RELOADCURRENTBLOCK, -3, "Clear the cached block that returned this code.")
 
 defineReturnCode (DBUS_READ_ERROR, -5, "Data bus read error.")
 
 defineReturnCode (DBUS_WRITE_ERROR, -6, "Data bus write error.")
 
 defineReturnCode (IBUS_READ_ERROR, -7, "Instruction bus read error.")
 
 defineReturnCode (IBUS_WRITE_ERROR, -8, "Instruction bus write error.")
 
 defineReturnCode (INTERRUPT, -9, "Signal an interrupt.")
 
 defineReturnCode (RESET, -10, "Reset signal.")
 
 defineReturnCode (ILLEGALINSTRUCTION, -11, "Illegal instruction.")
 
 defineReturnCode (ILLEGALJUMP, -12, "Illegal jump address.")
 
 defineReturnCode (INSTR_PAGEFAULT, -13, "Instruction page fault.")
 
 defineReturnCode (LOAD_PAGEFAULT, -14, "Load page fault.")
 
 defineReturnCode (STORE_PAGEFAULT, -15, "Store page fault.")
 
 defineReturnCode (GDBNOERROR, -16, "Has the same effect as NOERROR but allows exiting a block where NOERROR " "would have continued block execution.")
 
 defineReturnCode (SYSCALL, -17, "System call")
 
 defineReturnCode (PAGEFAULT, -18, "Virtual memory tranlation fault.")
 
 defineReturnCode (BREAKPOINT, -19, "Break point.")
 
 defineReturnCode (CPUFINISHED, 1<< 31, "Finished cpu execution. This is the proper way to exit from " "etiss::CPUCore::execute.")
 
 defineReturnCode (CPUTERMINATED, 0x80000001, "Terminates cpu execution. this is the proper way to force an " "exit from etiss::CPUCore::execute (e.g. by a debugger).")
 
 defineReturnCode (JITERROR, -32, "Error in JIT.")
 
 defineReturnCode (JITCOMPILATIONERROR, -33, "Error in JIT compilation.")
 
 defineReturnCode (ARCHERROR, -34, "Error in architecture.")
 
 defineReturnCode (EMULATIONNOTSUPPORTED, -35, "Emulation is not supported.")
 
 defineReturnCode (INVALIDSYSTEM, -36, "An ETISS_System structure doesn't contain " "the neccessary function pointers.")
 
 defineReturnCode (TEMPORARY0, -128, "")
 
 defineReturnCode (TEMPORARY1, -129, "")
 
 defineReturnCode (TEMPORARY2, -130, "")
 
 defineReturnCode (TEMPORARY3, -131, "")
 
 defineReturnCode (TEMPORARY4, -132, "")
 
 defineReturnCode (TEMPORARY5, -133, "")
 
 defineReturnCode (TEMPORARY6, -134, "")
 
 defineReturnCode (TEMPORARY7, -135, "")
 

Detailed Description

contains exception/return codes used to control execution of an etiss::CPUCore


Copyright 2018 Infineon Technologies AG

This file is part of ETISS tool, see https://github.com/tum-ei-eda/etiss.

The initial version of this software has been created with the funding support by the German Federal
Ministry of Education and Research (BMBF) in the project EffektiV under grant 01IS13022.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Author
Marc Greim marc..nosp@m.grei.nosp@m.m@myt.nosp@m.um.d.nosp@m.e, Chair of Electronic Design Automation, TUM
Date
July 24, 2014
Version
0.1

any return code defined with the defineReturnCode(NAME,VALUE,MSG) macro is available in C++ under the name etiss::RETURNCODE::NAME and ETISS_RETURNCODE_NAME and in C under the name ETISS_RETURNCODE_NAME. In C++ the return code names and messages are accessible via the maps returned by etiss::RETURNCODE::getErrorMessages and etiss::RETURNCODE::getErrorNames

Definition in file ReturnCode.h.

Macro Definition Documentation

◆ defineReturnCode

#define defineReturnCode (   NAME,
  VALUE,
  MSG 
)    static const etiss_int32 ETISS_RETURNCODE_##NAME = VALUE

define RETURNCODE definition template for easy use with c and c++

Definition at line 154 of file ReturnCode.h.

◆ etiss__merge2_

#define etiss__merge2_ (   X,
 
)    X##Y

Definition at line 98 of file ReturnCode.h.

◆ etiss__toString_

#define etiss__toString_ (   X)    #X

Definition at line 94 of file ReturnCode.h.

◆ etiss_merge2

#define etiss_merge2 (   X,
 
)    etiss__merge2_(X, Y)

Definition at line 99 of file ReturnCode.h.

◆ ETISS_RETURNCODE_TEMPORARY_COUNT

#define ETISS_RETURNCODE_TEMPORARY_COUNT   8

Definition at line 207 of file ReturnCode.h.

◆ etiss_toString

#define etiss_toString (   X)    etiss__toString_(X)

Definition at line 95 of file ReturnCode.h.

Function Documentation

◆ defineReturnCode() [1/34]

defineReturnCode ( ARCHERROR  ,
34,
"Error in architecture."   
)

◆ defineReturnCode() [2/34]

defineReturnCode ( BREAKPOINT  ,
19,
"Break point."   
)

◆ defineReturnCode() [3/34]

defineReturnCode ( CPUFINISHED  ,
1<<  31,
"Finished cpu execution. This is the proper way to exit from " "etiss::CPUCore::execute."   
)

◆ defineReturnCode() [4/34]

defineReturnCode ( CPUTERMINATED  ,
0x80000001  ,
"Terminates cpu execution. this is the proper way to force an " "exit from etiss::CPUCore::execute (e.g. by a debugger)."   
)

◆ defineReturnCode() [5/34]

defineReturnCode ( DBUS_READ_ERROR  ,
5,
"Data bus read error."   
)

◆ defineReturnCode() [6/34]

defineReturnCode ( DBUS_WRITE_ERROR  ,
6,
"Data bus write error."   
)

◆ defineReturnCode() [7/34]

defineReturnCode ( EMULATIONNOTSUPPORTED  ,
35,
"Emulation is not supported."   
)

◆ defineReturnCode() [8/34]

defineReturnCode ( GDBNOERROR  ,
16,
"Has the same effect as NOERROR but allows exiting a block where NOERROR " "would have continued block execution."   
)

◆ defineReturnCode() [9/34]

defineReturnCode ( GENERALERROR  ,
1,
"General error."   
)

◆ defineReturnCode() [10/34]

defineReturnCode ( IBUS_READ_ERROR  ,
7,
"Instruction bus read error."   
)

◆ defineReturnCode() [11/34]

defineReturnCode ( IBUS_WRITE_ERROR  ,
8,
"Instruction bus write error."   
)

◆ defineReturnCode() [12/34]

defineReturnCode ( ILLEGALINSTRUCTION  ,
11,
"Illegal instruction."   
)

◆ defineReturnCode() [13/34]

defineReturnCode ( ILLEGALJUMP  ,
12,
"Illegal jump address."   
)

◆ defineReturnCode() [14/34]

defineReturnCode ( INSTR_PAGEFAULT  ,
13,
"Instruction page fault."   
)

◆ defineReturnCode() [15/34]

defineReturnCode ( INTERRUPT  ,
9,
"Signal an interrupt."   
)

◆ defineReturnCode() [16/34]

defineReturnCode ( INVALIDSYSTEM  ,
36,
"An ETISS_System structure doesn't contain " "the neccessary function pointers."   
)

◆ defineReturnCode() [17/34]

defineReturnCode ( JITCOMPILATIONERROR  ,
33,
"Error in JIT compilation."   
)

◆ defineReturnCode() [18/34]

defineReturnCode ( JITERROR  ,
32,
"Error in JIT."   
)

◆ defineReturnCode() [19/34]

defineReturnCode ( LOAD_PAGEFAULT  ,
14,
"Load page fault."   
)

◆ defineReturnCode() [20/34]

defineReturnCode ( NOERROR  ,
,
"No error."   
)

◆ defineReturnCode() [21/34]

defineReturnCode ( PAGEFAULT  ,
18,
"Virtual memory tranlation fault."   
)

◆ defineReturnCode() [22/34]

defineReturnCode ( RELOADBLOCKS  ,
2,
"Clear cached translated blocks."   
)

◆ defineReturnCode() [23/34]

defineReturnCode ( RELOADCURRENTBLOCK  ,
3,
"Clear the cached block that returned this code."   
)

◆ defineReturnCode() [24/34]

defineReturnCode ( RESET  ,
10,
"Reset signal."   
)

◆ defineReturnCode() [25/34]

defineReturnCode ( STORE_PAGEFAULT  ,
15,
"Store page fault."   
)

◆ defineReturnCode() [26/34]

defineReturnCode ( SYSCALL  ,
17,
"System call"   
)

◆ defineReturnCode() [27/34]

defineReturnCode ( TEMPORARY0  ,
128,
""   
)

◆ defineReturnCode() [28/34]

defineReturnCode ( TEMPORARY1  ,
129,
""   
)

◆ defineReturnCode() [29/34]

defineReturnCode ( TEMPORARY2  ,
130,
""   
)

◆ defineReturnCode() [30/34]

defineReturnCode ( TEMPORARY3  ,
131,
""   
)

◆ defineReturnCode() [31/34]

defineReturnCode ( TEMPORARY4  ,
132,
""   
)

◆ defineReturnCode() [32/34]

defineReturnCode ( TEMPORARY5  ,
133,
""   
)

◆ defineReturnCode() [33/34]

defineReturnCode ( TEMPORARY6  ,
134,
""   
)

◆ defineReturnCode() [34/34]

defineReturnCode ( TEMPORARY7  ,
135,
""   
)

◆ etiss_returncode_setTemporary()

int32_t etiss_returncode_setTemporary ( const char *  msg)

sets the message of a temporary return code and returns the returncode.

use for custom messages. message may be overwritten if all other temporary return codes are used

Definition at line 81 of file ReturnCode.cpp.