Changeset 37b44b1e in OpenModelica
- Timestamp:
- 2022-06-29T10:41:46+02:00 (22 months ago)
- Parents:
- 2c25668
- git-author:
- Per Östlund <perost86@…> (06/29/22 10:39:38)
- git-committer:
- Per Östlund <perost86@…> (06/29/22 10:41:46)
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/NFFrontEnd/NFComponent.mo
re4e4270 r37b44b1e 989 989 output Integer flows = 0; 990 990 output Integer streams = 0; 991 output Boolean knownSize = true; 991 992 protected 992 993 Type ty; … … 997 998 Integer comp_size = 0, p, f, s; 998 999 Function fn; 1000 Boolean known_size; 999 1001 algorithm 1000 1002 cls := InstNode.getClass(classInstance(component)); … … 1008 1010 Function.instFunctionNode(eq_node, NFInstContext.NO_CONTEXT, info(component)); 1009 1011 fn := listHead(Function.typeNodeCache(eq_node)); 1010 comp_size := Type.sizeOf(Function.returnType(fn)); 1012 ty := Function.returnType(fn); 1013 1014 if Type.hasKnownSize(ty) then 1015 comp_size := Type.sizeOf(ty); 1016 else 1017 comp_size := 0; 1018 knownSize := false; 1019 end if; 1011 1020 else 1012 1021 ty := getType(component); … … 1016 1025 if isRoot then 1017 1026 comp_size := 1; 1027 elseif Type.hasKnownSize(ty) then 1028 comp_size := Dimension.sizesProduct(Type.arrayDims(ty)); 1018 1029 else 1019 comp_size := Dimension.sizesProduct(Type.arrayDims(ty)); 1030 comp_size := 0; 1031 knownSize := false; 1020 1032 end if; 1021 1033 … … 1026 1038 if Type.isRecord(ty) or isRoot then 1027 1039 for c in ClassTree.getComponents(Class.classTree(cls)) loop 1028 (p, f, s ) := countConnectorVars(InstNode.component(c), false);1040 (p, f, s, known_size) := countConnectorVars(InstNode.component(c), false); 1029 1041 potentials := potentials + p * comp_size; 1030 1042 flows := flows + f * comp_size; 1031 1043 streams := streams + s * comp_size; 1044 knownSize := known_size and knownSize; 1032 1045 end for; 1033 1046 end if; -
OMCompiler/Compiler/NFFrontEnd/NFTyping.mo
rf3c607f r37b44b1e 340 340 protected 341 341 Integer pots, flows, streams; 342 Boolean known_size; 342 343 Component comp; 343 344 InstNode parent; … … 354 355 end if; 355 356 356 (pots, flows, streams) := Component.countConnectorVars(comp); 357 (pots, flows, streams, known_size) := Component.countConnectorVars(comp); 358 359 if not known_size then 360 return; 361 end if; 357 362 358 363 // Modelica 3.2 section 9.3.1: -
testsuite/flattening/modelica/connectors/Makefile
r802adce r37b44b1e 43 43 ConnectorBalance6.mo \ 44 44 ConnectorBalance7.mo \ 45 ConnectorBalance8.mos \ 45 46 ConnectorComponents.mo \ 46 47 ConnectorCompOrder.mo \
Note: See TracChangeset
for help on using the changeset viewer.