fusesoc icon indicating copy to clipboard operation
fusesoc copied to clipboard

Improve help message from backend

Open imphil opened this issue 7 years ago • 2 comments
trafficstars

When I run the following fusesoc command:

fusesoc --cores-root /data/home/no56hud/src/optimsoc/examples run --target=lint --tool=spyglass optimsoc:examples:compute_tile_nexys4ddr --help

I get a help message like the one below:

usage: fusesoc run optimsoc_examples_compute_tile_nexys4ddr_0
       [-h] [--NUM_CORES NUM_CORES]

optional arguments:
  -h, --help            show this help message and exit

Verilog parameters (Compile-time option):
  --NUM_CORES NUM_CORES
                        Number of CPU cores per tile

The help message is created by the backend (EdaTool::parse_args()). Note two things:

  1. The --cores-root option is missing from the help message
  2. The help message shows the internal name of the core, instead of the one I passed to fusesoc (most likely due to self.name = eda_api['name'] in EdaTool::init())

imphil avatar Nov 12 '18 14:11 imphil

Hmm... you're right. Perhaps it would be better to pass the original VLNV instead of the sanitized name and let the backend sanitize it instead. Or pass both perhaps.

The reason why you don't see --cores-root (or --monochrome, --verbose etc) is because of the three-level parsing. Those are global options and because of that, only available if you run fusesoc --help

Don't think it's worth the work to let the subparsers inherit all parent parser options

olofk avatar Nov 30 '18 12:11 olofk

For 1: I see. Given that e.g. git does it the same way (git log --help doesn't show the global options either) I think the current behavior can stay as-is.

For 2: Passing both the sanitized name and the unsanitized one should do the trick (I quickly tried it but somehow didn't find the right knob right from the start, and didn't follow through).

imphil avatar Dec 10 '18 16:12 imphil