aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-07-21 06:00:08 +0200
committerTristan Gingold <tgingold@free.fr>2022-07-21 06:00:08 +0200
commitd4adf84a668874c645bb2846378ba0ede422bcd8 (patch)
treed91674445eca16d9f3ec5cff0358d19bae65758d
parent643d03ef4d0e479d8ba45b69aa1d5be5be71dbff (diff)
downloadghdl-d4adf84a668874c645bb2846378ba0ede422bcd8.tar.gz
ghdl-d4adf84a668874c645bb2846378ba0ede422bcd8.tar.bz2
ghdl-d4adf84a668874c645bb2846378ba0ede422bcd8.zip
Makefile.in: allow build of ghdl_mcode with sundials enabled
-rw-r--r--Makefile.in2
-rw-r--r--src/ghdldrv/ghdlrun.adb25
2 files changed, 26 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index bf3068736..918dcc29f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -209,7 +209,7 @@ GHDL_MCODE_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir
ghdl_mcode$(EXEEXT): GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
ghdl_mcode$(EXEEXT): $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) $(ORTHO_DEPS) \
memsegs_c.o version.ads force
- $(GNATMAKE) -o $@ -gnat12 $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) -gnatw.A ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o $(GRT_ADD_OBJS) $(LDFLAGS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB) $(GRT_EXEC_OPTS)) -shared-libgcc
+ $(GNATMAKE) -o $@ -gnat12 $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) -gnatw.A ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o $(GRT_ADD_OBJS) $(LDFLAGS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB) $(GRT_EXEC_OPTS)) $(sundials_ldflags) -shared-libgcc
memsegs_c.o: $(srcdir)/src/ortho/mcode/memsegs_c.c
$(CC) -c $(COVERAGE_FLAGS) $(CFLAGS) -o $@ $<
diff --git a/src/ghdldrv/ghdlrun.adb b/src/ghdldrv/ghdlrun.adb
index 2adc63130..bfa095307 100644
--- a/src/ghdldrv/ghdlrun.adb
+++ b/src/ghdldrv/ghdlrun.adb
@@ -61,6 +61,7 @@ with Grt.Names;
with Grt.Std_Logic_1164;
with Grt.Errors;
with Grt.Backtraces.Jit;
+with Grt.Analog_Solver;
with Ghdlcomp; use Ghdlcomp;
with Foreigns;
@@ -112,6 +113,30 @@ package body Ghdlrun is
Info : Translation.Foreign_Info_Type;
Ortho : O_Dnode);
+ subtype F64_C_Arr_Ptr is Grt.Analog_Solver.F64_C_Arr_Ptr;
+
+ procedure Residues (T : Grt.Types.Ghdl_F64;
+ Y : F64_C_Arr_Ptr;
+ Yp : F64_C_Arr_Ptr;
+ Res : F64_C_Arr_Ptr);
+ pragma Export (C, Residues, "grt__analog_solver__residues");
+
+ procedure Set_Quantities_Values (Y : F64_C_Arr_Ptr; Yp: F64_C_Arr_Ptr);
+ pragma Export (C, Set_Quantities_Values, "grt__analog_solver__set_values");
+
+ procedure Residues (T : Grt.Types.Ghdl_F64;
+ Y : F64_C_Arr_Ptr;
+ Yp : F64_C_Arr_Ptr;
+ Res : F64_C_Arr_Ptr) is
+ begin
+ raise Program_Error;
+ end Residues;
+
+ procedure Set_Quantities_Values (Y : F64_C_Arr_Ptr; Yp: F64_C_Arr_Ptr) is
+ begin
+ raise Program_Error;
+ end Set_Quantities_Values;
+
procedure Compile_Init (Analyze_Only : Boolean) is
begin
Common_Compile_Init (Analyze_Only);