Commit 568ae7ef authored by Richard Henderson's avatar Richard Henderson
Browse files

scripts: Add decodetree.py



To be used to decode ARM SVE, but could be used for any fixed-width ISA.

Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent ff868961
Loading
Loading
Loading
Loading

scripts/decodetree.py

0 → 100755
+1062 −0

File added.

Preview size limit exceeded, changes collapsed.

+8 −1
Original line number Diff line number Diff line
@@ -932,6 +932,13 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
	@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<

.PHONY: check-decodetree
check-decodetree:
	$(call quiet-command, \
	  cd $(SRC_PATH)/tests/decode && \
          ./check.sh "$(PYTHON)" "$(SRC_PATH)/scripts/decodetree.py", \
          TEST, decodetree.py)

# Consolidated targets

.PHONY: check-qapi-schema check-qtest check-unit check check-clean
@@ -940,7 +947,7 @@ check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
check-unit: $(patsubst %,check-%, $(check-unit-y))
check-speed: $(patsubst %,check-%, $(check-speed-y))
check-block: $(patsubst %,check-%, $(check-block-y))
check: check-qapi-schema check-unit check-qtest
check: check-qapi-schema check-unit check-qtest check-decodetree
check-clean:
	$(MAKE) -C tests/tcg clean
	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)

tests/decode/check.sh

0 → 100755
+18 −0
Original line number Diff line number Diff line
#!/bin/sh
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
# See the COPYING.LIB file in the top-level directory.

PYTHON=$1
DECODETREE=$2
E=0

# All of these tests should produce errors
for i in err_*.decode; do
    if $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then
        # Pass, aka failed to fail.
        echo FAIL: $i 1>&2
        E=1
    fi
done

exit $E
+5 −0
Original line number Diff line number Diff line
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
# See the COPYING.LIB file in the top-level directory.

# Diagnose duplicate member names
&args	a a
+5 −0
Original line number Diff line number Diff line
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
# See the COPYING.LIB file in the top-level directory.

# Diagnose invalid member names
&args	a b c d0 0e
Loading