Main Page | Modules | File List | Globals | Examples

Emulation state handling

These functions control the emulation state of the CPU - note that the first argument is always a CPU handle which is obtained through jtag_init(). More...

Enumerations

enum  CpuState { CPUSTATE_NORMAL, CPUSTATE_EMULATION, CPUSTATE_STEP }
 CPU state. More...
enum  {
  JTAG_CLKSPEED, EMUIR_SIZE = 32, EMUDAT_SIZE, EMULOOP_SIZE,
  EMU_STEP
}
 Tokens for Emulation Control ( emulation_config() ). More...

Functions

int emulation_init (CPU cpu)
 Initialize emulation.
int emulation_exit (CPU cpu)
 Exit emulation and turn off emulator unit (save power).
int emulation_enter (CPU cpu)
 Enter emulation state.
int emulation_leave (CPU cpu)
 Exit emulation state; 'go'.
int emulation_enter_singlestep (CPU cpu)
 Enter single stepping mode.
int emulation_go (CPU cpu)
 Return from emulation (go).
int emulation_leave_singlestep (CPU cpu)
 Leave single step mode.
int emulation_flush (CPU cpu)
 Flush memory changes.
int emulation_config (CPU cpu, int mode, int value)
 Configure emulation.
CpuState emulation_state (CPU cpu)
 Return emulation state for state debugging.

Detailed Description


Enumeration Type Documentation

anonymous enum
 

Enumerator:
JTAG_CLKSPEED  Emulator clock speed Value: 0: fastest, 255: slowest.
EMUIR_SIZE  EMUIR register size.
EMUDAT_SIZE  EMUDAT register size.
EMULOOP_SIZE  Instruction loop size [1,2].
EMU_STEP  Single step mode [1: on, 0: off].

enum CpuState
 

Enumerator:
CPUSTATE_NORMAL  Normal state (running).
CPUSTATE_EMULATION  In emulation mode.
CPUSTATE_STEP  In single step mode.


Function Documentation

int emulation_config CPU  cpu,
int  mode,
int  value
 

Parameters:
mode one of [JTAG_CLKSPEED]
The internal modes [EMUIR_SIZE, EMUDAT_SIZE, EMULOOP_SIZE, EMU_STEP] are dangerous to use, as they can compromise the system behaviour. When experimenting, always save and restore the DBGCTL register before calling any of the memory and register access functions.
value Depending on the mode:
  • JTAG_CLKSPEED: [0 - 255]; 0 is fastest
  • EMUIR_SIZE: [EMUIR_SIZE_32, EMUIR_SIZE_48, EMUIR_SIZE_64]
  • EMULOOP_SIZE: [1, 2]
  • EMUDAT_SIZE: [EMUDAT_SIZE_32, EMUDAT_SIZE_40, EMUDAT_SIZE_48]
  • EMU_STEP: [0: off, 1: on]
Examples:
memtest.c.

int emulation_enter CPU  cpu  ) 
 

Returns:
0 if successful, negative error code else.
Examples:
memtest.c, and register.c.

int emulation_flush CPU  cpu  ) 
 

This function makes sure that all cache lines on the CPU get flushed. This has only an effect if caching is turned on.

int emulation_go CPU  cpu  ) 
 

This function does not change the CPU state (i.e. is used in single step mode)

int emulation_init CPU  cpu  ) 
 

This must be called before anything else.

Examples:
memtest.c, and register.c.

CpuState emulation_state CPU  cpu  ) 
 

If an error happened, the return value is a negative error code. Always check.


Generated on Thu Sep 1 15:02:53 2005 for bfemu - Blackfin emulation library by  doxygen 1.4.3-20050530