[dvsim] FuseSoC takes much time searching for `.core` files in directories it should not
Nobody has claimed this yet.
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
`dvsim` invokes `fusesoc` with `--cores-root` set to the OT root directory. `fusesoc` then traverses all directories in OT searching for `.core` files. This currently takes ca. 50 seconds on my machine, because there are huge build / local install directories such as `bazel-bin/`, `bazel-opentitan/`, `bazel-out/`, `bazel-testlogs/`, `build/`, `build-bin/`, `scratch/`, and `.venv/`. `dvsim` places a `FUSESOC_IGNORE` file into the `scratch/` directory, which prevents FuseSoC from traversing it.
I see three possible solutions:
- Add a `FUSESOC_IGNORE` file also to the other build / install directories. Most of these directories exist for many OT users, such as the `bazel*` and `build*` directories (also see the `.gitignore` file). Others are more user-specific, such as `.venv`, so this solution would not automatically cause FuseSoC to ignore them.
- Use the `hw/` directory as `--cores-root`. There are three `.core` files that currently live outside the `hw/` directory: `check_tool_requirements.core`, `topgen-reg-only.core`, and `topgen.core`. This solution would probably only work if these files could also be moved into `hw/`. Is that the case, and if so, could they be moved?
- Extend FuseSoC to specify ignores through a command-line flag or configuration file entry.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how dvsim invokes FuseSoC with the OT root as --cores-root, then compare the listed build and install directories with .gitignore and the existing scratch/FUSESOC_IGNORE behavior. Determine which approach preserves access to check_tool_requirements.core, topgen-reg-only.core, and topgen.core while avoiding unnecessary traversal. Done means the chosen design is agreed and FuseSoC no longer spends roughly 50 seconds searching irrelevant directories.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100