Opened 15 months ago

Last modified 13 months ago

#5670 assigned enhancement

Improve handling of constants in functions

Reported by: Jonathan Kämpe Owned by: Jonathan Kämpe
Priority: major Milestone:
Component: Modelica/FrontEnd Version: trunk
Keywords: Cc:

Description

Currently, constants in functions and accesses to constants outside functions (from within a function) are flattened in such a way that the constant is added as a non-constant to the function, if it can't be inlined. We should add a structure for keeping the constants until runtime as global constants. This should improve performance for such functions. We also need to support external object package constants, which can't be inlined so we need the new representation.

Change History (19)

comment:1 Changed 15 months ago by Jonathan Kämpe

r11524 Refactoring external evaluation

comment:2 Changed 15 months ago by Jonathan Kämpe

r11541 Fixed a bug where external constant evaluation with literal or size inputs could produce wrong values if several modelica wrappers used the same external function.

comment:3 Changed 15 months ago by Jonathan Kämpe

r11543 Update handling of constants, and accesses to package constants, in functions for improved compilation and simulation performance.
r11544 Fixed bug in r11541
r11545 Fixed bug in r11543

comment:4 Changed 15 months ago by Jonathan Kämpe

r11546 Unused global variables removed by cleanup step

comment:5 Changed 15 months ago by Jonathan Kämpe

r11547 Fixed bug in r11543
r11548 Splitting generated code for global constants into component based functions to avoid megafunctions. Fixed bug where scalar record global constants caused segfaults.

comment:6 Changed 15 months ago by Jonathan Kämpe

r11549 Fixed minor code gen bug and added workaround for flattening bug where types referenced only through global constant binding expressions was not included in the flat tree.

comment:7 Changed 15 months ago by Jonathan Kämpe

r11551 Fixed code gen bug from r11548
r11559 Fixed record variability calculation bug from r11543 which lead to nullpointerexception

comment:8 Changed 14 months ago by Jonathan Kämpe

r11573 Merging all changesets related to #5670 to release branch

comment:9 Changed 14 months ago by Jonathan Kämpe

r11578 Basic support for external object package constants. Not including in arrays or records.
r11581 Fixed function inlining and code generation bug introduced in r11578

comment:10 Changed 14 months ago by Jonathan Kämpe

r11596 Fixed code generation bug introduced in r11578

comment:11 Changed 14 months ago by Jonathan Kämpe

r11631 Reverting r11578,r11581,r11596 probably causing intermittent simulation problems in some models.

comment:12 Changed 14 months ago by Jonathan Kämpe

r11639 Recommiting r11578,r11581,r11596 by reverting r11631

comment:13 Changed 13 months ago by Jonathan Kämpe

r11764 Minor refactoring

comment:14 Changed 13 months ago by Jonathan Kämpe

r11783 Adding description to tests introduced in r11578.

comment:15 Changed 13 months ago by Jonathan Kämpe

r11800 Removed some unnecessary and erroneous code. Added test for external function without inputs or outputs.

comment:16 Changed 13 months ago by Jonathan Kämpe

r11804 Added some documentation for FGlobalVariable. Updated fclass tostring to use "global variable" instead of "package constant".

comment:17 Changed 13 months ago by Jonathan Kämpe

r11805 Removed unused line

comment:18 Changed 13 months ago by Jonathan Kämpe

r11806 Removed unused code

comment:19 Changed 13 months ago by Jonathan Kämpe

r11814: Merging refactoring to trunk

Note: See TracTickets for help on using tickets.