From 4eb9358714cc5553c886021931752ec2b95055f4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 20 May 2022 10:13:50 +0000 Subject: Add a test benchmark for explore-kconfig --- examples/kconfig-static/Kconfig | 22 ++++++++++++++++++++++ examples/kconfig-static/Makefile | 19 +++++++++++++++++++ examples/kconfig-static/nfpkeys.json | 1 + examples/kconfig-static/nfpvalues.sh | 22 ++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 examples/kconfig-static/Kconfig create mode 100644 examples/kconfig-static/Makefile create mode 100644 examples/kconfig-static/nfpkeys.json create mode 100755 examples/kconfig-static/nfpvalues.sh (limited to 'examples') diff --git a/examples/kconfig-static/Kconfig b/examples/kconfig-static/Kconfig new file mode 100644 index 0000000..1b02bac --- /dev/null +++ b/examples/kconfig-static/Kconfig @@ -0,0 +1,22 @@ +choice +prompt "pi or tau?" + +config X5 +bool "X = 5" + +config X6 +bool "X = 6" +depends on !Y0 + +endchoice + +choice +prompt "apples or oranges?" + +config Y4 +bool "Y = 4" + +config Y0 +bool "Y = 0" + +endchoice diff --git a/examples/kconfig-static/Makefile b/examples/kconfig-static/Makefile new file mode 100644 index 0000000..9e56c12 --- /dev/null +++ b/examples/kconfig-static/Makefile @@ -0,0 +1,19 @@ +default: + @true + +config: + kconfig-qconf Kconfig + +randconfig: + kconfig-conf --randconfig Kconfig + +clean: + @true + +nfpvalues: + @./nfpvalues.sh + +nfpkeys: + @cat nfpkeys.json + +.PHONY: default config randconfig clean nfpvalues nfpkeys diff --git a/examples/kconfig-static/nfpkeys.json b/examples/kconfig-static/nfpkeys.json new file mode 100644 index 0000000..82a3e7f --- /dev/null +++ b/examples/kconfig-static/nfpkeys.json @@ -0,0 +1 @@ +{"Synthetic": {"X": {"unit": "apples", "description": "NFP X", "minimize": true}, "Y": {"unit": "oranges", "description": "NFP Y", "minimize": true}}} diff --git a/examples/kconfig-static/nfpvalues.sh b/examples/kconfig-static/nfpvalues.sh new file mode 100755 index 0000000..574aa47 --- /dev/null +++ b/examples/kconfig-static/nfpvalues.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +. ./.config + +X=0 +Y=0 + +if [ "$CONFIG_X5" = y ]; then + X=5 +fi +if [ "$CONFIG_X6" = y ]; then + X=6 +fi + +if [ "$CONFIG_Y0" = y ]; then + Y=0 +fi +if [ "$CONFIG_Y4" = y ]; then + Y=4 +fi + +echo '{"Synthetic": {"X": '$X', "Y": '$Y'}}' -- cgit v1.2.3