From e7f093ccdfa452806172e12af3167bc84f571026 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 31 Jan 2017 06:07:14 +0100 Subject: Add ghdlsynth in ghdl_simul --- Makefile.in | 17 +++++++++++++++-- ghdl.gpr.in | 4 +++- src/ghdldrv/ghdl_simul.adb | 3 +++ src/ghdldrv/ghdlsimul.adb | 6 +++++- src/ghdldrv/ghdlsimul.ads | 5 +++++ 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4674d1625..ac61815cf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -267,10 +267,10 @@ install.llvm: install.llvm.program install.vhdllib install.grt install.vpi ################ For simul (no code generation, interpretation) ########## -GHDL_SIMUL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/vhdl/simulate -aI$(srcdir)/src/grt +GHDL_SIMUL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/vhdl/simulate -aI$(srcdir)/src/synth -aI$(srcdir)/src/grt ghdl_simul$(EXEEXT): $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) version.ads force - $(GNATMAKE) $(GHDL_SIMUL_INCFLAGS) $(GNATFLAGS) ghdl_simul $(GNAT_BARGS) -largs $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) + $(GNATMAKE) $(GHDL_SIMUL_INCFLAGS) $(GNATFLAGS) -gnat12 ghdl_simul $(GNAT_BARGS) -largs $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) libs.vhdl.simul: ghdl_simul$(EXEEXT) $(MAKE) GHDL=$(PWD)/ghdl_simul$(EXEEXT) vhdl.libs.all @@ -287,6 +287,19 @@ libmhdlsimvhdl.a: $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) version.ads force $(RM) -f $@ ar rc $@ b~mhdlsim.o `cat mhdlsim.files` $(GRT_ADD_OBJS) +################ ghdlsynth library ###################################### + +GHDL_SYNTHLIB_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/synth -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/vhdl/simulate -aI$(srcdir)/src/grt + +libghdlsynth.a: $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) version.ads force + $(GNATMAKE) -c libghdlsynth $(GNATFLAGS) -gnat12 $(GHDL_SYNTHLIB_INCFLAGS) + gnatbind -Llibghdlsynth_ libghdlsynth.ali -O > ghdlsynth.files +# Extract link options, be sure to link statically with libgnat + gnatbind -Llibghdlsynth_ libghdlsynth.ali -K -Z | sed -e '\@adalib/$$@s/-L//' -e '\@adalib/@s@adalib/@adalib/libgnat.a@' -e '/-lgnat/d' > ghdlsynth.link + $(GNATMAKE) -c b~libghdlsynth.adb + $(RM) -f $@ + ar rc $@ b~libghdlsynth.o `cat ghdlsynth.files` $(GRT_ADD_OBJS) + ################ ghwdump ################################################# GHWDUMP_OBJS=ghwdump.o ghwlib.o diff --git a/ghdl.gpr.in b/ghdl.gpr.in index 8b6228996..3f2ae0cb6 100644 --- a/ghdl.gpr.in +++ b/ghdl.gpr.in @@ -6,7 +6,9 @@ project Ghdl is srcdir & "/src", srcdir & "/src/vhdl", srcdir & "/src/vhdl/translate", + srcdir & "/src/vhdl/simulate", srcdir & "/src/psl", + srcdir & "/src/synth", srcdir & "/src/ghdldrv", srcdir & "/src/grt", srcdir & "/src/grt/config", @@ -25,7 +27,7 @@ project Ghdl is package Compiler is for Default_Switches ("Ada") use - ("-gnaty3befhkmr", "-gnata", "-gnatwae", "-gnatf", "-gnat05", "-g"); + ("-gnaty3befhkmr", "-gnata", "-gnatwae", "-gnatf", "-gnat12", "-g"); for Default_Switches ("C") use ("-DWITH_GNAT_RUN_TIME"); end Compiler; diff --git a/src/ghdldrv/ghdl_simul.adb b/src/ghdldrv/ghdl_simul.adb index d4d0abd7a..57d5758fd 100644 --- a/src/ghdldrv/ghdl_simul.adb +++ b/src/ghdldrv/ghdl_simul.adb @@ -20,12 +20,15 @@ with Ghdllocal; with Ghdlprint; with Ghdlsimul; +with Ghdlsynth; + procedure Ghdl_Simul is begin -- Manual elaboration so that the order is known (because it is the order -- used to display help). Ghdlmain.Version_String := new String'("interpretation"); Ghdlsimul.Register_Commands; + Ghdlsynth.Register_Commands; Ghdllocal.Register_Commands; Ghdlprint.Register_Commands; Ghdlmain.Register_Commands; diff --git a/src/ghdldrv/ghdlsimul.adb b/src/ghdldrv/ghdlsimul.adb index 2f2e13ce5..31f084d62 100644 --- a/src/ghdldrv/ghdlsimul.adb +++ b/src/ghdldrv/ghdlsimul.adb @@ -23,7 +23,6 @@ with Ghdllocal; use Ghdllocal; with GNAT.OS_Lib; use GNAT.OS_Lib; with Types; -with Iirs; use Iirs; with Flags; with Name_Table; with Errorout; use Errorout; @@ -205,6 +204,11 @@ package body Ghdlsimul is Put_Line (" --debug Run with debugger"); end Disp_Long_Help; + function Get_Top_Config return Iir is + begin + return Top_Conf; + end Get_Top_Config; + procedure Set_Hooks is begin Ghdlcomp.Hooks := (Compile_Init'Access, diff --git a/src/ghdldrv/ghdlsimul.ads b/src/ghdldrv/ghdlsimul.ads index 4345d1349..3423b1152 100644 --- a/src/ghdldrv/ghdlsimul.ads +++ b/src/ghdldrv/ghdlsimul.ads @@ -15,9 +15,14 @@ -- along with GCC; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. + +with Iirs; use Iirs; + package Ghdlsimul is procedure Register_Commands; -- Functional interface. procedure Compile_Init; + + function Get_Top_Config return Iir; end Ghdlsimul; -- cgit v1.2.3