diff --git a/init/xentium_demo.c b/init/xentium_demo.c index fec43a8778470736ac3332251f091341ad142e46..96364a49cb10cacb0ac934a6cb7b14f1407cbcaa 100644 --- a/init/xentium_demo.c +++ b/init/xentium_demo.c @@ -1,6 +1,6 @@ /** * @file init/xentium_demo.c - * + * * @ingroup xen_demo * @defgroup xen_demo Xentium Demonstrator * @@ -20,6 +20,38 @@ #include <xentium_demo.h> +/** we use this to detect when we're done with the demo */ +static int xen_active_tasks; + + +/** + * @brief increment active task counter + */ + +static void xen_tasks_inc(void) +{ + xen_active_tasks++; +} + +/** + * @brief decrement active task counter if > 0 + */ +static void xen_tasks_dec(void) +{ + if (xen_active_tasks) + xen_active_tasks--; +} + +/** + * @brief get active task count + * + * @returns number of active tasks; + */ +static int xen_tasks_get(void) +{ + return xen_active_tasks; +} + /** * @brief the output function of the xentium processing network @@ -55,6 +87,9 @@ static int xen_op_output(unsigned long op_code, struct proc_task *t) pt_destroy(t); + /* decrement task counter */ + xen_tasks_dec(); + return PN_TASK_SUCCESS; } @@ -82,6 +117,8 @@ static void xen_new_input_task(size_t n) struct stack_op_info *stack_nfo; struct ramp_op_info *ramp_nfo; + /* increment task counter */ + xen_tasks_inc(); /* Kernels may need information on how to process an item. We allocate * these structures below @@ -149,7 +186,8 @@ static void xen_new_input_task(size_t n) /* add task top processing network */ while (xentium_input_task(t) < 0) - printk("Xenitium input busy!\n"); + printk("Xentium input busy!\n"); + } @@ -186,13 +224,15 @@ void xen_demo(void) xen_new_input_task(64); - /* Process the network outputs in an infinite loop. Since we have + /* Process the network outputs until all tasks are done. Since we have * 12 inputs, a stacking of 4 and a ramp length of 32, we will * get 1 data point output for inputs of 32 items and 2 for inputs * of 64 items, i.e. 5 in total. */ - while (1) + while (xen_tasks_get()) xentium_output_tasks(); + + printk("Xentium demo SUCCESSFUL\n"); } diff --git a/tools/testing/hwtests/xen_proc_net/.run_test.sh.swp b/tools/testing/hwtests/xen_proc_net/.run_test.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..6336c7ea0b8a8162f80d0c701f1df316ccbfb101 Binary files /dev/null and b/tools/testing/hwtests/xen_proc_net/.run_test.sh.swp differ diff --git a/tools/testing/hwtests/xen_proc_net/README b/tools/testing/hwtests/xen_proc_net/README new file mode 100644 index 0000000000000000000000000000000000000000..4bbc3f8d2e0be85bfddbb63711404ff9e4fd9a7c --- /dev/null +++ b/tools/testing/hwtests/xen_proc_net/README @@ -0,0 +1,35 @@ + +Description: +============ + +This test configures and executes the Xentium Processing Network Demonstrator +and evaluates success or failure. +The supplied shell script can be used in conjunction with git bisect run <...> + +Pass/Fail Criterea: +=================== + +The demonstrator will print a line containing SUCCESS if the test passes +successfully, all other conditions are considered a failure. + +The shell script will also fail the test if its execution lasts for more +than 120 seconds. This is done to detect situations where the grmon or +the hardware platform becomes stuck. In such a situation, the exit code +returned will be 125, as to indicate to git bisect, that the current +configuration can not be tested. + + +Prerequisites: +============== + + * MPPB v2.x + * DEBUG UART connected to /dev/ttyS0 + * grmon v1.1.x + + +Notes: +====== + +The current .config of LeanOS will be overwritten and the image will +be rebuilt. + diff --git a/tools/testing/hwtests/xen_proc_net/config b/tools/testing/hwtests/xen_proc_net/config new file mode 100644 index 0000000000000000000000000000000000000000..bc04635b3978699943fc7f08afc06b0fcb3f497f --- /dev/null +++ b/tools/testing/hwtests/xen_proc_net/config @@ -0,0 +1,78 @@ +# +# Automatically generated file; DO NOT EDIT. +# LeanOS Configuration +# + +# +# SPARC Configuration +# +CONFIG_LEON2=y +# CONFIG_LEON3 is not set +# CONFIG_MMU is not set +CONFIG_EXTRA_SPARC_PHYS_BANKS=1 + +# +# Memory Management Settings +# +CONFIG_SPARC_MM_BLOCK_ORDER_MAX=29 +CONFIG_SPARC_MM_BLOCK_ORDER_MIN=12 +CONFIG_SPARC_INIT_PAGE_MAP_MAX_ENTRIES=8 +CONFIG_SPARC_BOOTMEM_RESERVE_CHUNK_ORDER=20 +CONFIG_SPARC_BOOTMEM_REQUEST_NEW_ON_DEMAND=y + +# +# General Setup +# +CONFIG_KALLSYMS=y +CONFIG_CROSS_PLATFORM_TARGET=y +CONFIG_CROSS_COMPILE="sparc-elf-" +CONFIG_TARGET_COMPILER_BOOT_CODE=y +CONFIG_MODULES=y +CONFIG_EMBED_MODULES_IMAGE=y +CONFIG_BUILD_XEN_KERNELS=y +CONFIG_XENTIUM_PROC_DEMO=y + +# +# Compile-time checks and compiler options +# +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +# CONFIG_CC_OPTIMIZE_NONE is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_KERNEL_PRINTK=y +CONFIG_KERNEL_LEVEL=6 +CONFIG_SOC=y +CONFIG_MPPB=y + +# +# System-on-Chip drivers +# +CONFIG_NOC_DMA=y +CONFIG_NOC_DMA_TRANSFER_QUEUE_SIZE=32 +CONFIG_NOC_DMA_SAME_MASTER_TRANSFER_WORKAROUND=y +CONFIG_XENTIUM=y + +# +# Core Components +# +# CONFIG_SYSCTL is not set +CONFIG_MM=y + +# +# Memory Management Debug Options +# +# CONFIG_MM_DEBUG_DUMP is not set +CONFIG_PAGE_MAP=y + +# +# Page Map Options +# +# CONFIG_PAGE_MAP_CHECK_PAGE_ALIGNMENT is not set +CONFIG_PAGE_MAP_MOVE_NODE_AVAIL_THRESH=1 +CONFIG_CHUNK=y +CONFIG_AR=y +CONFIG_SAMPLES=y +# CONFIG_SAMPLE_MM is not set +# CONFIG_SAMPLE_CHUNK is not set +CONFIG_SAMPLE_PROC_CHAIN=y +CONFIG_SAMPLE_NOC_DMA=y diff --git a/tools/testing/hwtests/xen_proc_net/run_test.sh b/tools/testing/hwtests/xen_proc_net/run_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..dd8b4e428f0a14ff2c61f7a78a6a28b8ef5a17c6 --- /dev/null +++ b/tools/testing/hwtests/xen_proc_net/run_test.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# grmon must be in path! + +srcdir=../../../../ + +cp config ${srcdir}/.config || exit 1 + +cd ${srcdir} || exit 1 + +make clean || exit 1 + +make || exit 1 + + +timeout 120 bash -c \ + "printf \"load leanos\nrun\nquit\" |\ + grmon -leon2 -u -uart /dev/ttyS0 |\ + tee /dev/tty |\ + grep SUCCESS &> /dev/null" +ret=$? + +# if we timed out, adjust exit code for git bisect +if [ $ret -eq 124 ]; then + exit 125 +fi + +exit $ret