edaa-org / pyEDAA.ProjectModel

An abstract model of EDA tool projects.
https://edaa-org.github.io/pyEDAA.ProjectModel
Other
10 stars 1 forks source link

Merging/combining multiple projects #26

Open umarcor opened 2 years ago

umarcor commented 2 years ago

A VivadoProjectFile and a OSVVMProjectFile represent a project file. They offer a Parse() method, which fills a property called ProjectModel. So currently, each file has it's own project model. I'm not sure how we can define a merge operation an them.

Maybe that would be the case for the parent project:

project = Project("Parent", rootDirectory=Path.cwd())
osvvmFileSet = FileSet("OSVVM", project=project)
osvvmProjectFile = OSVVMProjectFile(osvvmPath, fileSet=osvvmFileSet)
osvvmProjectFile.Parse()

osvvmProject = osvvmProjectFile.ProjectModel

Maybe, we can have a

osvvmFileSet.Merge(osvvmProject)

or so?

_Originally posted by @Paebbels in https://github.com/edaa-org/pyEDAA.ProjectModel/pull/25#discussion_r740345903_

I believe it would be desirable to have a Merge operation for combining any two projects. I know that many possible combinations will produce conflicts, so I think we don't need a "too clever" approach but just produce meaningful failures when such conflicts arise. Then, it's up to users to understand/know what they can combine and what they cannot.

Particular use cases for combining two projects are: OSVVM and XPR in the context of tsfpga, or OSVVM and VUnit's API in the context of VUnit and OSVB.

_Originally posted by @umarcor in https://github.com/edaa-org/pyEDAA.ProjectModel/pull/25#discussion_r740355432_