Skip to content

#319 Add sub-plant creation functionality

Albert Hofkamp requested to merge 319-add-subplant-3 into develop

This patch constructs subplant (and sub-requirement) specifications for multi-level synthesis.

Is readable by commit, although it is pretty dense code. It takes the original specification, and copies parts of it to zero or more partial specifications.

The PartialSpecBuilder handles the global flow to construct partial specifications. It uses a PartialSpecBuilder for each specification that must be created. The manager class handles the details of copying and keeping track of things.

For each partial specification, first the needed plants and requirements are deep-cloned in a minimal way. Next, dangling objects are resolved by deep-cloning more parts of the original specification. This may also lead to new dangling objects of course. Resolving continues until everything is resolved. At that point the objects in the partial specification are all contained and they can be written out to a file.

One thing to keep in mind is that deep-cloning keeps a record of all copied objects. This makes that EnumLiteral and Field classes can be resolved. (Not sure the latter always works, I am not quite sure where these objects can be contained.)

To get stable output, I had to maintain the same order in contained lists with declarations, components, etc, between the original and the partial specification. I believe the cause is somewhere in the EcoreUtil classes.

@mgoorden7u4 Could you have a look at the output of the lock model to check if the result makes sense? It has been added to oee.cif.tests/tests/multilevel

Addresses #318 Closes #319 (closed)

Merge request reports