mips32: new code for pracc exec
authorSalvador Arroyo <sarroyofdez@yahoo.es>
Tue, 3 Dec 2013 22:25:20 +0000 (23:25 +0100)
committerFreddie Chopin <freddie.chopin@gmail.com>
Fri, 9 May 2014 20:40:31 +0000 (20:40 +0000)
commit6cadbadb3763101a495fddfedec52781a3ac6af7
treed6dbea7cd20ab59fe81d9581fbb698322c45b301
parentfcd7b90db6f6f81ace4e35fca8d124d0fb3a3685
mips32: new code for pracc exec

This is only the basic code proposed for mips32_pracc_exec() function.
It checks every pracc address against the expected address when
reading (instruction fetch).
The code expects to start at PRACC_TEXT and any subsequent read address
is obtained by adding 4 to the previous one.
After shifting out all the instructions the code executes a final check.
It checks now for the first pass trough PRACC_TEXT and shift out
only NOP instructions.
A mips core does not need an additional NOP and after the first check
it exits if there is no store access pending.
After shifting out one NOP the core must be reading at pracc text or the
code exits with error.
The code continues shifting out NOPs until all store accesses have
been performed.
After shifting out 10 NOPs it exits with error.
No assumption is made about the number of store instruction shifted out or
the ordering of the store accesses. It only checks that the number of
store accesses is the same as the number of store instructions at dmseg
after execution.
mips32_pracc_read_ctrl_addr() and mips32_pracc_finish() are added to
simpify a bit the code. Fields pa_ctrl and pa_addr are added
in ejtag_info for storing values of pracc control and address.

Change-Id: If6322d5c8cbeadcd4acd3972c0f72c8490f53c34
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1827
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/target/mips32_pracc.c
src/target/mips32_pracc.h
src/target/mips_ejtag.c
src/target/mips_ejtag.h