// read aligned word (the size is in words) public virtual List <UInt32> _readBlock32(UInt32 addr, UInt16 size) { var num = this.dp.next_access_number; if (DebugAccessPort.LOG_DAP) { Trace.TraceInformation("_readBlock32:%06d (addr=0x%08x, size=%d) {", num, addr, size); } // put address in TAR this.write_reg(DebugAccessPort.AP_REG["CSW"], CSW_VALUE | CSW_SIZE32); this.write_reg(DebugAccessPort.AP_REG["TAR"], addr); List <UInt32> resp; try { REG_APnDP_A3_A2 reg = DebugAccessPort._ap_addr_to_reg((this.ap_num << DebugAccessPort.APSEL_SHIFT) | DebugAccessPort.READ | DebugAccessPort.AP_ACC | DebugAccessPort.AP_REG["DRW"]); resp = this.link.reg_read_repeat(size, reg)(); } catch (Exception error) { // Annotate error with target address. this._handle_error(error, num); throw new Exception(string.Format("Fault Address {0:X8}", addr), error); // error.fault_address = addr; } if (DebugAccessPort.LOG_DAP) { Trace.TraceInformation("_readBlock32:%06d }", num); } return(resp); }
// write aligned word ("data" are words) public virtual void _writeBlock32(UInt32 addr, List <UInt32> data) { var num = this.dp.next_access_number; if (DebugAccessPort.LOG_DAP) { Trace.TraceInformation("_writeBlock32:%06d (addr=0x%08x, size=%d) {", num, addr, data.Count); } // put address in TAR this.write_reg(DebugAccessPort.AP_REG["CSW"], CSW_VALUE | CSW_SIZE32); this.write_reg(DebugAccessPort.AP_REG["TAR"], addr); try { REG_APnDP_A3_A2 reg = DebugAccessPort._ap_addr_to_reg(this.ap_num << DebugAccessPort.APSEL_SHIFT | DebugAccessPort.WRITE | DebugAccessPort.AP_ACC | DebugAccessPort.AP_REG["DRW"]); this.link.reg_write_repeat((UInt16)data.Count, reg, data); } catch (Exception error) { // Annotate error with target address. this._handle_error(error, num); throw new Exception(string.Format("Fault Address {0:X8}", addr), error); // error.fault_address = addr; } if (DebugAccessPort.LOG_DAP) { Trace.TraceInformation("_writeBlock32:%06d }", num); } }
public MEM_AP(DebugAccessPort dp, UInt32 ap_num) : base(dp, ap_num) { // Default to the smallest size supported by all targets. // A size smaller than the supported size will decrease performance // due to the extra address writes, but will not create any // read/write errors. this.auto_increment_page_size = 1024; }
public AccessPort(DebugAccessPort dp, UInt32 ap_num) { this.dp = dp; this.ap_num = ap_num; this.link = dp.link; this.idr = 0; this.rom_addr = 0; this.has_rom_table = false; this.rom_table = null; this.inited_primary = false; this.inited_secondary = false; if (DebugAccessPort.LOG_DAP) { //this.logger = this.dp.logger.getChild(String.Format("ap%d", ap_num)); } }
public CortexM(IDapAccessLink link, DebugAccessPort dp, MEM_AP ap, Memory.MemoryMap memoryMap = null, byte core_num = 0) : base(link, memoryMap) { this.arch = 0; this.core_type = 0; this.has_fpu = false; this.dp = dp; this.ap = ap; this.core_number = core_num; this._run_token = 0; this._target_context = null; // Set up breakpoints manager. this.fpb = new FPB(this.ap); this.dwt = new DWT(this.ap); this.sw_bp = new SoftwareBreakpointProvider(this); this.bp_manager = new BreakpointManager(this); this.bp_manager.add_provider(this.fpb, EBreakpointType.BREAKPOINT_HW); this.bp_manager.add_provider(this.sw_bp, EBreakpointType.BREAKPOINT_SW); }
public AHB_AP(DebugAccessPort dp, UInt32 ap_num) : base(dp, ap_num) { }