Conversation
|
Regarding the various open questions: For source files:
For header files: For include directories, the situation is different and the hierarchy must be preserved if include path sare used. The same problem arises for software libraries and the target_sources command with FILE_SETS and BASE_DIR arguments is there for that. The use of FILE_SETS is also mentioned in #123 to distinguish various configuration (e.g., simulation, ASIC, FPGA), so it could be one more reason to investigate this solution. |
|
Is the example supposed to work? For me it does not. I get this error: It looks like it tries to install the files under /usr/local/VERILOG |
|
Hello @benoitdenkinger , Yes, that works correctly. To change the install directory, you need to pass |
I am not sure I fully understand, are you saying to have something like this:
This would be ideal, but I am not sure this can be enforced easily
I agree, this is probably the way to go
Yes there are some good ideas, I am currently working with IPXact, and I am looking into how FileSets are used there. |
Yes, even: This open the possibility to have multiple versions of the same IP
Do you mean that in IPXact you can define any fileset? In that case, again, the question is how to support these filesets on SoCMake (see #123). Or did you mean something else? |
I think this is a great idea. We can even think of organizing the default binary directories for targets like that. |
So IPXact can have arbitrary filesets, the fileSet element looks something like this: You can have arbitrary number of ipxact:fileSet elements in ipxact:fileSets element. On #138 , it is already implemented to extract the fileType and file list from the ipxact:fileSet. The proposal from #123 would still work, and would look like this: P.S. one additional issue to consider is that IPXact can define a VHDL library per file, while in SoCMake a VHDL library is unique per IP block. |
Ok, nice. To me this is an additional strong point in favor of moving toward fileset support in SoCMake. If we move forward with the latest proposal in #123, I think we have an elegant and flexible solution as in your example.
This shouldn't be difficult to support, no? We can create different IPs for each vhdl library.
Nice match indeed. What is the FUNCTION field, I don't see it in the IPXact files? |
I think we have enough information to start implementing this, I will open a pull request in the next days.
I think its not, so trivial.
The FUNCTION is in SoCMake the target that generates the output directory, for example for Xcelium: Well something like that doesnt really exist in IPXact. |
Ok, I see. So what would/could be the hierarchy exactly? Would it also include the language/fileset? Any chance to strip the FUNCTION name to have something cleaner (e.g., reglbock instead of vendor__library__name__0.0.1__peakrdl_regblock)? Currently, the implementation is exporting the files in a way it can be imported by cmake/socmake. Do you think we could/should export a list of the files (and other important parameters, e.g., include directories) so it can also be imported without SoCMake? Or should we have dedicated scripts to generate such files to import the design in other tools? |
Ah, sorry, I jumped to another topic there. Regarding the INSTALL_DIR structure. But do we really need this distinction? If not, it becomes simpler.
Well, sure, it can be done, but the question is what would that format be? We can play around with CMake script mode, to provide these "build system manifest conversion" functions. So you would run something like this: Few things to keep in mind while installing the IP blocks
I implemented the basic version of it, but maybe we can use something more sophisticated like https://github.com/TheLartians/PackageProject.cmake
Usually, the generated Config.cmake would contain the
a) Dependency can be built and installed during the parent project configure time, that way the package would be available as installed package to the parent project. No targets need to be executed |
|
From your last comment and from the offline discussion:
Yes, the installation will install everything. By default, each IP will be installed independently and can be retrieved also independently. As discussed, we could add a FLATTEN option to install ( What could be interesting is to also have a FILE_SETS option. By default, all the FILE_SETS are installed, but we could also specify the ones to install. Or an option to exclude a certain IP in the hierarchy? Maybe you want to export your block, but not a certain sub-module. You can also control this when you import again the files, but maybe you don't even want to expose these files to the user importing them. What do you thing @Risto97? |
Implement file sets
…a alias target without version
… linking to IP libraries that were not yet defined
Implement file sets
Implement file sets
20c9cc1 to
77b44c5
Compare
Experimental support for installing IP blocks.
The idea is to install an IP block that does not have any targets, instead, all the generated files are statically included in the package.
Additionally, it should be possible to install the elaborated simulation databases for different simulators, so when the importing projects link to the installed simulation database, it should only add it to the search path, and not recompile the source files.
A new function is provided
ip_install()that installs the IP block to a new location.Compared to the installation of C/C++ libraries, we have a bit of a different problem.
In C++ installation, typically only the static, shared libraries or executables are installed as binary files.
In addition to that, header files can also be installed, typically in the case of header files a whole include directory could be copied to the new location.
In C++ source
.ccfiles are not installed.This would be equivalent in HW flow where only the simulation database is installed but the HDL source files are not.
Although this is a valid approach, in HW flows it is often needed to deliver also the generated HDL files without the need to run the generators on the IP consumer user side.
The consumer can then use these generated HDL files to run simulation, synthesis, implementation etc...
Often there might also be a requirement to export the SoCMake's CMake recipe into something more build system agnostic, like IPXact, json, or a simple txt file with the list of files.
In case of installing source files, a problem is deciding on where should the new source files be placed?
Similar issues exist also for the include directories, where the include directories of the IP, need to keep the header files in the same directory tree relative to include directories in the destination directory.
In case of
include "inc_dir/some_dir/header.svh"no directory levels can be lost to not break the functionality.