Skip to content

Commit

Permalink
*BEWARE*, quite BIG changes, MathCore will need to update their files!
Browse files Browse the repository at this point in the history
- new implementation for inner outer to get the Elementary ThreeSprings working
  + inner components are put first in the list returned by Inst.splitElems to be instantiated first
  + when instantiated the inner component environment and the dae is saved into InnerOuter.InstHierarchy
  + when instantiated the outer component the inner component is looked up into InnerOuter.InstHierarchy
    and the returned environment and dae are processed to make it usable for outer:
    * components in the environment are switched from INNER to OUTER
    * components in the dae are switched from INNER to OUTER and prefixed with the prefix of outer
- tons of other fixes

InnerOuter.mo is a new package
- contains the instance hierarchy and the inner/outer functionality previously in Inst.mo

Prefix.mo split into Prefix.mo and PrefixUtil.mo
- this makes Prefix.mo to contain just data type definitions and can be included almost anywhere.
- Prefix functionality that heavily depends on other packages is moved to PrefixUtil.mo

Connect.mo split into Connect.mo and ConnectUtil.mo
- just data types in Connect.mo to be easily included anywhere
- ConnectUtil.mo better encapsulates the connect functionality from Inst.mo and Env.mo

SCode.mo
- added info node to SCode.CLASS (is now used in Static.mo to get the build time for a function
  instead of going via Interactive.getPathedClassInProgram which might do instantiation again)

Inst.mo
- moved big parts of Inst.mo into ConnectUtil.mo and InnerOuter.mo
- modification on outer will be ignored and will generate only a warning 
  instead of an error as some other Modelica tools do.

Env.mo 
- moved parts of Env.mo into ConnectUtil.mo as they really belong there!
- this makes Env.mo much lightweight on imported modules.

DAEUtil.mo
- correctly dump the input/output types of the flattened functions
- got rid of some spaces before the ";"

Cevalfunc.mo
- fixed an error with the dimension of the type of the output components in functions
    type AliasToArrayType = Real[3];
    output AliasToArrayType x; 
  wrongly generated:
    output Real x;

Main.mo 
- better display of errors and warnings when flattening files from the command line 
- hopefully fixed the naming of generated code if you load a library via the command line 
  ./omc File.mo Modelica wrongly generated Modelica.cpp Modelica_functions.cpp ... 

System.mo and systemimpl.c
- changed a bit the global caching interface.

Static.mo
- return the same expression in makeASUBArrayAdressing if we have qualified component references
  This will get rid of x.y.f[{1,2,3}] = ... in the Elementary examples.
- implemented function caching in Ceval.mo (disabled for now as we 
  get permission denied when trying to delete .dlls in .mos scripts)

Makefile*
- updates to makefiles to compile the new packages

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4985 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 18, 2010
1 parent 1e58316 commit fff335c
Show file tree
Hide file tree
Showing 31 changed files with 7,454 additions and 5,995 deletions.
22 changes: 11 additions & 11 deletions Compiler/Builtin.mo
Expand Up @@ -61,19 +61,19 @@ protected import Values;
`Real\', `Integer\' etc.
*/
public constant SCode.Class rlType=SCode.CLASS("RealType",false,false,SCode.R_PREDEFINED_REAL(),
SCode.PARTS({},{},{},{},{},NONE,{},NONE)) " real type ";
SCode.PARTS({},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) " real type ";

public constant SCode.Class intType=SCode.CLASS("IntegerType",false,false,SCode.R_PREDEFINED_INT(),
SCode.PARTS({},{},{},{},{},NONE,{},NONE));
SCode.PARTS({},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo);

public constant SCode.Class strType=SCode.CLASS("StringType",false,false,SCode.R_PREDEFINED_STRING(),
SCode.PARTS({},{},{},{},{},NONE,{},NONE));
SCode.PARTS({},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo);

public constant SCode.Class boolType=SCode.CLASS("BooleanType",false,false,SCode.R_PREDEFINED_BOOL(),
SCode.PARTS({},{},{},{},{},NONE,{},NONE));
SCode.PARTS({},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo);

protected constant SCode.Class enumType=SCode.CLASS("EnumType",false,false,SCode.R_PREDEFINED_ENUM(),
SCode.PARTS({},{},{},{},{},NONE,{},NONE));
SCode.PARTS({},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo);

protected constant SCode.Element unit=SCode.COMPONENT("unit",Absyn.UNSPECIFIED(),true,false,false,
SCode.ATTR({},false,false,SCode.RW(),SCode.PARAM(),Absyn.BIDIR()),Absyn.TPATH(Absyn.IDENT("StringType"),NONE),
Expand Down Expand Up @@ -140,23 +140,23 @@ protected constant list<SCode.Element> stateSelectComps={
SCode.ATTR({},false,false,SCode.RO(),SCode.CONST(),Absyn.BIDIR()),Absyn.TPATH(Absyn.IDENT("EnumType"),NONE),SCode.NOMOD(),NONE,NONE,NONE,NONE,NONE)} "The StateSelect enumeration" ;

protected constant SCode.Class stateSelectType=SCode.CLASS("StateSelect",false,false,SCode.R_ENUMERATION(),
SCode.PARTS(stateSelectComps,{},{},{},{},NONE,{},NONE)) "The State Select Type";
SCode.PARTS(stateSelectComps,{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) "The State Select Type";

public constant SCode.Class ExternalObjectType=SCode.CLASS("ExternalObject",false,false,SCode.R_CLASS(),
SCode.PARTS({},{},{},{},{},NONE,{},NONE)) "ExternalObject type" ;
SCode.PARTS({},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) "ExternalObject type" ;

public constant SCode.Class realType=SCode.CLASS("Real",false,false,SCode.R_PREDEFINED_REAL(),
SCode.PARTS({unit,quantity,displayUnit,min,max,realStart,fixed,nominal,
stateSelect},{},{},{},{},NONE,{},NONE)) "- The `Real\' type" ;
stateSelect},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) "- The `Real\' type" ;

protected constant SCode.Class integerType=SCode.CLASS("Integer",false,false,SCode.R_PREDEFINED_INT(),
SCode.PARTS({quantity,min,max,integerStart,fixed},{},{},{},{},NONE,{},NONE)) "- The `Integer\' type" ;
SCode.PARTS({quantity,min,max,integerStart,fixed},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) "- The `Integer\' type" ;

protected constant SCode.Class stringType=SCode.CLASS("String",false,false,SCode.R_PREDEFINED_STRING(),
SCode.PARTS({quantity,stringStart},{},{},{},{},NONE,{},NONE)) "- The `String\' type" ;
SCode.PARTS({quantity,stringStart},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) "- The `String\' type" ;

protected constant SCode.Class booleanType=SCode.CLASS("Boolean",false,false,SCode.R_PREDEFINED_BOOL(),
SCode.PARTS({quantity,booleanStart,fixed},{},{},{},{},NONE,{},NONE)) "- The `Boolean\' type" ;
SCode.PARTS({quantity,booleanStart,fixed},{},{},{},{},NONE,{},NONE),Absyn.dummyInfo) "- The `Boolean\' type" ;

protected constant DAE.Var timeVar=DAE.TYPES_VAR("time",
DAE.ATTR(false,false,SCode.RO(),SCode.VAR(),Absyn.BIDIR(),Absyn.UNSPECIFIED()),false,(DAE.T_REAL({}),NONE),DAE.UNBOUND()) "- The `time\' variable" ;
Expand Down

0 comments on commit fff335c

Please sign in to comment.