Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CR 1217061 : xrt-smi advanced --help prints Alveo help #8545

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/runtime_src/core/tools/xbutil2/SubCmdAdvanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ SubCmdAdvanced::SubCmdAdvanced(bool _isHidden, bool _isDepricated, bool _isPreli
setIsPreliminary(_isPreliminary);

m_commonOptions.add_options()
("device,d", boost::program_options::value<decltype(m_device)>(&m_device), "The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this device. "xrt-smi advanced --device <>" Is not a valid command. We have devices inside the suboptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can print device specific help only when m_device is populated.
SubCmdProgram class also has a m_device which works on the OptionOption mechanism, similar to advanced.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, please make sure that all possible option combos work after this change!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only clocks and preemption are used as valida reports right now. Generating preemption exits silently and clocks works fine :

Z:\Repos\XRT-MCDM-FORK\XRT-MCDM\build\WRelease\xilinx\xrt>xrt-smi advanced --report preemption

Z:\Repos\XRT-MCDM-FORK\XRT-MCDM\build\WRelease\xilinx\xrt>xrt-smi advanced --report clocks

Clocks
  H Clock                : 800 MHz
  MP-NPU Clock           : 400 MHz

("help", boost::program_options::bool_switch(&m_help), "Help to use this sub-command")
;

Expand Down Expand Up @@ -78,15 +79,11 @@ SubCmdAdvanced::execute(const SubCmdOptions& _options) const
auto optionOption = checkForSubOption(vm);

// No suboption print help
if (!optionOption) {
printHelp();
if (!optionOption || m_help) {
printHelp(false, "", XBU::get_device_class(m_device, true));
return;
}

// 2) Process the top level options
if (m_help)
topOptions.push_back("--help");

optionOption->setGlobalOptions(getGlobalOptions());

// Execute the option
Expand Down
Loading