qemu/tests/tcg/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
..
crt.S tests: mv tests/* -> tests/tcg 2012-01-12 10:03:28 -06:00
linker.ld.S Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
macros.inc target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
Makefile target/xtensa: fix timers test 2018-03-26 14:17:04 -07:00
test_b.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_bi.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_boolean.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_break.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_bz.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_cache.S target-xtensa: add basic tests for cache opcodes 2014-02-24 04:47:02 +04:00
test_clamps.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_extui.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_fail.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_interrupt.S target/xtensa: tests: clean up interrupt tests 2017-01-15 13:36:09 -08:00
test_loop.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_mac16.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_max.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_min.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_mmu.S target-xtensa: test cross-page opcode 2014-12-17 05:49:32 +03:00
test_mul16.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_mul32.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_nsa.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_pipeline.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_quo.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_rem.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_rst0.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_s32c1i.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_sar.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_sext.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_shift.S target-xtensa: allow using core configuration in tests 2014-02-24 04:47:01 +04:00
test_sr.S target/xtensa: tests: fix memctl SR test 2018-01-09 09:55:38 -08:00
test_timer.S target/xtensa: tests: add ccount write tests 2017-01-15 13:01:56 -08:00
test_windowed.S target-xtensa: add entry overflow test 2014-11-10 17:59:13 +03:00
vectors.S tests: mv tests/* -> tests/tcg 2012-01-12 10:03:28 -06:00