23 unsigned brp_num = nds32_v3m->
n_hbr - 1;
59 unsigned brp_num = nds32_v3m->
n_hbr - 1;
85 uint32_t wp_config = 0;
86 bool ld_stop, st_stop;
89 ld_stop = st_stop =
false;
93 if (wp_num < nds32_v3m->used_n_wp) {
118 " mask %08" PRIx32, wp_num, wp->
address, wp->
mask);
127 ld_stop = st_stop =
true;
150 bool clean_global_stop =
false;
154 if (wp_num < nds32_v3m->used_n_wp) {
159 " mask %08" PRIx32, wp_num, wp->
address, wp->
mask);
162 clean_global_stop =
true;
166 if (clean_global_stop) {
169 edm_ctl = edm_ctl & (~0x30);
186 LOG_ERROR(
"<-- TARGET ERROR! Reaching the max interrupt stack level %" PRIu32
". -->",
218 LOG_WARNING(
"%s: ran after reset and before halt ...",
240 "hardware breakpoints/watchpoints! "
241 "The limit of combined hardware "
242 "breakpoints/watchpoints is %" PRId32
". -->",
244 LOG_WARNING(
"<-- TARGET STATUS: Inserted number of "
245 "hardware breakpoint: %" PRId32
", hardware "
246 "watchpoints: %" PRId32
". -->",
308 "watchpoints exceeds the hardware "
309 "resources. Stop at every load/store "
310 "instruction to check for watchpoint matches. -->");
314 LOG_WARNING(
"<-- TARGET WARNING! Insert too many hardware "
315 "watchpoints! The limit of hardware watchpoints "
316 "is %" PRId32
". -->", nds32_v3m->
n_hwp);
317 LOG_WARNING(
"<-- TARGET STATUS: Inserted number of "
318 "hardware watchpoint: %" PRId32
". -->",
327 "watchpoints exceeds the hardware "
328 "resources. Stop at every load/store "
329 "instruction to check for watchpoint matches. -->");
333 LOG_WARNING(
"<-- TARGET WARNING! Insert too many hardware "
334 "breakpoints/watchpoints! The limit of combined "
335 "hardware breakpoints/watchpoints is %" PRId32
". -->",
337 LOG_WARNING(
"<-- TARGET STATUS: Inserted number of "
338 "hardware breakpoint: %" PRId32
", hardware "
339 "watchpoints: %" PRId32
". -->",
384 nds32_v3m = calloc(1,
sizeof(*nds32_v3m));
412 nds32_v3m->
n_hbr = (edm_cfg & 0x7) + 1;
419 nds32_v3m->
n_hwp = 0;
420 for (int32_t i = 0 ; i < nds32_v3m->
n_hbr ; i++) {
434 LOG_INFO(
"%s: total hardware breakpoint %" PRId32
" (simple breakpoint %" PRId32
")",
#define CHECK_RETVAL(action)
#define LOG_WARNING(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
int nds32_poll(struct target *target)
int nds32_mmu(struct target *target, int *enabled)
int nds32_halt(struct target *target)
int nds32_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c)
int nds32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
get all register list
int nds32_arch_state(struct target *target)
int nds32_get_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t *value)
int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fileio_info)
int nds32_edm_config(struct nds32 *nds32)
int nds32_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
int nds32_read_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int nds32_add_software_breakpoint(struct target *target, struct breakpoint *breakpoint)
int nds32_virtual_to_physical(struct target *target, target_addr_t address, target_addr_t *physical)
int nds32_write_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int nds32_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
int nds32_set_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t value)
set register internally
int nds32_assert_reset(struct target *target)
int nds32_remove_software_breakpoint(struct target *target, struct breakpoint *breakpoint)
int nds32_reset_halt(struct nds32 *nds32)
static bool nds32_reach_max_interrupt_level(struct nds32 *nds32)
static struct aice_port_s * target_to_aice(struct target *target)
static int aice_write_debug_reg(struct aice_port_s *aice, uint32_t addr, const uint32_t val)
static int aice_read_debug_reg(struct aice_port_s *aice, uint32_t addr, uint32_t *val)
const struct command_registration nds32_command_handlers[]
int nds32_v3_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int nds32_v3_init_target(struct command_context *cmd_ctx, struct target *target)
int nds32_v3_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, int timeout_ms, void *arch_info)
int nds32_v3_target_create_common(struct target *target, struct nds32 *nds32)
int nds32_v3_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
int nds32_v3_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
int nds32_v3_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int nds32_v3_target_request_data(struct target *target, uint32_t size, uint8_t *buffer)
target_type functions:
int nds32_v3_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
find out which watchpoint hits get exception address and compare the address to watchpoints
void nds32_v3_common_register_callback(struct nds32_v3_common_callback *callback)
int nds32_v3_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
static int nds32_v3m_deassert_reset(struct target *target)
static struct nds32_v3_common_callback nds32_v3m_common_callback
static int nds32_v3m_examine(struct target *target)
static int nds32_v3m_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int nds32_v3m_deactivate_hardware_watchpoint(struct target *target)
static int nds32_v3m_activate_hardware_watchpoint(struct target *target)
static int nds32_v3m_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int nds32_v3m_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int nds32_v3m_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
struct target_type nds32_v3m_target
Holds methods for NDS32 V3m targets.
static int nds32_v3m_deactivate_hardware_breakpoint(struct target *target)
static int nds32_v3m_restore_interrupt_stack(struct nds32 *nds32)
static int nds32_v3m_check_interrupt_stack(struct nds32 *nds32)
static int nds32_v3m_activate_hardware_breakpoint(struct target *target)
static int nds32_v3m_target_create(struct target *target, Jim_Interp *interp)
static struct nds32_v3m_common * target_to_nds32_v3m(struct target *target)
enum breakpoint_type type
bool address_translation
Address translation.
int(* check_interrupt_stack)(struct nds32 *nds32)
int32_t next_hwp_index
next hardware watchpoint index
int32_t used_n_wp
number of used hardware watchpoints
int32_t next_hbr_index
next hardware breakpoint index
int32_t n_hwp
number of hardware watchpoints
int32_t n_hbr
number of hardware breakpoints
Represents a generic Andes core.
struct target * target
Backpointer to the target.
bool auto_convert_hw_bp
Flag to indicate if auto convert software breakpoints to hardware breakpoints or not in ROM.
bool reset_halt_as_examine
reset-halt as target examine
struct nds32_memory memory
Memory information.
bool global_stop
Flag reporting whether global stop is active.
uint32_t current_interrupt_level
current interrupt level
This holds methods shared between all instances of a given target type.
const char * name
Name of this type of target.
enum target_debug_reason debug_reason
struct breakpoint * breakpoints
struct watchpoint * watchpoints
int target_halt(struct target *target)
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
static bool target_was_examined(struct target *target)