olofk / fusesoc

Package manager and build abstraction tool for FPGA/ASIC development
BSD 2-Clause "Simplified" License
1.16k stars 242 forks source link

Problem with describing big repositories as remote FuseSoc libraries. #299

Open m-kru opened 5 years ago

m-kru commented 5 years ago

I want to describe some quite big HDL library as FuseSoc library. As I do not expect the maintainers of the library to accept my pull request adding .core files, I want to create separate repository. What I have realized is that FuseSoc clones the repository for each core! It is time consuming and wastes space. I can see 2 solutions here and I think having both would be great!

  1. FuseSoc should clone repository that contains source code for FuseSoc library to some location, for example to .local/fusesoc/library_source. Then, if some core has this git repository as a provider, FuseSoc would first check if this repository is already cloned. If it is, then the files should be copied form there, without cloning it again. If the commit that is required from this source code repository does not exist, FuseSoc should try to update this repository.

  2. It would be nice to be able to specify multiple urls to be downloaded if provider is of type url. Example:

CAPI=2:

name: vendor:lib:core_name

filesets:
    rtl:
        files: 
            - file_1.vhd
            - file_2.vhd
        file_type: vhdlSource-93

targets:
    default:
        filesets:
            - rtl

provider:
    name: url
    url: 
        -https://www.url.org/project/raw/34kg8e1d2d2c6a72ded627dd6eaa9a7e398a9042/dir_1/file_1.vhd
        -https://www.url.org/project/raw/34kg81d2d2c6a72ded627dd6eaa9a3e798a9042/dir_2/file_2.vhd
    filetype: simple
olofk commented 5 years ago

Yeah, this is an issue I'm painfully aware of. For SVN repos you can specify repo_root to just get a subtree but that doesn't work for git repositories. Using a list of urls in the url provider is a good idea and would at least help in many cases. It should be easy to do, but to keep backwards compatibility, we need to still allow a single string. This is already the case for the toplevel parameter in targets