⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mini_simrdi_manager.h

📁 realview22.rar
💻 H
📖 第 1 页 / 共 3 页
字号:
 * SimRdiProcVec for a particular advert structure which will have the
 * fields filled in with defaults.  It fills in the fields it knows
 * about and then advertises it back to the SimRdi_Manager using the
 * SimRdiProcVec.  Modules can tell the version of the SimRdi_Manager
 * and hence the advert structures by looking in the SimRdiProcVec.
 * If it finds that the SimRdi_Manager talks a higher protocol than
 * itself then it can still participate as the defaults in the advert
 * will indicate its non-awareness of the higher protocol.  If the
 * situation is reversed and the Module talks a higher version
 * protocol then it must adapt its behaviour to the lower version
 * protocol.
 *
 * In general, a module should not assume that an advert will not move
 * throughout its lifetime, it will be passed to the appropriate
 * functions each time.  This allows the SimRdi_Manager to store them
 * in a variety of different ways to optimise efficiency.  Each advert
 * has a unique id that can be used to deregister the advert.
 * Immediately after advertising, the pointer to the advert should be
 * considered invalid. */
typedef struct tag_private_simrdi_manager_data {
  SimRdi_Advert_Base* next;
  union {
    uint32 n;
    void*  data;
  } x;
} Private_SimRdi_Manager_Data;

typedef union { uint32 id; void* p; } Advert_ID;

struct tag_simrdi_advert_base {

  char const* name;   /* name of advert */
  Advert_ID   id;     /* unique id that can be used to recover the
                         advert, it is filled in by SimRdi_Manager
                         when we get a new advert. */
  void*       handle; /* module-specific data. */

  RDI_ModuleDesc* coredesc; /* fille in core description here, may be
                               used later in multicore models. */

  Private_SimRdi_Manager_Data simrdi_manager_data;  /* private to simrdi_manager */

  SimRdi_Config_Flags config_flags; /* generic flags that get ored together. */
  
  SimRdi_Notice* notice; /* should be NULL for the moment
                            -- functionality not
                            implemented, acts rather like RDIInfo call. */
}; /* SimRdi_Advert_Base */

/*
 * Negotiation adverts
 *
 * Advert negotiation is currently not implemented as it is not needed
 * at the moment -- all negotiation is performed by sorting the
 * adverts on config_flags & sort_mask but we provide hooks to let
 * potential negotiators register.
 *
 * The topmost negotiation advert (by sort order) is called after all
 * adverts have been collected but before they have been processed
 * into the SIM_ABS structure by SimRdi_Manager.  */

typedef struct tag_simrdi_negotiator_advert SimRdi_Negotiator_Advert;
typedef void SimRdi_Negotiator( SimRdi_Negotiator_Advert* ad, SimRdiProcVec* state );

#define SIMRDI_NEGOTIATOR_SORT_MASK 0xFF

struct tag_simrdi_negotiator_advert {

  SimRdi_Advert_Base x;

  SimRdi_Negotiator* negotiator;
  
}; /* SimRdi_Negotiator_Advert */

/*
 * End_Gather adverts
 *
 * Objects can post an advert to ask to be called when the
 * SimRdi_Manager has finished anything that it wants to do.  This
 * provides an opportunity for objects/services to perform any
 * manipulation of the SIM_ABS structure themselves, etc.
 */

typedef struct tag_simrdi_end_gather_advert SimRdi_End_Gather_Advert;
typedef void SimRdi_End_Gather( SimRdi_End_Gather_Advert* ad, SimRdiProcVec* state );

#define SIMRDI_END_GATHER_SORT_MASK 0xFF

struct tag_simrdi_end_gather_advert {

  SimRdi_Advert_Base x;

  SimRdi_End_Gather* end_gather;
  
}; /* SimRdi_End_Gather_Advert */

/*
 * Global break adverts
 *
 * A 'global break' appears under 'Processor Events' in RVD.  The
 * concept is an event that is not tied to a particular address and
 * that we can stop on.  Examples of these are the exceptions such as
 * Undefined instruction, Data abort, etc.
 *
 * For each global break set, then simrdi_global_break will be called
 * with the handle that you registered and in 'n' the element number
 * (0..len-1) of the global break in global_breaks that we are trying
 * to query/set.  If 'set' is true then this is a call to write the global
 * break enable/disable to *value (true is enabled).  Otherwise should
 * return in *value of the breakpoint.
 *
 * If you return an error, then further processing of
 * enabling/disabling the global breaks will be stopped.  This will in
 * general leave RVD and the simulator with inconsistent views of what
 * has been enabled/disabled, and so should only be done in extreme
 * circumstances. */

typedef SIM_ERR SimRdiGlobalBreak  ( void* handle, uint32 n,
                                     bool_int set,
                                     bool_int* value );

typedef struct tag_simrdi_Global_Breaks_Advert {
  SimRdi_Advert_Base x;

  uint32* start_global_number;
  /* if non-null, then will be the global break number of
     global_breaks[0], this is needed when you generate a global break
     stop. */

  int len; /* number of breaks this function will deal with */
  char** global_breaks; /* list of them */

  void* handle_for_function;
  SimRdiGlobalBreak* simrdi_global_breaks;

} SimRdi_Global_Breaks_Advert;

#define SIMRDI_GLOBAL_BREAKS_SORT_MASK 0xF
/* note that you must NEVER us the sort value of 0xF or the standard
   ARM exception global breaks will not work */

/*
 * Error function adverts (unimplemented)
 *
 * To advertise a set of error numbers 0..len-1 use this advert.  Note
 * that as people need to return absolute error numbers to REMSIM it
 * will have to return *start_error_number+i (i in 0..len-1).  Only
 * function-call type errors are supported, however by returning a
 * string NOT starting with a '!' will let RVD cache the error and it
 * won't be called again.  _SimError will be given x.handle as its
 * handle.
 *
 * You must register all errors during registration time, adverts
 * after will be ignored. */

typedef SIM_ERR SimabsErrorFunction( void* handle, int code, 
                                     char* buffer, bool_int* details );

typedef struct tag_simrdi_Errors_Advert {
  SimRdi_Advert_Base x;

  int len; /* number of errors this function will deal with */
  uint32* start_error_number; /* if you want to generate the nth error
                                 the return *start_error_number+n-1,
                                 note the error function will still
                                 get an error number 0..len-1 */
  void* handle_for_function;
  SimabsErrorFunction* _SimError; /* handle passed will be x.handle,
                                     and code will be err. */
} SimRdi_Errors_Advert;

/*
 * Uniregs/Regsiter adverts
 *
 * Uniregs are standardised register names for ARM core and
 * coprocessor registers.  ARMulator has extended these so that models
 * can put in extra simulator-defined registers.
 *
 * If an object supports uniregs then it should advertise them using
 * either this structure or using the structures in
 * uniregs_registration_event.h (a lot of the comments in that file
 * also apply so make sure you read it as well).
 *
 * If an object can export extra registers or actions that it wants to
 * be accessible by reading/writing to registers then it can post a
 * description of them using this advert.
 *
 * Note that there are two types of registers -- those in blocks 0..31
 * of the uniregs will be given unmutalated uniregs numbers.  Those in
 * the armulator blocks (uniregs_armulator..uniregs_armulator_top)
 * will be given uniregs mutilated by the register
 *
 * ARMulator blocks: to advertise 'len' registers then it should fill
 * in the array desc with the description of them.  These will be
 * copied out after advert arbitration has finished.  The function
 * _SimReg will be called whenever the debugger wants to access a
 * register.  The register number passed to _SimReg to access the nth
 * element of desc (thus the first element is desc[0]) will be
 * start_reg_number+n-1 or if reg_numbers is non-null then
 * reg_numbers[n-1], thus allowing non-contiguous, non-monotonic
 * register numbers to be used, if that fits your model better.  The
 * array reg_numbers should be valid throughout the lifetime of the
 * model.
 *
 * You may only add the uniregs during registration.  If you add them
 * during the simulation then they will be ignored.
 *
 * In the future it is hoped that the read/write/_SimReg functionality
 * can be merged.  It is also hoped that eventually, that for standard
 * uniregs (as opposed to simulator added ones) that descriptions of
 * them can also be placed in the advert so that we can see they meet
 * up woth the TABS ones.  Thus it is encouraged that you provide the
 * descriptions (which must be valid for the lifetime of the
 * simulator).
 *
 * Note that simulators may currently only export 4 byte registers.
 * Later releases will support larger sizes. */

typedef SIM_ERR SimabsRegisterAccess( void* handle,
                                      bool_int reg_read,
                                      uint32 reg_num,
                                      REGVAL* regval, uint16 size );

typedef struct tag_register_definition /* an analogue of TABS_REGDEF */
{                               /* Register definition for new regs */
  uint16        size;           /* register size in bytes -- only size 4 is supported at moment */
  uint8         change_case;    /* case of the name EECHGCASE_xxx */
  uint8         type;           /* register type - as TYPE_xxx */
  char          *name;          /* register Name (should have @ as 1st char) */
  char          *buttonName;    /* name of register in reg window */
  uint32        flags;          /* register is readonly if 1 */
  uint16        reg_map;        /* reserved - use 0 */
} Register_Definition;

typedef struct tag_simrdi_Uniregs_Advert {
  SimRdi_Advert_Base x;

  const char* description;

  void*           sdm_me; /* reserved */

  uint32          block_num;
  /* 0-31 are the block numbers in the uniregs scheme.  Coprocessor 0
     is in block 16, Coprocessor 14 is in block 30. Coprocessor 15 is
     in block 31 with an extension space in Coprocessor 15 that should
     be registered separately.  Simulator-added registers not in the
     uniregs scheme are in higher block numbers, see
     uniregs_registration_event.h to see their names */

  SimRdi_Config_Flags    config_flags;
  /* use not specified at the moment */

  /* for advertising extra registers */
  /* to access the nth register in desc _SimReg will be called with
     start_reg_number+n-1 or if reg_numbers is non-null then with
     reg_numbers[n-1]. */
  int                   len; /* length of desc and reg_numbers (if non-NULL) */
  uint32                start_reg_number;
  uint32*               reg_numbers;
  Register_Definition*  desc;
  SimabsRegisterAccess* _SimReg; /* for simulator-defined registers */

  /* handle passed to _SimReg and read/write */
  void*                 handle_for_function;

  /* standard uniregs blocks use these functions */
  DebugRead*  read;  /* MRC */
  DebugWrite* write; /* MCR */

} SimRdi_Uniregs_Advert;

/*
 * Regwin adverts (unimplemented)
 *
 * RVD lets you define news tabs in the register window adverts.  If
 * you add non-uniregs registers then you can make them display in a
 * tab group.  Read the comments in simabs.h as to how to use the
 * RegWin structure. */

typedef struct tag_simrdi_regwin_advert {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -