olofk / fusesoc

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

Generator Cache doesn't work with --no-export #673

Open nicorum opened 4 months ago

nicorum commented 4 months ago

When using the --no-export argument the generator cache gets placed in the build/<core>/<target>-<tool>/generator_cachefolder instead of the .cache/fusesoc/generator_cache folder. But this folder is removed at the start of each fusesoc run. Which is why the generator_cache does not work with the --no-export argument.

I can fix this problem for me by removing self.gen_root from the line that contains self.gen_root or self.core.cache_root, in the Ttptttg class. But I don't want to create a pull request with the possible fix. Because I don't understand what the exact purpose of using self.gen_root is. Is this behaviour intended?

olofk commented 3 months ago

Hmm... good question. There is some complexity in that part of the code, so I can't honestly say right away if it's a bug or the intended way. One thing though, did you mark your generator as cacheable? That also needs to be done.

nicorum commented 3 months ago

I'm using cache_type: input in the generator core. Caching works with this generator when not using the --no-export flag.

If you can't reproduce the problem, I can create and upload a minimal example.