Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Select first algorithm for dynamic selector if multiple exist
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninbas committed Mar 7, 2018
1 parent db16220 commit 9c16f29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p4c_bm/gen_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,11 @@ def dump_action_profile(pipe_name, action_profiles, p4_action_profile,
if p4_action_profile.selector is not None:
p4_selector = p4_action_profile.selector
selector = OrderedDict()
selector["algo"] = p4_selector.selection_key.algorithm
if type(p4_selector.selection_key.algorithm) is list:
# we already print a warning for this case in dump_calculations
selector["algo"] = p4_selector.selection_key.algorithm[0]
else:
selector["algo"] = p4_selector.selection_key.algorithm
elements = []
assert(len(p4_selector.selection_key.input) == 1)
for field in p4_selector.selection_key.input[0].fields:
Expand Down

0 comments on commit 9c16f29

Please sign in to comment.