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"
get_mode | Cell Context |
set_mode | Global Context |
get_line_size | Cell Context |
set_line_size | Global Context |