image_snoop instrumentation_order
API Reference Manual  /  5 Model-to-Simulator Interfaces  / 

instruction_fetch

Description
The instruction_fetch interface is implemented by processors. The interface controls how instruction fetches should be modeled.

The get_mode and set_mode functions get and set the instruction fetch mode. There are three available modes. All modes are not supported by all processor types. The instruction_fetch_none mode is the least accurate but the fastest mode. The other modes are more accurate but slower.

The get_line_size and set_line_size functions get and set the fetch size on each instruction fetch. This is often related to cache line size or similar. The line size must be power of 2.

typedef enum {
        /* No instruction fetch sent to memory hierarchy */
        Instruction_Fetch_None = 0,

        /* Memory hierarchy gets fetch for each cache line access */
        Instruction_Fetch_Cache_Access_Trace = 1,

        /* Memory hierarchy gets fetch for each instruction fetch. Only
           x86/x86-64 */
        Instruction_Fetch_Trace = 2
} instruction_fetch_mode_t;

SIM_INTERFACE(instruction_fetch) {
        instruction_fetch_mode_t (*get_mode)(conf_object_t *obj);
        void (*set_mode)(conf_object_t *obj, instruction_fetch_mode_t mode);
        int (*get_line_size)(conf_object_t *obj);
        void (*set_line_size)(conf_object_t *obj, int size);
};
#define INSTRUCTION_FETCH_INTERFACE "instruction_fetch"

Execution Context
get_modeCell Context
set_modeGlobal Context
get_line_sizeCell Context
set_line_sizeGlobal Context

image_snoop instrumentation_order