Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towards complete pulpv3 coverage #3

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9a4ef86
Apply tracer patch from ultrasoc
bluewww Oct 19, 2018
9a0f621
Fix ust_open when passing NULL
bluewww Oct 19, 2018
d3b759f
Overwrite with newer Spike from mempool
phsauter Jul 21, 2022
43fd971
Implement p.cnt instruction
phsauter Jul 26, 2022
e9d29d5
Implement all instruction in macrnhi subset
phsauter Jul 26, 2022
8cc9423
Split Xpulpimg instrs into subset in the makefile
phsauter Jul 26, 2022
1a417f5
Add disassembly for macrnhi set
phsauter Aug 4, 2022
44a0ef2
Implement all instructions in hwloop subset
phsauter Aug 4, 2022
3ec9a9e
Fix signedness issue in hwloop instructions
phsauter Aug 5, 2022
faf1758
Add missing disassembly for lp.counti
phsauter Aug 5, 2022
e072768
Remove ifdef guards for hwloop
phsauter Aug 5, 2022
a0b9951
Fix vector signed/zero-extend macros
phsauter Aug 8, 2022
32e642a
Implement all instructions in bitop subset
phsauter Aug 8, 2022
1d143a5
Remove debug output from p.clb (bitop instr)
phsauter Aug 8, 2022
5926008
Implement bitrev subset/instruction
phsauter Aug 8, 2022
6bb6ce7
Implement all instructions in macrnhi subset
phsauter Aug 9, 2022
99ff721
Implement all instructions in addsubrn subset
phsauter Aug 9, 2022
5d8b61a
Implement all instr in vectshufflepack subset
phsauter Aug 9, 2022
44345c4
Fix disassembly of Luimm5/luimm5 ops
phsauter Aug 15, 2022
c75a8c3
Implement remaining instr in vect subset
phsauter Sep 2, 2022
f3df505
Implement all instructions in vectcomplex subset
phsauter Sep 3, 2022
cc940b3
Fix non-gcc bitop implementations
phsauter Sep 4, 2022
cd888ed
Update Readme.md to current state of project
phsauter Sep 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Version 1.0.1-dev
-----------------
- Preliminary support for a subset of the Vector Extension, v0.7.1.
- Support S-mode vectored interrupts (i.e. `stvec[0]` is now writable).
- Added support for dynamic linking of libraries containing MMIO devices.
- Added `--priv` flag to control which privilege modes are available.
- When the commit log is enabled at configure time (`--enable-commitlog`),
it must also be enabled at runtime with the `--log-commits` option.
- Several debug-related additions and changes:
- Added `hasel` debug feature.
- Added `--dm-no-abstract-csr` command-line option.
- Added `--dm-no-halt-groups` command line option.
- Renamed `--progsize` to `--dm-progsize`.
- Renamed `--debug-sba` to `--dm-sba`.
- Renamed `--debug-auth` to `--dm-auth`.
- Renamed `--abstract-rti` to `--dm-abstract-rti`.
- Renamed `--without-hasel` to `--dm-no-hasel`.

Version 1.0.0 (2019-03-30)
--------------------------
- First versioned release.
116 changes: 70 additions & 46 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ project_name := @PACKAGE_TARNAME@
src_dir := @srcdir@
scripts_dir := $(src_dir)/scripts

HAVE_INT128 := @HAVE_INT128@
HAVE_DLOPEN := @HAVE_DLOPEN@

# If the version information is not in the configure script, then we
# assume that we are in a working directory. We use the vcs-version.sh
# script in the scripts directory to generate an appropriate version
Expand All @@ -50,17 +53,11 @@ endif

# Installation directories

prefix := @prefix@
enable_stow := @enable_stow@
prefix ?= @prefix@

ifeq ($(enable_stow),yes)
stow_pkg_dir := $(prefix)/pkgs
INSTALLDIR ?= $(DESTDIR)$(stow_pkg_dir)/$(project_name)-$(project_ver)
else
INSTALLDIR ?= $(DESTDIR)$(prefix)
endif
INSTALLDIR ?= $(DESTDIR)$(prefix)

install_hdrs_dir := $(INSTALLDIR)/include/$(project_name)
install_hdrs_dir := $(INSTALLDIR)/include
install_libs_dir := $(INSTALLDIR)/lib
install_exes_dir := $(INSTALLDIR)/bin

Expand All @@ -81,25 +78,52 @@ VPATH := $(addprefix $(src_dir)/, $(sprojs_enabled))
# C++ compiler
# - CPPFLAGS : flags for the preprocessor (eg. -I,-D)
# - CXXFLAGS : flags for C++ compiler (eg. -Wall,-g,-O3)
#
# To allow a user to specify CFLAGS or similar as part of the Make
# command, we also have mcpps-CFLAGS etc. with stuff that shouldn't be
# lost in such a case.
#
# The order of precedence (highest to lowest) is then:
#
# - Specified as part of Make command line
# - Specified as part of running configure
# - Specified here (default-CFLAGS)
#
# These all appear on the command line, from lowest precedence to
# highest.

default-CFLAGS := -DPREFIX=\"$(prefix)\" -Wall -Wno-unused -g -O2
default-CXXFLAGS := $(default-CFLAGS) -std=c++11

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

CC := @CC@
CXX := @CXX@
CFLAGS += @CFLAGS@ -DPREFIX=\"$(prefix)\"
CPPFLAGS += @CPPFLAGS@
CXXFLAGS += @CXXFLAGS@ -DPREFIX=\"$(prefix)\"
COMPILE := $(CXX) -fPIC -MMD -MP $(CPPFLAGS) $(CXXFLAGS) \
$(sprojs_include)
COMPILE_C := $(CC) -fPIC -MMD -MP $(CPPFLAGS) $(CFLAGS) \
$(sprojs_include)

# These are the flags actually used for a C++ compile or a C compile.
# The language-specific flags come after the preprocessor flags, but
# user-supplied flags always take precedence.
all-cxx-flags := \
$(mcppbs-CPPFLAGS) $(mcppbs-CXXFLAGS) $(CPPFLAGS) $(CXXFLAGS)
all-c-flags := \
$(mcppbs-CPPFLAGS) $(mcppbs-CFLAGS) $(CPPFLAGS) $(CFLAGS)

COMPILE := $(CXX) -MMD -MP $(all-cxx-flags) $(sprojs_include)
COMPILE_C := $(CC) -MMD -MP $(all-c-flags) $(sprojs_include)

# Linker
# - LDFLAGS : Flags for the linker (eg. -L)
# - LIBS : Library flags (eg. -l)

mcppbs-LDFLAGS := @LDFLAGS@
all-link-flags := $(mcppbs-LDFLAGS) $(LDFLAGS)

comma := ,
LD := $(CXX)
LDFLAGS := @LDFLAGS@
LIBS := @LIBS@
LINK := $(LD) -L. $(LDFLAGS) -Wl,-rpath,$(install_libs_dir) $(patsubst -L%,-Wl$(comma)-rpath$(comma)%,$(filter -L%,$(LDFLAGS)))
LINK := $(LD) -L. $(all-link-flags) -Wl,-rpath,$(install_libs_dir) $(patsubst -L%,-Wl$(comma)-rpath$(comma)%,$(filter -L%,$(LDFLAGS)))

# Library creation

Expand All @@ -115,9 +139,9 @@ RUNFLAGS := @RUNFLAGS@

MKINSTALLDIRS := $(scripts_dir)/mk-install-dirs.sh
INSTALL := @INSTALL@
INSTALL_HDR := $(INSTALL) -m 444
INSTALL_HDR := $(INSTALL) -m 644
INSTALL_LIB := $(INSTALL) -m 644
INSTALL_EXE := $(INSTALL) -m 555
INSTALL_EXE := $(INSTALL) -m 755
STOW := @stow@

# Tests
Expand Down Expand Up @@ -194,12 +218,12 @@ $(2)_deps := $$(patsubst %.o, %.d, $$($(2)_objs))
$(2)_deps += $$(patsubst %.o, %.d, $$($(2)_c_objs))
$(2)_deps += $$(patsubst %.h, %.h.d, $$($(2)_precompiled_hdrs))
$$($(2)_pch) : %.h.gch : %.h
$(COMPILE) -x c++-header $$< -o $$@
$(COMPILE) -x c++-header -c $$< -o $$@
# If using clang, don't depend (and thus don't build) precompiled headers
$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs) $(if $(filter-out clang,$(CC)),$$($(2)_pch))
$(COMPILE) -c $$<
$(COMPILE) $$($(2)_CFLAGS) -c $$<
$$($(2)_c_objs) : %.o : %.c $$($(2)_gen_hdrs)
$(COMPILE_C) -c $$<
$(COMPILE_C) $$($(2)_CFLAGS) -c $$<

$(2)_junk += $$($(2)_pch) $$($(2)_objs) $$($(2)_c_objs) $$($(2)_deps) \
$$($(2)_gen_hdrs)
Expand All @@ -213,13 +237,17 @@ $(2)_reverse_deps := $$(call reverse_list,$$($(2)_subproject_deps))
# Build a library for this subproject

$(2)_lib_libs := $$($(2)_reverse_deps)
$(2)_lib_libnames := $$(patsubst %, lib%.so, $$($(2)_lib_libs))
$(2)_lib_libnames := $$(patsubst %, lib%.a, $$($(2)_lib_libs))
$(2)_lib_libarg := $$(patsubst %, -l%, $$($(2)_lib_libs))
$(2)_lib_libnames_shared := $$(if $$($(2)_install_shared_lib),lib$(1).so,)

lib$(1).so : $$($(2)_objs) $$($(2)_c_objs) $$($(2)_lib_libnames)
$(LINK) -shared -o $$@ $(if $(filter Darwin,$(shell uname -s)),-install_name $(install_libs_dir)/$$@) $$^ $$($(2)_lib_libarg) $(LIBS)
lib$(1).a : $$($(2)_objs) $$($(2)_c_objs) $$($(2)_lib_libnames)
$(AR) rcs $$@ $$^
lib$(1).so : $$($(2)_objs) $$($(2)_c_objs) $$($(2)_lib_libnames_shared) $$($(2)_lib_libnames)
$(LINK) -shared -o $$@ $(if $(filter Darwin,$(shell uname -s)),-install_name $(install_libs_dir)/$$@) $$^ $$($(2)_lib_libnames) $(LIBS)

$(2)_junk += lib$(1).so
$(2)_junk += lib$(1).a
$(2)_junk += $$(if $$($(2)_install_shared_lib),lib$(1).so,)

# Build unit tests

Expand All @@ -228,14 +256,14 @@ $(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_libnames := $$(patsubst %, lib%.so, $$($(2)_test_libs))
$(2)_test_libnames := $$(patsubst %, lib%.a, $$($(2)_test_libs))
$(2)_test_libarg := $$(patsubst %, -l%, $$($(2)_test_libs))

$$($(2)_test_objs) : %.o : %.cc
$(COMPILE) -c $$<

$$($(2)_test_exes) : %-utst : %.t.o $$($(2)_test_libnames)
$(LINK) -o $$@ $$< $$($(2)_test_libarg) $(LIBS)
$(LINK) -o $$@ $$< $$($(2)_test_libnames) $(LIBS)

$(2)_deps += $$($(2)_test_deps)
$(2)_junk += \
Expand All @@ -255,14 +283,14 @@ $(2)_prog_objs := $$(patsubst %.cc, %.o, $$($(2)_prog_srcs))
$(2)_prog_deps := $$(patsubst %.o, %.d, $$($(2)_prog_objs))
$(2)_prog_exes := $$(patsubst %.cc, %, $$($(2)_prog_srcs))
$(2)_prog_libs := $(1) $$($(2)_reverse_deps)
$(2)_prog_libnames := $$(patsubst %, lib%.so, $$($(2)_prog_libs))
$(2)_prog_libnames := $$(patsubst %, lib%.a, $$($(2)_prog_libs))
$(2)_prog_libarg := $$(patsubst %, -l%, $$($(2)_prog_libs))

$$($(2)_prog_objs) : %.o : %.cc
$(COMPILE) -c $$<

$$($(2)_prog_exes) : % : %.o $$($(2)_prog_libnames)
$(LINK) -o $$@ $$< $$($(2)_prog_libarg) $(LIBS)
$(LINK) -o $$@ $$< $$($(2)_prog_libnames) $(LIBS)

$(2)_deps += $$($(2)_prog_deps)
$(2)_junk += $$($(2)_prog_objs) $$($(2)_prog_deps) $$($(2)_prog_exes)
Expand All @@ -277,7 +305,7 @@ $$($(2)_install_prog_objs) : %.o : %.cc $$($(2)_gen_hdrs)
$(COMPILE) -c $$<

$$($(2)_install_prog_exes) : % : %.o $$($(2)_prog_libnames)
$(LINK) -o $$@ $$< $$($(2)_prog_libarg) $(LIBS)
$(LINK) -o $$@ $$< $$($(2)_prog_libnames) $(LIBS)

$(2)_deps += $$($(2)_install_prog_deps)
$(2)_junk += \
Expand All @@ -286,7 +314,7 @@ $(2)_junk += \

# Subproject specific targets

all-$(1) : lib$(1).so $$($(2)_install_prog_exes)
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
Expand All @@ -298,7 +326,7 @@ clean-$(1) :

# Update running variables

libs += lib$(1).so
libs += lib$(1).a
objs += $$($(2)_objs)
srcs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_srcs))
hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_hdrs)) $$($(2)_gen_hdrs)
Expand All @@ -307,10 +335,11 @@ deps += $$($(2)_deps)

test_outs += $$($(2)_test_outs)

install_hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_hdrs)) $$($(2)_gen_hdrs)
install_libs += lib$(1).so
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 += riscv-$(1).pc
install_pcs += $$(if $$($(2)_install_lib),riscv-$(1).pc,)

endef

Expand Down Expand Up @@ -353,11 +382,12 @@ check : check-cpp check-bin
# Installation
#-------------------------------------------------------------------------

install-hdrs : $(install_hdrs) config.h
install-hdrs : $(install_hdrs)
$(MKINSTALLDIRS) $(install_hdrs_dir)
for file in $^; \
for file in $(subst $(src_dir)/,,$^); \
do \
$(INSTALL_HDR) $$file $(install_hdrs_dir); \
$(MKINSTALLDIRS) $(install_hdrs_dir)/`dirname $$file`; \
$(INSTALL_HDR) $(src_dir)/$$file $(install_hdrs_dir)/`dirname $$file`; \
done

install-libs : $(install_libs)
Expand All @@ -382,12 +412,6 @@ install-pc : $(install_pcs)
done

install : install-hdrs install-libs install-exes install-pc
ifeq ($(enable_stow),yes)
$(MKINSTALLDIRS) $(stow_pkg_dir)
cd $(stow_pkg_dir) && \
$(STOW) --delete $(project_name)-* && \
$(STOW) $(project_name)-$(project_ver)
endif

.PHONY : install install-hdrs install-libs install-exes

Expand Down
Loading