Skip to content

Commit

Permalink
Update JSON files for examples (#253)
Browse files Browse the repository at this point in the history
The checked-in JSON files for simple_router and l2_switch were old. The
one for l2_switch was so old it was causing the CLI to crash. I ran a
recent version of the compiler to obtain up-to-date JSON files.
  • Loading branch information
antoninbas authored Jan 1, 2017
1 parent a37568d commit e9cbeb2
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 75 deletions.
157 changes: 114 additions & 43 deletions targets/l2_switch/l2_switch.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"__meta__": {
"version": [
2,
0
]
},
"header_types": [
{
"name": "standard_metadata_t",
Expand Down Expand Up @@ -36,7 +42,9 @@
"_padding",
5
]
]
],
"length_exp": null,
"max_length": null
},
{
"name": "ethernet_t",
Expand All @@ -54,7 +62,9 @@
"etherType",
16
]
]
],
"length_exp": null,
"max_length": null
},
{
"name": "intrinsic_metadata_t",
Expand All @@ -68,24 +78,29 @@
"mgid",
4
]
]
],
"length_exp": null,
"max_length": null
}
],
"headers": [
{
"name": "standard_metadata",
"id": 0,
"header_type": "standard_metadata_t"
"header_type": "standard_metadata_t",
"metadata": true
},
{
"name": "ethernet",
"id": 1,
"header_type": "ethernet_t"
"header_type": "ethernet_t",
"metadata": false
},
{
"name": "intrinsic_metadata",
"id": 2,
"header_type": "intrinsic_metadata_t"
"header_type": "intrinsic_metadata_t",
"metadata": true
}
],
"header_stacks": [],
Expand All @@ -102,7 +117,8 @@
"transition_key": [],
"transitions": [
{
"value": "default",
"type": "default",
"value": null,
"mask": null,
"next_state": "parse_ethernet"
}
Expand All @@ -125,7 +141,8 @@
"transition_key": [],
"transitions": [
{
"value": "default",
"type": "default",
"value": null,
"mask": null,
"next_state": null
}
Expand All @@ -134,6 +151,7 @@
]
}
],
"parse_vsets": [],
"deparsers": [
{
"name": "deparser",
Expand All @@ -146,28 +164,36 @@
"meter_arrays": [],
"actions": [
{
"name": "forward",
"name": "mac_learn",
"id": 0,
"runtime_data": [
{
"name": "port",
"bitwidth": 9
}
],
"runtime_data": [],
"primitives": [
{
"op": "modify_field",
"parameters": [
{
"type": "field",
"value": [
"standard_metadata",
"egress_port"
"intrinsic_metadata",
"learn_id"
]
},
{
"type": "runtime_data",
"value": 0
"type": "hexstr",
"value": "0x0"
}
]
},
{
"op": "generate_digest",
"parameters": [
{
"type": "hexstr",
"value": "0x1"
},
{
"type": "hexstr",
"value": "0x1"
}
]
}
Expand Down Expand Up @@ -197,36 +223,28 @@
]
},
{
"name": "mac_learn",
"name": "forward",
"id": 2,
"runtime_data": [],
"runtime_data": [
{
"name": "port",
"bitwidth": 9
}
],
"primitives": [
{
"op": "modify_field",
"parameters": [
{
"type": "field",
"value": [
"intrinsic_metadata",
"learn_id"
"standard_metadata",
"egress_port"
]
},
{
"type": "hexstr",
"value": "0x0"
}
]
},
{
"op": "generate_digest",
"parameters": [
{
"type": "hexstr",
"value": "0x1"
},
{
"type": "hexstr",
"value": "0x1"
"type": "runtime_data",
"value": 0
}
]
}
Expand All @@ -252,13 +270,16 @@
"type": "simple",
"max_size": 512,
"with_counters": false,
"direct_meters": null,
"support_timeout": false,
"key": [
{
"match_type": "exact",
"target": [
"ethernet",
"srcAddr"
]
],
"mask": null
}
],
"actions": [
Expand All @@ -269,7 +290,7 @@
"mac_learn": "dmac",
"_nop": "dmac"
},
"default_action": null
"base_default_next": "dmac"
},
{
"name": "dmac",
Expand All @@ -278,13 +299,16 @@
"type": "simple",
"max_size": 512,
"with_counters": false,
"direct_meters": null,
"support_timeout": false,
"key": [
{
"match_type": "exact",
"target": [
"ethernet",
"dstAddr"
]
],
"mask": null
}
],
"actions": [
Expand All @@ -295,16 +319,18 @@
"forward": null,
"broadcast": null
},
"default_action": null
"base_default_next": null
}
],
"action_profiles": [],
"conditionals": []
},
{
"name": "egress",
"id": 1,
"init_table": null,
"tables": [],
"action_profiles": [],
"conditionals": []
}
],
Expand All @@ -331,5 +357,50 @@
}
]
}
],
"field_lists": [],
"counter_arrays": [],
"register_arrays": [],
"force_arith": [
[
"standard_metadata",
"ingress_port"
],
[
"standard_metadata",
"packet_length"
],
[
"standard_metadata",
"egress_spec"
],
[
"standard_metadata",
"egress_port"
],
[
"standard_metadata",
"egress_instance"
],
[
"standard_metadata",
"instance_type"
],
[
"standard_metadata",
"clone_spec"
],
[
"standard_metadata",
"_padding"
],
[
"intrinsic_metadata",
"learn_id"
],
[
"intrinsic_metadata",
"mgid"
]
]
}
}
Loading

0 comments on commit e9cbeb2

Please sign in to comment.