📄 tmgrem.h
字号:
VMM_TYPE type; /* type of memory space */
UINT16 flags; /* VMMFLG_xxx flags */
UINT32 start_addr; /* start of range */
UINT32 page; /* optional page of start addr */
UINT32 length; /* byte length of region (inclusive) */
UINT16 handle; /* unique handle for safety */
UINT8 attributes; /* VMMATR_xxx attributes of memory */
UINT8 wait_states; /* optional wait states */
UINT16 shared_id; /* if shared memory, uniq id */
UINT16 flash_id; /* program function id if known */
} SIM_MAP_ITEM;
/* EXECUTION MODEL: You must understand the execution model in terms
of what is passed and what is to be returned and what is
expected of the callee (sim or emu):
1) The callee sets the exec_config flags to indicate what is
supported. STEP must be supported. All others are optional.
2) Simulators may use the SIMFLG_STOP_PER config flag. This
indicates that they will run (step) a maximum number of
instructons per call. If that number is expired, they
return an OK status and _SimTestStopState returns RUNNING.
The _SimExec call will be made again the same way but without
modifying the timer content (if used). If the simulator
engine runs as a separate thread, it can choose between
allowing the main thread to poll it or it can use the
SIMCAL_STOPPED bit to have the SIMCB_STOPPED callback
registered. This latter approach allows the simulator
to indicate from its thread that execution has stopped.
The main thread will then check for stopped reasons. This
avoids polling.
3) The SimExec call should never return an error if it has
executed some instructions. Instead, it should return that
information on the next _SimTestStopState call. It should
only return an error if it fails to start.
4) The STATUS_MODE return to _SimTestStopState must be
carefully mapped to insure correct behavior. For requests
such as STEP/RANGE/RANGE_OV/RESET/RUN_UNTIL/RUN_TIME,
SMODE_HALTED should be returned when the request is completed
normally. SMODE_SWBREAK should only be returned when a break
was encountered (whether a registered one or not). Likewise
SMODE_HWBREAK should be used if it was the primary reason
for stopping. Detail should be set to the HW Break handle
and Trig_addr should be set if it is known and different than
the PC. SIG/SIG_MEM should be used when other sorts of errors
occur. The result of SimHalt is to return a SMODE_SIG and
OSIG_USER_HALT detail.
5) START_RUN_FAST will not cause _SimTestStopState to be called.
But, it should still return periodically (for sim) to allow
the Halt request to get in. It can ignore all breaks and
all callbacks.
6) RUN_CLOCK is used to record timing. This is not to say that
clock counting needs to be off otherwise, but it is used when
clock counting is on (for profiling or other uses)
7) The timer argument will be passed under two conditions:
RUN_TIME (SIMEXE_CLOCK), to get a SIMCB_CLOCK
callback (SIMEXE_CLOCK and SIMCAL_CLOCK). The latter
is not used with STEP or RUN_TIME. It allows the
simulator to notify SIMAPI that a certain number of
cycles have elapsed.
*/
/* START_MODE is used to control beginning of execution. Only the
values allowed by the exe_config will be called. This is used to
optimize execution time. */
typedef enum
{ /* Start requests */
START_RUN, /* normal run */
START_STEP, /* normal step-instruction */
START_RUN_CLOCK, /* run with full cycle counting on */
START_RUN_UNTIL, /* run until a stop location encountered */
START_RUN_FAST, /* run full speed - no debug testing */
START_RESET, /* reset processor and stop */
START_RUN_TIME, /* run until time expired */
START_STEP_RANGE, /* step until PC outside of range */
START_STEP_OV_RANGE, /* same as above except run calls */
START_STEP_CYCLE /* only step one cycle */
} START_MODE;
/* STOP_LOCS is used to pass step-range and run-until details. For
step-range calls it provides the start/end address pair that the
PC must stay within (or else stop). For run-until, it provides up
to 16 stop locations (max number used based on num_until_brks and
what is needed for the operation). */
typedef struct _STOP_LOCS
{
UINT8 num_stop_addrs; /* number of stop addrs if run_until */
UINT8 page; /* page for addresses */
UINT16 pad2;
UINT32 addrs[16]; /* up to 16 addresses for run_until */
/* note on above: addrs[0] is start, addrs[1] is end inclusive limits
for step-range operations. */
} STOP_LOCS;
/* STATUS_INFO and STATUS_MODE are used to allow the simulator to
provide details of the current execution state. If the mode is
running, no additional information is provided. Else, the information
provided is based on the reason for stopping. The special cases are
signals and HW breaks. If a HW break, the detail field contains the
HW break handle if known, else 0. The trip_page/addr contains the
location that triggered the breakpoint (not the PC if data break).
If signal, the detail field contains the OSIG_xxx value. If SIG_MEM,
the trip_page/addr fields contain the location that caused the fault.
If SMODE_ERROR, the detail field is a SIM_ERR value. */
typedef enum
{
SMODE_RUNNING, /* still running */
SMODE_HALTED, /* step/range/until/reset normal stop */
SMODE_UNKNOWN, /* unknown stop reason */
SMODE_SWBREAK, /* stopped on SW break at PC */
SMODE_HWBREAK, /* stopped on hardware break */
SMODE_SIG, /* exception, signal, etc stopped it */
SMODE_SIG_MEM, /* exception on memory (trip_) */
SMODE_ERROR, /* faulted with error */
SMODE_GLOBRK, /* global break - detail is index */
SMODE_REGBRK /* register break - trip_addr is
index, detail is break handle */
} STATUS_MODE;
typedef struct _STATUS_INFO
{
STATUS_MODE mode; /* reason for stopping if stopped */
UINT32 detail; /* HW break handle, OSIG_xx, or err value */
UINT32 trip_page; /* HW break or SIG trip location */
UINT32 trip_addr;
} STATUS_INFO;
/* the OSIG values are the builtin stopping reasons that can be
returned in detail when SMODE_SIG/SMODE_SIG_MEM are used */
#ifndef _VABSGEN_H
typedef enum
{ /* same as vabsgen.h @*/
OSIG_USER_HALT, /* halted by user action */
OSIG_EMU_STOP, /* stop from emulator */
OSIG_ILL_OP, /* illegal instruction */
OSIG_MEM_VIOL, /* memory access violation */
OSIG_TIME_OUT, /* timeout from emulator */
OSIG_NO_POWER, /* no target power detected */
OSIG_BUSY, /* target not responding - busy */
OSIG_ERROR, /* unknown error */
OSIG_ERROR_MSG, /* error from target */
OSIG_RESET, /* reset of target */
OSIG_ABORT, /* took an abort */
OSIG_BADSTATE, /* bad state */
OSIG_BUSERR, /* bus error */
OSIG_INT, /* interrupt */
OSIG_TRAP, /* trap to use */
OSIG_ANA_FULL, /* analyzer full */
OSIG_ANA_TRIG, /* analyzer triggered */
OSIG_GLOBRK, /* global break detected */
OSIG_BRANCH, /* control flow breakpoint */
OSIG_REGBRK /* register breakpoint */
} GEN_SIGNALS;
struct ARM_ADVANCED
{ /* advanced info on ARM if any */
UINT8 init; /* True if initialized by AI */
UINT8 vector_catch; /* True if want vector catch */
UINT8 semi_host; /* True if want semi-hosting */
UINT8 sim_fp_emu; /* True if want float emu */
UINT32 top_mem; /* top of memory for stack/heap */
UINT32 stack_base, stack_limit, heap_base, heap_limit;
UINT32 vectors; /* vectors to catch */
UINT32 semi_vector; /* location to stop for sem-host */
UINT32 arm_swi; /* number of ARM SWI */
UINT32 thumb_swi; /* number of thumb SWI */
UINT32 sim_clock; /* clock speed (in MHz) */
char *config_path; /* path for config file */
char *config_file; /* name of config file */
UINT8 top_mem_set; /* user set top_mem */
/* next set are purely dynamically set */
UINT8 is_veneer_valid;/* True if veneer addr valid */
UINT8 is_set_sp; /* True if __rt_init_32 brk set */
UINT8 is_set_user; /* True if use set brk there */
UINT32 rt_init_loc; /* location of __rt_init_32 or 0 */
UINT32 data_end; /* end of data section */
UINT32 code_end; /* end of code section */
UINT32 veneer_loc[2]; /* start/end pair */
/* next one is short term use. It is the toolconf file's lines in
an array. This allows writing to a file or converting to a
toolconf in-memory format. */
char *toolconf; /* stringized form of file */
};
/* see pin_list field in SIM_ABS for details on pin lists
in processor models. See pin_list in DEV_ABS for details
of pin use in devices. */
struct PIN_LIST
{ /* definition of pin/signal */
char *pin_name; /* name of pin */
UINT16 pin_id; /* ID of pin for sim */
/* flags define type of pin, read/write rules, interrupt
rules (if processor), and interrupt vector (if processor) */
UINT16 flags; /* pin definition */
UINT32 family_mask1; /* bit set if family member supports */
UINT32 family_mask2;
};
#endif /* !_VABSGEN_H */
/* INTFLG and PINFLG values are used with INT_LIST and
PIN_LIST structures. Note that the PINFLG_INTID is
an interrupt ID associated with the Pin. */
#define INTFLG_INTERN 0x01 /* internal interrupt */
#define INTFLG_EXCEP 0x02 /* exception */
#define INTFLG_DATA 0x04 /* requires data on the bus */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -