Services - tools - models - for embedded software development
Embecosm divider strip
Prev  Next

4.7.6.  Reading and Writing All Registers

The g and G packets respectively read and write all registers, and are handled by the functions rsp_read_all_regs () and rsp_write_all_regs ().

4.7.6.1.  Reading All Registers

The register data is provided in a reply packet as a stream of hexadecimal digits for each register in GDB register order. For the OpenRISC 1000 this is the 32 GPRs followed by the Previous Program Counter, Next Program Counter and Supervision Register SPRs. Each register is presented in target endian order, using the convenience function reg2hex ().

4.7.6.2.  Writing All Registers

The register data follows the G as a stream of hexadecimal digits for each register in GDB register order. For the OpenRISC 1000 this is the 32 GPRs followed by the Previous Program Counter, Next Program Counter and Supervision Register SPRs. Each register is supplied in target endian order and decoded using the utility function hex2reg ().

The corresponding values are set in the Or1ksim data structures. For the GPRs this is in the cpu_state.regs array. For the Previous Program Counter and Supervision Register it is the relevant entry in the cpu_state.sprs array. The Next Program Counter is set using the set_npc () convenience function (see Section 4.6.5), which ensures associated variables, controlling the delay pipeline are also updated appropriately.

Embecosm divider strip