fusesoc
fusesoc copied to clipboard
Improve help message from backend
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:
- The
--cores-rootoption is missing from the help message - 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']inEdaTool::init())
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
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).