-
Notifications
You must be signed in to change notification settings - Fork 812
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
[RACL] Add documentation and example config #26198
base: master
Are you sure you want to change the base?
Conversation
8aebeae
to
873e7a6
Compare
af586d9
to
9f6cebf
Compare
hw/ip_templates/racl_ctrl/README.md
Outdated
```hjson | ||
racl_mappings: { | ||
soc: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson' | ||
sram: 'top_darjeeling/data/racl/all_rd_wr_mapping.hjson' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to give an example where the different interfaces have different mappings?
parser.add_argument('--racl-config', | ||
'-r', | ||
required=True, | ||
required=not is_doc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather clever! But the error messages might be a bit confusing. I'd probably make these optional for argparse, but then put an extra check just after the call to parse_args
, which does something like this? (Completely untested!)
if not args.is_doc:
if (args.racl_config is None or
args.ip is None or
args.mapping is None):
raise SystemExit("--racl-config, --ip and --mapping are all required for non-doc runs.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rswarbrick I pushed some changes and came up with a different solution. Let me know what you think of it!
% ./util/raclgen.py
usage:
raclgen.py --doc DOC
Generates markdown documentation of the RACL configuration for a given top.
raclgen.py --racl-config RACL_CONFIG --ip IP --mapping MAPPING [--if-name IF_NAME]
Generates the RACL policy selection vector for the given IP, RACL mapping, and interface name.
raclgen.py: error: the following arguments are required: --racl-config/-r, --ip/-i, --mapping/-m
Arguably, this error message is still not 100% correct but I would like to avoid the if (args.racl_config ...
checks.
b687cea
to
b19bb50
Compare
Signed-off-by: David Schrammel <[email protected]>
Signed-off-by: David Schrammel <[email protected]>
b19bb50
to
3834170
Compare
This commit adds initial documentation for RACL and describes the racl configuration files in the form of inline examples.
Furthermore, it generates a
racl_configuration.md
file which documents the current RACL configuration for each module instance and interface.I don't have a strong opinion on how to format the RACL config information in the generated tables. We can still discuss and changes this!