Skip to content

Commit

Permalink
Huge update
Browse files Browse the repository at this point in the history
===========
1. Updated version to 1.4.4 in:
-------------------------------
   - Examples/*.onb
   - Setup.vdproj
   - settingsimpl.c
   - updated the new product code in Uninstall.bat

2. Updated more files with the new OSMC-PL license.
---------------------------------------------------

3. Merged branch with branches/x08joekl_dynamic_loading up to revision 3162, see below:
---------------------------------------------------------------------------------------
Revision: 3162
Author: x08joekl
Date: 16:33:27, den 8 februari 2008
Message:
** Beefed up the testcase to show more bugs where functions isn't 
   cleared from the cache.
** Fixed the bugs the testcase now tests.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/.depend
Modified : /branches/x08joekl_dynamic_loading/Compiler/Interactive.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Overloading3.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Overloading4.mo
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/OverloadingFunc.mos


Revision: 3161
Author: x08kimja
Date: 13:32:40, den 8 februari 2008
Message:
++ But the so file on *nix can be removed
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/strings.mos


Revision: 3160
Author: x08kimja
Date: 13:31:25, den 8 februari 2008
Message:
** This testcase should not remove foo.dll since windows does not allow a filehandle to be removed while the file is open.
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/strings.mos


Revision: 3159
Author: x08joekl
Date: 10:28:48, den 8 februari 2008
Message:
++ The CompiledCFunction list in the symboltable is now cleared
   when a function is either removed from Absyn tree or replaced.
   This so that the "cached" funcHandle is closed and reevaluated.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/ClassLoader.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Interactive.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Main.mo


Revision: 3151
Author: x08joekl
Date: 13:07:15, den 7 februari 2008
Message:
** Updated dependencies
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/.depend


Revision: 3150
Author: x08kimja
Date: 12:28:09, den 7 februari 2008
Message:
++ Interactive.CompiledCFunction is a public uniontype.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Interactive.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Main.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3149
Author: x08joekl
Date: 12:11:11, den 7 februari 2008
Message:
** Use Static.isFunctionInCflist new spiffy feature of returning the
   function handler. This means we don't have to load the library each 
   time.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3148
Author: x08joekl
Date: 12:09:52, den 7 februari 2008
Message:
** Changed isFunctionInCflist to also return the function handle if 
   it we're a match.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3147
Author: x08joekl
Date: 12:09:00, den 7 februari 2008
Message:
-- remove writeValuesAsArgs since it's been depricated for some time 
now.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Values.mo


Revision: 3146
Author: x08kimja
Date: 11:17:24, den 7 februari 2008
Message:
** Added functionhandler to the list for compiled c functions
++ removeCF now calls freeFunction
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Interactive.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Main.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3145
Author: x08joekl
Date: 10:50:53, den 7 februari 2008
Message:
** Add funcHandle to cflist in Static.mo
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3144
Author: x08kimja
Date: 16:47:41, den 6 februari 2008
Message:
** moved case that always compiles functions a few steps down.
** Changed the definition of cflist so that it does not cause confusion
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3143
Author: x08joekl
Date: 15:21:44, den 6 februari 2008
Message:
** Correct comment.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3142
Author: x08joekl
Date: 15:14:38, den 6 februari 2008
Message:
-- Reverted the "correct-targets" revision (r3141) and instead
   made the targets really phony.
   This because filesystem have too low resolution in filetimes.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo


Revision: 3141
Author: x08kimja
Date: 14:27:25, den 6 februari 2008
Message:
** Now writes "correct" targets in Makefile
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo


Revision: 3140
Author: x08joekl
Date: 14:17:13, den 6 februari 2008
Message:
** Split executeFunction into loadLibrary, lookupFunction,
   executeFunction, freeFunction and freeLibrary.
   This to make it possible for the next step to "save" a 
   functionpointer.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/System.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3139
Author: x08joekl
Date: 17:30:56, den 5 februari 2008
Message:
** Fixed pathString2 so that it atleast somewhat protecteds strings
   with the used delimiter in them. Ie, if you had function
   Test_Func inside Test_Package, the old code would have said:
   Test_Package_Test_Func (with _ as delimiter)
   Now is returnes:
   Test__Package_Test__Func so it's different than
   Test.Package.Test.Func ...
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/.depend
Modified : /branches/x08joekl_dynamic_loading/Compiler/ModUtil.mo


Revision: 3138
Author: x08joekl
Date: 17:27:52, den 5 februari 2008
Message:
** Replaced _replace with a new and improved version:
   ++ Handles search string being a substring of target string.
   ++ Abit more effective.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3137
Author: x08joekl
Date: 14:51:12, den 5 februari 2008
Message:
** Ported r3128 from trunk:
   SCode.mo
   .depend
   Env.mo
   Inst.mo
   SimCodegen.mo
   Interactive.mo
   Mod.mo

** Ported r3126 from trunk:
   CodeGen.mo

** Ported r3116 from trunk:
   Absyn.mo
   DFA.mo
   Patternm.mo
   Exp.mo
   Static.mo

----
Modified : /branches/x08joekl_dynamic_loading/Compiler/.depend
Modified : /branches/x08joekl_dynamic_loading/Compiler/Absyn.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Codegen.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/DFA.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Env.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Exp.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Inst.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Interactive.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Mod.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Patternm.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/SCode.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3136
Author: x08joekl
Date: 14:49:25, den 5 februari 2008
Message:
** Ported r3117 from trunk.
----
Added : /branches/x08joekl_dynamic_loading/testsuite/meta/List3.mo(Copy from path: /trunk/testsuite/meta/List3.mo, Revision, 3117
Added : /branches/x08joekl_dynamic_loading/testsuite/meta/List3.mos(Copy from path: /trunk/testsuite/meta/List3.mos, Revision, 3117
Added : /branches/x08joekl_dynamic_loading/testsuite/meta/List4.mo(Copy from path: /trunk/testsuite/meta/List4.mo, Revision, 3117
Added : /branches/x08joekl_dynamic_loading/testsuite/meta/List4.mos(Copy from path: /trunk/testsuite/meta/List4.mos, Revision, 3117
Modified : /branches/x08joekl_dynamic_loading/testsuite/meta/Makefile


Revision: 3135
Author: x08joekl
Date: 14:48:36, den 5 februari 2008
Message:
** Ported r3127 from trunk
++ Added FuncNamespace test.
++ Added OverloadingFunc test.
----
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Func.c
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Func.h
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/FuncNamespace.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/FuncNamespace.mos
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Makefile
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Matrix.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Matrix.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Overloading1.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/Overloading2.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/OverloadingFunc.mos


Revision: 3134
Author: x08joekl
Date: 14:47:12, den 5 februari 2008
Message:
** Ported r3128 from trunk.
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mofiles/Makefile


Revision: 3133
Author: x08joekl
Date: 14:46:54, den 5 februari 2008
Message:
** Ported r3128 from trunk.
----
Added : /branches/x08joekl_dynamic_loading/testsuite/mofiles/IconsRecursiveTest.mo


Revision: 3132
Author: x08joekl
Date: 12:33:32, den 5 februari 2008
Message:
** Ported r3128 from trunk.
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/solver_euler.cpp


Revision: 3131
Author: x08joekl
Date: 12:31:14, den 5 februari 2008
Message:
** Ported r3128 from trunk.
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/simulation_events.cpp


Revision: 3130
Author: x08joekl
Date: 12:27:13, den 5 februari 2008
Message:
** Ported r3125 from trunk.
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/README
Modified : /branches/x08joekl_dynamic_loading/c_runtime/simulation_init.cpp
Modified : /branches/x08joekl_dynamic_loading/c_runtime/simulation_input.cpp
Modified : /branches/x08joekl_dynamic_loading/c_runtime/simulation_runtime.cpp
Modified : /branches/x08joekl_dynamic_loading/c_runtime/solver_dasrt.cpp


Revision: 3129
Author: x08joekl
Date: 12:13:47, den 5 februari 2008
Message:
** Added some debug printouts.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3120
Author: x08joekl
Date: 16:42:03, den 4 februari 2008
Message:
** There's bugs in the compiler that this exposes, but have no clue if 
   it's known bug, supposed to fail or what - and as it's not on our 
   table at the moment, remove.
   
----
Deleted : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/MatrixSolve.mos


Revision: 3119
Author: x08joekl
Date: 16:21:49, den 4 februari 2008
Message:
** Correct test. Now it fails on compiling in both trunk and branch.
----
Deleted : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/MatrixSolve.mo
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/MatrixSolve.mos


Revision: 3118
Author: x08joekl
Date: 16:09:32, den 4 februari 2008
Message:
++ Added testcase that fails with UnknownException on trunk and invalid 
C-code on dynload branch.
----
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/MatrixSolve.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/MatrixSolve.mos


Revision: 3115
Author: x08kimja
Date: 13:46:32, den 4 februari 2008
Message:
-- Some commented code related to in/outfile
-- unused variables infile and outfile
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3114
Author: x08joekl
Date: 16:27:13, den 31 januari 2008
Message:
++ Implement more boolean_array functions as it's usable these days.
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/boolean_array.c
Modified : /branches/x08joekl_dynamic_loading/c_runtime/boolean_array.h


Revision: 3113
Author: x08joekl
Date: 16:26:37, den 31 januari 2008
Message:
** Handle conversion of empty arrays to other array types
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/read_write.c


Revision: 3112
Author: x08joekl
Date: 16:25:29, den 31 januari 2008
Message:
++ Add testcase for using arrays as input and output arguments to functions. Specially boolean arrays.
----
Added : /branches/x08joekl_dynamic_loading/testsuite/mofiles/InOutArray.mo
Modified : /branches/x08joekl_dynamic_loading/testsuite/mofiles/Makefile


Revision: 3111
Author: x08joekl
Date: 15:12:19, den 31 januari 2008
Message:
** Added a testcase utilizing that external functions now can have boolean in and out arguments.
----
Added : /branches/x08joekl_dynamic_loading/testsuite/mofiles/InOutBool.mo
Modified : /branches/x08joekl_dynamic_loading/testsuite/mofiles/Makefile


Revision: 3110
Author: x08joekl
Date: 15:09:42, den 31 januari 2008
Message:
** Match modelica_boolean:s new type with some correct rml boolean handling.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3109
Author: x08joekl
Date: 15:07:27, den 31 januari 2008
Message:
++ Made boolean_array a bit more complete with the addition of a free_data function.
** Changed modelica_boolean typedef to a signed char instead of a double.
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/boolean_array.c
Modified : /branches/x08joekl_dynamic_loading/c_runtime/boolean_array.h
Modified : /branches/x08joekl_dynamic_loading/c_runtime/memory_pool.h
Modified : /branches/x08joekl_dynamic_loading/c_runtime/read_write.c


Revision: 3108
Author: x08joekl
Date: 14:31:48, den 31 januari 2008
Message:
** executeFunction now handles boolean arguments
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mofiles/FuncDer.mo


Revision: 3107
Author: x08joekl
Date: 14:30:57, den 31 januari 2008
Message:
** As simulation executables now are created without .exe suffix on non-windows it's a bad idea to use the names of builtin shell commands (that always are checked before the path).
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/ExtObj.mo
Modified : /branches/x08joekl_dynamic_loading/testsuite/mosfiles/ExtObj.mos


Revision: 3106
Author: x08joekl
Date: 12:39:54, den 31 januari 2008
Message:
-- Removed debug code, interfears with some of the testcases.
** Fixed generating arrays. Wrapps all the lists in Values__ARRAY and
   build up the list backwards.

----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3105
Author: x08joekl
Date: 12:00:45, den 31 januari 2008
Message:
** As we no longer use printf(%e) as transport we get better precision
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mofiles/EquationCall.mo


Revision: 3104
Author: x08joekl
Date: 11:59:28, den 31 januari 2008
Message:
** As we no longer use printf(%e) as transport we get better precision
----
Modified : /branches/x08joekl_dynamic_loading/testsuite/mofiles/FunctionSimplex.mo


Revision: 3103
Author: x08joekl
Date: 11:42:40, den 31 januari 2008
Message:
** Real fix
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/printimpl.c


Revision: 3102
Author: x08joekl
Date: 11:33:43, den 31 januari 2008
Message:
** Print error buf to stderr instead of stdout so it doesn't interfer with the testcases.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/printimpl.c


Revision: 3101
Author: x08kimja
Date: 11:02:57, den 31 januari 2008
Message:
** %s -> %lu
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3100
Author: x08kimja
Date: 11:02:03, den 31 januari 2008
Message:
-- Removed appending of _ to external function names
++ prepended external function names with in
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Codegen.mo


Revision: 3099
Author: x08joekl
Date: 10:40:29, den 31 januari 2008
Message:
-- Removed no longer used functions.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/System.mo


Revision: 3098
Author: x08joekl
Date: 10:38:27, den 31 januari 2008
Message:
** Modulized executeFunction to lessen code duplication.
++ Added support for arrays in and out (real, int and bool arrays that 
is).
++ Added support for returning tuples.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3097
Author: x08joekl
Date: 10:36:24, den 31 januari 2008
Message:
++ Added support for tuples
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/read_write.c
Modified : /branches/x08joekl_dynamic_loading/c_runtime/read_write.h


Revision: 3096
Author: x08joekl
Date: 10:35:25, den 31 januari 2008
Message:
** Correct allocation in real_array and integer_array
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/integer_array.c
Modified : /branches/x08joekl_dynamic_loading/c_runtime/real_array.c


Revision: 3095
Author: x08kimja
Date: 14:57:10, den 30 januari 2008
Message:
-- Removed PRE_VARIABLES etc macros etc from generateReadCallWriteExternal
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Codegen.mo


Revision: 3094
Author: x08joekl
Date: 14:26:27, den 30 januari 2008
Message:
** Some whitespace fixes just to make diffs to trunk nicer
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3093
Author: x08joekl
Date: 16:48:42, den 29 januari 2008
Message:
** System.executeFunction now uses the new and improved read_write to talk with dynamicly loaded functions.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3092
Author: x08joekl
Date: 16:48:06, den 29 januari 2008
Message:
** System.executeFunction now uses the new and improved read_write to talk with dynamicly loaded functions.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/System.mo


Revision: 3091
Author: x08joekl
Date: 16:47:29, den 29 januari 2008
Message:
** System.executeFunction now uses the new and improved read_write to talk with dynamicly loaded functions.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3090
Author: x08joekl
Date: 16:43:33, den 29 januari 2008
Message:
** The king is dead, praise the king. read_write now deals in direct memory transfer between omc and functions instead of files.
----
Modified : /branches/x08joekl_dynamic_loading/c_runtime/read_write.c
Modified : /branches/x08joekl_dynamic_loading/c_runtime/read_write.h


Revision: 3089
Author: x08kimja
Date: 16:26:42, den 29 januari 2008
Message:
** inArgs are sent as references
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Codegen.mo


Revision: 3088
Author: x08kimja
Date: 16:08:01, den 29 januari 2008
Message:
-- modelica.h seems to be included twice so removed it from generateFunctionHeaders
-- Removed fileoperation macros.
** Changed var names for in_file and out_file since files are no longer used
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Codegen.mo


Revision: 3087
Author: x08kimja
Date: 16:05:26, den 29 januari 2008
Message:
-- Removed the creation of main function in cevalGenerateFunction
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3086
Author: x08joekl
Date: 14:07:07, den 28 januari 2008
Message:
** Some testcases, mostly for dynamic linking
----
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/Makefile
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/MyHelloWorld.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/MyHelloWorld.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/PowerOf3.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/PowerOf3.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/PowerOf3_pkg.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/dyn1.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/dyn1.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/dyn2.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/dyn2.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/dyn2_pkg.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/rtest-mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/rtest-mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/simulation_failed_template.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/simulation_template.mos
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/translation_failed_template.mo
Added : /branches/x08joekl_dynamic_loading/testsuite/mytest/translation_template.mo


Revision: 3085
Author: x08kimja
Date: 12:20:58, den 28 januari 2008
Message:
** %MODELICAUSERCFLAGS -> ${MODELICAUSERCFLAGS}
** Loading functions dynamically rather than calling exe.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3084
Author: x08joekl
Date: 11:20:32, den 28 januari 2008
Message:
** Changed dependencies between mo files a while back and as this is in 
   the SVN - generate a new one.

----
Modified : /branches/x08joekl_dynamic_loading/Compiler/.depend


Revision: 3083
Author: x08joekl
Date: 11:19:11, den 28 januari 2008
Message:
++ Ceval now generates a makefile for functions that create a dynamic 
   library instead of a exe.
++ On *nix, systemimpl.c now needs to link with libdl.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/omc_debug/Makefile.in
Modified : /branches/x08joekl_dynamic_loading/Compiler/omc_release/Makefile.in


Revision: 3082
Author: x08joekl
Date: 11:17:29, den 28 januari 2008
Message:
++ executeFunction now dynamicly links function instead.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3081
Author: x08joekl
Date: 17:10:52, den 25 januari 2008
Message:
** Need to keep executeFunction around for a while longer
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/System.mo


Revision: 3080
Author: x08joekl
Date: 17:06:59, den 25 januari 2008
Message:
** Use Debug.fprintln instead of print.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3079
Author: x08kimja
Date: 16:57:24, den 25 januari 2008
Message:
Debug prints are printed to the console
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/printimpl.c


Revision: 3078
Author: x08joekl
Date: 16:45:56, den 25 januari 2008
Message:
** Cleaned up (and corrected) makefiles generated both in Ceval and
   SimCodegen.
** Ceval:s simulate() function now uses System.getExeExt() instead of
   a hardcoded .exe
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo


Revision: 3077
Author: x08joekl
Date: 16:42:16, den 25 januari 2008
Message:
link is a function in libc on *nix
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3076
Author: x08kimja
Date: 15:38:11, den 25 januari 2008
Message:
-- System from imported files
-- Unused variable libs removed
-- Own implementation of cevalGenerateFunction
++ Call to cevalGenerateFunction
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Static.mo


Revision: 3075
Author: x08kimja
Date: 15:35:32, den 25 januari 2008
Message:
++ Imports Ceval in order to call generateMakefileHeader
-- generateMakefile does not take MakefileHeader as an argument any more.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo


Revision: 3074
Author: x08kimja
Date: 15:27:35, den 25 januari 2008
Message:
** SimCodegen now makes the call to Ceval.generateMakefileHeader rather than take it as an argument.
** Changed some inparameters to descriptive names
** Made geretateMakefileHeader a public function so that it could be called from SimCodegen
** Made cevalGenerateFunction public so that Static does not have to implement it's own version of the function.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3073
Author: x08joekl
Date: 14:08:13, den 25 januari 2008
Message:
** On Win32, programs are now generated with .exe
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3072
Author: x08joekl
Date: 13:22:51, den 25 januari 2008
Message:
** _replace is used by settingsimpl.c, so can't be static.
** set_link is the name of the function, not set_linker.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3071
Author: x08joekl
Date: 12:52:22, den 25 januari 2008
Message:
** Missed needed header for generate_array defintion.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3070
Author: x08kimja
Date: 12:14:45, den 25 januari 2008
Message:
** Forgot to change two of the calls to local variables
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3069
Author: x08kimja
Date: 12:12:31, den 25 januari 2008
Message:
** Switched to local variables in generateMakefileHeader
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3068
Author: x08joekl
Date: 12:10:51, den 25 januari 2008
Message:
** Too much copy-paste isn't good for you.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/System.mo


Revision: 3067
Author: x08kimja
Date: 12:01:22, den 25 januari 2008
Message:
++ Added function to generate MakefileHeader that all Makefiles should contain.
** Changed from using Print to stringAppendList in cevalGenerateFunction to be more symmetric to other code.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/Ceval.mo


Revision: 3066
Author: x08joekl
Date: 11:54:00, den 25 januari 2008
Message:
++ Added settings for c++ compiler, linker and linkflags aswell.
++ Added functions for reading c compiler, c compiler flags and those settings above aswell.
** Moved some code around in systemimpl.c to lessen the duplication of code.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/System.mo
Modified : /branches/x08joekl_dynamic_loading/Compiler/runtime/systemimpl.c


Revision: 3065
Author: x08kimja
Date: 11:53:48, den 25 januari 2008
Message:
++ Added inParameter for MakefileHeader
** Changed names of inparameters to descriptive names in generateMakefile
** Changed the list of strings that makes the Makefile so that the MakefileHeader is used.
----
Modified : /branches/x08joekl_dynamic_loading/Compiler/SimCodegen.mo


Revision: 3064
Author: x08joekl
Date: 11:10:42, den 25 januari 2008
Message:
** Initial commit of Dynamic Loading of functions branch.
----
Added : /branches/x08joekl_dynamic_loading(Copy from path: /trunk, Revision, 3063


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@3193 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 15, 2008
1 parent a631341 commit 21fc15e
Show file tree
Hide file tree
Showing 31 changed files with 2,942 additions and 2,140 deletions.
182 changes: 115 additions & 67 deletions Compiler/Ceval.mo

Large diffs are not rendered by default.

232 changes: 131 additions & 101 deletions Compiler/ClassLoader.mo

Large diffs are not rendered by default.

49 changes: 22 additions & 27 deletions Compiler/Codegen.mo
Expand Up @@ -879,9 +879,9 @@ algorithm
equation
Debug.fprintln("cgtr", "generate_function_bodies");
cfns = generateFunctionsElist(elist);
Print.printBuf("\n/* body part */\n");
Print.printBuf("\n/* Body */\n");
cPrintFunctions(cfns);
Print.printBuf("\n");
Print.printBuf("/* End Body */\n");
then
();
case _
Expand Down Expand Up @@ -910,10 +910,9 @@ algorithm
Debug.fprintln("cgtr", "generate_function_headers");
cfns = generateFunctionsElist(elist);
Print.printBuf("/* header part */\n");
Print.printBuf("#include \"modelica.h\"\n");
libs = cPrintFunctionIncludes(cfns) ;
cPrintFunctionHeaders(cfns);
Print.printBuf("\n");
Print.printBuf("/* End of header part */\n");
then
libs;
case _
Expand Down Expand Up @@ -5693,27 +5692,25 @@ protected function generateReadCallWrite "function generateReadCallWrite
input String retstr;
input list<DAE.Element> invars;
output CFunction cfn;
Lib rcw_fnname,out_decl,in_args,fn_call;
Lib out_decl,in_args,fn_call;
CFunction cfn1,cfn1_1,cfn31,cfn32,cfn3,cfn3_1,cfn4,cfn4_1,cfn5,cfn5_1;
Integer tnr21,tnr2;
list<Lib> in_names;
algorithm
cfn1 := cMakeFunction("int", "in" +& fnname, {},
{"type_description * inArgs","type_description * outVar"});
Debug.fprintln("cgtr", "generate_read_call_write");
rcw_fnname := stringAppend(fnname, "_read_call_write");
cfn1 := cMakeFunction("int", rcw_fnname, {},
{"char const* in_filename","char const* out_filename"});
out_decl := Util.stringAppendList({retstr," out;"});
cfn1_1 := cAddInits(cfn1, {"PRE_VARIABLES",out_decl});
cfn1_1 := cAddInits(cfn1, {out_decl});
(cfn3,tnr21) := generateVarDecls(invars, isRcwInput, 1, funContext);
cfn3_1 := cAddInits(cfn3, {"PRE_OPEN_INFILE"});
in_names := invarNames(invars);
in_args := Util.stringDelimitList(in_names, ", ");
cfn4 := generateRead(invars);
fn_call := Util.stringAppendList({"out = ",fnname,"(",in_args,");"});
cfn4_1 := cAddStatements(cfn4, {"PRE_READ_DONE",fn_call,"PRE_OPEN_OUTFILE"});
cfn4_1 := cAddStatements(cfn4, {fn_call});
cfn5 := generateWriteOutvars(outvars,1);
cfn5_1 := cAddStatements(cfn5, {"PRE_WRITE_DONE","return 0;"});
cfn := cMergeFns({cfn1_1,cfn3_1,cfn4_1,cfn5_1});
cfn5_1 := cAddStatements(cfn5, {"return 0;"});
cfn := cMergeFns({cfn1_1,cfn3,cfn4_1,cfn5_1});
end generateReadCallWrite;

protected function generateExternalWrapperCall "function: generateExternalWrapperCall
Expand Down Expand Up @@ -5789,19 +5786,18 @@ algorithm
matchcontinue (inString1,inDAEElementLst2,inString3,inDAEElementLst4,inExternalDecl5,inDAEElementLst6)
local
Integer tnr,tnr_ret,tnr_bialloc_1,tnr_bialloc,tnr_mem,tnr_invars1,tnr_invars,tnr_bivars1,tnr_bivars,tnr_extcall;
Lib rcw_fnname,out_decl,mem_decl,mem_var,get_mem_stmt,rest_mem_stmt,fnname,retstr;
Lib out_decl,mem_decl,mem_var,get_mem_stmt,rest_mem_stmt,fnname,retstr;
CFunction cfn1,cfn1_1,allocstmts_1,allocstmts,biallocstmts,cfnoutinit,cfnoutbialloc,mem_fn_1,mem_fn_2,mem_fn,cfn31,cfn32,cfn33,cfn34,cfn3,cfn3_1,readinvars,readdone,extcall,cfn4_1,cfn5,cfn5_1,cfn_1,cfn;
list<DAE.Element> vars_1,vars,outvars,invars,bivars;
DAE.ExternalDecl extdecl;
case (fnname,outvars,retstr,invars,extdecl,bivars) /* function name output variables return type input variables external declaration bidirectional vars */
equation
Debug.fprintln("cgtr", "generate_read_call_write_external");
tnr = 1;
rcw_fnname = stringAppend(fnname, "_read_call_write");
cfn1 = cMakeFunction("int", rcw_fnname, {},
{"char const* in_filename","char const* out_filename"});
cfn1 = cMakeFunction("int", "in" +& fnname, {},
{"type_description * inArgs","type_description * outVar"});
out_decl = Util.stringAppendList({retstr," out;"});
cfn1_1 = cAddInits(cfn1, {"PRE_VARIABLES"});
cfn1_1 = cAddInits(cfn1,{});
(allocstmts_1,tnr_ret) = generateAllocOutvarsExt(outvars, "out", 1,tnr, extdecl) "generate_vars(outvars,is_rcw_output,1) => (cfn2,tnr1) &" ;
allocstmts = cAddVariables(allocstmts_1, {out_decl});
(biallocstmts,tnr_bialloc_1) = generateAllocOutvarsExt(bivars, "", 1,tnr_ret, extdecl);
Expand All @@ -5818,16 +5814,15 @@ algorithm
(cfn33,tnr_bivars1) = generateVarDecls(bivars, isRcwBidir, tnr_invars, funContext);
(cfn34,tnr_bivars) = generateVarInits(bivars, isRcwBidir, 1,tnr_bivars1, "", funContext);
cfn3 = cMergeFns({cfn31,cfn32,cfn33,cfn34});
cfn3_1 = cAddInits(cfn3, {"PRE_OPEN_INFILE"});
cfn3_1 = cAddInits(cfn3, {});
readinvars = generateRead(invars);
readdone = cAddInits(readinvars, {"PRE_READ_DONE"});
readdone = cAddInits(readinvars, {});
vars_1 = listAppend(invars, outvars);
vars = listAppend(vars_1, bivars);
(extcall,tnr_extcall) = generateExtCall(vars, extdecl, tnr_bivars);
cfn4_1 = cAddStatements(extcall, {"PRE_OPEN_OUTFILE"});
cfn4_1 = cAddStatements(extcall,{});
cfn5 = generateWriteOutvars(outvars,1);
cfn5_1 = cAddStatements(cfn5, {"PRE_WRITE_DONE"});
cfn_1 = cMergeFns({cfn1_1,cfn3_1,readdone,mem_fn,cfn4_1,cfn5_1});
cfn_1 = cMergeFns({cfn1_1,cfn3_1,readdone,mem_fn,cfn4_1,cfn5});
cfn = cAddCleanups(cfn_1, {rest_mem_stmt,"return 0;"});
then
cfn;
Expand Down Expand Up @@ -7159,7 +7154,7 @@ algorithm
(cref_str,_) = compRefCstr(id);
type_string = daeTypeStr(t, false);
stmt = Util.stringAppendList(
{"if(read_",type_string,"(in_file, &",cref_str,
{"if(read_",type_string,"(&inArgs, &",cref_str,
")) return 1;"});
cfn1 = cAddInits(cEmptyFunction, {stmt});
cfn2 = generateRead(r);
Expand All @@ -7171,7 +7166,7 @@ algorithm
(cref_str,_) = compRefCstr(id);
type_string = daeTypeStr(t, true);
stmt = Util.stringAppendList(
{"if(read_",type_string,"(in_file, &",cref_str,
{"if(read_",type_string,"(&inArgs, &",cref_str,
")) return 1;"});
cfn1 = cAddInits(cEmptyFunction, {stmt});
cfn2 = generateRead(r);
Expand Down Expand Up @@ -7209,7 +7204,7 @@ algorithm
equation
iStr = intString(i);
type_string = daeTypeStr(t, false);
stmt = Util.stringAppendList({"write_",type_string,"(out_file, &out.","targ",iStr,");"});
stmt = Util.stringAppendList({"write_",type_string,"(outVar, &out.","targ",iStr,");"});
cfn1 = cAddStatements(cEmptyFunction, {stmt});
cfn2 = generateWriteOutvars(r,i+1);
cfn = cMergeFn(cfn1, cfn2);
Expand All @@ -7219,7 +7214,7 @@ algorithm
equation
iStr = intString(i);
type_string = daeTypeStr(t, true);
stmt = Util.stringAppendList({"write_",type_string,"(out_file, &out.","targ",iStr,");"});
stmt = Util.stringAppendList({"write_",type_string,"(outVar, &out.","targ",iStr,");"});
cfn1 = cAddStatements(cEmptyFunction, {stmt});
cfn2 = generateWriteOutvars(r,i+1);
cfn = cMergeFn(cfn1, cfn2);
Expand Down

0 comments on commit 21fc15e

Please sign in to comment.