loci: use ID classes from the IR
Instead of building them itself.
diff --git a/c_gen/build_of_g.py b/c_gen/build_of_g.py
index 2a272ce..f117bfd 100755
--- a/c_gen/build_of_g.py
+++ b/c_gen/build_of_g.py
@@ -443,28 +443,6 @@
of_g.ordered_classes[wire_version].append(new_cls)
classes[new_cls] = classes[cls]
- # Generate action_id classes for OF 1.3
- for wire_version, ordered_classes in of_g.ordered_classes.items():
- if not wire_version in [of_g.VERSION_1_3]:
- continue
- classes = versions[of_g.of_version_wire2name[wire_version]]['classes']
- for cls in ordered_classes:
- if not loxi_utils.class_is_action(cls):
- continue
- action = cls[10:]
- if action == '' or action == 'header':
- continue
- name = "of_action_id_" + action
- members = classes["of_action"][:]
- of_g.ordered_classes[wire_version].append(name)
- if type_maps.action_id_is_extension(name, wire_version):
- # Copy the base action classes thru subtype
- members = classes["of_action_" + action][:4]
- classes[name] = members
-
- # @fixme If we support extended actions in OF 1.3, need to add IDs
- # for them here
-
for wire_version in of_g.wire_ver_map.keys():
version_name = of_g.of_version_wire2name[wire_version]
calculate_offsets_and_lengths(
diff --git a/c_gen/loxi_utils_legacy.py b/c_gen/loxi_utils_legacy.py
index e20155d..9abca52 100644
--- a/c_gen/loxi_utils_legacy.py
+++ b/c_gen/loxi_utils_legacy.py
@@ -180,6 +180,8 @@
"""
Return True if cls_name is an instruction object
"""
+ if cls.find("of_instruction_id") == 0:
+ return False
if cls.find("of_instruction") == 0:
return True
diff --git a/c_gen/type_maps.py b/c_gen/type_maps.py
index ae5f481..e709b70 100644
--- a/c_gen/type_maps.py
+++ b/c_gen/type_maps.py
@@ -60,21 +60,25 @@
of_g.VERSION_1_3:dict()
}
-# HACK shared between actions and action_ids
-of_1_3_action_types = dict()
+instruction_id_types = {
+ of_g.VERSION_1_0:dict(),
+ of_g.VERSION_1_1:dict(),
+ of_g.VERSION_1_2:dict(),
+ of_g.VERSION_1_3:dict()
+ }
action_types = {
of_g.VERSION_1_0:dict(),
of_g.VERSION_1_1:dict(),
of_g.VERSION_1_2:dict(),
- of_g.VERSION_1_3:of_1_3_action_types
+ of_g.VERSION_1_3:dict(),
}
action_id_types = {
of_g.VERSION_1_0:dict(),
of_g.VERSION_1_1:dict(),
of_g.VERSION_1_2:dict(),
- of_g.VERSION_1_3:of_1_3_action_types
+ of_g.VERSION_1_3:dict(),
}
queue_prop_types = {
@@ -134,6 +138,7 @@
# All inheritance data for non-messages
inheritance_data = dict(
of_instruction = instruction_types,
+ of_instruction_id = instruction_id_types,
of_action = action_types,
of_action_id = action_id_types,
of_oxm = oxm_types,