mirror_qemu/target/xtensa
Max Filippov d0ce7e9cfc target/xtensa: fix timers test
The value of CCOUNT special register is calculated as time elapsed
since CCOUNT == 0 multiplied by the core frequency. In icount mode time
increment between consecutive instructions that don't involve time
warps is constant, but unless the result of multiplication of this
constant by the core frequency is a whole number the CCOUNT increment
between these instructions may not be constant. E.g. with icount=7 each
instruction takes 128ns, with core clock of 10MHz CCOUNT values for
consecutive instructions are:

  502: (128 * 502 * 10000000) / 1000000000 = 642.56
  503: (128 * 503 * 10000000) / 1000000000 = 643.84
  504: (128 * 504 * 10000000) / 1000000000 = 645.12

I.e.the CCOUNT increments depend on the absolute time. This results in
varying CCOUNT differences for consecutive instructions in tests that
involve time warps and don't set CCOUNT explicitly.

Change frequency of the core used in tests so that clock cycle takes
exactly 64ns. Change icount power used in tests to 6, so that each
instruction takes exactly 1 clock cycle. With these changes CCOUNT
increments only depend on the number of executed instructions and that's
what timer tests expect, so they work correctly.

Longer story:
  http://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg04326.html

Cc: Pavel Dovgaluk <Pavel.Dovgaluk@ispras.ru>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-26 14:17:04 -07:00
..
core-dc232b target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-dc233c target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-de212 target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-fsf target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-sample_controller target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
Makefile.objs target/xtensa: add linux-user support 2018-03-16 09:40:34 -07:00
core-dc232b.c target/xtensa: fix timers test 2018-03-26 14:17:04 -07:00
core-dc233c.c target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-de212.c target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-fsf.c target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
core-sample_controller.c target/xtensa: add .inc. to non-top level source file names 2018-03-26 14:17:03 -07:00
cpu-qom.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
cpu.c target/xtensa: add linux-user support 2018-03-16 09:40:34 -07:00
cpu.h cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
gdbstub.c target/xtensa: use correct number of registers in gdbstub 2018-03-13 11:30:22 -07:00
helper.c target/xtensa: add linux-user support 2018-03-16 09:40:34 -07:00
helper.h target/xtensa: add linux-user support 2018-03-16 09:40:34 -07:00
import_core.sh target/xtensa/import_core.sh: fix #include <xtensa-isa.h> 2018-03-26 14:17:03 -07:00
monitor.c monitor: Fix crashes when using HMP commands without CPU 2017-02-21 18:29:01 +00:00
op_helper.c target/xtensa: add linux-user support 2018-03-16 09:40:34 -07:00
overlay_tool.h target/xtensa: use correct number of registers in gdbstub 2018-03-13 11:30:22 -07:00
translate.c target/xtensa: add linux-user support 2018-03-16 09:40:34 -07:00
xtensa-isa-internal.h target/xtensa: import libisa source 2017-12-18 21:26:19 -08:00
xtensa-isa.c Clean up includes 2018-02-09 05:05:11 +01:00
xtensa-isa.h Use #include "..." for our own headers, <...> for others 2018-02-09 05:05:11 +01:00
xtensa-semi.c char: add backend hotswap handler 2017-07-14 11:04:33 +02:00