All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 00/12] tests/tcg: Add TriCore tests
@ 2018-05-01 14:22 Bastian Koppelmann
  2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 01/12] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Bastian Koppelmann @ 2018-05-01 14:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Hi Alex,

I finally came around converting some of my TriCore regression tests into actual
tests, that don't require the proprietary Infineon simulator.

These tests are heavily inspired by the riscv-tests [1]. I add macros that
allow easy testing of single asm instructions.

e.g. for add %d1, %d2, %d3 this looks like
          insn test_num res  rs1  rs2
           v      v      v    v    v
TEST_D_DD(add,    1,    0x3, 0x1, 0x2)

Each of the macros generates code that loads the operands into registers,
executes the instruction, and finally checks if the result is as expected.
If the expected result does not match, a guest fail handler is called, that
writes the test_num to a testdev. This testdev takes the test_num and returns it
as an status code using exit(). If all tests pass, we jump to a pass handler,
that writes 0 to the testdev.

Unfortunately, I didn't add any switch to run this automatically on 'make check'
or similar, since there is no obvious way to integrate the tricore-binutils [2].

You can find the full tree here:
https://github.com/bkoppelmann/qemu/tree/tcg-tests-tricore

Cheers,
Bastian

[1] https://github.com/riscv/riscv-tests
[2] https://github.com/bkoppelmann/tricore-binutils

Bastian Koppelmann (12):
  hw/tricore: Add testdevice for tests in tests/tcg/
  tests/tcg/tricore: Add build infrastructure
  tests/tcg/tricore: Add macros to easily create tests and first test
    'abs'
  tests/tcg/tricore: Add bmerge test
  tests/tcg/tricore: Add clz test
  tests/tcg/tricore: Add dvstep test
  tests/tcg/tricore: Add fadd test
  tests/tcg/tricore: Add fmul test
  tests/tcg/tricore: Add ftoi test
  tests/tcg/tricore: Add madd test
  tests/tcg/tricore: Add msub test
  tests/tcg/tricore: Add muls test

 hw/tricore/Makefile.objs                |   1 +
 hw/tricore/tricore_testboard.c          |   8 ++
 hw/tricore/tricore_testdevice.c         |  81 ++++++++++++++++++++
 include/hw/tricore/tricore_testdevice.h |  38 ++++++++++
 tests/tcg/tricore/Makefile              |  41 ++++++++++
 tests/tcg/tricore/link.ld               |  60 +++++++++++++++
 tests/tcg/tricore/macros.h              | 129 ++++++++++++++++++++++++++++++++
 tests/tcg/tricore/test_abs.S            |   8 ++
 tests/tcg/tricore/test_bmerge.S         |   8 ++
 tests/tcg/tricore/test_clz.S            |   9 +++
 tests/tcg/tricore/test_dvstep.S         |  15 ++++
 tests/tcg/tricore/test_fadd.S           |  16 ++++
 tests/tcg/tricore/test_fmul.S           |   8 ++
 tests/tcg/tricore/test_ftoi.S           |  10 +++
 tests/tcg/tricore/test_madd.S           |  11 +++
 tests/tcg/tricore/test_msub.S           |   9 +++
 tests/tcg/tricore/test_muls.S           |   9 +++
 17 files changed, 461 insertions(+)
 create mode 100644 hw/tricore/tricore_testdevice.c
 create mode 100644 include/hw/tricore/tricore_testdevice.h
 create mode 100644 tests/tcg/tricore/Makefile
 create mode 100644 tests/tcg/tricore/link.ld
 create mode 100644 tests/tcg/tricore/macros.h
 create mode 100644 tests/tcg/tricore/test_abs.S
 create mode 100644 tests/tcg/tricore/test_bmerge.S
 create mode 100644 tests/tcg/tricore/test_clz.S
 create mode 100644 tests/tcg/tricore/test_dvstep.S
 create mode 100644 tests/tcg/tricore/test_fadd.S
 create mode 100644 tests/tcg/tricore/test_fmul.S
 create mode 100644 tests/tcg/tricore/test_ftoi.S
 create mode 100644 tests/tcg/tricore/test_madd.S
 create mode 100644 tests/tcg/tricore/test_msub.S
 create mode 100644 tests/tcg/tricore/test_muls.S

--
2.11.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-05-25 16:16 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-01 14:22 [Qemu-devel] [RFC PATCH 00/12] tests/tcg: Add TriCore tests Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 01/12] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
2018-05-25 16:14   ` Alex Bennée
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 02/12] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
2018-05-01 15:40   ` Alex Bennée
     [not found]     ` <f24f7977-cd8b-f502-e3f1-2ae6b0f422d8@mail.uni-paderborn.de>
2018-05-02  9:42       ` Bastian Koppelmann
2018-05-02 13:05         ` Alex Bennée
2018-05-02  0:41   ` Philippe Mathieu-Daudé
2018-05-02  9:26     ` Bastian Koppelmann
2018-05-02  9:50       ` Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 03/12] tests/tcg/tricore: Add macros to easily create tests and first test 'abs' Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 04/12] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 05/12] tests/tcg/tricore: Add clz test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 06/12] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 07/12] tests/tcg/tricore: Add fadd test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 08/12] tests/tcg/tricore: Add fmul test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 09/12] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 10/12] tests/tcg/tricore: Add madd test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 11/12] tests/tcg/tricore: Add msub test Bastian Koppelmann
2018-05-01 14:22 ` [Qemu-devel] [RFC PATCH 12/12] tests/tcg/tricore: Add muls test Bastian Koppelmann
2018-05-01 14:35 ` [Qemu-devel] [RFC PATCH 00/12] tests/tcg: Add TriCore tests no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.