All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/15] tests/tcg: Add TriCore tests
@ 2020-06-04  8:54 Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image Bastian Koppelmann
                   ` (17 more replies)
  0 siblings, 18 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Hi Alex,

I managed to update the series to successfully run make check-tcg. This required
some changes to the makefiles. I tried running the riscv64 and arm tests and so
far I didn't break anything.

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

Cheers,
Bastian

Bastian Koppelmann (15):
  docker/tricore: Use stretch-slim as a base image
  tests/tcg: Add docker_as and docker_ld cmds
  tests/tcg: Run timeout cmds using --foreground
  hw/tricore: Add testdevice for tests in tests/tcg/
  tests/tcg/tricore: Add build infrastructure
  tests/tcg/tricore: Add macros to 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                      |   2 +-
 hw/tricore/tricore_testboard.c                |   8 ++
 hw/tricore/tricore_testdevice.c               |  82 +++++++++++
 include/hw/tricore/tricore_testdevice.h       |  38 ++++++
 .../dockerfiles/debian-tricore-cross.docker   |  16 ++-
 tests/tcg/Makefile.qemu                       |  11 ++
 tests/tcg/Makefile.target                     |   5 +-
 tests/tcg/configure.sh                        |   9 +-
 tests/tcg/tricore/Makefile.softmmu-target     |  28 ++++
 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 ++
 21 files changed, 485 insertions(+), 6 deletions(-)
 create mode 100644 hw/tricore/tricore_testdevice.c
 create mode 100644 include/hw/tricore/tricore_testdevice.h
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
 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.26.2



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

* [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04 15:41   ` Alex Bennée
  2020-06-04  8:54 ` [PATCH v2 02/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

we get an authentication errror when trying to pull qemu:debian9. Thus
just start from a plain debian image.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 .../dockerfiles/debian-tricore-cross.docker      | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
index 4a0f7706a3..544d7814f8 100644
--- a/tests/docker/dockerfiles/debian-tricore-cross.docker
+++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
@@ -7,10 +7,22 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 #
-FROM qemu:debian9
-
+FROM debian:stretch-slim
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
+RUN apt-get update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt-get install -y --no-install-recommends \
+        bison \
+        build-essential \
+        ca-certificates \
+        curl \
+        flex \
+        gettext \
+        git \
+        python3-minimal
+
 RUN git clone --single-branch \
         https://github.com/bkoppelmann/tricore-binutils.git \
         /usr/src/binutils && \
-- 
2.26.2



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

* [PATCH v2 02/15] tests/tcg: Add docker_as and docker_ld cmds
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-16 16:13   ` Alex Bennée
  2020-06-04  8:54 ` [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

At least for the TriCore target no easily available c compiler exists.
Thus we need to rely on "as" and "ld". This allows us to run them
through the docker image.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/Makefile.qemu | 11 +++++++++++
 tests/tcg/configure.sh  |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
index 9c23aeaa2a..e5b3a4bacc 100644
--- a/tests/tcg/Makefile.qemu
+++ b/tests/tcg/Makefile.qemu
@@ -50,11 +50,22 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
 		-i qemu:$(DOCKER_IMAGE) \
 		-s $(SRC_PATH) -- "
 
+DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
+		--cc $(DOCKER_CROSS_AS_GUEST) \
+		-i qemu:$(DOCKER_IMAGE) \
+		-s $(SRC_PATH) -- "
+
+DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
+		--cc $(DOCKER_CROSS_LD_GUEST) \
+		-i qemu:$(DOCKER_IMAGE) \
+		-s $(SRC_PATH) -- "
+
 .PHONY: docker-build-guest-tests
 docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
 	$(call quiet-command, \
 	  (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
 	   $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
+			AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
 			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
 			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
 	"BUILD","$(TARGET) guest-tests with docker qemu:$(DOCKER_IMAGE)")
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 2326f97856..6e8659d488 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -242,6 +242,8 @@ for target in $target_list; do
   if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
     echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
     echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
+    echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> $config_target_mak
+    echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> $config_target_mak
   fi
 done
 
-- 
2.26.2



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

* [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 02/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-16 16:22   ` Alex Bennée
  2020-06-04  8:54 ` [PATCH v2 04/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
                   ` (14 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

when trying to run successful short tests from the Makefile timeout would no
terminate. Rather it would wait until the time runs out. Excerpt from the
manpage:

--foreground
    when not running timeout directly from a shell prompt,
    allow COMMAND to read from the TTY and get TTY signals; in this mode, chil‐
    dren of COMMAND will not be timed out

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/Makefile.target | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index b3cff3cad1..423caffa56 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -40,9 +40,10 @@ quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
 
 # $1 = test name, $2 = cmd, $3 = desc
 ifdef CONFIG_USER_ONLY
-run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out \
+	"TEST",$3)
 else
-run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2,"TEST",$3)
 endif
 
 # $1 = test name, $2 = reference
-- 
2.26.2



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

* [PATCH v2 04/15] hw/tricore: Add testdevice for tests in tests/tcg/
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (2 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-16 17:07   ` Alex Bennée
  2020-06-04  8:54 ` [PATCH v2 05/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

this device is used to verify the correctness of regression tests by
allowing guests to write their exit status to this device. This is then
used by qemu to exit using the written status.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 hw/tricore/Makefile.objs                |  2 +-
 hw/tricore/tricore_testboard.c          |  8 +++
 hw/tricore/tricore_testdevice.c         | 82 +++++++++++++++++++++++++
 include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++
 4 files changed, 129 insertions(+), 1 deletion(-)
 create mode 100644 hw/tricore/tricore_testdevice.c
 create mode 100644 include/hw/tricore/tricore_testdevice.h

diff --git a/hw/tricore/Makefile.objs b/hw/tricore/Makefile.objs
index 5501f6c1a8..163148d04a 100644
--- a/hw/tricore/Makefile.objs
+++ b/hw/tricore/Makefile.objs
@@ -1 +1 @@
-obj-$(CONFIG_TRICORE) += tricore_testboard.o
+obj-$(CONFIG_TRICORE) += tricore_testboard.o tricore_testdevice.o
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index 8ec2b5bddd..b826c99b5f 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -28,6 +28,7 @@
 #include "exec/address-spaces.h"
 #include "elf.h"
 #include "hw/tricore/tricore.h"
+#include "hw/tricore/tricore_testdevice.h"
 #include "qemu/error-report.h"
 
 
@@ -57,6 +58,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
 {
     TriCoreCPU *cpu;
     CPUTriCoreState *env;
+    TriCoreTestDeviceState *test_dev;
 
     MemoryRegion *sysmem = get_system_memory();
     MemoryRegion *ext_cram = g_new(MemoryRegion, 1);
@@ -88,6 +90,12 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
     memory_region_add_subregion(sysmem, 0xf0050000, pcp_data);
     memory_region_add_subregion(sysmem, 0xf0060000, pcp_text);
 
+    /* test device */
+    test_dev = g_new(TriCoreTestDeviceState, 1);
+    object_initialize(test_dev, sizeof(TriCoreTestDeviceState),
+                      TYPE_TRICORE_TESTDEVICE);
+    memory_region_add_subregion(sysmem, 0xf0000000, &test_dev->iomem);
+
     tricoretb_binfo.ram_size = machine->ram_size;
     tricoretb_binfo.kernel_filename = machine->kernel_filename;
 
diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevice.c
new file mode 100644
index 0000000000..676e00b465
--- /dev/null
+++ b/hw/tricore/tricore_testdevice.c
@@ -0,0 +1,82 @@
+/*
+ *  Copyright (c) 2018 Bastian Koppelmann Paderborn University
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/sysbus.h"
+#include "hw/qdev-properties.h"
+#include "hw/tricore/tricore_testdevice.h"
+
+static void tricore_testdevice_write(void *opaque, hwaddr offset,
+                                      uint64_t value, unsigned size)
+{
+    exit(value);
+}
+
+static uint64_t tricore_testdevice_read(void *opaque, hwaddr offset,
+                                         unsigned size)
+{
+    return 0xdeadbeef;
+}
+
+static void tricore_testdevice_reset(DeviceState *dev)
+{
+}
+
+static const MemoryRegionOps tricore_testdevice_ops = {
+    .read = tricore_testdevice_read,
+    .write = tricore_testdevice_write,
+    .valid = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
+    .endianness = DEVICE_NATIVE_ENDIAN,
+};
+
+static void tricore_testdevice_init(Object *obj)
+{
+    TriCoreTestDeviceState *s = TRICORE_TESTDEVICE(obj);
+   /* map memory */
+    memory_region_init_io(&s->iomem, OBJECT(s), &tricore_testdevice_ops, s,
+                          "tricore_testdevice", 0x4);
+}
+
+static Property tricore_testdevice_properties[] = {
+    DEFINE_PROP_END_OF_LIST()
+};
+
+static void tricore_testdevice_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    device_class_set_props(dc, tricore_testdevice_properties);
+    dc->reset = tricore_testdevice_reset;
+}
+
+static const TypeInfo tricore_testdevice_info = {
+    .name          = TYPE_TRICORE_TESTDEVICE,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(TriCoreTestDeviceState),
+    .instance_init = tricore_testdevice_init,
+    .class_init    = tricore_testdevice_class_init,
+};
+
+static void tricore_testdevice_register_types(void)
+{
+    type_register_static(&tricore_testdevice_info);
+}
+
+type_init(tricore_testdevice_register_types)
diff --git a/include/hw/tricore/tricore_testdevice.h b/include/hw/tricore/tricore_testdevice.h
new file mode 100644
index 0000000000..5b2df219e3
--- /dev/null
+++ b/include/hw/tricore/tricore_testdevice.h
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (c) 2018  Bastian Koppelmann Paderborn University
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef HW_TRICORE_TESTDEV_H
+#define HW_TRICORE_TESTDEV_H
+
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+
+#define TYPE_TRICORE_TESTDEVICE "tricore_testdevice"
+#define TRICORE_TESTDEVICE(obj) \
+    OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+
+} TriCoreTestDeviceState;
+
+#endif
-- 
2.26.2



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

* [PATCH v2 05/15] tests/tcg/tricore: Add build infrastructure
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (3 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 04/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-16 17:22   ` Alex Bennée
  2020-06-04  8:54 ` [PATCH v2 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
                   ` (12 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

this includes the Makefile and linker script to build all the tests.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target | 17 +++++++
 tests/tcg/tricore/link.ld                 | 60 +++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
 create mode 100644 tests/tcg/tricore/link.ld

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
new file mode 100644
index 0000000000..4a2cd6f218
--- /dev/null
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -0,0 +1,17 @@
+HOST_CC = gcc
+
+TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
+
+LDFLAGS = -T$(TESTS_PATH)/link.ld
+ASFLAGS =
+
+QEMU_OPTS += -M tricore_testboard -nographic -kernel
+
+%.pS: $(TESTS_PATH)/%.S
+	$(HOST_CC) -E -o $@ $<
+
+%.o: %.pS
+	$(AS) $(ASFLAGS) -o $@ $<
+
+%.tst: %.o
+	$(LD) $(LDFLAGS) $< -o $@
diff --git a/tests/tcg/tricore/link.ld b/tests/tcg/tricore/link.ld
new file mode 100644
index 0000000000..364bcdc00a
--- /dev/null
+++ b/tests/tcg/tricore/link.ld
@@ -0,0 +1,60 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-tricore")
+OUTPUT_ARCH(tricore)
+ENTRY(_start)
+
+/* the internal ram description */
+MEMORY
+{
+  text_ram (rx!p): org = 0x80000000, len = 15K
+  data_ram (w!xp): org = 0xd0000000, len = 130K
+}
+/*
+ * Define the sizes of the user and system stacks.
+ */
+__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
+/*
+ * Define the start address and the size of the context save area.
+ */
+__CSA_BEGIN =  0xd0000000 ;
+__CSA_SIZE =  8k ;
+__CSA_END = __CSA_BEGIN + __CSA_SIZE ;
+
+SECTIONS
+{
+  .text  :
+  {
+    *(.text)
+    . = ALIGN(8);
+  } > text_ram
+
+  .rodata :
+  {
+    *(.rodata)
+    *(.rodata1)
+  } > data_ram
+
+  .data :
+  {
+    . = ALIGN(8) ;
+    *(.data)
+    *(.data.*)
+    . = ALIGN(8) ;
+    __USTACK = . + __USTACK_SIZE -768;
+
+  } > data_ram
+  /*
+   * Allocate space for BSS sections.
+   */
+  .bss  :
+  {
+    BSS_BASE = . ;
+    *(.bss)
+    *(COMMON)
+    . = ALIGN(8) ;
+  } > data_ram
+  /* Make sure CSA, stack and heap addresses are properly aligned.  */
+  _. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
+  _. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;
+
+}
-- 
2.26.2



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

* [PATCH v2 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs'
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (4 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 05/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-16 17:28   ` Alex Bennée
  2020-06-04  8:54 ` [PATCH v2 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
                   ` (11 subsequent siblings)
  17 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

This kind of tests is inspired by the riscv-tests repository. This adds
macros that makes it easy to create single instruction self containing
tests.

It is achieved by macros that create a test sequence for an
instruction and check for a supplied correct value. If the value is correct the
next instruction is tested. Otherwise we jump to fail handler that writes is
test number as a status code back to qemu that then exits on that status code.
If all tests pass we write back 0 as a status code and exit.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/configure.sh                    |  7 ++-
 tests/tcg/tricore/Makefile.softmmu-target |  2 +
 tests/tcg/tricore/macros.h                | 53 +++++++++++++++++++++++
 tests/tcg/tricore/test_abs.S              |  8 ++++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/tricore/macros.h
 create mode 100644 tests/tcg/tricore/test_abs.S

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 6e8659d488..cd857433d9 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -85,7 +85,7 @@ for target in $target_list; do
     xtensa|xtensaeb)
       arches=xtensa
       ;;
-    alpha|cris|hppa|i386|lm32|m68k|openrisc|riscv64|s390x|sh4|sparc64)
+    alpha|cris|hppa|i386|lm32|m68k|openrisc|riscv64|s390x|sh4|sparc64|tricore)
       arches=$target
       ;;
     *)
@@ -169,6 +169,11 @@ for target in $target_list; do
       container_image=debian-sparc64-cross
       container_cross_cc=sparc64-linux-gnu-gcc
       ;;
+    tricore-softmmu)
+        container_image=debian-tricore-cross
+        container_cross_as=tricore-as
+        container_cross_ld=tricore-ld
+        ;;
     xtensa*-softmmu)
       container_image=debian-xtensa-cross
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 4a2cd6f218..1b1f220c7c 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -7,6 +7,8 @@ ASFLAGS =
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
+TESTS += test_abs.tst
+
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
 
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
new file mode 100644
index 0000000000..76c133132a
--- /dev/null
+++ b/tests/tcg/tricore/macros.h
@@ -0,0 +1,53 @@
+/* Helpers */
+#define LI(reg, val)           \
+    mov.u reg, lo:val;         \
+    movh DREG_TEMP_LI, up:val; \
+    or reg, reg, DREG_TEMP_LI; \
+
+/* Address definitions */
+#define TESTDEV_ADDR 0xf0000000
+/* Register definitions */
+#define DREG_RS1 %d0
+#define DREG_CALC_RESULT %d1
+#define DREG_TEMP_LI %d10
+#define DREG_TEMP %d11
+#define DREG_TEST_NUM %d14
+#define DREG_CORRECT_RESULT %d15
+
+#define DREG_DEV_ADDR %a15
+
+/* Test case wrappers */
+#define TEST_CASE(num, testreg, correct, code...) \
+test_ ## num:                                     \
+    code;                                         \
+    LI(DREG_CORRECT_RESULT, correct)              \
+    mov DREG_TEST_NUM, num;                       \
+    jne testreg, DREG_CORRECT_RESULT, fail        \
+
+/* Actual test case type
+ * e.g inst %dX, %dY      -> TEST_D_D
+ *     inst %dX, %dY, %dZ -> TEST_D_DD
+ *     inst %eX, %dY, %dZ -> TEST_E_DD
+ */
+#define TEST_D_D(insn, num, result, rs1)      \
+    TEST_CASE(num, DREG_CALC_RESULT, result,  \
+    LI(DREG_RS1, rs1);                        \
+    insn DREG_CALC_RESULT, DREG_RS1;          \
+    )
+
+/* Pass/Fail handling part */
+#define TEST_PASSFAIL                       \
+        j pass;                             \
+fail:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j fail;                             \
+pass:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        mov DREG_TEST_NUM, 0;               \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j pass;
diff --git a/tests/tcg/tricore/test_abs.S b/tests/tcg/tricore/test_abs.S
new file mode 100644
index 0000000000..acc143901c
--- /dev/null
+++ b/tests/tcg/tricore/test_abs.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D(abs, 1, 0, 0)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 07/15] tests/tcg/tricore: Add bmerge test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (5 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/macros.h                | 24 +++++++++++++++++++++++
 tests/tcg/tricore/test_bmerge.S           |  8 ++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 tests/tcg/tricore/test_bmerge.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 1b1f220c7c..abcd5a4e6e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -8,6 +8,7 @@ ASFLAGS =
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
 TESTS += test_abs.tst
+TESTS += test_bmerge.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 76c133132a..52aa936c56 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -8,7 +8,10 @@
 #define TESTDEV_ADDR 0xf0000000
 /* Register definitions */
 #define DREG_RS1 %d0
+#define DREG_RS2 %d1
 #define DREG_CALC_RESULT %d1
+#define DREG_CALC_PSW %d2
+#define DREG_CORRECT_PSW %d3
 #define DREG_TEMP_LI %d10
 #define DREG_TEMP %d11
 #define DREG_TEST_NUM %d14
@@ -24,6 +27,17 @@ test_ ## num:                                     \
     mov DREG_TEST_NUM, num;                       \
     jne testreg, DREG_CORRECT_RESULT, fail        \
 
+#define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \
+test_ ## num:                                                      \
+    code;                                                          \
+    LI(DREG_CORRECT_RESULT, correct)                               \
+    mov DREG_TEST_NUM, num;                                        \
+    jne testreg, DREG_CORRECT_RESULT, fail;                        \
+    mfcr DREG_CALC_PSW, $psw;                                      \
+    LI(DREG_CORRECT_PSW, correct_psw)                              \
+    mov DREG_TEST_NUM, num;                                        \
+    jne DREG_CALC_PSW, DREG_CORRECT_PSW, fail;
+
 /* Actual test case type
  * e.g inst %dX, %dY      -> TEST_D_D
  *     inst %dX, %dY, %dZ -> TEST_D_DD
@@ -35,6 +49,16 @@ test_ ## num:                                     \
     insn DREG_CALC_RESULT, DREG_RS1;          \
     )
 
+#define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,   \
+    LI(DREG_RS1, rs1);                                  \
+    LI(DREG_RS2, rs2);                                  \
+    rstv;                                               \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
+    )
+
+
+
 /* Pass/Fail handling part */
 #define TEST_PASSFAIL                       \
         j pass;                             \
diff --git a/tests/tcg/tricore/test_bmerge.S b/tests/tcg/tricore/test_bmerge.S
new file mode 100644
index 0000000000..8a0fa6d3f6
--- /dev/null
+++ b/tests/tcg/tricore/test_bmerge.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(bmerge, 1, 0x555557f7, 0x00000b80, 0x0000001d, 0x0000ffff)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 08/15] tests/tcg/tricore: Add clz test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (6 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target | 1 +
 tests/tcg/tricore/test_clz.S              | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 tests/tcg/tricore/test_clz.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index abcd5a4e6e..7a08b656a6 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -9,6 +9,7 @@ QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
+TESTS += test_clz.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/test_clz.S b/tests/tcg/tricore/test_clz.S
new file mode 100644
index 0000000000..e03835f123
--- /dev/null
+++ b/tests/tcg/tricore/test_clz.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D(cls.h, 1, 0x0, 0x6db17976)
+    TEST_D_D(cls.h, 2, 0x000f000f, 0x0)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 09/15] tests/tcg/tricore: Add dvstep test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (7 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/macros.h                | 29 ++++++++++++++++++++++-
 tests/tcg/tricore/test_dvstep.S           | 15 ++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/tricore/test_dvstep.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 7a08b656a6..a70fa9643d 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -10,6 +10,7 @@ QEMU_OPTS += -M tricore_testboard -nographic -kernel
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
+TESTS += test_dvstep.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 52aa936c56..59b4b9a352 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -19,6 +19,18 @@
 
 #define DREG_DEV_ADDR %a15
 
+#define EREG_RS1 %e6
+#define EREG_RS1_LO %d6
+#define EREG_RS1_HI %d7
+#define EREG_RS2 %e8
+#define EREG_RS2_LO %d8
+#define EREG_RS2_HI %d9
+#define EREG_CALC_RESULT %e8
+#define EREG_CALC_RESULT_HI %d9
+#define EREG_CALC_RESULT_LO %d8
+#define EREG_CORRECT_RESULT_LO %d0
+#define EREG_CORRECT_RESULT_HI %d1
+
 /* Test case wrappers */
 #define TEST_CASE(num, testreg, correct, code...) \
 test_ ## num:                                     \
@@ -27,6 +39,15 @@ test_ ## num:                                     \
     mov DREG_TEST_NUM, num;                       \
     jne testreg, DREG_CORRECT_RESULT, fail        \
 
+#define TEST_CASE_E(num, correct_lo, correct_hi, code...)  \
+test_ ## num:                                              \
+    code;                                                  \
+    mov DREG_TEST_NUM, num;                                \
+    LI(EREG_CORRECT_RESULT_LO, correct_lo)                 \
+    jne EREG_CALC_RESULT_LO, EREG_CORRECT_RESULT_LO, fail; \
+    LI(EREG_CORRECT_RESULT_HI, correct_hi)                 \
+    jne EREG_CALC_RESULT_HI, EREG_CORRECT_RESULT_HI, fail;
+
 #define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \
 test_ ## num:                                                      \
     code;                                                          \
@@ -57,7 +78,13 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
     )
 
-
+#define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \
+    TEST_CASE_E(num, res_lo, res_hi,                              \
+    LI(EREG_RS1_LO, rs1_lo);                                      \
+    LI(EREG_RS1_HI, rs1_hi);                                      \
+    LI(DREG_RS2, rs2);                                            \
+    insn EREG_CALC_RESULT, EREG_RS1, DREG_RS2;                    \
+    )
 
 /* Pass/Fail handling part */
 #define TEST_PASSFAIL                       \
diff --git a/tests/tcg/tricore/test_dvstep.S b/tests/tcg/tricore/test_dvstep.S
new file mode 100644
index 0000000000..858dbc62dd
--- /dev/null
+++ b/tests/tcg/tricore/test_dvstep.S
@@ -0,0 +1,15 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    #                              Result                   RS1            RS2
+    TEST_E_ED(dvstep,   1, 0x000001ff, 0xfffe5cff, 0x00000001, 0xfffffe5c, 0x0)
+    TEST_E_ED(dvstep,   2, 0x00000000, 0x000000ff, 0x00000000, 0x00000000, 0x0)
+    TEST_E_ED(dvstep,   3, 0x0000f000, 0x000000fd, 0x010000f0, 0x00000000, 0x0)
+    TEST_E_ED(dvstep,   4, 0xfffff000, 0x00000000, 0x7ffffff0, 0x00000000, 0x0)
+    TEST_E_ED(dvstep.u, 5, 0xffffff00, 0x100008ff, 0xffffffff, 0x00100008, 0x0)
+    TEST_E_ED(dvstep.u, 6, 0x00000100, 0x00000000, 0x08000001, 0x00000000, \
+                           0xffffff2d)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 10/15] tests/tcg/tricore: Add fadd test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (8 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/test_fadd.S             | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 tests/tcg/tricore/test_fadd.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index a70fa9643d..3cbb1c8668 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -11,6 +11,7 @@ TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
+TESTS += test_fadd.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/test_fadd.S b/tests/tcg/tricore/test_fadd.S
new file mode 100644
index 0000000000..1a65054803
--- /dev/null
+++ b/tests/tcg/tricore/test_fadd.S
@@ -0,0 +1,16 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(add.f, 1, 0x7fc00000, 0x00000b80, 0xffffff85, 0x00001234)
+    TEST_D_DD_PSW(add.f, 2, 0xf9c00000, 0x00000b80, 0xf9400000, 0xf9400000)
+    TEST_D_DD_PSW(add.f, 3, 0x8bb858ca, 0x00000b80, 0x8b3858ca, 0x8b3858ca)
+    TEST_D_DD_PSW(add.f, 4, 0x00000000, 0x00000b80, 0x000000ff, 0x00000000)
+    TEST_D_DD_PSW(add.f, 5, 0x7fc00000, 0x00000b80, 0xfffffe52, 0x0a4cf70c)
+    TEST_D_DD_PSW(add.f, 6, 0x9e6d5076, 0x84000b80, 0x9ded50ec, 0x9ded4fff)
+    TEST_D_DD_PSW(add.f, 7, 0x00000000, 0x04000b80, 0x0000e8bd, 0x00000000)
+    TEST_D_DD_PSW(add.f, 8, 0x7fc00000, 0xc4000b80, 0xffad546e, 0xffad546e)
+    TEST_D_DD_PSW(add.f, 9, 0x7fc00000, 0x04000b80, 0xfffe0000, 0x08130000)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 11/15] tests/tcg/tricore: Add fmul test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (9 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target | 1 +
 tests/tcg/tricore/test_fmul.S             | 8 ++++++++
 2 files changed, 9 insertions(+)
 create mode 100644 tests/tcg/tricore/test_fmul.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 3cbb1c8668..21a7017f07 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -12,6 +12,7 @@ TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
+TESTS += test_fmul.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/test_fmul.S b/tests/tcg/tricore/test_fmul.S
new file mode 100644
index 0000000000..fb1f634b2d
--- /dev/null
+++ b/tests/tcg/tricore/test_fmul.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(mul.f, 1, 0x974f4f0a, 0x84000b80, 0x1a0b1980, 0xbcbec42d)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 12/15] tests/tcg/tricore: Add ftoi test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (10 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/macros.h                |  7 +++++++
 tests/tcg/tricore/test_ftoi.S             | 10 ++++++++++
 3 files changed, 18 insertions(+)
 create mode 100644 tests/tcg/tricore/test_ftoi.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 21a7017f07..a4eebbccb4 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -13,6 +13,7 @@ TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
+TESTS += test_ftoi.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 59b4b9a352..e6a41cd1a2 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -70,6 +70,13 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1;          \
     )
 
+#define TEST_D_D_PSW(insn, num, result, psw, rs1)     \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw, \
+    LI(DREG_RS1, rs1);                                \
+    rstv;                                             \
+    insn DREG_CORRECT_RESULT, DREG_RS1;               \
+    )
+
 #define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \
     TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,   \
     LI(DREG_RS1, rs1);                                  \
diff --git a/tests/tcg/tricore/test_ftoi.S b/tests/tcg/tricore/test_ftoi.S
new file mode 100644
index 0000000000..fb4af6b5aa
--- /dev/null
+++ b/tests/tcg/tricore/test_ftoi.S
@@ -0,0 +1,10 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D_PSW(ftoi, 1, 0x0, 0x84000b80, 0x05f6e605)
+    TEST_D_D_PSW(ftoi, 2, 0x0, 0x04000b80, 0x00012200)
+    TEST_D_D_PSW(ftoi, 3, 0x0, 0xc4000b80, 0xffffffff)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 13/15] tests/tcg/tricore: Add madd test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (11 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/macros.h                | 18 ++++++++++++++++++
 tests/tcg/tricore/test_madd.S             | 11 +++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 tests/tcg/tricore/test_madd.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index a4eebbccb4..4d8d403e80 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -14,6 +14,7 @@ TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
+TESTS += test_madd.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index e6a41cd1a2..0d76fc403a 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -9,6 +9,7 @@
 /* Register definitions */
 #define DREG_RS1 %d0
 #define DREG_RS2 %d1
+#define DREG_RS3 %d4
 #define DREG_CALC_RESULT %d1
 #define DREG_CALC_PSW %d2
 #define DREG_CORRECT_PSW %d3
@@ -85,6 +86,23 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
     )
 
+#define TEST_D_DDD_PSW(insn, num, result, psw, rs1, rs2, rs3) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,         \
+    LI(DREG_RS1, rs1);                                        \
+    LI(DREG_RS2, rs2);                                        \
+    LI(DREG_RS3, rs3);                                        \
+    rstv;                                                     \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3;      \
+    )
+
+#define TEST_D_DDI_PSW(insn, num, result, psw, rs1, rs2, imm) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,         \
+    LI(DREG_RS1, rs1);                                        \
+    LI(DREG_RS2, rs2);                                        \
+    rstv;                                                     \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm;           \
+    )
+
 #define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \
     TEST_CASE_E(num, res_lo, res_hi,                              \
     LI(EREG_RS1_LO, rs1_lo);                                      \
diff --git a/tests/tcg/tricore/test_madd.S b/tests/tcg/tricore/test_madd.S
new file mode 100644
index 0000000000..5d839772bb
--- /dev/null
+++ b/tests/tcg/tricore/test_madd.S
@@ -0,0 +1,11 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DDI_PSW(madd,    1, 0x0000fffd, 0x60000b80, 0x0000ffff, 0x7fffffff,2)
+    TEST_D_DDI_PSW(madd,    2, 0xffff7fff, 0x60000b80, 0xffff8001, 0x7fffffff,2)
+    TEST_D_DDD_PSW(madds.u, 3, 0xffffffff, 0x60000b80, 0x00000000, 0x80000000, \
+                             0x80000000)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 14/15] tests/tcg/tricore: Add msub test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (12 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  8:54 ` [PATCH v2 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target | 1 +
 tests/tcg/tricore/test_msub.S             | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 tests/tcg/tricore/test_msub.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 4d8d403e80..2d74aa09bb 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -15,6 +15,7 @@ TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
+TESTS += test_msub.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/test_msub.S b/tests/tcg/tricore/test_msub.S
new file mode 100644
index 0000000000..6dee87d99c
--- /dev/null
+++ b/tests/tcg/tricore/test_msub.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DDI_PSW(msub, 1, 0xd2fbe5e0, 0x00000b80,0x64003300, 0xff5420d4, -216)
+    TEST_D_DDI_PSW(msub, 2, 0xfffffc10, 0x00000b80,0xfffffe68, 0xfffffffd, -200)
+    TEST_D_DDD_PSW(msubs.u, 3, 0x0, 0x60000b80, 0x1, 0xffffffff, 0xffffffdb)
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* [PATCH v2 15/15] tests/tcg/tricore: Add muls test
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (13 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
@ 2020-06-04  8:54 ` Bastian Koppelmann
  2020-06-04  9:37 ` [PATCH v2 00/15] tests/tcg: Add TriCore tests no-reply
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-04  8:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target | 1 +
 tests/tcg/tricore/test_muls.S             | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 tests/tcg/tricore/test_muls.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 2d74aa09bb..723d805150 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -16,6 +16,7 @@ TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
 TESTS += test_msub.tst
+TESTS += test_muls.tst
 
 %.pS: $(TESTS_PATH)/%.S
 	$(HOST_CC) -E -o $@ $<
diff --git a/tests/tcg/tricore/test_muls.S b/tests/tcg/tricore/test_muls.S
new file mode 100644
index 0000000000..ca517556bc
--- /dev/null
+++ b/tests/tcg/tricore/test_muls.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(muls.u, 1, 0xffffffff, 0x78000b80, 0x80000001, 0xffffffff)
+    TEST_D_DD_PSW(muls.u, 2, 0xffffffff, 0x60000b80, 0xfffffffe, 0xffffffff)
+
+    TEST_PASSFAIL
+
-- 
2.26.2



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

* Re: [PATCH v2 00/15] tests/tcg: Add TriCore tests
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (14 preceding siblings ...)
  2020-06-04  8:54 ` [PATCH v2 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
@ 2020-06-04  9:37 ` no-reply
  2020-06-16 17:29 ` Alex Bennée
  2021-02-22  9:23 ` Thomas Huth
  17 siblings, 0 replies; 29+ messages in thread
From: no-reply @ 2020-06-04  9:37 UTC (permalink / raw)
  To: kbastian; +Cc: alex.bennee, qemu-devel

Patchew URL: https://patchew.org/QEMU/20200604085441.103087-1-kbastian@mail.uni-paderborn.de/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20200604085441.103087-1-kbastian@mail.uni-paderborn.de
Subject: [PATCH v2 00/15] tests/tcg: Add TriCore tests
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20200602084151.480567-1-imammedo@redhat.com -> patchew/20200602084151.480567-1-imammedo@redhat.com
 * [new tag]         patchew/20200604085441.103087-1-kbastian@mail.uni-paderborn.de -> patchew/20200604085441.103087-1-kbastian@mail.uni-paderborn.de
 * [new tag]         patchew/20200604085533.7769-1-chen.zhang@intel.com -> patchew/20200604085533.7769-1-chen.zhang@intel.com
 * [new tag]         patchew/20200604090830.33885-1-ppandit@redhat.com -> patchew/20200604090830.33885-1-ppandit@redhat.com
Switched to a new branch 'test'
adea249 tests/tcg/tricore: Add muls test
ed03880 tests/tcg/tricore: Add msub test
fd95aee tests/tcg/tricore: Add madd test
6cda27e tests/tcg/tricore: Add ftoi test
e0d0d05 tests/tcg/tricore: Add fmul test
f415da7 tests/tcg/tricore: Add fadd test
4e3bbcf tests/tcg/tricore: Add dvstep test
cbb2a9b tests/tcg/tricore: Add clz test
e7bf647 tests/tcg/tricore: Add bmerge test
2496174 tests/tcg/tricore: Add macros to create tests and first test 'abs'
e409c6e tests/tcg/tricore: Add build infrastructure
cfede30 hw/tricore: Add testdevice for tests in tests/tcg/
6ce5ebb tests/tcg: Run timeout cmds using --foreground
674eec5 tests/tcg: Add docker_as and docker_ld cmds
2054d8f docker/tricore: Use stretch-slim as a base image

=== OUTPUT BEGIN ===
1/15 Checking commit 2054d8f49a1e (docker/tricore: Use stretch-slim as a base image)
2/15 Checking commit 674eec5f42a0 (tests/tcg: Add docker_as and docker_ld cmds)
3/15 Checking commit 6ce5ebb80600 (tests/tcg: Run timeout cmds using --foreground)
4/15 Checking commit cfede3047604 (hw/tricore: Add testdevice for tests in tests/tcg/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#55: 
new file mode 100644

total: 0 errors, 1 warnings, 148 lines checked

Patch 4/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/15 Checking commit e409c6efd010 (tests/tcg/tricore: Add build infrastructure)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

total: 0 errors, 1 warnings, 77 lines checked

Patch 5/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/15 Checking commit 2496174da493 (tests/tcg/tricore: Add macros to create tests and first test 'abs')
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#59: 
new file mode 100644

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#65: FILE: tests/tcg/tricore/macros.h:2:
+#define LI(reg, val)           \
+    mov.u reg, lo:val;         \
+    movh DREG_TEMP_LI, up:val; \
+    or reg, reg, DREG_TEMP_LI; \
+

ERROR: spaces required around that ':' (ctx:VxV)
#66: FILE: tests/tcg/tricore/macros.h:3:
+    mov.u reg, lo:val;         \
                  ^

ERROR: spaces required around that ':' (ctx:VxV)
#67: FILE: tests/tcg/tricore/macros.h:4:
+    movh DREG_TEMP_LI, up:val; \
                          ^

ERROR: spaces required around that '%' (ctx:WxV)
#73: FILE: tests/tcg/tricore/macros.h:10:
+#define DREG_RS1 %d0
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#73: FILE: tests/tcg/tricore/macros.h:10:
+#define DREG_RS1 %d0

ERROR: spaces required around that '%' (ctx:WxV)
#74: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_CALC_RESULT %d1
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#74: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_CALC_RESULT %d1

ERROR: spaces required around that '%' (ctx:WxV)
#75: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_TEMP_LI %d10
                      ^

ERROR: Macros with complex values should be enclosed in parenthesis
#75: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_TEMP_LI %d10

ERROR: spaces required around that '%' (ctx:WxV)
#76: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_TEMP %d11
                   ^

ERROR: Macros with complex values should be enclosed in parenthesis
#76: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_TEMP %d11

ERROR: spaces required around that '%' (ctx:WxV)
#77: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_TEST_NUM %d14
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#77: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_TEST_NUM %d14

ERROR: spaces required around that '%' (ctx:WxV)
#78: FILE: tests/tcg/tricore/macros.h:15:
+#define DREG_CORRECT_RESULT %d15
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#78: FILE: tests/tcg/tricore/macros.h:15:
+#define DREG_CORRECT_RESULT %d15

ERROR: spaces required around that '%' (ctx:WxV)
#80: FILE: tests/tcg/tricore/macros.h:17:
+#define DREG_DEV_ADDR %a15
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#80: FILE: tests/tcg/tricore/macros.h:17:
+#define DREG_DEV_ADDR %a15

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#83: FILE: tests/tcg/tricore/macros.h:20:
+#define TEST_CASE(num, testreg, correct, code...) \
+test_ ## num:                                     \
+    code;                                         \
+    LI(DREG_CORRECT_RESULT, correct)              \
+    mov DREG_TEST_NUM, num;                       \
+    jne testreg, DREG_CORRECT_RESULT, fail        \
+

ERROR: spaces required around that ':' (ctx:VxE)
#84: FILE: tests/tcg/tricore/macros.h:21:
+test_ ## num:                                     \
             ^

WARNING: Block comments use a leading /* on a separate line
#90: FILE: tests/tcg/tricore/macros.h:27:
+/* Actual test case type

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#102: FILE: tests/tcg/tricore/macros.h:39:
+#define TEST_PASSFAIL                       \
+        j pass;                             \
+fail:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j fail;                             \
+pass:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        mov DREG_TEST_NUM, 0;               \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j pass;

ERROR: space prohibited before open square bracket '['
#107: FILE: tests/tcg/tricore/macros.h:44:
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\

ERROR: space prohibited before open square bracket '['
#114: FILE: tests/tcg/tricore/macros.h:51:
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\

total: 22 errors, 2 warnings, 88 lines checked

Patch 6/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/15 Checking commit e7bf647c2950 (tests/tcg/tricore: Add bmerge test)
ERROR: spaces required around that '%' (ctx:WxV)
#30: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_RS2 %d1
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#30: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_RS2 %d1

ERROR: spaces required around that '%' (ctx:WxV)
#32: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_CALC_PSW %d2
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#32: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_CALC_PSW %d2

ERROR: spaces required around that '%' (ctx:WxV)
#33: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_CORRECT_PSW %d3
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#33: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_CORRECT_PSW %d3

ERROR: spaces required around that ':' (ctx:VxE)
#42: FILE: tests/tcg/tricore/macros.h:31:
+test_ ## num:                                                      \
             ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#73: 
new file mode 100644

total: 7 errors, 1 warnings, 58 lines checked

Patch 7/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

8/15 Checking commit cbb2a9b16fb4 (tests/tcg/tricore: Add clz test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
new file mode 100644

total: 0 errors, 1 warnings, 16 lines checked

Patch 8/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/15 Checking commit 4e3bbcf905f6 (tests/tcg/tricore: Add dvstep test)
ERROR: spaces required around that '%' (ctx:WxV)
#30: FILE: tests/tcg/tricore/macros.h:22:
+#define EREG_RS1 %e6
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#30: FILE: tests/tcg/tricore/macros.h:22:
+#define EREG_RS1 %e6

ERROR: spaces required around that '%' (ctx:WxV)
#31: FILE: tests/tcg/tricore/macros.h:23:
+#define EREG_RS1_LO %d6
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#31: FILE: tests/tcg/tricore/macros.h:23:
+#define EREG_RS1_LO %d6

ERROR: spaces required around that '%' (ctx:WxV)
#32: FILE: tests/tcg/tricore/macros.h:24:
+#define EREG_RS1_HI %d7
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#32: FILE: tests/tcg/tricore/macros.h:24:
+#define EREG_RS1_HI %d7

ERROR: spaces required around that '%' (ctx:WxV)
#33: FILE: tests/tcg/tricore/macros.h:25:
+#define EREG_RS2 %e8
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#33: FILE: tests/tcg/tricore/macros.h:25:
+#define EREG_RS2 %e8

ERROR: spaces required around that '%' (ctx:WxV)
#34: FILE: tests/tcg/tricore/macros.h:26:
+#define EREG_RS2_LO %d8
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#34: FILE: tests/tcg/tricore/macros.h:26:
+#define EREG_RS2_LO %d8

ERROR: spaces required around that '%' (ctx:WxV)
#35: FILE: tests/tcg/tricore/macros.h:27:
+#define EREG_RS2_HI %d9
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#35: FILE: tests/tcg/tricore/macros.h:27:
+#define EREG_RS2_HI %d9

ERROR: spaces required around that '%' (ctx:WxV)
#36: FILE: tests/tcg/tricore/macros.h:28:
+#define EREG_CALC_RESULT %e8
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#36: FILE: tests/tcg/tricore/macros.h:28:
+#define EREG_CALC_RESULT %e8

ERROR: spaces required around that '%' (ctx:WxV)
#37: FILE: tests/tcg/tricore/macros.h:29:
+#define EREG_CALC_RESULT_HI %d9
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#37: FILE: tests/tcg/tricore/macros.h:29:
+#define EREG_CALC_RESULT_HI %d9

ERROR: spaces required around that '%' (ctx:WxV)
#38: FILE: tests/tcg/tricore/macros.h:30:
+#define EREG_CALC_RESULT_LO %d8
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#38: FILE: tests/tcg/tricore/macros.h:30:
+#define EREG_CALC_RESULT_LO %d8

ERROR: spaces required around that '%' (ctx:WxV)
#39: FILE: tests/tcg/tricore/macros.h:31:
+#define EREG_CORRECT_RESULT_LO %d0
                                ^

ERROR: Macros with complex values should be enclosed in parenthesis
#39: FILE: tests/tcg/tricore/macros.h:31:
+#define EREG_CORRECT_RESULT_LO %d0

ERROR: spaces required around that '%' (ctx:WxV)
#40: FILE: tests/tcg/tricore/macros.h:32:
+#define EREG_CORRECT_RESULT_HI %d1
                                ^

ERROR: Macros with complex values should be enclosed in parenthesis
#40: FILE: tests/tcg/tricore/macros.h:32:
+#define EREG_CORRECT_RESULT_HI %d1

ERROR: spaces required around that ':' (ctx:VxE)
#50: FILE: tests/tcg/tricore/macros.h:43:
+test_ ## num:                                              \
             ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#77: 
new file mode 100644

total: 23 errors, 1 warnings, 69 lines checked

Patch 9/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

10/15 Checking commit f415da7548bc (tests/tcg/tricore: Add fadd test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
new file mode 100644

total: 0 errors, 1 warnings, 23 lines checked

Patch 10/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/15 Checking commit e0d0d05ca98d (tests/tcg/tricore: Add fmul test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
new file mode 100644

total: 0 errors, 1 warnings, 15 lines checked

Patch 11/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/15 Checking commit 6cda27e1216b (tests/tcg/tricore: Add ftoi test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#41: 
new file mode 100644

total: 0 errors, 1 warnings, 30 lines checked

Patch 12/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/15 Checking commit fd95aee92a6e (tests/tcg/tricore: Add madd test)
ERROR: spaces required around that '%' (ctx:WxV)
#30: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_RS3 %d4
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#30: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_RS3 %d4

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#59: 
new file mode 100644

total: 2 errors, 1 warnings, 48 lines checked

Patch 13/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

14/15 Checking commit ed038809a5e2 (tests/tcg/tricore: Add msub test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
new file mode 100644

total: 0 errors, 1 warnings, 16 lines checked

Patch 14/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
15/15 Checking commit adea249349c0 (tests/tcg/tricore: Add muls test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
new file mode 100644

total: 0 errors, 1 warnings, 16 lines checked

Patch 15/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200604085441.103087-1-kbastian@mail.uni-paderborn.de/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image
  2020-06-04  8:54 ` [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image Bastian Koppelmann
@ 2020-06-04 15:41   ` Alex Bennée
  0 siblings, 0 replies; 29+ messages in thread
From: Alex Bennée @ 2020-06-04 15:41 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> we get an authentication errror when trying to pull qemu:debian9. Thus
> just start from a plain debian image.

Ahh I see a breakage in tests/docker/Makefile.include where the line
should be:

docker-image-debian-tricore-cross: docker-image-debian9

to ensure qemu:debian9 is built before this one.

>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
>  .../dockerfiles/debian-tricore-cross.docker      | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
> index 4a0f7706a3..544d7814f8 100644
> --- a/tests/docker/dockerfiles/debian-tricore-cross.docker
> +++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
> @@ -7,10 +7,22 @@
>  #
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  #
> -FROM qemu:debian9
> -
> +FROM debian:stretch-slim

Any reason not to up the base to debian10 to stay ahead of the
deprecation curve?

-- 
Alex Bennée


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

* Re: [PATCH v2 02/15] tests/tcg: Add docker_as and docker_ld cmds
  2020-06-04  8:54 ` [PATCH v2 02/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
@ 2020-06-16 16:13   ` Alex Bennée
  0 siblings, 0 replies; 29+ messages in thread
From: Alex Bennée @ 2020-06-16 16:13 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> At least for the TriCore target no easily available c compiler exists.
> Thus we need to rely on "as" and "ld". This allows us to run them
> through the docker image.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
>  tests/tcg/Makefile.qemu | 11 +++++++++++
>  tests/tcg/configure.sh  |  2 ++
>  2 files changed, 13 insertions(+)
>
> diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
> index 9c23aeaa2a..e5b3a4bacc 100644
> --- a/tests/tcg/Makefile.qemu
> +++ b/tests/tcg/Makefile.qemu
> @@ -50,11 +50,22 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
>  		-i qemu:$(DOCKER_IMAGE) \
>  		-s $(SRC_PATH) -- "
>  
> +DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
> +		--cc $(DOCKER_CROSS_AS_GUEST) \
> +		-i qemu:$(DOCKER_IMAGE) \
> +		-s $(SRC_PATH) -- "
> +
> +DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
> +		--cc $(DOCKER_CROSS_LD_GUEST) \
> +		-i qemu:$(DOCKER_IMAGE) \
> +		-s $(SRC_PATH) -- "
> +
>  .PHONY: docker-build-guest-tests
>  docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
>  	$(call quiet-command, \
>  	  (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
>  	   $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
> +			AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
>  			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
>  			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
>  	"BUILD","$(TARGET) guest-tests with docker qemu:$(DOCKER_IMAGE)")
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index 2326f97856..6e8659d488 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -242,6 +242,8 @@ for target in $target_list; do
>    if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
>      echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
>      echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
> +    echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> $config_target_mak
> +    echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> $config_target_mak
>    fi
>  done

We should keep parity with locally installed tools though. Can we emit a
CROSS_LD_GUEST/CROSS_AS_GUEST for locally installed tools?

-- 
Alex Bennée


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

* Re: [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground
  2020-06-04  8:54 ` [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
@ 2020-06-16 16:22   ` Alex Bennée
  2020-06-17  6:13     ` Bastian Koppelmann
  0 siblings, 1 reply; 29+ messages in thread
From: Alex Bennée @ 2020-06-16 16:22 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> when trying to run successful short tests from the Makefile timeout would no
> terminate. Rather it would wait until the time runs out. Excerpt from the
> manpage:

Which tests hang without this change?

>
> --foreground
>     when not running timeout directly from a shell prompt,
>     allow COMMAND to read from the TTY and get TTY signals; in this mode, chil‐
>     dren of COMMAND will not be timed out
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
>  tests/tcg/Makefile.target | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
> index b3cff3cad1..423caffa56 100644
> --- a/tests/tcg/Makefile.target
> +++ b/tests/tcg/Makefile.target
> @@ -40,9 +40,10 @@ quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
>  
>  # $1 = test name, $2 = cmd, $3 = desc
>  ifdef CONFIG_USER_ONLY
> -run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
> +run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out \
> +	"TEST",$3)

This breaks make check-tcg due to a dropped ,

>  else
> -run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3)
> +run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2,"TEST",$3)
>  endif
>  
>  # $1 = test name, $2 = reference


-- 
Alex Bennée


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

* Re: [PATCH v2 04/15] hw/tricore: Add testdevice for tests in tests/tcg/
  2020-06-04  8:54 ` [PATCH v2 04/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
@ 2020-06-16 17:07   ` Alex Bennée
  0 siblings, 0 replies; 29+ messages in thread
From: Alex Bennée @ 2020-06-16 17:07 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> this device is used to verify the correctness of regression tests by
> allowing guests to write their exit status to this device. This is then
> used by qemu to exit using the written status.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


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

* Re: [PATCH v2 05/15] tests/tcg/tricore: Add build infrastructure
  2020-06-04  8:54 ` [PATCH v2 05/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
@ 2020-06-16 17:22   ` Alex Bennée
  0 siblings, 0 replies; 29+ messages in thread
From: Alex Bennée @ 2020-06-16 17:22 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> this includes the Makefile and linker script to build all the tests.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
>  tests/tcg/tricore/Makefile.softmmu-target | 17 +++++++
>  tests/tcg/tricore/link.ld                 | 60 +++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
>  create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
>  create mode 100644 tests/tcg/tricore/link.ld
>
> diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
> new file mode 100644
> index 0000000000..4a2cd6f218
> --- /dev/null
> +++ b/tests/tcg/tricore/Makefile.softmmu-target
> @@ -0,0 +1,17 @@
> +HOST_CC = gcc

I guess you need HOST_CC to process the source file. You don't need to
define it though - it should be picked up by config-host.mak included by
the main tcg makefile.

> +
> +TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
> +
> +LDFLAGS = -T$(TESTS_PATH)/link.ld
> +ASFLAGS =
> +
> +QEMU_OPTS += -M tricore_testboard -nographic -kernel
> +
> +%.pS: $(TESTS_PATH)/%.S
> +	$(HOST_CC) -E -o $@ $<
> +
> +%.o: %.pS
> +	$(AS) $(ASFLAGS) -o $@ $<
> +
> +%.tst: %.o
> +	$(LD) $(LDFLAGS) $< -o $@
> diff --git a/tests/tcg/tricore/link.ld b/tests/tcg/tricore/link.ld
> new file mode 100644
> index 0000000000..364bcdc00a
> --- /dev/null
> +++ b/tests/tcg/tricore/link.ld
> @@ -0,0 +1,60 @@
> +/* Default linker script, for normal executables */
> +OUTPUT_FORMAT("elf32-tricore")
> +OUTPUT_ARCH(tricore)
> +ENTRY(_start)
> +
> +/* the internal ram description */
> +MEMORY
> +{
> +  text_ram (rx!p): org = 0x80000000, len = 15K
> +  data_ram (w!xp): org = 0xd0000000, len = 130K
> +}
> +/*
> + * Define the sizes of the user and system stacks.
> + */
> +__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
> +/*
> + * Define the start address and the size of the context save area.
> + */
> +__CSA_BEGIN =  0xd0000000 ;
> +__CSA_SIZE =  8k ;
> +__CSA_END = __CSA_BEGIN + __CSA_SIZE ;
> +
> +SECTIONS
> +{
> +  .text  :
> +  {
> +    *(.text)
> +    . = ALIGN(8);
> +  } > text_ram
> +
> +  .rodata :
> +  {
> +    *(.rodata)
> +    *(.rodata1)
> +  } > data_ram
> +
> +  .data :
> +  {
> +    . = ALIGN(8) ;
> +    *(.data)
> +    *(.data.*)
> +    . = ALIGN(8) ;
> +    __USTACK = . + __USTACK_SIZE -768;
> +
> +  } > data_ram
> +  /*
> +   * Allocate space for BSS sections.
> +   */
> +  .bss  :
> +  {
> +    BSS_BASE = . ;
> +    *(.bss)
> +    *(COMMON)
> +    . = ALIGN(8) ;
> +  } > data_ram
> +  /* Make sure CSA, stack and heap addresses are properly aligned.  */
> +  _. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
> +  _. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;
> +
> +}

Now would also be a good time to update the MAINTAINERS entry for
tricore to include everything in tests/tcg/tricore ;-)

Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


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

* Re: [PATCH v2 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs'
  2020-06-04  8:54 ` [PATCH v2 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
@ 2020-06-16 17:28   ` Alex Bennée
  0 siblings, 0 replies; 29+ messages in thread
From: Alex Bennée @ 2020-06-16 17:28 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> This kind of tests is inspired by the riscv-tests repository. This adds
> macros that makes it easy to create single instruction self containing
> tests.
>
> It is achieved by macros that create a test sequence for an
> instruction and check for a supplied correct value. If the value is correct the
> next instruction is tested. Otherwise we jump to fail handler that writes is
> test number as a status code back to qemu that then exits on that status code.
> If all tests pass we write back 0 as a status code and exit.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
>  tests/tcg/configure.sh                    |  7 ++-
>  tests/tcg/tricore/Makefile.softmmu-target |  2 +
>  tests/tcg/tricore/macros.h                | 53 +++++++++++++++++++++++
>  tests/tcg/tricore/test_abs.S              |  8 ++++
>  4 files changed, 69 insertions(+), 1 deletion(-)
>  create mode 100644 tests/tcg/tricore/macros.h
>  create mode 100644 tests/tcg/tricore/test_abs.S
>
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index 6e8659d488..cd857433d9 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -85,7 +85,7 @@ for target in $target_list; do
>      xtensa|xtensaeb)
>        arches=xtensa
>        ;;
> -    alpha|cris|hppa|i386|lm32|m68k|openrisc|riscv64|s390x|sh4|sparc64)
> +    alpha|cris|hppa|i386|lm32|m68k|openrisc|riscv64|s390x|sh4|sparc64|tricore)
>        arches=$target
>        ;;
>      *)
> @@ -169,6 +169,11 @@ for target in $target_list; do
>        container_image=debian-sparc64-cross
>        container_cross_cc=sparc64-linux-gnu-gcc
>        ;;
> +    tricore-softmmu)
> +        container_image=debian-tricore-cross
> +        container_cross_as=tricore-as
> +        container_cross_ld=tricore-ld
> +        ;;
>      xtensa*-softmmu)
>        container_image=debian-xtensa-cross

I'd of been tempted to include this with the build infrastructure patch
but whatever...

>  
> diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
> index 4a2cd6f218..1b1f220c7c 100644
> --- a/tests/tcg/tricore/Makefile.softmmu-target
> +++ b/tests/tcg/tricore/Makefile.softmmu-target
> @@ -7,6 +7,8 @@ ASFLAGS =
>  
>  QEMU_OPTS += -M tricore_testboard -nographic -kernel
>  
> +TESTS += test_abs.tst
> +

Also you could use wildcards so adding new tests is simpler but anyway:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


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

* Re: [PATCH v2 00/15] tests/tcg: Add TriCore tests
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (15 preceding siblings ...)
  2020-06-04  9:37 ` [PATCH v2 00/15] tests/tcg: Add TriCore tests no-reply
@ 2020-06-16 17:29 ` Alex Bennée
  2021-02-22  9:23 ` Thomas Huth
  17 siblings, 0 replies; 29+ messages in thread
From: Alex Bennée @ 2020-06-16 17:29 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> Hi Alex,
>
> I managed to update the series to successfully run make check-tcg. This required
> some changes to the makefiles. I tried running the riscv64 and arm tests and so
> far I didn't break anything.

You can have a:

Tested-by: Alex Bennée <alex.bennee@linaro.org>

for patches 6-15 although I have no idea if the results are correct ;-)

-- 
Alex Bennée


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

* Re: [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground
  2020-06-16 16:22   ` Alex Bennée
@ 2020-06-17  6:13     ` Bastian Koppelmann
  2020-06-17  9:59       ` Alex Bennée
  0 siblings, 1 reply; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-17  6:13 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel

On Tue, Jun 16, 2020 at 05:22:42PM +0100, Alex Bennée wrote:
> 
> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> 
> > when trying to run successful short tests from the Makefile timeout would no
> > terminate. Rather it would wait until the time runs out. Excerpt from the
> > manpage:
> 
> Which tests hang without this change?

The TriCore tests ;). 

> 
> >
> > --foreground
> >     when not running timeout directly from a shell prompt,
> >     allow COMMAND to read from the TTY and get TTY signals; in this mode, chil‐
> >     dren of COMMAND will not be timed out
> >
> > Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> > ---
> >  tests/tcg/Makefile.target | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
> > index b3cff3cad1..423caffa56 100644
> > --- a/tests/tcg/Makefile.target
> > +++ b/tests/tcg/Makefile.target
> > @@ -40,9 +40,10 @@ quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
> >  
> >  # $1 = test name, $2 = cmd, $3 = desc
> >  ifdef CONFIG_USER_ONLY
> > -run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
> > +run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out \
> > +	"TEST",$3)
> 
> This breaks make check-tcg due to a dropped ,

Whoops

Cheers,
Bastian


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

* Re: [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground
  2020-06-17  6:13     ` Bastian Koppelmann
@ 2020-06-17  9:59       ` Alex Bennée
  2020-06-17 10:52         ` Bastian Koppelmann
  0 siblings, 1 reply; 29+ messages in thread
From: Alex Bennée @ 2020-06-17  9:59 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> On Tue, Jun 16, 2020 at 05:22:42PM +0100, Alex Bennée wrote:
>> 
>> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
>> 
>> > when trying to run successful short tests from the Makefile timeout would no
>> > terminate. Rather it would wait until the time runs out. Excerpt from the
>> > manpage:
>> 
>> Which tests hang without this change?
>
> The TriCore tests ;).

Hmm I wonder why? All the other tests work so is this a function of
output from the test? The softmmu tests for example usually redirect
their output via a chardev device. Tests which require actual input from
the user are skipped (the semiconsole test is MANUAL only).

>
>> 
>> >
>> > --foreground
>> >     when not running timeout directly from a shell prompt,
>> >     allow COMMAND to read from the TTY and get TTY signals; in this mode, chil‐
>> >     dren of COMMAND will not be timed out
>> >
>> > Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>> > ---
>> >  tests/tcg/Makefile.target | 5 +++--
>> >  1 file changed, 3 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
>> > index b3cff3cad1..423caffa56 100644
>> > --- a/tests/tcg/Makefile.target
>> > +++ b/tests/tcg/Makefile.target
>> > @@ -40,9 +40,10 @@ quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
>> >  
>> >  # $1 = test name, $2 = cmd, $3 = desc
>> >  ifdef CONFIG_USER_ONLY
>> > -run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
>> > +run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out \
>> > +	"TEST",$3)
>> 
>> This breaks make check-tcg due to a dropped ,
>
> Whoops
>
> Cheers,
> Bastian


-- 
Alex Bennée


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

* Re: [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground
  2020-06-17  9:59       ` Alex Bennée
@ 2020-06-17 10:52         ` Bastian Koppelmann
  0 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2020-06-17 10:52 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel

Hi Alex,

On Wed, Jun 17, 2020 at 10:59:22AM +0100, Alex Bennée wrote:
> 
> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> 
> > On Tue, Jun 16, 2020 at 05:22:42PM +0100, Alex Bennée wrote:
> >> 
> >> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> >> 
> >> > when trying to run successful short tests from the Makefile timeout would no
> >> > terminate. Rather it would wait until the time runs out. Excerpt from the
> >> > manpage:
> >> 
> >> Which tests hang without this change?
> >
> > The TriCore tests ;).
> 
> Hmm I wonder why? All the other tests work so is this a function of
> output from the test? The softmmu tests for example usually redirect
> their output via a chardev device. Tests which require actual input from
> the user are skipped (the semiconsole test is MANUAL only).
  
I was wondering as well. If you run the test command without --foreground on a
shell, it works. If you run it from make, it times out. Maybe this is just on my
end. I usually run bleeding edge software on my developing machines. I have
timeout 8.32 here.

Cheers,
Bastian


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

* Re: [PATCH v2 00/15] tests/tcg: Add TriCore tests
  2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (16 preceding siblings ...)
  2020-06-16 17:29 ` Alex Bennée
@ 2021-02-22  9:23 ` Thomas Huth
  2021-02-23 10:25   ` Bastian Koppelmann
  17 siblings, 1 reply; 29+ messages in thread
From: Thomas Huth @ 2021-02-22  9:23 UTC (permalink / raw)
  To: Bastian Koppelmann, qemu-devel; +Cc: alex.bennee

On 04/06/2020 10.54, Bastian Koppelmann wrote:
> Hi Alex,
> 
> I managed to update the series to successfully run make check-tcg. This required
> some changes to the makefiles. I tried running the riscv64 and arm tests and so
> far I didn't break anything.
> 
> You can find the full tree here:
> https://github.com/bkoppelmann/qemu/tree/tricore-tcg-tests
> 
> Cheers,
> Bastian
> 
> Bastian Koppelmann (15):
>    docker/tricore: Use stretch-slim as a base image
>    tests/tcg: Add docker_as and docker_ld cmds
>    tests/tcg: Run timeout cmds using --foreground
>    hw/tricore: Add testdevice for tests in tests/tcg/
>    tests/tcg/tricore: Add build infrastructure
>    tests/tcg/tricore: Add macros to 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

  Hi Bastian,

I'm currently looking at the containers that we build in the gitlab-CI, and 
it seems that the "debian-tricore-cross" container is currently always built 
though it is never used.
So I'm wondering: Do you still plan to finish this series here and get it 
merged, or could we remove the "debian-tricore-cross" container from the 
gitlab-CI again?

  Thanks,
   Thomas



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

* Re: [PATCH v2 00/15] tests/tcg: Add TriCore tests
  2021-02-22  9:23 ` Thomas Huth
@ 2021-02-23 10:25   ` Bastian Koppelmann
  0 siblings, 0 replies; 29+ messages in thread
From: Bastian Koppelmann @ 2021-02-23 10:25 UTC (permalink / raw)
  To: Thomas Huth; +Cc: alex.bennee, qemu-devel

Hi Thomas,

On Mon, Feb 22, 2021 at 10:23:23AM +0100, Thomas Huth wrote:
> On 04/06/2020 10.54, Bastian Koppelmann wrote:
> > Hi Alex,
> > 
> > I managed to update the series to successfully run make check-tcg. This required
> > some changes to the makefiles. I tried running the riscv64 and arm tests and so
> > far I didn't break anything.
> > 
> > You can find the full tree here:
> > https://github.com/bkoppelmann/qemu/tree/tricore-tcg-tests
> > 
> > Cheers,
> > Bastian
> > 
> > Bastian Koppelmann (15):
> >    docker/tricore: Use stretch-slim as a base image
> >    tests/tcg: Add docker_as and docker_ld cmds
> >    tests/tcg: Run timeout cmds using --foreground
> >    hw/tricore: Add testdevice for tests in tests/tcg/
> >    tests/tcg/tricore: Add build infrastructure
> >    tests/tcg/tricore: Add macros to 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
> 
>  Hi Bastian,
> 
> I'm currently looking at the containers that we build in the gitlab-CI, and
> it seems that the "debian-tricore-cross" container is currently always built
> though it is never used.
> So I'm wondering: Do you still plan to finish this series here and get it
> merged, or could we remove the "debian-tricore-cross" container from the
> gitlab-CI again?

yes, I'm still working on it. However, right now I have limited time. I plan
work on it again in the beginning of March.

Cheers,
Bastian


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

end of thread, other threads:[~2021-02-23 10:27 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04  8:54 [PATCH v2 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 01/15] docker/tricore: Use stretch-slim as a base image Bastian Koppelmann
2020-06-04 15:41   ` Alex Bennée
2020-06-04  8:54 ` [PATCH v2 02/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
2020-06-16 16:13   ` Alex Bennée
2020-06-04  8:54 ` [PATCH v2 03/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
2020-06-16 16:22   ` Alex Bennée
2020-06-17  6:13     ` Bastian Koppelmann
2020-06-17  9:59       ` Alex Bennée
2020-06-17 10:52         ` Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 04/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
2020-06-16 17:07   ` Alex Bennée
2020-06-04  8:54 ` [PATCH v2 05/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
2020-06-16 17:22   ` Alex Bennée
2020-06-04  8:54 ` [PATCH v2 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
2020-06-16 17:28   ` Alex Bennée
2020-06-04  8:54 ` [PATCH v2 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
2020-06-04  8:54 ` [PATCH v2 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
2020-06-04  9:37 ` [PATCH v2 00/15] tests/tcg: Add TriCore tests no-reply
2020-06-16 17:29 ` Alex Bennée
2021-02-22  9:23 ` Thomas Huth
2021-02-23 10:25   ` Bastian Koppelmann

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.