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.
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
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
@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