Instance handling breaks FWK's ghdl target
If a Module is instantiated multiple times in the Application, DesyRDL generates exactly the same code for each instance in separate subfolders and these are all added to the project by the tcl
files. Then, if you try to do make ghdl
in FWK, Cmake will complain about the CMakeList file defining the same target multiple times (applying different file paths) like this
` CMake Error at CMakeLists.txt:447 (add_custom_command): Attempt to add a custom rule to output
<path>/desyrdl/<desyrdl file>.o.rule
which already has a custom rule. `
It is also confusing that all the generated files seeem to be added to the project multiple times (for every channel?), which is defined by the generated tcl
file (for the damc example design this means all desyrdl files are added threetimes); although most tools ignore this (e. g. Cmake is not concerned about this, since in this case all the lines exactly match).
If you turn on set ::fwfwk::ModuleOwnLib 1
, things change a bit; each instance's desyrdl stuff goes into a lib named after the instance (really duplicating the code in the project); Module's own code goes to a lib named after the module. But then the module's code (where you typically instantiate the generated part) should refer to an instance name defined at the project level which does not make too much sense for me.
What was the idea here, or am I doing something wrong? Why add generated code per instance in the first place?