Browse Source

Separate build of spike and spike-dasm

pull/550/head
Andrew Waterman 6 years ago
parent
commit
59d450e586
  1. 1
      Makefile.in
  2. 97
      configure
  3. 2
      configure.ac
  4. 0
      disasm/disasm.ac
  5. 0
      disasm/disasm.cc
  6. 5
      disasm/disasm.mk.in
  7. 0
      disasm/regnames.cc
  8. 5
      riscv/riscv.ac
  9. 1
      riscv/riscv.mk.in
  10. 2
      spike_dasm/spike-dasm.cc
  11. 0
      spike_dasm/spike_dasm.ac
  12. 9
      spike_dasm/spike_dasm.mk.in
  13. 1
      spike_dasm/spike_dasm_option_parser.cc
  14. 2
      spike_main/spike_main.mk.in

1
Makefile.in

@ -37,6 +37,7 @@ 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

97
configure

@ -626,6 +626,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
subprojects_enabled
subprojects
HAVE_DLOPEN
HAVE_INT128
INSTALL_DATA
INSTALL_SCRIPT
@ -4852,7 +4853,11 @@ ac_res=$ac_cv_search_dlopen
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h
,
HAVE_DLOPEN=yes
fi
@ -4982,6 +4987,51 @@ fi
# Add subproject to our running list
subprojects="$subprojects disasm"
# Process the subproject appropriately. If enabled add it to the
# $enabled_subprojects running shell variable, set a
# SUBPROJECT_ENABLED C define, and include the appropriate
# 'subproject.ac'.
{ $as_echo "$as_me:${as_lineno-$LINENO}: configuring default subproject : disasm" >&5
$as_echo "$as_me: configuring default subproject : disasm" >&6;}
ac_config_files="$ac_config_files disasm.mk:disasm/disasm.mk.in"
enable_disasm_sproj="yes"
subprojects_enabled="$subprojects_enabled disasm"
$as_echo "#define DISASM_ENABLED /**/" >>confdefs.h
# Determine if this is a required or an optional subproject
# Determine if there is a group with the same name
# Create variations of the subproject name suitable for use as a CPP
# enabled define, a shell enabled variable, and a shell function
# Add subproject to our running list
subprojects="$subprojects customext"
@ -5141,6 +5191,51 @@ $as_echo "#define SPIKE_MAIN_ENABLED /**/" >>confdefs.h
# Determine if this is a required or an optional subproject
# Determine if there is a group with the same name
# Create variations of the subproject name suitable for use as a CPP
# enabled define, a shell enabled variable, and a shell function
# Add subproject to our running list
subprojects="$subprojects spike_dasm"
# Process the subproject appropriately. If enabled add it to the
# $enabled_subprojects running shell variable, set a
# SUBPROJECT_ENABLED C define, and include the appropriate
# 'subproject.ac'.
{ $as_echo "$as_me:${as_lineno-$LINENO}: configuring default subproject : spike_dasm" >&5
$as_echo "$as_me: configuring default subproject : spike_dasm" >&6;}
ac_config_files="$ac_config_files spike_dasm.mk:spike_dasm/spike_dasm.mk.in"
enable_spike_dasm_sproj="yes"
subprojects_enabled="$subprojects_enabled spike_dasm"
$as_echo "#define SPIKE_DASM_ENABLED /**/" >>confdefs.h
# Output make variables
@ -5874,10 +5969,12 @@ do
case $ac_config_target in
"fesvr.mk") CONFIG_FILES="$CONFIG_FILES fesvr.mk:fesvr/fesvr.mk.in" ;;
"riscv.mk") CONFIG_FILES="$CONFIG_FILES riscv.mk:riscv/riscv.mk.in" ;;
"disasm.mk") CONFIG_FILES="$CONFIG_FILES disasm.mk:disasm/disasm.mk.in" ;;
"customext.mk") CONFIG_FILES="$CONFIG_FILES customext.mk:customext/customext.mk.in" ;;
"fdt.mk") CONFIG_FILES="$CONFIG_FILES fdt.mk:fdt/fdt.mk.in" ;;
"softfloat.mk") CONFIG_FILES="$CONFIG_FILES softfloat.mk:softfloat/softfloat.mk.in" ;;
"spike_main.mk") CONFIG_FILES="$CONFIG_FILES spike_main.mk:spike_main/spike_main.mk.in" ;;
"spike_dasm.mk") CONFIG_FILES="$CONFIG_FILES spike_dasm.mk:spike_dasm/spike_dasm.mk.in" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"riscv-spike.pc") CONFIG_FILES="$CONFIG_FILES riscv-spike.pc" ;;

2
configure.ac

@ -96,7 +96,7 @@ AX_APPEND_LINK_FLAGS([-Wl,--export-dynamic])
# The '*' suffix indicates an optional subproject. The '**' suffix
# indicates an optional subproject which is also the name of a group.
MCPPBS_SUBPROJECTS([ fesvr, riscv, customext, fdt, softfloat, spike_main ])
MCPPBS_SUBPROJECTS([ fesvr, riscv, disasm, customext, fdt, softfloat, spike_main, spike_dasm ])
#-------------------------------------------------------------------------
# MCPPBS subproject groups

0
disasm/disasm.ac

0
spike_main/disasm.cc → disasm/disasm.cc

5
disasm/disasm.mk.in

@ -0,0 +1,5 @@
disasm_CFLAGS = -fPIC
disasm_srcs = \
disasm.cc \
regnames.cc \

0
riscv/regnames.cc → disasm/regnames.cc

5
riscv/riscv.ac

@ -19,7 +19,10 @@ AC_ARG_WITH(varch,
AC_DEFINE_UNQUOTED([DEFAULT_VARCH], ["vlen:128,elen:64,slen:128"], [Default value for --varch switch]))
AC_SEARCH_LIBS([dlopen], [dl dld], AC_DEFINE([HAVE_DLOPEN], [], [Dynamic library loading is supported]))
AC_SEARCH_LIBS([dlopen], [dl dld], [
AC_DEFINE([HAVE_DLOPEN], [], [Dynamic library loading is supported]),
AC_SUBST([HAVE_DLOPEN], [yes])
])
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR([libpthread is required])])

1
riscv/riscv.mk.in

@ -51,7 +51,6 @@ riscv_srcs = \
extension.cc \
extensions.cc \
rocc.cc \
regnames.cc \
devices.cc \
rom.cc \
clint.cc \

2
spike_main/spike-dasm.cc → spike_dasm/spike-dasm.cc

@ -21,7 +21,9 @@ int main(int argc, char** argv)
std::function<extension_t*()> extension;
option_parser_t parser;
#ifdef HAVE_DLOPEN
parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);});
#endif
parser.option(0, "isa", 1, [&](const char* s){isa = s;});
parser.parse(argv);

0
spike_dasm/spike_dasm.ac

9
spike_dasm/spike_dasm.mk.in

@ -0,0 +1,9 @@
spike_dasm_subproject_deps = \
disasm \
$(if $(HAVE_DLOPEN),riscv,) \
spike_dasm_srcs = \
spike_dasm_option_parser.cc \
spike_dasm_install_prog_srcs = \
spike-dasm.cc \

1
spike_dasm/spike_dasm_option_parser.cc

@ -0,0 +1 @@
../fesvr/option_parser.cc

2
spike_main/spike_main.mk.in

@ -2,11 +2,11 @@ spike_main_subproject_deps = \
fdt \
fesvr \
softfloat \
disasm \
riscv \
spike_main_install_prog_srcs = \
spike.cc \
spike-dasm.cc \
spike-log-parser.cc \
xspike.cc \
termios-xspike.cc \

Loading…
Cancel
Save