[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb-patches
Subject:    [PATCH 5/8] sim: mips: hoist "single" igen rules up to common builds
From:       Mike Frysinger via Gdb-patches <gdb-patches () sourceware ! org>
Date:       2022-12-25 19:28:49
Message-ID: 20221225192852.1940-5-vapier () gentoo ! org
[Download RAW message or body]

---
 sim/Makefile.in       | 108 ++++++++++++++++++++++++++++++------------
 sim/configure         |  18 ++++++-
 sim/mips/Makefile.in  |  49 +------------------
 sim/mips/acinclude.m4 |   1 +
 sim/mips/local.mk     |  50 +++++++++++++++++++
 5 files changed, 147 insertions(+), 79 deletions(-)

diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index d9b489858c54..247208fea5cc 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -86,56 +86,10 @@ IGEN_INCLUDE=\
 	$(srcdir)/mips3264r2.igen \
 	$(srcdir)/mips3264r6.igen \
 
-SIM_SINGLE_ALL = tmp-single
+SIM_SINGLE_ALL =
 SIM_M16_ALL = tmp-m16
 SIM_MULTI_ALL = tmp-multi
 
-BUILT_SRC_FROM_SINGLE = \
-	icache.h \
-	icache.c \
-	idecode.h \
-	idecode.c \
-	semantics.h \
-	semantics.c \
-	model.h \
-	model.c \
-	support.h \
-	support.c \
-	engine.h \
-	engine.c \
-	irun.c \
-
-$(BUILT_SRC_FROM_SINGLE): tmp-single
-
-tmp-single: $(IGEN_INSN) $(IGEN_DC) $(IGEN) $(IGEN_INCLUDE)
-	$(ECHO_IGEN) $(IGEN_RUN) \
-		$(IGEN_TRACE) \
-		-I $(srcdir) \
-		-Werror \
-		-Wnodiscard \
-		$(SIM_MIPS_SINGLE_FLAGS) \
-		-G gen-direct-access \
-		-G gen-zero-r0 \
-		-B 32 \
-		-H 31 \
-		-i $(IGEN_INSN) \
-		-o $(IGEN_DC) \
-		-x \
-		-n icache.h    -hc icache.h \
-		-n icache.c    -c  icache.c \
-		-n semantics.h -hs semantics.h \
-		-n semantics.c -s  semantics.c \
-		-n idecode.h   -hd idecode.h \
-		-n idecode.c   -d  idecode.c \
-		-n model.h     -hm model.h \
-		-n model.c     -m  model.c \
-		-n support.h   -hf support.h \
-		-n support.c   -f  support.c \
-		-n engine.h    -he engine.h \
-		-n engine.c    -e  engine.c \
-		-n irun.c      -r  irun.c
-	$(SILENCE) touch $@
-
 BUILT_SRC_FROM_M16 = \
 	m16_icache.h \
 	m16_icache.c \
@@ -303,7 +257,6 @@ tmp-run-multi: $(srcdir)/m16run.c $(srcdir)/micromipsrun.c
 	$(SILENCE) touch $@
 
 clean-extra:
-	rm -f $(BUILT_SRC_FROM_SINGLE)
 	rm -f $(BUILT_SRC_FROM_M16)
 	rm -f $(BUILT_SRC_FROM_MULTI)
 	rm -f tmp-*
diff --git a/sim/mips/acinclude.m4 b/sim/mips/acinclude.m4
index 111dd87618e3..313e40b150bc 100644
--- a/sim/mips/acinclude.m4
+++ b/sim/mips/acinclude.m4
@@ -333,3 +333,4 @@ AC_SUBST(SIM_MIPS_IGEN_ITABLE_FLAGS)
 AC_SUBST(SIM_MIPS_MULTI_IGEN_CONFIGS)
 AC_SUBST(SIM_MIPS_MULTI_SRC)
 AC_SUBST(SIM_MIPS_MULTI_OBJ)
+AM_CONDITIONAL([SIM_MIPS_GEN_MODE_SINGLE], [test "$SIM_MIPS_GEN" = "SINGLE"])
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index beed8f28a169..0a6f1da1a462 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -30,14 +30,34 @@ AM_MAKEFLAGS += \
%C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"  \
%C%_BUILT_SRC_FROM_IGEN_ITABLE = \  %D%/itable.h \
 	%D%/itable.c
+%C%_BUILT_SRC_FROM_GEN_MODE_SINGLE = \
+	%D%/icache.h \
+	%D%/icache.c \
+	%D%/idecode.h \
+	%D%/idecode.c \
+	%D%/semantics.h \
+	%D%/semantics.c \
+	%D%/model.h \
+	%D%/model.c \
+	%D%/support.h \
+	%D%/support.c \
+	%D%/engine.h \
+	%D%/engine.c \
+	%D%/irun.c
 %C%_BUILD_OUTPUTS = \
 	$(%C%_BUILT_SRC_FROM_IGEN_ITABLE) \
 	%D%/stamp-igen-itable
+if SIM_MIPS_GEN_MODE_SINGLE
+%C%_BUILD_OUTPUTS += \
+	$(%C%_BUILT_SRC_FROM_GEN_MODE_SINGLE) \
+	%D%/stamp-gen-mode-single
+endif
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN_ITABLE): %D%/stamp-igen-itable
+$(%C%_BUILT_SRC_FROM_GEN_MODE_SINGLE): %D%/stamp-gen-mode-single
 
 %C%_IGEN_TRACE = # -G omit-line-numbers # -G trace-rule-selection -G \
trace-rule-rejection -G trace-entries # -G trace-all  %C%_IGEN_INSN = \
$(srcdir)/%D%/mips.igen @@ -55,6 +75,7 @@ $(%C%_BUILT_SRC_FROM_IGEN_ITABLE): \
%D%/stamp-igen-itable  %D%/sb1.igen \
 	%D%/tx.igen \
 	%D%/vr.igen
+%C%_IGEN_DC = $(srcdir)/%D%/mips.dc
 
 ## NB:	Since these can be built by a number of generators, care
 ##	must be taken to ensure that they are only dependant on
@@ -75,6 +96,35 @@ $(%C%_BUILT_SRC_FROM_IGEN_ITABLE): %D%/stamp-igen-itable
 		-n itable.c    -t  %D%/itable.c
 	$(AM_V_at)touch $@
 
+%D%/stamp-gen-mode-single: $(%C%_IGEN_INSN) $(%C%_IGEN_INSN_INC) $(%C%_IGEN_DC) \
$(IGEN) +	$(AM_V_GEN)$(IGEN_RUN) \
+		$(%C%_IGEN_TRACE) \
+		-I $(srcdir)/%D% \
+		-Werror \
+		-Wnodiscard \
+		$(SIM_MIPS_SINGLE_FLAGS) \
+		-G gen-direct-access \
+		-G gen-zero-r0 \
+		-B 32 \
+		-H 31 \
+		-i $(%C%_IGEN_INSN) \
+		-o $(%C%_IGEN_DC) \
+		-x \
+		-n icache.h    -hc %D%/icache.h \
+		-n icache.c    -c  %D%/icache.c \
+		-n semantics.h -hs %D%/semantics.h \
+		-n semantics.c -s  %D%/semantics.c \
+		-n idecode.h   -hd %D%/idecode.h \
+		-n idecode.c   -d  %D%/idecode.c \
+		-n model.h     -hm %D%/model.h \
+		-n model.c     -m  %D%/model.c \
+		-n support.h   -hf %D%/support.h \
+		-n support.c   -f  %D%/support.c \
+		-n engine.h    -he %D%/engine.h \
+		-n engine.c    -e  %D%/engine.c \
+		-n irun.c      -r  %D%/irun.c
+	$(AM_V_at)touch $@
+
 MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
 ## These are created by mips/acinclude.m4 during configure time.
 DISTCLEANFILES += %D%/multi-include.h %D%/multi-run.c
-- 
2.39.0


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic