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

VITIS-8127 Refactor SubCmdConfigure #7571

Merged
merged 3 commits into from
Jun 26, 2023
Merged

Conversation

rchane
Copy link
Collaborator

@rchane rchane commented Jun 1, 2023

Problem solved by the commit

https://jira.xilinx.com/browse/VITIS-8127 SubCmdConfigure should be refactored like SubCmdExamine to use configuration JSON

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

N/A

How problem was solved, alternative solutions (if any) and why they were rejected

SubCmdConfigureInternal has been made similar to SubCmdExamineInternal. The --input and --retention options for xbmgmt configure have been made OptionOptions to take advantage of the configuration JSON. As a result, the conflicting options check was removed from the execute function as well (if --input or --retention are found, we execute and return). The hidden options can be taken care of later if we decide to make them OptionOptions or manage them with the configuration JSON.

Risks (if any) associated the changes in the commit

This changes how SubCmdConfigure works behind the scenes.

What has been tested and how, request additional testing if necessary

rchane@xsjrchane50:/proj/rdi/staff/rchane/XRT$ xbmgmt configure --help
COMMAND: configure

DESCRIPTION: Advanced options for configuring a device

USAGE: xbmgmt configure [ --input arg | [--retention arg] ] [--help] [-d arg]

OPTIONS:
  -d, --device       - The Bus:Device.Function (e.g., 0000:d8:00.0) device of interest
  --help             - Help to use this sub-command
  --input            - Takes an INI file with configuration details (e.g. memory, clock throttling)
                       and loads them onto the device
  --retention        - Enables / Disables memory retention. Valid values are: [ENABLE | DISABLE]


GLOBAL OPTIONS:
  --verbose          - Turn on verbosity
  --batch            - Enable batch mode (disables escape characters)
  --force            - When possible, force an operation

root@xsjrchane50:/proj/rdi/staff/rchane/XRT# xbutil configure --help
COMMAND: configure

DESCRIPTION: Device and host configuration.

USAGE: xbutil configure [ --host-mem | --p2p ] [--help]

OPTIONS:
  --help             - Help to use this sub-command
  --host-mem         - Controls host-mem functionality
  --p2p              - Controls P2P functionality


GLOBAL OPTIONS:
  --verbose          - Turn on verbosity
  --batch            - Enable batch mode (disables escape characters)
  --force            - When possible, force an operation

After changing to OptionsOptions, the help menu looks a little different for xbmgmt configure. Testing was done on Ubuntu 22.04 to make sure --input, --retention, and some hidden options worked as desired. Pipeline should test thoroughly to ensure functionality is the same as before refactoring.

Documentation impact (if any)

N/A

@gbuildx
Copy link
Collaborator

gbuildx commented Jun 1, 2023

Build failed :(

@gbuildx
Copy link
Collaborator

gbuildx commented Jun 2, 2023

Build failed :(

Copy link
Contributor

@dbenusov dbenusov left a comment

Choose a reason for hiding this comment

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

Awesome work. Much cleaner and easier to maintain!

@dayeh-xilinx
Copy link

retest this please.

@gbuildx
Copy link
Collaborator

gbuildx commented Jun 3, 2023

Build failed :(

@dayeh-xilinx
Copy link

retest this please.

@gbuildx
Copy link
Collaborator

gbuildx commented Jun 5, 2023

Build failed :(

@dayeh-xilinx
Copy link

retest this please.

@gbuildx
Copy link
Collaborator

gbuildx commented Jun 6, 2023

Build Passed!

@gbuildx
Copy link
Collaborator

gbuildx commented Jun 6, 2023

Build Passed!

Copy link
Contributor

@dbenusov dbenusov left a comment

Choose a reason for hiding this comment

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

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants