bender icon indicating copy to clipboard operation
bender copied to clipboard

syntax for target filtering dependencies?

Open epsilon537 opened this issue 1 year ago • 3 comments

The README says: "Targets are flags that can be used to filter source files and dependencies." I can't seem to figure out the syntax for target-based filtering of dependencies. I couldn't find any examples online either. Thanks for any help.

epsilon537 avatar Oct 15 '24 15:10 epsilon537

Targets can be specified in the Bender.yml with source file groups, as shown in the Readme. To specify these targets for your scripts generation, add a --target <YOUR_TARGET> or -t <YOUR_TARGET> to your command. As an example, specifying the test target for a vsim script works as follows:

bender script vsim --target test

More info can be found in bender's help menu with bender script --help.

If you're looking for an example, check out cheshire's Bender.yml and Makefile

micprog avatar Oct 17 '24 01:10 micprog

Thanks for getting back to me. I'm aware that targets can be specified in source groups. My question is, can targets also be used in the dependencies section of Bender.yml? The README says that target flags can be used to filter dependencies, not just source files.

I'm looking for something along these lines:

dependencies:
  ...
  vs0: {target: vivado, path: "../../components/vs0_empty"}
  vs0: {target: verilator, path: "../../components/vs0_stub"}

The above syntax does not work. I'm looking for the correct syntax (if there is one).

epsilon537 avatar Oct 17 '24 09:10 epsilon537

it seems, now, you can list all the targets after '-t/--target' (one with each) while do bender script

0xcdef avatar Oct 30 '24 08:10 0xcdef

Filtering dependencies with targets is currently not supported, and will be difficult to support to properly construct the dependency tree. You can exclude individual dependencies (and their exclusive dependents) in the script and sources commands with the -e/--exclude <dep> flag. Future features may add target filtering ability for dependencies similar to what you are proposing, although this will also still only apply with the sources and script commands that pass targets, not when updating the dependency tree.

micprog avatar Apr 22 '25 14:04 micprog