From patchwork Fri Dec 2 15:59:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 86329 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp399089obb; Fri, 2 Dec 2016 08:07:18 -0800 (PST) X-Received: by 10.200.56.182 with SMTP id f51mr40074194qtc.208.1480694838309; Fri, 02 Dec 2016 08:07:18 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l24si3297170qta.212.2016.12.02.08.07.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 02 Dec 2016 08:07:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCqMn-00088l-2u for patch@linaro.org; Fri, 02 Dec 2016 11:07:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCqFf-000347-94 for qemu-devel@nongnu.org; Fri, 02 Dec 2016 10:59:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCqFc-00051r-5x for qemu-devel@nongnu.org; Fri, 02 Dec 2016 10:59:55 -0500 Received: from mail-wj0-x22e.google.com ([2a00:1450:400c:c01::22e]:33547) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCqFb-0004ze-W8 for qemu-devel@nongnu.org; Fri, 02 Dec 2016 10:59:52 -0500 Received: by mail-wj0-x22e.google.com with SMTP id xy5so235708588wjc.0 for ; Fri, 02 Dec 2016 07:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JH1ggUWGnyWNNv4u8F0FtC6f1kXaTez6cVwQiylPM/M=; b=icw/o+YbIktHSa8vgojDXg3X8mGUFlfQ8ogcMU8P+Q1fCq2gI7bIF6BWyArAXW7tfd fkkW16S7mXKTlCmdqHTfvPoSE7eIG0Bvyjv6wX+6HXl6R4NM6ybH4joT4SGfJsvlfxlM Inkyq+0pUUebho5h0FZCYmxfx9fzD6dvz5rLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JH1ggUWGnyWNNv4u8F0FtC6f1kXaTez6cVwQiylPM/M=; b=lsbn7302nvNwsDYtporRpLU7LeUb2/SXOeXQqthTNX310KW0W5RpEg4i2lwOclpu2d dI1FIt3hMVcCf+r0JWA9P1axxDGGGchAroukq7Lo6v0x0tEHlh0nGfrzbMZTwB3tq1kD VxGj21Vep8eA2TOrrlHOENdhW72rrGZ8vBzG94MX1IGSj2f65NFhEG4M/VzeRXRAwtpW 3oZL56hFAh9kNURzu1Gzt6jKHXbDGNw2j2OBtGnJK0V7aeQYDBoVeuPA0TbbLgYX1IKQ F4ZKaRpdiK1QOWD3l7UiPG8pjpiyK+HvhpMV16mDhl064ueVh/GSEZAmb6o1ESZsZlQD miJQ== X-Gm-Message-State: AKaTC023Ww9xcHiRMz/xuCSnlU9eiY5cgujBcARb/090iV4FEbe2oViFiJXEko2pq9y4TZ0f X-Received: by 10.194.100.225 with SMTP id fb1mr40004325wjb.128.1480694388684; Fri, 02 Dec 2016 07:59:48 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w18sm3884035wme.9.2016.12.02.07.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2016 07:59:47 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 945AD3E0552; Fri, 2 Dec 2016 15:59:40 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 2 Dec 2016 15:59:33 +0000 Message-Id: <20161202155935.3130-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161202155935.3130-1-alex.bennee@linaro.org> References: <20161202155935.3130-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c01::22e Subject: [Qemu-devel] [RISU PATCH 7/9] new: generate_all.sh script X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , joserz@linux.vnet.ibm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" A simple script to cut up a full .risu file and generate binaries for the whole set. Call with risu file and instruction count and directory: ./generate_all.sh aarch64.risu 4 20000 testcases.aarch64 Signed-off-by: Alex Bennée --- generate_all.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 generate_all.sh -- 2.10.2 diff --git a/generate_all.sh b/generate_all.sh new file mode 100755 index 0000000..4c490be --- /dev/null +++ b/generate_all.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Generate All Patterns +# +# Work through a given .risu file and generate full coverage +# + +BASE_SHELL_PARAMS="./risugen" + +risufile=$1 +divisor=$2 +insns=$3 +dir=$4 + +if test -z "$risufile"; then + echo "Need to specify a risu defintiion file" + exit 1 +fi + +if test -z "$divisor"; then + divisor=4 +fi + +if test -n "$insns"; then + BASE_SHELL_PARAMS="${BASE_SHELL_PARAMS} --numinsns $insns" +fi + +if test -n "dir"; then + mkdir -p $dir +else + dir="./" +fi + +ALL_INSNS=$(cat $risufile | ag "^\w" | cut -f 1 -d " " | sort) +COUNT=$(cat $risufile | ag "^\w" | cut -f 1 -d " " | wc -l) +set -- $ALL_INSNS + +GROUP=$((COUNT / $divisor)) + +while test $# -gt 0 ; do + INSN_PATTERNS="" + I_FILE="$dir/insn_" + for i in `seq 1 $divisor`; do + I=$1 + if test -n "${I}"; then + shift + INSN_PATTERNS="${INSN_PATTERNS} --pattern ${I}" + I_FILE="${I_FILE}${I}_" + fi + done + I_FILE="${I_FILE}_INC.risu.bin" + CMD="$BASE_SHELL_PARAMS ${INSN_PATTERNS} $risufile ${I_FILE}" + echo "Running: $CMD" + $CMD +done