VIRTUTECH CONFIDENTIAL    Previous - Up - Next

3.2   Simics API Data Types

3.2.1   Generic Data Types

addr_prof_iter_t
NAME
addr_prof_iter_t
DESCRIPTION

An address profile iterator will iterate over a specified portion of the address space in some unspecified order, and return every nonzero counter value exactly once. When done, it will return 0.

attr_value_t, attr_kind_t, attr_list_t, attr_data_t
NAME
attr_value_t, attr_kind_t, attr_list_t, attr_data_t
SYNOPSIS
struct attr_value {
        attr_kind_t          kind;
        union {
                const char    *string;   /* Sim_Val_String   */
                integer_t      integer;  /* Sim_Val_Integer  */
                integer_t      boolean;  /* Sim_Val_Boolean  */
                double         floating; /* Sim_Val_Floating */
                attr_list_t    list;     /* Sim_Val_List     */
                attr_dict_t    dict;     /* Sim_Val_Dict     */
                attr_data_t    data;     /* Sim_Val_Data     */
                conf_object_t *object;   /* Sim_Val_Object   */
        } u;
};
typedef struct attr_value attr_value_t;
typedef enum {
        Sim_Val_Invalid  = 0,
        Sim_Val_String   = 1,
        Sim_Val_Integer  = 2,
        Sim_Val_Floating = 3,
        Sim_Val_List     = 4,
        Sim_Val_Data     = 5,
        Sim_Val_Nil      = 6,
        Sim_Val_Object   = 7,
        Sim_Val_Dict     = 8,
        Sim_Val_Boolean  = 9
} attr_kind_t;
typedef struct attr_list attr_list_t;
struct attr_list {
        integer_t            size;
        struct attr_value   *vector; /* [size] */
};
typedef struct {
        integer_t              size;
        struct attr_dict_pair *vector; /* [size] */
} attr_dict_t;
typedef struct attr_dict_pair attr_dict_pair_t;
struct attr_dict_pair {
        struct attr_value   key;
        struct attr_value   value;
};
typedef struct attr_data attr_data_t;
struct attr_data {
        integer_t            size;
        uint8               *data; /* [size] */
};
DESCRIPTION
The attr_value_t is the type used for all values in the configuration system. All but the Sim_Val_Data kind are stored as text when taking checkpoints.

The following table shows how the different types of values are to be interpreted in C and Python, respectively:

KindCPython
Sim_Val_Invalidn/araises exception
Sim_Val_Stringconst char *String
Sim_Val_Integerinteger_tInteger
Sim_Val_Booleaninteger_tBool
Sim_Val_FloatingdoubleFloat
Sim_Val_Listattr_list_tList
Sim_Val_Dictattr_dict_tDictionary
Sim_Val_Dataattr_data_tTuple
Sim_Val_Niln/aNone

Use the SIM_make_attr_XXX functions to create these data types.

SEE ALSO
SIM_make_attr_integer, SIM_make_attr_boolean, SIM_make_attr_string, SIM_make_attr_floating, SIM_make_attr_object, SIM_make_attr_invalid, SIM_make_attr_nil, SIM_make_attr_list, SIM_alloc_attr_list, SIM_alloc_attr_dict
class_data_t, class_kind_t
NAME
class_data_t, class_kind_t
SYNOPSIS
typedef enum {
        Sim_Class_Kind_Vanilla, /* object is saved at checkpoints */
        Sim_Class_Kind_Session, /* object is saved as part of a
                                 * session only */
        Sim_Class_Kind_Pseudo   /* object is never saved */
} class_kind_t;
typedef struct class_data {
        conf_object_t *(*new_instance)(parse_object_t *parse_obj);
        int (*delete_instance)(conf_object_t *obj);
        void (*finalize_instance)(conf_object_t *obj);
        attr_value_t (*default_get_attr)(const char *name,
                                         conf_object_t *obj,
                                         attr_value_t *idx);
        set_error_t (*default_set_attr)(const char *name,
                                        conf_object_t *obj,
                                        attr_value_t *val,
                                        attr_value_t *idx);
        conf_class_t         *parent;
        const char           *description;
        class_kind_t          kind;
} class_data_t;
DESCRIPTION
The class_data_t type is used when a new class is registered. The only mandatory field is new_instance. Make sure that uninitialized fields are set to zero before the structure is passed to SIM_register_class(). The optional finalize_instance function is called when all attributes have been initialized in an object, and in all other objects that are created at the same time.
conf_object_t
NAME
conf_object_t
SYNOPSIS
struct conf_object {
        conf_class_t *class_data;  /* class data */
        const char *name;          /* instance name */
        struct conf_object *queue; /* queue */
        lang_void *object_data;    /* internal to class implementation */
        int object_id;             /* deprecated, do not use */
        int configured;            /* set when configuration ready */
};
typedef struct conf_object conf_object_t;
DESCRIPTION
All classes must inherit the conf_object_t type by including it first in the subclass structure. Always initialize the conf_object_t part of an object structure using the SIM_object_constructor() function.
data_or_instr_t
NAME
data_or_instr_t
SYNOPSIS
typedef enum {
        Sim_DI_Instruction      = 0,
        Sim_DI_Data             = 1
} data_or_instr_t;
DESCRIPTION
This type is used in several API functions and structures to indicate if data or instructions is used.
dbuffer_t
NAME
dbuffer_t
SYNOPSIS
typedef struct dbuffer dbuffer_t;
DESCRIPTION
This type is used to store blocks of binary data. It is optimized for fast adding and removing of data, and does fast copying between buffers using copy-on-write semantics.
endianness_t
NAME
endianness_t
SYNOPSIS
typedef enum {
        Sim_Endian_Target,
        Sim_Endian_Host_From_BE,
        Sim_Endian_Host_From_LE,
        Sim_Endian_Host          /* Obsolete. Do not use */
} endianness_t;
DESCRIPTION
Specifies the endianness to use for certain memory operations. When Sim_Endian_Target is used, the data from memory is copied without any endian conversion. Sim_Endian_Host_From_BE and Sim_Endian_Host_From_LE copies data between a big-endian, or little-endian, memory and a host buffer. Sim_Endian_Host is obsolete and should not be used.
event_handler_t
NAME
event_handler_t
SYNOPSIS
typedef void (*event_handler_t)(conf_object_t *obj,
                                lang_void *parameter);
typedef event_handler_t event_function_t;

DESCRIPTION
The event_handler_t data type is used for event handler functions. event_function_t is a deprecated data type used for the same purpose.
SEE ALSO
SIM_step_clean, SIM_step_post, SIM_time_clean, SIM_time_clean
exception_type_t
NAME
exception_type_t
SYNOPSIS
typedef int exception_type_t;
DESCRIPTION
Accommodate all kinds of exceptions and pseudo-exceptions in a single type.
generic_transaction_t
NAME
generic_transaction_t
SYNOPSIS
struct generic_transaction {
        logical_address_t   logical_address;
        physical_address_t  physical_address;
        unsigned int        size;             /* size in bytes */
        mem_op_type_t       type;             /* opaque */
        unsigned int        atomic:1;         /* trans is part of an atomic
                                                 sequence of mem ops */

        unsigned int        inquiry:1;        /* set to 1 to indicate inquiry
                                                 access */
        unsigned int        speculative:1;    /* access is speculative,
                                                 may not be committed */

        unsigned int        ignore:1;         /* set to 1 to signal no-op
                                                 (don't do access) */
        unsigned int        may_stall:1;      /* when set to 0, any stall time
                                                 returned is ignored */
        unsigned int        ma_no_reissue:1;  /* if the transaction's
                                                 instruction is rolled back
                                                 during a stall the memory
                                                 hierarchy should not be called
                                                 again */
        unsigned int        reissue:1;        /* If this is 1, the transaction
                                                 will be reissued if a stall
                                                 greater than 0 is returned */
        unsigned int        block_STC:1;      /* set to 1 iff anybody (MMU,
                                                 memory hierarchy, etc) wants
                                                 to see future accesses of this
                                                 type */
        unsigned int        use_page_cache:1; /* internal - do not change */

        unsigned int        inverse_endian:1; /* data transfer is
                                                 byte-reversed */

        unsigned int        page_cross:2;     /* page crossing
                                                 0 - no crossing
                                                 1 - first access
                                                 2 - second access */

        unsigned int        use_iostc:1;      /* may be added to iostc */
        unsigned int        iostc_blocked:1;  /* was blocked from iostc */

        ini_type_t          ini_type;         /* cpu, device, or other */
        conf_object_t      *ini_ptr;

        int                 id;               /* will be different for
                                                 simultaneously outstanding
                                                 transactions */
        exception_type_t    exception;        /* set if memhier throws
                                                 exception, otherwise
                                                 Sim_PE_No_Exception */
        void               *user_ptr;         /* user pointer that Simics never
                                                 touches */

        char               *real_address;     /* data pointer for the
                                                 initiator */

        int                space_count;       /* internal, # of memory space
                                                 transitions */

        page_t *page;           /* internal: page if RAM access */
        page_t *tag_page;       /* internal: tag page if any */
        unsigned tag_page_ofs;  /* internal: start of page in tag page */

        physical_address_t  source_physical_address; /* if arc_type
                                                        == Arc_Taken_Branch */
        arc_type_t          arc_type;         /* filled for fetches from
                                                 branch targets */
        int                 allocation_size;  /* The size of the transaction 
                                                 (including local part) only
                                                 valid if > 0 */

        stall_id_t          stall_id;
};
typedef struct generic_transaction generic_transaction_t;

typedef enum {
        /* Arc caused by a regular branch instruction. */
        Arc_None,
        Arc_Taken_Branch,
        Arc_Init,
        Arc_Cache_Line_Start,
        Arc_User,
        Arc_Compensate,
        Arc_Interrupt,
        Arc_Page_Start,
        /* Arm */
        /* Arc caused by a software interrupt instruction. */
        Arc_Exception_Counted,
        /* Arc caused by some other exception than software interrupt. This
           kind of branch arc is special in that it is not subtracted from the
           number of times the instruction has been executed. */
        Arc_Exception_Not_Counted,
        /* Arc caused by an ALU instruction with pc as rd and the s bit set,
           i.e, probably a return from an exception. */
        Arc_Return_From_Exception,
        /* Arc caused by the execution entering or leaving the interpreter. */
        Arc_To_From_Interpreter,
        /* Arc caused by a fall through from one storage page to the next. */
        Arc_End_Of_Page,

        /* Just to avoid comma problems with the ifdefs... */
        Arc_Dummy
} arc_type_t;

typedef struct page page_t;
DESCRIPTION
Used to communicate information about memory operations. Not all info is complete/correct in all uses. For an example of how a memory hierarchy can use a memory transaction, see example memory hierarchy.

The transaction parameters are divided into a generic part shown below and an architecture specific part. The generic struct is included as the first component of the memory_transaction_t struct, where the architecture-specific parameters are declared.

Normally the logical address and most control flags are set before the mmu is called. The host_address is a host pointer to the start of the simulated memory the transaction loads from or stores to.

real_address points to the destination for a load or source of a store operation.

The ini_ptr points to the object initiating the operation, this is either a processor or a device depending on the ini_type field.

typedef enum {
        Sim_Initiator_Illegal         = 0x0,    /* catch uninitialized */
        Sim_Initiator_CPU             = 0x1000,
        Sim_Initiator_CPU_V9          = 0x1100,
        Sim_Initiator_CPU_UII         = 0x1101,
        Sim_Initiator_CPU_UIII        = 0x1102,
        Sim_Initiator_CPU_UIV         = 0x1103,
        Sim_Initiator_CPU_UT1         = 0x1104, /* 1105, 1106 internal */
        Sim_Initiator_CPU_X86         = 0x1200,
        Sim_Initiator_CPU_PPC         = 0x1300,
        Sim_Initiator_CPU_Alpha       = 0x1400,
        Sim_Initiator_CPU_IA64        = 0x1500,
        Sim_Initiator_CPU_MIPS        = 0x1600,
        Sim_Initiator_CPU_MIPS_RM7000 = 0x1601,
        Sim_Initiator_CPU_MIPS_E9000  = 0x1602,
        Sim_Initiator_CPU_ARM         = 0x1700,
        Sim_Initiator_Device          = 0x2000,
        Sim_Initiator_PCI_Device      = 0x2010,
        Sim_Initiator_Cache           = 0x3000, /* The transaction is a cache
                                                   transaction as defined by
                                                   g-cache */
        Sim_Initiator_Other           = 0x4000  /* initiator == NULL */
} ini_type_t;

The mmu sets the physical_address and possibly set some more control flags. The memory hierarchy only reads the memory transaction to decide what stall time to return.

The block_STC bit functions as a "veto" flag for various modules. Any code can set this to 1, but it should not be set to zero. When set to one, the next access to the same STC line will be passed to the memory hierarchy.

The may_stall bit is set to zero for a few types of references where the simulator kernel cannot deal with stalling. A memory hierarchy must return stall time zero when the flag is clear. A memory hierarchy that wants to stall anyway should accumulate stall time, and trigger the total stall time when a stall-capable access comes along (which is not guaranteed to happen but most probably will). For atomic read/write instructions (swap) any access may stall. If an instruction is stalled the entire instruction will be executed after the stalltime is up. The may_stall bit may be cleared by the mmu.

The ignore flag can be set to 1 by the MMU. When set no memory operation will be performed. This is useful for instructions coded as a memory operation but which really only modify mmu internal state.

The inverse_endian flag may be changed by the MMU. If set, the data involved in the access will be transferred in the opposite order. If not set, the bytes will be transferred in the same order they occur in the memory space. A memory object should not set this bit to a hard value, only toggle it. It may have been set by Simics for implementation reasons.

The page_cross field is used to indicate when Simics has split a memory transaction in two. It is normally 0, but when a transaction crosses an MMU page boundary, it will be converted into two separate transactions, one for each accessed page. The addresses and sizes are adjusted to confine them to their respective pages. The first of these transaction will have page_cross set to 1, and the second will have it set to 2.

The atomic is read only. It may be read by any module. The atomic flag is set for any data memory transaction caused by an atomic instruction; i.e., an instruction whose memory references must be performed without any intervening memory references (from other processors). The atomic sequence is a read followed by a write.

The use_page_cache is used internally. Do not change its value.

The user_ptr may be used to pass information between user defined modules that use memory transactions. Simics does not use this field.

The type field should not be used directly; use the SIM_mem_op_is_xxx() predicate functions, where xxx can be instruction, data, read, or write. SIM_set_mem_op_type() function is used to set the type of a memory operation (see the mem_op_type_t enum definition), and SIM_get_mem_op_type() is used to read it.

id is a unique number for all currently outstanding memory transactions. In an in-order version of Simics, this field is zero. See the SIM_get_unique_memory_transaction_id() function.

When activated, instruction fetches set arc_type to indicate if the fetch is the result of sequential execution or a branch. In case of a branch, the source_physical_address is set to the address where the branch was made from.

SEE ALSO
mem_op_type_t

hap_flags_t
NAME
hap_flags_t
SYNOPSIS
typedef enum {
        Sim_Hap_Simulation  = 1,
        Sim_Hap_Old_Format  = 2,  /* internal use */
        Sim_Hap_Added       = 4,  /* internal use */
        Sim_Hap_Deleted     = 8,  /* internal use */
        Sim_Hap_Attr        = 16  /* internal use */
} hap_flags_t;
DESCRIPTION
The hap_flags_t is used to specify additional information about a hap. Sim_Hap_Simulation signals that the hap is used to model simulated behavior. All other values are currently for Simics internal use only.
SEE ALSO
SIM_hap_add_callback
hap_type_t
NAME
hap_type_t
SYNOPSIS
typedef int hap_type_t;
DESCRIPTION
This data type is used to represent hap (occurrence) types. This is a runtime number that may change between different Simics invocations. Haps are normally identified by strings, but by calling SIM_hap_get_number(), a lookup from such a name to a hap_type_t can be made.
SEE ALSO
SIM_hap_get_number, SIM_hap_add_type, SIM_for_all_hap_types
instr_type_t
NAME
instr_type_t
SYNOPSIS
typedef uint64 instr_type_t;
#define It_Other                   UINT64_C(0x1)
#define It_Alu                     UINT64_C(0x2)
#define It_Relbranch               UINT64_C(0x4)
#define It_Load                    UINT64_C(0x8)
#define It_Store                   UINT64_C(0x10)
#define It_Sethi                   UINT64_C(0x20)
#define It_Popc                    UINT64_C(0x40)
#define It_Fp_Triop                UINT64_C(0x80)
#define It_Fp_Diop                 UINT64_C(0x100)
#define It_Fp_Unop                 UINT64_C(0x200)
#define It_Fp_Cmp                  UINT64_C(0x400)
#define It_Swap                    UINT64_C(0x800)
#define It_Vis                     UINT64_C(0x1000)
#define It_Flush                   UINT64_C(0x2000)
#define It_Call                    UINT64_C(0x4000)
#define It_Return                  UINT64_C(0x8000)
#define It_Trap                    UINT64_C(0x10000)
#define It_Trap_Ret                UINT64_C(0x20000)
#define It_Idle                    UINT64_C(0x40000)
#define It_User_Decoder_Defined    UINT64_C(0x80000)
#define It_Varbranch               UINT64_C(0x100000) /* Branchtarget is dynamic */
#define It_Absbranch               UINT64_C(0x200000) /* branch to an immidiate absolute target */
#define It_Fstsw                   UINT64_C(0x400000) /* fstsw */
#define It_Fp                      UINT64_C(0x800000) /* floating point instruction */
#define It_Membar                  UINT64_C(0x1000000)
#define It_Prefetch                UINT64_C(0x2000000)
#define It_Convert                 UINT64_C(0x4000000)
#define It_Cmov                    UINT64_C(0x8000000)
#define It_String                  UINT64_C(0x10000000)
#define It_Mov                     UINT64_C(0x20000000)
#define It_SSE                     UINT64_C(0x40000000)
#define It_MMX                     UINT64_C(0x80000000)
#define It_Cond                    UINT64_C(0x100000000) /* Conditional, i.e it may continue to 
                                                            the sequentially next instruction */

DESCRIPTION
This encodes the type of an instruction, which is composed of ORing together the It_ constants.
instruction_error_t
NAME
instruction_error_t
SYNOPSIS
typedef enum instruction_error {
        Sim_IE_OK = 0,
        Sim_IE_Unresolved_Dependencies,
        Sim_IE_Speculative,
        Sim_IE_Stalling,
        Sim_IE_Not_Inserted,      /* trying to execute or squash an 
                                     instruction that is inserted. */ 
        Sim_IE_Exception,         /* (SPARC-V9 only) */
        Sim_IE_Fault = Sim_IE_Exception, 
        Sim_IE_Trap,              /* (X86 only) Returned if a trap is 
                                     encountered */
        Sim_IE_Interrupt,         /* (X86 only) Returned if an interrupt is 
                                     waiting and interrupts are enabled */

        Sim_IE_Sync_Instruction,  /* Returned if sync instruction is 
                                     not allowd to execute */
        Sim_IE_No_Exception,      /* Returned by SIM_instruction_
                                     handle_exception */
        Sim_IE_Illegal_Interrupt_Point,
        Sim_IE_Illegal_Exception_Point,
        Sim_IE_Illegal_Address,
        Sim_IE_Illegal_Phase,
        Sim_IE_Interrupts_Disabled,
        Sim_IE_Illegal_Id,
        Sim_IE_Instruction_Tree_Full,
        Sim_IE_Null_Pointer,
        Sim_IE_Illegal_Reg,
        Sim_IE_Invalid,
        Sim_IE_Out_of_Order_Commit, 
        Sim_IE_Retired_Instruction, /* try to squash a retiring instruction */
        Sim_IE_Not_Committed,       /* Returned by SIM_instruction_end */
        Sim_IE_Code_Breakpoint,
        Sim_IE_Mem_Breakpoint,
        Sim_IE_Step_Breakpoint,
        Sim_IE_Hap_Breakpoint
} instruction_error_t;
DESCRIPTION
This type is used by the Micro Architecture Interface and documented in the Simics Out Of Order Guide.
instruction_phase_t
NAME
instruction_phase_t
SYNOPSIS
typedef enum instruction_phase {
        Sim_Phase_Initiated,
        Sim_Phase_Fetched,
        Sim_Phase_Decoded,
        Sim_Phase_Executed,
        Sim_Phase_Retired,
        Sim_Phase_Committed,
        Sim_Phases
} instruction_phase_t;
DESCRIPTION
This type is used by the Micro Architecture Interface and documented in the Simics Out Of Order Guide.
instruction_status_t
NAME
instruction_status_t
SYNOPSIS
typedef enum { 
        Sim_IS_Waiting  = 0x1,           /* Not all inputs are ready */
        Sim_IS_Ready    = 0x2,           /* All inputs are ready */
        Sim_IS_Stalling = 0x4,           /* Waiting for memory to 
                                            finish the operation */
        Sim_IS_Executed = 0x8,           /* Done */
        Sim_IS_Faulting = 0x10,          /* Has raised an exception - 
                                            a fault in x86 case */
        Sim_IS_Branch_Taken = 0x20,      /* The branch is taken for 
                                            branch instructions */
        Sim_IS_Trap     = 0x40,          /* (x86) this instruction
                                            generated a trap */
        Sim_IS_Interrupt = 0x80,         /* (x86) this instruction can not
                                            be executed because the interrupt
                                            must be taken first */
        Sim_IS_Retired = 0x100           /* All stores are retired */
} instruction_status_t;
DESCRIPTION
This type is used by the Micro Architecture Interface and documented in the Simics Out Of Order Guide.
int8, int16, int32, int64, uint8, uint16, uint32, uint64, intptr_t, uintptr_t, integer_t, uinteger_t
NAME
int8, int16, int32, int64, uint8, uint16, uint32, uint64, intptr_t, uintptr_t, integer_t, uinteger_t
SYNOPSIS
These data types have host-dependent definitions. Use the api-help Simics command line command to get their exact definition.
DESCRIPTION
These are basic integer data types defined by the Simics headers (unless defined by system header files).

The intn types are defined to be signed integers of exactly n bits. The uintn types are their unsigned counterparts.

intptr_t and uintptr_t are signed and unsigned integer types of a size that lets any pointer to void be cast to it and then cast back to a pointer to void, and the result will compare equal to the original pointer. This typically means that the two types are 32 bits wide on 32-bit machines and 64 bits on 64-bit machines.

integer_t and uinteger_t are the largest integers (signed and unsigned, respectively) used by the Simics API. They are currently defined to be 64 bits.

lang_void
NAME
lang_void
SYNOPSIS
typedef void lang_void;
typedef void typed_lang_void;
DESCRIPTION
In some places in the Simics API, arguments of type lang_void * are used. This data type is used to allow transparent passing of any data type in the current programming language as argument. In C, this works exactly like a void * and in Python, it is any Python object. The type typed_lang_void is equivalent to lang_void in the Simics API.

Typically, this is used by iterator functions in the API which take callback functions as arguments. The callback function is later called with the lang_void data and the object being iterated over.

SEE ALSO
SIM_for_all_processors, SIM_register_typed_attribute, SIM_hap_add_callback
log_object_t
NAME
log_object_t
SYNOPSIS
struct log_object {
        conf_object_t   obj;

        uint32          access_cnt;    /* number of IO transactions
                                        * performed  */
        int             access_active; /* set while an access is in
                                        * progress  */

        io_trace_log_t *active_trace;  /* temporary log list during
                                        * the access  */

        io_trace_t     *trace_buffer;
        int             trace_next;
        int             trace_wrap;
        int             trace_size;

        int             log_level;
        int             group_mask;
        int             type_mask;
};
typedef struct log_object log_object_t;
DESCRIPTION
The log_object_t structure directly inherits conf_object_t, and it extends that class with logging functionality. Use SIM_log_constructor() to initialize new instances. The constructor automatically adds attributes to save and restore the members in the log_object_t structure.

Since the internal representation of this structure may change between releases, classes using the structure should not inspect the members directly (except for obj), but rather use the attributes. New entries should be added with the SIM_log_message() function. From C/C++ the SIM_log_... helper functions are recommended.

SEE ALSO
SIM_log_constructor, SIM_log_message
log_type_t
NAME
log_type_t
SYNOPSIS
typedef enum {
        Sim_Log_Info,           // Normal informational message
        Sim_Log_Error,          // Simics error
        Sim_Log_Undefined,      // use of undefined target behavior
        Sim_Log_Spec_Violation, // target program violates the specification
        Sim_Log_Target_Error,   // error state in target (not in Simics)
        Sim_Log_Unimplemented,  // not implemented in Simics
        Sim_Log_Num_Types       // Do not use
} log_type_t;
DESCRIPTION
This type defines different log types that are used by the logging facility to categorise messages.
logical_address_t, physical_address_t, generic_address_t, linear_address_t
NAME
logical_address_t, physical_address_t, generic_address_t, linear_address_t,
SYNOPSIS
These data types are target architecture independent, and always large enough to hold 64-bit addresses.
DESCRIPTION
These are integer data types defined to reflect the nature of the simulated architecture.

logical_address_t is an unsigned integer sufficiently large to contain logical (virtual) addresses on the target machine. define.

physical_address_t is an unsigned integer sufficiently large to contain physical addresses on the target machine.

generic_address_t is defined to be the largest of the logical_address_t and physical_address_t types.

linear_address_t is used for linear addresses used on x86 machines after segmentation but before paging.

map_info_t
NAME
map_info_t
SYNOPSIS
typedef struct map_info {
        physical_address_t  base;
        physical_address_t  start;
        physical_address_t  length;
        int                 function;
        uint8               priority;
        int                 align_size;
        swap_mode_t         reverse_endian;
} map_info_t;
typedef enum swap_mode {
        Sim_Swap_None       = 0,
        Sim_Swap_Bus        = 1,
        Sim_Swap_Bus_Trans  = 2,
        Sim_Swap_Trans      = 3
} swap_mode_t;
DESCRIPTION
The map_info_t structure members have the following meaning:
map_list_t
NAME
map_list_t
SYNOPSIS
typedef enum { 
        Sim_Map_Ram,
        Sim_Map_Rom,
        Sim_Map_IO,
        Sim_Map_Port,
        Sim_Map_Translate = 0x100, /* pseudo - do not use */
        Sim_Map_Translate_To_Space,
        Sim_Map_Translate_To_Ram,
        Sim_Map_Translate_To_Rom
} map_type_t;
struct map_list {
        map_type_t       map_type;
        conf_object_t   *object;
        void            *interface_ptr;
        void            *target_interface;
        void            *breakpoint_interface;
        void            *bridge_interface;
        conf_object_t   *target_object;
        conf_object_t   *bridge;
        map_info_t       map_info;

        physical_address_t map_size; /* not constant, use with caution */

        int              deleted;  /* internal flag - should always be 0 ! */
};
typedef struct map_list map_list_t;
DESCRIPTION
This data structure is used to pass information about the set of mappings a particular address in an address space contains.
mem_op_type_t
NAME
mem_op_type_t
SYNOPSIS
typedef enum {
        Sim_Trans_Load          = 0,
        Sim_Trans_Store         = Sim_Trn_Write,
        Sim_Trans_Instr_Fetch   = Sim_Trn_Instr,
        Sim_Trans_Prefetch      = Sim_Trn_Prefetch | Sim_Trn_Control,
        Sim_Trans_Cache         = Sim_Trn_Control
} mem_op_type_t;
DESCRIPTION
This enum is used to identify the type of a memory operation. The function SIM_get_mem_op_type() returns the type of a generic_transaction_t, and SIM_set_mem_op_type() is used to set it.
SEE ALSO
SIM_get_mem_op_type, SIM_set_mem_op_type, generic_transaction_t, SIM_get_mem_op_type_name
pci_memory_transaction_t
NAME
pci_memory_transaction_t
SYNOPSIS
typedef struct pci_memory_transaction {
        generic_transaction_t s;
        /* The original_size field will probably be moved to the
           generic_transaction_t structure in the future */
        uint32 original_size;
        int bus_address;
} pci_memory_transaction_t;
DESCRIPTION
The pci_memory_transaction_t is used for memory accesses initiated by PCI devices. It is based on a generic memory transaction struct, followed by two PCI specific fields. The first, original_size, should not be accessed if possible since it may be changed in future Simics versions. It specifies the size of the original memory access before possible split up. The bus_address field is the address of the initiating PCI device in a PCI Type 1 address format, i.e. bus << 16 | device << 11 | function << 8. A generic_transaction_t can be converted to a pci_memory_transaction_t if the ini_type field has the value Sim_Initiator_PCI_Device.
SEE ALSO
generic_transaction_t, PCI_data_from_memory
processor_mode_t
NAME
processor_mode_t
SYNOPSIS
typedef enum {
        Sim_CPU_Mode_User       = 0,
        Sim_CPU_Mode_Supervisor = 1,
        Sim_CPU_Mode_Hypervisor
} processor_mode_t;
DESCRIPTION
The processor_mode_t data type is used to specify if a CPU is running in user mode or in a privileged mode (often called supervisor mode). For processor architectures with several privilege levels, the non-user levels are all identified as Sim_CPU_Mode_Supervisor.
processor_t
NAME
processor_t
SYNOPSIS
typedef struct conf_object processor_t;
DESCRIPTION
Equivalent to a conf_object_t, but usually used when the expected object is a processor.
pseudo_exceptions_t
NAME
pseudo_exceptions_t
SYNOPSIS
typedef enum {
        Sim_PE_No_Exception = 1025,
        Sim_PE_Code_Break,
        Sim_PE_Silent_Break,
        Sim_PE_Inquiry_Outside_Memory,
        Sim_PE_Inquiry_Unhandled,
        Sim_PE_IO_Not_Taken,
        Sim_PE_IO_Error,
        Sim_PE_Interrupt_Break,
        Sim_PE_Interrupt_Break_Take_Now,
        Sim_PE_Exception_Break,
        Sim_PE_Hap_Exception_Break,
        Sim_PE_Stall_Cpu,
        Sim_PE_Locked_Memory,
        Sim_PE_Return_Break,
        Sim_PE_Instruction_Finished,
        Sim_PE_Default_Semantics,
        Sim_PE_Ignore_Semantics,
        Sim_PE_Speculation_Failed,
        Sim_PE_Invalid_Address,
        Sim_PE_MAI_Return,
        Sim_PE_Last
} pseudo_exceptions_t;
DESCRIPTION
Used to signal simulator exceptions for memory accesses. Memory access functions in Simics use exception_type_t to return errors. Errors usually corresponds to hardware exceptions, but in some cases additional return values are needed, and then pseudo exceptions are used. The most common is Sim_PE_No_Exception, indicating that no error has occurred. Most pseudo exceptions are Simics internals, but some are used by devices and memory spaces.
Sim_PE_No_Exception
No exception.
Sim_PE_IO_Not_Taken
Access to unmapped memory. In the PCI memory spaces interpreted as master abort.
Sim_PE_IO_Error
Accessed device returned error. In the PCI memory spaces interpreted as target abort.
Sim_PE_Inquiry_Outside_Memory
Same as Sim_PE_IO_Not_Taken, but for inquiry accesses.
Sim_PE_Inquiry_Unhandled
The accessed device does not support inquiry operations.
Sim_PE_Stall_Cpu
Timing model requested stall
Sim_PE_Default_Semantics
Used by ASI handlers on SPARC, and for user decoders to signal that the default semantics should be run.
Sim_PE_Ignore_Semantics
Used by ASI handlers on SPARC to signal no update of destination registers.
Internal:
Sim_PE_Silent_Break, Sim_PE_Return_Break, Sim_PE_Interrupt_Break, Sim_PE_Interrupt_Break_Take_Now, Sim_PE_Exception_Break, Sim_PE_Hap_Exception_Break, Sim_PE_Instruction_Finished, Sim_PE_Invalid_Address, Sim_PE_Speculation_Failed, Sim_PE_MAI_Return, Sim_PE_Last.
read_or_write_t
NAME
read_or_write_t
SYNOPSIS
typedef enum {
        Sim_RW_Read  = 0,
        Sim_RW_Write = 1
} read_or_write_t;
DESCRIPTION
Whether a memory access is a read (from memory) or a write (to memory).
register_type_t
NAME
register_type_t
SYNOPSIS
typedef enum {
        Sim_Reg_Type_Invalid,
        Sim_Reg_Type_Integer,
        Sim_Reg_Type_Floating,
        Sim_Reg_Type_Control
} register_type_t;
DESCRIPTION
Defines several type of register banks.
set_error_t
NAME
set_error_t
SYNOPSIS
typedef enum {
        Sim_Set_Ok,
        Sim_Set_Need_Integer,
        Sim_Set_Need_Floating,
        Sim_Set_Need_String,
        Sim_Set_Need_List,
        Sim_Set_Need_Dict,
        Sim_Set_Need_Boolean,
        Sim_Set_Need_Data,
        Sim_Set_Need_Object,
        Sim_Set_Object_Not_Found,
        Sim_Set_Interface_Not_Found,
        Sim_Set_Illegal_Value,
        Sim_Set_Illegal_Type,
        Sim_Set_Illegal_Index,
        Sim_Set_Attribute_Not_Found,
        Sim_Set_Not_Writable,
        Sim_Set_Ignored
} set_error_t;
DESCRIPTION
The SIM_set_attribute() family of functions and the set functions registered with the SIM_register_typed_attribute() family of functions return a set_error_t value to report success or failure.

Sim_Set_Ok
The attribute was successfully set.

Sim_Set_Need_Integer
Sim_Set_Need_Floating
Sim_Set_Need_String
Sim_Set_Need_List
Sim_Set_Need_Dict
Sim_Set_Need_Boolean
Sim_Set_Need_Data
Sim_Set_Need_Object

The value is of an illegal type for the attribute. Deprecated, use Sim_Set_Illegal_Type instead.

Sim_Set_Object_Not_Found
The string value does not match any object name.?Deprecated, use attributes of object type instead of string attributes referring to object names.

Sim_Set_Interface_Not_Found
The object value does not implement an interface required by the attribute.

Sim_Set_Illegal_Value
The value is of a legal type for the attribute, but outside the legal range.

Sim_Set_Illegal_Type
The value is of an illegal type for the attribute.

Sim_Set_Attribute_Not_Found
The object has no attribute with the specified name. Should only be returned by SIM_set_attribute() family of functions, not by attribute set functions.

Sim_Set_Not_Writable
The attribute is read-only.

Sim_Set_Ignored
The value was accepted for backwards compatibility reasons, but was ignored. Should only be returned by set_event_info() functions registered with the event-poster interface.

simtime_t, cycles_t, pc_step_t, nano_secs_t
NAME
simtime_t, cycles_t, pc_step_t, nano_secs_t
SYNOPSIS
typedef integer_t simtime_t;
typedef simtime_t cycles_t;
typedef simtime_t pc_step_t;
typedef simtime_t nano_secs_t;
DESCRIPTION
These are the types used for keeping track of time in Simics.

cycles_t is used when the time is specified in cycles, pc_step_t is used when the time is specified in steps, and simtime_t is used in places where it is unknown whether the time is in steps or cycles. See the chapter "The Simics Simulator" in the Simics User Guide for a discussion about the difference between steps and cycles.

nano_secs_t is used to express a number of nanoseconds (10−9 seconds).

socket_t
NAME
socket_t
SYNOPSIS
#ifdef _WIN32
typedef SOCKET socket_t;
#else
typedef int socket_t;
#endif /* !_WIN32 */

DESCRIPTION
This data type is used to identify a communication socket (typically TCP/IP). It is defined to be an int on UNIX systems and SOCKET under Windows.

3.2.2   Architecture Specific Data Types

alpha_cpu_mode_t
NAME
alpha_cpu_mode_t
SYNOPSIS
typedef enum {
        Sim_Alpha_Mode_Kernel     = 0,
        Sim_Alpha_Mode_Executive  = 1,
        Sim_Alpha_Mode_Supervisor = 2,
        Sim_Alpha_Mode_User       = 3
} alpha_cpu_mode_t;
DESCRIPTION
The alpha_cpu_mode_t corresponds to the current mode (CM) field of the processor status register.
alpha_memory_transaction_t
NAME
alpha_memory_transaction_t
SYNOPSIS
typedef struct alpha_memory_transaction {

        /* generic transaction */
        generic_transaction_t s;

        /* mode of the current alpha cpu */
        int mode;

        /* flags used by hw_ld / hw_st instructions */
        palcode_memop_flags_t palcode_flags;

        /* The pte is needed the Icache module, since it needs the ASM bit. */
        uint64 pte;

        /* if non-zero, the id needed to calculate the program counter */
        intptr_t turbo_miss_id;
} alpha_memory_transaction_t;
DESCRIPTION

The s field contains generic information about memory operations (see generic_transaction_t). The mode is the current mode of the alpha cpu. The values of palcode_flags, used by hw_ld and hw_st instructions, see palcode_memop_flags_t datatype.

arm_memory_transaction_t
NAME
arm_memory_transaction_t
SYNOPSIS
typedef struct arm_memory_transaction {

        /* generic transaction */
        generic_transaction_t s;

        /* processor mode */
        processor_mode_t mode;

        int rotate;

        /* if non-zero, the id needed to calculate the program counter */
        intptr_t turbo_miss_id;
} arm_memory_transaction_t;
DESCRIPTION

This is the ARM specific memory transaction data structure. The generic data is stored in the s field.

The mode field specifies the processor mode the MMU should assume when processing the transaction. This is the same as the current mode of the processor, except that it is always Sim_CPU_Mode_User for ldrbt, ldrt, strbt and strt instructions.

ia64_fp_register_t
NAME
ia64_fp_register_t
SYNOPSIS
typedef struct ia64_fp_register {
        uint64   significand;
        uint32   exponent;
        unsigned sign:1;
        unsigned nat:1;
} ia64_fp_register_t;
DESCRIPTION
Representation of an IA64 floating-point register.
ia64_interruption_t
NAME
ia64_interruption_t
SYNOPSIS
typedef enum {
        IA64_Abort_RESET = 1,
        IA64_Abort_MCA,
        IA64_Int_INIT,
        IA64_Int_PMI,
        IA64_Int_INT,
        IA64_Fault_IR_unimplmented_data_address,
        IA64_Fault_IR_data_nested_tlb,
        IA64_Fault_IR_alternate_data_tlb,
        IA64_Fault_IR_vhpt_data,
        IA64_Fault_IR_data_tlb,
        IA64_Fault_IR_data_page_not_present,
        IA64_Fault_IR_data_nat_page_consumption,
        IA64_Fault_IR_data_key_miss,
        IA64_Fault_IR_data_key_permission,
        IA64_Fault_IR_data_access_rights,
        IA64_Fault_IR_data_access_bit,
        IA64_Fault_IR_data_debug,
        IA64_Fault_IA32_instruction_breakpoint,
        IA64_Fault_IA32_code_fetch,
        IA64_Fault_alternate_instruction_tlb,
        IA64_Fault_vhpt_instruction,
        IA64_Fault_instruction_tlb,
        IA64_Fault_instruction_page_not_present,
        IA64_Fault_instruction_nat_page_consumption,
        IA64_Fault_instruction_key_miss,
        IA64_Fault_instruction_key_permission,
        IA64_Fault_instruction_access_rights,
        IA64_Fault_instruction_access_bit,
        IA64_Fault_instruction_debug,
        IA64_Fault_IA32_instruction_length,
        IA64_Fault_IA32_invalid_opcode,
        IA64_Fault_IA32_instruction_intercept,
        IA64_Fault_illegal_operation,
        IA64_Fault_illegal_dependency,
        IA64_Fault_break_instruction,
        IA64_Fault_privileged_operation,
        IA64_Fault_disabled_floating_point_register,
        IA64_Fault_diabled_instruction_set_transition,
        IA64_Fault_IA32_device_not_available,
        IA64_Fault_IA32_fp_error,
        IA64_Fault_register_nat_consumption,
        IA64_Fault_reserved_register_field,
        IA64_Fault_unimplemented_data_address,
        IA64_Fault_privileged_register,
        IA64_Fault_speculative_operation,
        IA64_Fault_IA32_stack_exception,
        IA64_Fault_IA32_general_protection,
        IA64_Fault_data_nested_tlb,
        IA64_Fault_alternate_data_tlb,
        IA64_Fault_vhpt_data,
        IA64_Fault_data_tlb,
        IA64_Fault_data_page_not_present,
        IA64_Fault_data_nat_page_consumption,
        IA64_Fault_data_key_miss,
        IA64_Fault_data_key_permission,
        IA64_Fault_data_access_rights,
        IA64_Fault_data_dirty_bit,
        IA64_Fault_data_access_bit,
        IA64_Fault_data_debug,
        IA64_Fault_unaligned_data_reference,
        IA64_Fault_IA32_alignment_check,
        IA64_Fault_IA32_locked_data_reference,
        IA64_Fault_IA32_segment_not_present,
        IA64_Fault_IA32_divide_by_zero,
        IA64_Fault_IA32_bound,
        IA64_Fault_IA32_sse_numeric_error,
        IA64_Fault_unsupported_data_reference,
        IA64_Fault_floating_point,
        IA64_Trap_unimplemented_instruction_address,
        IA64_Trap_floating_point,
        IA64_Trap_lower_privilege_transfer,
        IA64_Trap_taken_branch,
        IA64_Trap_single_step,
        IA64_Trap_IA32_system_flag_intercept,
        IA64_Trap_IA32_gate_intercept,
        IA64_Trap_IA32_into,
        IA64_Trap_IA32_breakpoint,
        IA64_Trap_IA32_software_interrupt,
        IA64_Trap_IA32_data_breakpoint,
        IA64_Trap_IA32_taken_branch,
        IA64_Trap_IA32_single_step
} ia64_interruption_t;
DESCRIPTION
These are the interruptions that can occur in an ia64 processor. The numbers correspond to the numbers given by the Intel architecture manuals. They are, among other things, used by the Core_Exception hap.
ia64_interruption_type_t
NAME
ia64_interruption_type_t
SYNOPSIS
typedef enum {
        IT_abort,
        IT_interrupt,
        IT_fault,
        IT_trap
} ia64_interruption_type_t;
DESCRIPTION
Defines the different type of interruptions in the IA-64 architecture.
ia64_iva_offset_t
NAME
ia64_iva_offset_t
SYNOPSIS
typedef enum {
        IVA_vhpt_trans      = 0x0000,
        IVA_instr_tlb       = 0x0400,
        IVA_data_tlb        = 0x0800,
        IVA_alt_instr_tlb   = 0x0c00,
        IVA_alt_data_tlb    = 0x1000,
        IVA_data_nested     = 0x1400,
        IVA_instr_key_miss  = 0x1800,
        IVA_data_key_miss   = 0x1c00,
        IVA_dirty_bit       = 0x2000,
        IVA_instr_acc_bit   = 0x2400,
        IVA_data_acc_bit    = 0x2800,
        IVA_break           = 0x2c00,
        IVA_ext_int         = 0x3000,
        IVA_page_not_pres   = 0x5000,
        IVA_key_perm        = 0x5100,
        IVA_instr_acc_right = 0x5200,
        IVA_data_acc_right  = 0x5300,
        IVA_gen_exc         = 0x5400,
        IVA_dis_fp          = 0x5500,
        IVA_nat_cons        = 0x5600,
        IVA_spec            = 0x5700,
        IVA_debug           = 0x5900,
        IVA_unal_ref        = 0x5a00,
        IVA_unsup_data_ref  = 0x5b00,
        IVA_fp              = 0x5c00,
        IVA_fp_trap         = 0x5d00,
        IVA_lp_trans_trap   = 0x5e00,
        IVA_tak_br_trap     = 0x5f00,
        IVA_ss_trap         = 0x6000,
        IVA_ia32_exc        = 0x6900,
        IVA_ia32_intercept  = 0x6a00,
        IVA_ia32_interrupt  = 0x9b00
} ia64_iva_offset_t;
DESCRIPTION
The location of the Interruption Vector Table (IVT) is stored in the cr.iva control register. These constants describe the offsets of the different vectors in the table.
ia64_memory_transaction_t
NAME
ia64_memory_transaction_t
SYNOPSIS
typedef struct ia64_memory_transaction {

        /* generic transaction */
        generic_transaction_t s;

        int privilege_level;
        int speculative;
        int advanced;
        int non_access;
        uint16 isr_code;

        int rse;
        int rse_ir;

        /* "Output" */
        int deferred_fault;
} ia64_memory_transaction_t;
DESCRIPTION
The s field contains generic information about memory operations (see generic_transaction_t).

The privilege_level is the current privilege level (0-3) of the cpu.

The speculative flag indicates that the memory operation is caused by control speculation.

The advanced flag indicates an advanced load, i.e. that the memory operation is caused by data speculation.

The isr_code is used to help the MMU fill in the correct values in the cr.isr register on a fault.

The rse flag indicates that the memory operation is caused by a mandatory RSE operation, and the rse_ir whether the current frame is incomplete. This is used to raise the appropriate faults on failure.

The deferred_fault is set by the MMU when a speculative memory operation fails.

mips_memory_transaction_t
NAME
mips_memory_transaction_t
SYNOPSIS
typedef struct mips_memory_transaction {

        /* generic transaction */
        generic_transaction_t s;

        /* Cache coherency, values as the C field in EntryLo0 and EntryLo1. */
        unsigned int cache_coherency:3;

        /* if non-zero, the id needed to calculate the program counter */
        intptr_t turbo_miss_id;
} mips_memory_transaction_t;
DESCRIPTION

This is the MIPS specific memory transaction data structure. The generic data is stored in the s field.

The cache_coherency field specifies the cache coherency attribute of the memory transaction, as defined by the C field of the EntryLo0 and EntryLo1 coprocessor 0 registers.

palcode_memop_flags_t
NAME
palcode_memop_flags_t
SYNOPSIS
typedef enum palcode_memop_flags {
        
        /* nothing special */
        Pal_memop_normal   = 0x0000,

        /* cleared: the effective address is virtual
           set:     the effective address is physical */
        Pal_memop_physical = 0x0001, 
        
        /* cleared: use current mode for access checks
           set:     use alt mode for access checks */
        Pal_memop_altmode  = 0x0002,    

        /* cleared: check fault-on-read (FOR) and read access violations
           set:     check FOR, fault-on-write and read/write violations */
        Pal_memop_wrtck    = 0x0004,

        /* cleared: length is longword
           set:     length is quadword */
        Pal_memop_quadword = 0x0008,

        /* cleared: normal fetch
           set:     flags a virtual pte fetch */
        Pal_memop_vpte     = 0x0010,

        /* cleared:  normal operation
           set:      load-locked version of hw_ld */
        Pal_memop_lock     = 0x0020,

        /* cleared:  normal operation
           set:      store-conditional version of hw_st */
        Pal_memop_cond     = 0x0040

} palcode_memop_flags_t;
DESCRIPTION
PALcode uses hw_ld and hw_st instructions to access memory outside of the realm of normal Alpha memory management. These flags are used in such operations.
ppc_mem_instr_origin_t
NAME
ppc_mem_instr_origin_t
SYNOPSIS
typedef enum {
        /* Normal load or store instructions */
        Normal_Load_Store = 0,

        /* No data touched by the load/store will be placed in cache */
        Caching_Inhibited,

        Instr_Multiple,         /* load/store multiple */
        Instr_String,           /* load/store string */

        Instr_Altivec_Element,  /* Altivec load/store element */

        /* Data cache manipulations */
        Instr_dcbt,             /* data cache block touch */
        Instr_dcbst,            /* data cache block store */
        Instr_dcbtst,           /* data cache block touch for store */
        Instr_dcbi,             /* data cache block invalidate */
        Instr_dcbf,             /* data cache block flush */
        Instr_dcbfl,            /* data cache block flush local */
        Instr_dcba,             /* data cache block allocate */
        Instr_dcbz,             /* data cache block to zero */
        
        /* Instruction cache manipulations */
        Instr_icbi,             /* instruction cache block invalidate */
        
        /* Data stream (Altivec) manipulations */
        Instr_dst,              /* data stream touch */
        Instr_dstt,             /* data stream touch transient */
        Instr_dstst,            /* data stream touch for store */
        Instr_dststt,           /* data stream touch for store transient */

        /* e500 cache lock apu instructions */
        Instr_dcblc_l1,         /* data cache block lock clear (L1) */
        Instr_dcblc_l2,         /* data cache block lock clear (L2) */
        Instr_dcbtls_l1,        /* data cache block touch and lock set (L1)*/
        Instr_dcbtls_l2,        /* data cache block touch and lock set (L1)*/
        Instr_dcbtstls_l1,      /* data cache block touch for store and lock
                                   set (L1)*/
        Instr_dcbtstls_l2,      /* data cache block touch for store and lock
                                   set (L1)*/
        Instr_icblc_l1,         /* instruction cache block clear (L1) */
        Instr_icblc_l2,         /* instruction cache block clear (L2) */
        Instr_icbtls_l1,        /* instruction cache block touch and lock
                                   set (L1) */
        Instr_icbtls_l2,        /* instruction cache block touch and lock
                                   set (L1) */

        /* Other loads/stores or cache affecting instructions */
        Instr_lwarx,
        Instr_stwcx,
        Instr_ldarx,
        Instr_stdcx,
        Instr_lq,
        Instr_stq,

        /* Other cache affecting instructions */
        Instr_sync,
        Instr_eieio,
        Instr_ecowx,
        Instr_eciwx,
        Instr_tlbie,
        Instr_tlbsync,
        Instr_isync,

        Instr_lfdp,             /* Load Floating point Double Pair */
        Instr_stfdp             /* Store Floating point Double Pair */
} ppc_mem_instr_origin_t;
DESCRIPTION
List of special memory operations that can be send by a PPC processor.
ppc_memory_transaction_t
NAME
ppc_memory_transaction_t
SYNOPSIS
typedef struct ppc_memory_transaction {

        /* generic transaction */
        generic_transaction_t s;

        processor_mode_t mode;
        ppc_mem_instr_origin_t instr_origin;
        logical_address_t ea_origin;
        uint8 wimg;
        uint8 alignment;

        /* cache operations may flag this to cause prefetches to be no-ops */
        uint8 inhibit_exception;

        intptr_t turbo_miss_id;
} ppc_memory_transaction_t;
DESCRIPTION

This is the PPC specific memory transaction data structure. The generic data is stored in the s field.

The current processor mode when generating this transaction is stored in the mode field.

The type of instruction generating the memory transactions is provided by the instr_origin field. Note that it is mainly provided for special memory accesses like cache block operations..

The wimg field is filled in by the MMU with the corresponding WIMG bits during the translation.

The alignment field contains the size on which the transaction is required to be aligned.

The inhibit_exception field is set for operations that should be ignored if triggering an exception.

register_id_t
NAME
register_id_t
SYNOPSIS
typedef uint32 register_id_t;
typedef enum {
        V9_Reg_Id_R0   = 0,
        /* R1 - R31 */
        V9_Reg_Id_F0   = 32,
        /* F1 - F63 */
        V9_Reg_Id_FCC0 = 96,
        V9_Reg_Id_FCC1 = 97,
        V9_Reg_Id_FCC2 = 98,
        V9_Reg_Id_FCC3 = 99,
        V9_Reg_Id_CC   = 100,
        V9_Reg_Id_PC   = 101,
        V9_Reg_Id_NPC  = 102,
        V9_Reg_Id_AEXC = 103, /* part of fsr */
        V9_Reg_Id_CEXC = 104, /* part of fsr */
        V9_Reg_Id_FTT  = 105, /* part of fsr */
        V9_Reg_Id_DUDL = 106, /* part of fprs */
        V9_Reg_Id_FEF  = 107, /* part of fprs */
        V9_Reg_Id_Y    = 108,
        V9_Reg_Id_GSR  = 109,
        V9_Reg_Id_CANSAVE = 110,
        V9_Reg_Id_CANRESTORE = 111,
        V9_Reg_Id_OTHERWIN = 112,
        V9_Reg_Id_CLEANWIN = 113,
        V9_Reg_Id_CWP  = 114,
        V9_Reg_Id_ASI  = 115,

        V9_Reg_Id_Not_Used  = 124,
        V9_Reg_Id_Sync = 125
} v9_register_id_t;
typedef enum {
        X86_Reg_Id_Rax = 0,
        X86_Reg_Id_Rcx = 1,
        X86_Reg_Id_Rdx = 2,
        X86_Reg_Id_Rbx = 3,
        X86_Reg_Id_Rsp = 4,
        X86_Reg_Id_Rbp = 5,
        X86_Reg_Id_Rsi = 6,
        X86_Reg_Id_Rdi = 7,

        X86_Reg_Id_R8  = 8,
        X86_Reg_Id_R9  = 9,
        X86_Reg_Id_R10 = 10,
        X86_Reg_Id_R11 = 11,
        X86_Reg_Id_R12 = 12,
        X86_Reg_Id_R13 = 13,
        X86_Reg_Id_R14 = 14,
        X86_Reg_Id_R15 = 15,

        X86_Reg_Id_Xmm0  = 16,
        X86_Reg_Id_Xmm1  = 17,
        X86_Reg_Id_Xmm2  = 18,
        X86_Reg_Id_Xmm3  = 19,
        X86_Reg_Id_Xmm4  = 20,
        X86_Reg_Id_Xmm5  = 21,
        X86_Reg_Id_Xmm6  = 22,
        X86_Reg_Id_Xmm7  = 23,

        X86_Reg_Id_Xmm8  = 24,
        X86_Reg_Id_Xmm9  = 25,
        X86_Reg_Id_Xmm10 = 26,
        X86_Reg_Id_Xmm11 = 27,
        X86_Reg_Id_Xmm12 = 28,
        X86_Reg_Id_Xmm13 = 29,
        X86_Reg_Id_Xmm14 = 30,
        X86_Reg_Id_Xmm15 = 31,

        X86_Reg_Id_Mm0 = 32,
        X86_Reg_Id_Mm1 = 33,
        X86_Reg_Id_Mm2 = 34,
        X86_Reg_Id_Mm3 = 35,
        X86_Reg_Id_Mm4 = 36,
        X86_Reg_Id_Mm5 = 37,
        X86_Reg_Id_Mm6 = 38,
        X86_Reg_Id_Mm7 = 39,

        X86_Reg_Id_PC  = 40,    /* this is RIP */

        X86_Reg_Id_CF  = 41,    /* integer condition code flags */
        X86_Reg_Id_DST = 42,    /* DST field used to cache PF flag */
        X86_Reg_Id_AF  = 43,
        X86_Reg_Id_ZF  = 44,
        X86_Reg_Id_SF  = 45,
        X86_Reg_Id_OF  = 46,
        X86_Reg_Id_DF  = 47,

        X86_Reg_Id_EFLAGS = 48, /* the whole 32 bits eflags */

        X86_Reg_Id_C0 = 49,     /* floating point cc flags */
        X86_Reg_Id_C1 = 50,
        X86_Reg_Id_C2 = 51,
        X86_Reg_Id_C3 = 52,
        X86_Reg_Id_Top = 53,    /* floating point stack top */
        X86_Reg_Id_Not_Used,    /* dummy number that can be used */

        X86_Reg_Id_Local_Max    /* keep this one last */
} x86_register_id_t;
DESCRIPTION
For SPARC the enum v9_register_id_t can be used to refer to the different registers. The following macros also exists to generate the register id for integer and floating point registers:

#define V9_REG_ID_RN(n)   (V9_Reg_Id_R0+(n))
#define V9_REG_ID_FN(n)   (V9_Reg_Id_F0+(n))
#define V9_REG_ID_FCCN(n) (V9_Reg_Id_FCC0+(n))

For x86 the x86_register_id_t can be used to refer to the different registers.

v9_exception_type_t
NAME
v9_exception_type_t
SYNOPSIS
typedef enum v9_exception_type {
        Power_On_Reset = 0x001,
        Watchdog_Reset = 0x002,
        Externally_Initiated_Reset = 0x003,
        Software_Initiated_Reset = 0x004,
        Red_State_Exception = 0x005,
        Instruction_Access_Exception = 0x008,
        Instruction_Access_MMU_Miss = 0x009,
        Instruction_Access_Error = 0x00a,
        Illegal_Instruction = 0x010,
        Privileged_Opcode = 0x011,
        Unimplemented_Ldd = 0x012,
        Unimplemented_Std = 0x013,
        Fp_Disabled = 0x020,
        Fp_Exception_Ieee_754 = 0x021,
        Fp_Exception_Other = 0x022,
        Tag_Overflow = 0x023,
        Clean_Window = 0x024,
        Division_By_Zero = 0x028,
        Internal_Processor_Error = 0x029,
        Data_Access_Exception = 0x030,
        Data_Access_MMU_Miss = 0x031,
        Data_Access_Error = 0x032,
        Data_Access_Protection = 0x033,
        Mem_Address_Not_Aligned = 0x034,
        Lddf_Mem_Address_Not_Aligned = 0x035,
        Stdf_Mem_Address_Not_Aligned = 0x036,
        Privileged_Action = 0x037,
        Ldqf_Mem_Address_Not_Aligned = 0x038,
        Stqf_Mem_Address_Not_Aligned = 0x039,


        Async_Data_Error = 0x040,
        Interrupt_Level_1 = 0x41,
        Interrupt_Level_2 = 0x42,
        Interrupt_Level_3 = 0x43,
        Interrupt_Level_4 = 0x44,
        Interrupt_Level_5 = 0x45,
        Interrupt_Level_6 = 0x46,
        Interrupt_Level_7 = 0x47,
        Interrupt_Level_8 = 0x48,
        Interrupt_Level_9 = 0x49,
        Interrupt_Level_10 = 0x4a,
        Interrupt_Level_11 = 0x4b,
        Interrupt_Level_12 = 0x4c,
        Interrupt_Level_13 = 0x4d,
        Interrupt_Level_14 = 0x4e,
        Interrupt_Level_15 = 0x4f,


        Interrupt_Vector = 0x60,
        PA_Watchpoint = 0x61,
        VA_Watchpoint = 0x62,
        Corrected_ECC_Error = 0x63,
        
        Fast_Instruction_Access_MMU_Miss = 0x64,
        Fast_Data_Access_MMU_Miss = 0x68,
        Fast_Data_Access_Protection = 0x6c,

        Fast_ECC_Error = 0x70,



        Spill_0_Normal = 0x080,
        Spill_1_Normal = 0x084,
        Spill_2_Normal = 0x088,
        Spill_3_Normal = 0x08c,
        Spill_4_Normal = 0x090,
        Spill_5_Normal = 0x094,
        Spill_6_Normal = 0x098,
        Spill_7_Normal = 0x09c,
        Spill_0_Other = 0x0a0,
        Spill_1_Other = 0x0a4,
        Spill_2_Other = 0x0a8,
        Spill_3_Other = 0x0ac,
        Spill_4_Other = 0x0b0,
        Spill_5_Other = 0x0b4,
        Spill_6_Other = 0x0b8,
        Spill_7_Other = 0x0bc,
        Fill_0_Normal = 0x0c0,
        Fill_1_Normal = 0x0c4,
        Fill_2_Normal = 0x0c8,
        Fill_3_Normal = 0x0cc,
        Fill_4_Normal = 0x0d0,
        Fill_5_Normal = 0x0d4,
        Fill_6_Normal = 0x0d8,
        Fill_7_Normal = 0x0dc,
        Fill_0_Other = 0x0e0,
        Fill_1_Other = 0x0e4,
        Fill_2_Other = 0x0e8,
        Fill_3_Other = 0x0ec,
        Fill_4_Other = 0x0f0,
        Fill_5_Other = 0x0f4,
        Fill_6_Other = 0x0f8,
        Fill_7_Other = 0x0fc,
        Trap_Instruction = 0x100,
        Last_Real_Exception = 0x200
} v9_exception_type_t;
DESCRIPTION
The v9_exception_type_t lists all hardware exceptions defined in the UltraSPARC architecture. This type is used in some cases where functions take the generic exception_type_t.
v9_memory_transaction_t
NAME
v9_memory_transaction_t
SYNOPSIS
typedef struct v9_memory_transaction {
        generic_transaction_t s;
        unsigned              cache_virtual:1;
        unsigned              cache_physical:1;
        unsigned              side_effect:1;
        unsigned              priv:1;
        unsigned              red:1;
        unsigned              hpriv:1;
        unsigned              henb:1;
        uint8                 address_space;
        uint8                 prefetch_fcn;
        sparc_access_type_t   access_type;

        /* if non-zero, the id needed to calculate the program counter */
        intptr_t turbo_miss_id;
} v9_memory_transaction_t;
DESCRIPTION

This is the Sparc specific memory transaction data structure. The generic data is stored in the s field.

The cache_virtual bit is set if this memory transaction corresponds to a TLB entry that has the CV (cache virtual) bit set. Conversely, the cache_physical bit corresponds to the TLB entry's CP (cache physical) bit and the side_effect bit corresponds to the E bit.

The priv bit is cleared if the memory transaction comes from one of the USER ASI's.

The red bit is set if the memory transaction was generated by a CPU which has the RED bit in the %pstate register set.

SPARC-V9 uses an address space identifier (ASI) to qualify memory access instructions. This is stored in the address_space field; it will be set to ASI_PRIMARY for "normal" memory transactions.

The prefetch_fcn field is only set for memory transactions of type Sim_Trans_Prefetch, for which it contains the fcn field of the prefetch instruction.

The access_type field describes the type of the access, as defined in the sparc_access_type_t enum. For example if a load is for a floating point register or a standard integer one.

x86_memory_transaction_t
NAME
x86_memory_transaction_t, p2_memory_transaction_t
SYNOPSIS
typedef struct x86_memory_transaction {
        generic_transaction_t s;                /* Superclass */
        processor_mode_t      mode;
        linear_address_t      linear_address;   
        uint16                selector;         /* Segment selector */
        unsigned              access_linear:1;  /* Linear access */
        unsigned              io:1;             /* I/O (port) access */
        unsigned              fault_as_if_write:1;
        x86_access_type_t     access_type;
        x86_memory_type_t     pat_type;
        x86_memory_type_t     mtrr_type;
        x86_memory_type_t     effective_type;
        int                   sequence_number; /* used for -stall */

        /* if non-zero, the id needed to calculate the program counter */
        intptr_t turbo_miss_id;
} x86_memory_transaction_t;

typedef struct x86_memory_transaction p2_memory_transaction_t;

DESCRIPTION

The s field contains generic information about memory operations (see generic_transaction_t).

The mode is the current mode (user or supervisor) of the cpu.

The linear_address contains the address for transactions with linear addresses.

The access_linear flag is set for all transactions with linear addresses.

The access_type field contains the type of the transaction.

typedef enum x86_access_type {
        X86_Other,               /* Access that is not categorized (rare) */
        X86_Vanilla,             /* "Normal" access, such as a MOV to/from
                                    memory. X86_Vanilla operations use the STCs. */
        X86_Instruction,         /* Instruction fetch */
        X86_Clflush,             /* Cache line flush from CLFLUSH */
        X86_Fpu_Env,             /* Floating point environment (FLDENV, FNSTENV,
                                    environment part of FRSTOR, FNSAVE) */
        X86_Fpu_State,           /* Register part of FRSTOR and FNSAVE */
        X86_Idt,                 /* Interrupt descriptor table */
        X86_Gdt,                 /* Global descriptor table */
        X86_Ldt,                 /* Local descriptor table */
        X86_Task_Segment,        /* Task segment */
        X86_Task_Switch,         /* Task save/restore during a task switch */
        X86_Far_Call_Parameter,  /* Parameter copy in far call */
        X86_Stack,               /* Stack accesses during complex control flow
                                    operations (exception handling, etc.) */
        X86_Pml4,                /* Page map level 4 table */
        X86_Pdp,                 /* Page directory pointer table */
        X86_Pd,                  /* Page directory table */
        X86_Pt,                  /* Page table */
        X86_Sse,                 /* 16-byte operations to/from SSE registers */
        X86_Fpu,                 /* 10-byte and 16-byte operations to/from
                                    X87 registers */
        X86_Access_Simple,       /* Device accesses (DMA) */
        X86_Microcode_Update,    /* Data read when performing a processor
                                    microcode update */
        X86_Non_Temporal,        /* Non temporal store (example: MOVNTI) */
        X86_Prefetch_3DNow,      /* Prefetch with PREFETCH (3DNow!) */
        X86_Prefetchw_3DNow,     /* Prefetch with PREFETCHW (3DNow!) */
        X86_Prefetch_T0,         /* Prefetch with PREFETCHT0 (SSE) */
        X86_Prefetch_T1,         /* Prefetch with PREFETCHT1 (SSE) */
        X86_Prefetch_T2,         /* Prefetch with PREFETCHT2 (SSE) */
        X86_Prefetch_NTA,        /* Prefetch with PREFETCHNTA (SSE) */
        X86_Loadall,             /* State read by the loadall instruction */
        X86_Atomic_Info,         /* Transaction sent with size 0 to
                                    finish an atomic transaction */
        X86_Cmpxchg16b,          /* CMPXCHG16B instruction */
        X86_Smm_State            /* SMM state structure */
} x86_access_type_t;

The effective memory type for the access is contained in effective_type. The MMU calculates the effective memory type using both the PAT type (in pat_type) and the MTRR type (in mtrr_type).

typedef enum {
        X86_None,
        X86_Strong_Uncacheable,    /* UC */
        X86_Uncacheable,           /* UC- */
        X86_Write_Combining,       /* WC */
        X86_Write_Through,         /* WT */
        X86_Write_Back,            /* WB */
        X86_Write_Protected        /* WP */
} x86_memory_type_t;

x86_sync_instruction_type_t
NAME
x86_sync_instruction_type_t
SYNOPSIS
typedef enum {
        X86_SFence = 1,
        X86_LFence = 2,
        X86_MFence = 3
} x86_sync_instruction_type_t;
DESCRIPTION
Type of synchronisation instruction for x86. Used in the Core_Sync_Instruction hap.

3.2.3   Internal Data Types

addr_type_t, assoc_table_t, attr_initiator_t, attr_set_t, binary_heap_compare_func_t, binary_heap_t, byte_string_t, struct dmacache, event_queue_type_t, for_all_assoc_table_func_t, ht_entry_t, ht_for_each_entry_func_t, ht_iter_t, ht_sorted_entries_func_t, ht_table_t, icode_mode_group_t, icode_mode_t, icode_page_t, image_spage_t, instruction_trace_callback_t, interface_list_t, intervals_func_t, interval_set_t, interval_set_iter_t, io_trace_t, mmu_error_info_t, os_time_t, struct os_tm, page_info_t, prof_data_t, prof_data_address_t, prof_data_counter_t, prof_data_func_t, prof_data_iter_t, radix_bottom_t, radix_middle_t, radix_top_t, rand_state_t, range_node_t, set_error_t, sim_ic_type_t, simics_internal_counters_t, simics_symbol_lookup_t, source_python_func_t, source_python_module_func_t, st_do_all_func_t, st_for_all_func_t, enum st_lookup_approx_result, stall_id_num_t, stall_id_t, state_save_kind_t, strbuf_t, string_tree_t, struct simcontext, struct symtable, table_t, table_func_t, turbo_exit_case_t, struct ucontext, vtmem_inform_opcode_t,

NAME
addr_type_t, assoc_table_t, attr_set_t, attr_initiator_t, binary_heap_compare_func_t, binary_heap_t, byte_string_t, struct dmacache, struct ether_addr, for_all_assoc_table_func_t, ht_entry_t, ht_for_each_entry_func_t, ht_iter_t, ht_sorted_entries_func_t, ht_table_t, icode_mode_group_t, icode_mode_t, icode_page_t, image_spage_t, instruction_trace_callback_t, interface_list_t, intervals_func_t, interval_set_t, interval_set_iter_t, io_trace_t, io_trace_log_t, mmu_error_info_t, os_time_t, struct os_tm, page_info_t, prof_data_t, prof_data_address_t, prof_data_counter_t, prof_data_func_t, prof_data_iter_t, radix_bottom_t, radix_middle_t, radix_top_t, rand_state_t, range_node_t, set_error_t, sim_ic_type_t, simics_internal_counters_t, simics_symbol_lookup_t, source_python_func_t, source_python_module_func_t, st_do_all_func_t, st_for_all_func_t, enum st_lookup_approx_result , stall_id_num_t, stall_id_t, state_save_kind_t, strbuf_t, string_tree_t, struct simcontext, struct symtable, table_t, table_func_t, turbo_exit_case_t, struct ucontext, vtmem_inform_opcode_t

DESCRIPTION
These data types are exported for Simics internal use.

3.2.4   Simics Types in Python

When writing code in Python, almost all Simics API functions can be used. Since not all C/C++ types are available in Python, Simics supplies the following special type mappings.

C/C++Python
attr_value_t, kind == Sim_Val_Stringstr (a Python string)
attr_value_t, kind == Sim_Val_Integerint or long
attr_value_t, kind == Sim_Val_Floatingfloat
attr_value_t, kind == Sim_Val_Listlist
attr_value_t, kind == Sim_Val_Datatuple of integers (bytes)
attr_value_t, kind == Sim_Val_NilNone
attr_value_t, kind == Sim_Val_ObjectAn object from the conf namespace.
attr_value_t, kind == Sim_Val_Dictdict
attr_value_t, kind == Sim_Val_Booleanbool
conf_class_t *str (name of class)
conf_object_t *An object from the conf namespace

VIRTUTECH CONFIDENTIAL    Previous - Up - Next