From patchwork Fri Dec 9 11:48:28 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: 87454 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp267125qgi; Fri, 9 Dec 2016 04:03:09 -0800 (PST) X-Received: by 10.200.38.168 with SMTP id 37mr69481322qto.160.1481284989173; Fri, 09 Dec 2016 04:03:09 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id w62si19881165qkc.150.2016.12.09.04.03.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 09 Dec 2016 04:03:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; 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 208.118.235.17 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]:46087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFJt1-0000w5-Kj for patch@linaro.org; Fri, 09 Dec 2016 07:02:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFJgS-0007Mu-Bh for qemu-devel@nongnu.org; Fri, 09 Dec 2016 06:49:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFJgM-0007pZ-SM for qemu-devel@nongnu.org; Fri, 09 Dec 2016 06:49:48 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFJgM-0007p4-Lo for qemu-devel@nongnu.org; Fri, 09 Dec 2016 06:49:42 -0500 Received: by mail-wm0-f50.google.com with SMTP id f82so23297455wmf.1 for ; Fri, 09 Dec 2016 03:49:42 -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=uevUa67S1oMy61n3+8AV2mB+1N15tGSx15E1cxaHl70=; b=CKaIuZ/NFzBkFaNF7TVPWAi4xwu4SknfJHHXnEdYHPy3L2XO5RaskaV4RhrzGKQG79 ZAOhSvthxMSHAEo9UjEoYP3pDvV8Yg5y+zZ8zDWRP3+Urz9ZWCSa94waCeuxbFUAy0gU /hHr+8xegE+py5s3utQ5VsKHpvBq4F88dpwdc= 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=uevUa67S1oMy61n3+8AV2mB+1N15tGSx15E1cxaHl70=; b=l9l+tvAXBJPPmbqwVyMoO89PoT5HPJenmAxS4GfC3qv4OnZJM+ZfNk/Y9fcWOCtkhO D/5SU4bg3MGLCgOBmdMQb8W4YXAu2bcOYTwFnyPl6VXvGoSnz70owdpVTrwbFVHRzah3 xY4YGp0kA3Xn4q8gOxN5/YYjmNRuBrnkh1WphTwQ91HmT4rlfOVhF3aRMHPfia2CH65K qblq0sn+XbI3YNnRa1zBApfC9vZYeQDNR/b5tdUgsO+XMmj90L4aUoyDfTxJ9ow3q/ig bPVbiNEqYHwEzvM7gltkz4w9oLYfKUUIGE9fHa8WlAPo/fQKfNL7sGivJjm8XlZEDZKZ 5Nqw== X-Gm-Message-State: AKaTC01+cwqxxGGSJ+W6nvn1giI5nihtR9EI7cwsoyWVW4f4SvyaNkosf09dBBS+j0EIyLAA X-Received: by 10.28.232.16 with SMTP id f16mr6275483wmh.103.1481284121585; Fri, 09 Dec 2016 03:48:41 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e6sm41849438wjw.33.2016.12.09.03.48.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2016 03:48:39 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id DD85B3E0A0E; Fri, 9 Dec 2016 11:48:34 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 9 Dec 2016 11:48:28 +0000 Message-Id: <20161209114830.9158-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161209114830.9158-1-alex.bennee@linaro.org> References: <20161209114830.9158-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] [fuzzy] X-Received-From: 74.125.82.50 Subject: [Qemu-devel] [RISU PATCH v3 08/10] 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.11.0 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