Skip to content

Commit

Permalink
Merge branch 'master' into pr-icount-bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
YenHaoChen committed Jun 23, 2023
2 parents e7505b3 + 71f5a8f commit 6ce7bbf
Show file tree
Hide file tree
Showing 205 changed files with 4,833 additions and 1,299 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,37 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
# checkout full tree
fetch-depth: 0

- name: Install Dependencies
run: sudo xargs apt-get install -y < .github/workflows/apt-packages.txt

- run: |
ci-tests/build-spike
ci-tests/test-spike
for commit in $(git rev-list origin/master..HEAD); do
git checkout $commit
echo "Checking commit $commit"
ci-tests/build-spike
ci-tests/test-spike
done
test-macos:
name: Test Spike build (MacOS)
runs-on: macos-12
steps:
- uses: actions/checkout@v2
with:
# checkout full tree
fetch-depth: 0

- name: Install Dependencies
run: xargs brew install < .github/workflows/brew-packages.txt

- run: |
ci-tests/build-spike
ci-tests/test-spike
for commit in $(git rev-list origin/master..HEAD); do
git checkout $commit
echo "Checking commit $commit"
ci-tests/build-spike
ci-tests/test-spike
done
27 changes: 8 additions & 19 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ default-CXXFLAGS := $(default-CFLAGS) -std=c++17

mcppbs-CPPFLAGS := @CPPFLAGS@
mcppbs-CFLAGS := $(default-CFLAGS) @CFLAGS@
mcppbs-CXXFLAGS := $(mcppbs-CFLAGS) $(default-CXXFLAGS) @CXXFLAGS@
mcppbs-CXXFLAGS := $(default-CXXFLAGS) @CXXFLAGS@

CC := @CC@
CXX := @CXX@
Expand Down Expand Up @@ -256,7 +256,7 @@ $(2)_test_objs := $$(patsubst %.cc, %.o, $$($(2)_test_srcs))
$(2)_test_deps := $$(patsubst %.o, %.d, $$($(2)_test_objs))
$(2)_test_exes := $$(patsubst %.t.cc, %-utst, $$($(2)_test_srcs))
$(2)_test_outs := $$(patsubst %, %.out, $$($(2)_test_exes))
$(2)_test_libs := $(1) $$($(2)_reverse_deps) utst
$(2)_test_libs := $(1) $$($(2)_reverse_deps)
$(2)_test_libnames := $$(patsubst %, lib%.a, $$($(2)_test_libs))
$(2)_test_libarg := $$(patsubst %, -l%, $$($(2)_test_libs))

Expand All @@ -274,7 +274,8 @@ $(2)_junk += \
# Run unit tests

$$($(2)_test_outs) : %.out : %
$(RUN) $(RUNFLAGS) ./$$< default | tee $$@
./$$< default
touch $$@

$(2)_junk += $$($(2)_test_outs)

Expand Down Expand Up @@ -318,7 +319,7 @@ $(2)_junk += \
all-$(1) : lib$(1).a $$($(2)_install_prog_exes)

check-$(1) : $$($(2)_test_outs)
echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segementation' $$^; echo
echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segmentation' $$^; echo

clean-$(1) :
rm -rf $$($(2)_junk)
Expand All @@ -337,7 +338,7 @@ install_hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_install_hdrs))
install_libs += $$(if $$($(2)_install_lib),lib$(1).a,)
install_libs += $$(if $$($(2)_install_shared_lib),lib$(1).so,)
install_exes += $$($(2)_install_prog_exes)
install_pcs += $$(if $$($(2)_install_lib),riscv-$(1).pc,)
install_pcs += $$(if $$($(2)_install_pcs),riscv-$(1).pc,)

endef

Expand All @@ -359,20 +360,8 @@ deps : $(deps)
# Check
#-------------------------------------------------------------------------

bintest_outs = $(bintests:=.out)
junk += $(bintest_outs)
%.out: % all
./$* < /dev/null 2>&1 | tee $@

check-cpp : $(test_outs)
@echo
! grep -h -e'Unit Tests' -e'FAILED' -e'Segmentation' $^ < /dev/null
@echo

check-bin : $(bintest_outs)
! tail -n 1 $^ < /dev/null 2>&1 | grep FAILED

check : check-cpp check-bin
check : $(test_outs)
echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segementation' $^ < /dev/null; echo

.PHONY : check

Expand Down
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,9 @@ Spike supports the following RISC-V ISA features:
- Zcd extension, v1.0
- Zcmp extension, v1.0
- Zcmt extension, v1.0

As a Spike extension, the remainder of the proposed
[Bit-Manipulation Extensions](https://github.com/riscv/riscv-bitmanip)
is provided under the Spike-custom extension name _Xbitmanip_.
These instructions (and, of course, the extension name) are not RISC-V
standards.

These proposed bit-manipulation extensions can be split into further
groups: Zbp, Zbs, Zbe, Zbf, Zbc, Zbm, Zbr, Zbt. Note that Zbc is
ratified, but the original proposal contained some extra instructions
(64-bit carryless multiplies) which are captured here.

To enable these extensions individually, use the Spike-custom
extension names _XZbp_, _XZbs_, _XZbc_, and so on.
- Zfbfmin extension, v0.6
- Zvfbfmin extension, v0.6
- Zvfbfwma extension, v0.6

Versioning and APIs
-------------------
Expand Down
3 changes: 3 additions & 0 deletions ci-tests/build-spike
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

rm -rf build

mkdir build
cd build
mkdir install
CXXFLAGS="-Wnon-virtual-dtor" CFLAGS="-Werror -Wignored-qualifiers -Wunused-function -Wunused-parameter -Wunused-variable" $DIR/../configure --prefix=`pwd`/install
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
make check
make install

# check that help message prints without error
Expand Down
2 changes: 1 addition & 1 deletion ci-tests/testlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main()
hartids,
false,
4);
std::vector<std::pair<reg_t, abstract_device_t*>> plugin_devices;
std::vector<const device_factory_t*> plugin_devices;
std::vector<std::string> htif_args {"pk", "hello"};
debug_module_config_t dm_config = {
.progbufsize = 2,
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
/* Dynamic library loading is supported */
#undef HAVE_DLOPEN

/* __int128_t is supported */
#undef HAVE_INT128

/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

Expand Down
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4742,6 +4742,9 @@ ac_fn_cxx_check_type "$LINENO" "__int128_t" "ac_cv_type___int128_t" "$ac_include
if test "x$ac_cv_type___int128_t" = xyes; then :
HAVE_INT128=yes
$as_echo "#define HAVE_INT128 1" >>confdefs.h
fi
Expand Down Expand Up @@ -6362,6 +6365,8 @@ ac_config_files="$ac_config_files riscv-fesvr.pc"
ac_config_files="$ac_config_files riscv-disasm.pc"
ac_config_files="$ac_config_files riscv-riscv.pc"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
Expand Down Expand Up @@ -7065,6 +7070,7 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"riscv-fesvr.pc") CONFIG_FILES="$CONFIG_FILES riscv-fesvr.pc" ;;
"riscv-disasm.pc") CONFIG_FILES="$CONFIG_FILES riscv-disasm.pc" ;;
"riscv-riscv.pc") CONFIG_FILES="$CONFIG_FILES riscv-riscv.pc" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ AC_HEADER_STDC
# Checks for type
#-------------------------------------------------------------------------

AC_CHECK_TYPE([__int128_t], AC_SUBST([HAVE_INT128],[yes]))
AC_CHECK_TYPE([__int128_t],
[AC_SUBST([HAVE_INT128],[yes])
AC_DEFINE([HAVE_INT128], [1], [__int128_t is supported])])

#-------------------------------------------------------------------------
# Default compiler flags
Expand Down Expand Up @@ -123,4 +125,5 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([riscv-fesvr.pc])
AC_CONFIG_FILES([riscv-disasm.pc])
AC_CONFIG_FILES([riscv-riscv.pc])
AC_OUTPUT
Loading

0 comments on commit 6ce7bbf

Please sign in to comment.