Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 1 | BMV2_CPU_PORT=255 |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 2 | MAVERICKS_CPU_PORT=320 |
| 3 | MONTARA_CPU_PORT=192 |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 4 | |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 5 | ECMP_GROUP_SIZE=2 |
| 6 | |
| 7 | MAVERICKS_OPTIONS=-DCPU_PORT=$(MAVERICKS_CPU_PORT) -DECMP_GROUP_SIZE=$(ECMP_GROUP_SIZE) |
| 8 | MONTARA_OPTIONS=-DCPU_PORT=$(MONTARA_CPU_PORT) -DECMP_GROUP_SIZE=$(ECMP_GROUP_SIZE) |
| 9 | BMV2_OPTIONS=-DDO_BMV2_BUILD -DCPU_PORT=$(BMV2_CPU_PORT) -DECMP_GROUP_SIZE=$(ECMP_GROUP_SIZE) |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 10 | |
| 11 | all: bmv2 |
| 12 | |
| 13 | bmv2: default-bmv2 empty-bmv2 ecmp-bmv2 wcmp-bmv2 |
| 14 | |
Carmelo Cascone | f2ac720 | 2017-09-08 00:57:44 +0200 | [diff] [blame] | 15 | tofino: default-tofino ecmp-tofino |
| 16 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 17 | default-bmv2: default.p4 |
| 18 | p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/default.json \ |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 19 | --p4runtime-file p4c-out/default.p4info --p4runtime-format text \ |
| 20 | default.p4 |
| 21 | |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 22 | default-tofino: default.p4 |
| 23 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/default/mavericks $(MAVERICKS_OPTIONS) default.p4 |
Carmelo Cascone | 6230a61 | 2017-09-13 03:25:41 +0200 | [diff] [blame] | 24 | sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/default/mavericks/context/context.json |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 25 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/default/montara $(MONTARA_OPTIONS) default.p4 |
Carmelo Cascone | 6230a61 | 2017-09-13 03:25:41 +0200 | [diff] [blame] | 26 | sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/default/montara/context/context.json |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 27 | cp p4c-out/default.json p4c-out/tofino/default/mavericks |
| 28 | cp p4c-out/default.json p4c-out/tofino/default/montara |
| 29 | cp p4c-out/default.p4info p4c-out/tofino/default/mavericks |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 30 | cp p4c-out/default.p4info p4c-out/tofino/default/montara |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 31 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/mavericks/default.json |
| 32 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/montara/default.json |
| 33 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/mavericks/default.p4info |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 34 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/montara/default.p4info |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 35 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 36 | empty-bmv2: empty.p4 |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 37 | p4c-bm2-ss --p4v 14 -o p4c-out/empty.json \ |
| 38 | --p4runtime-file p4c-out/empty.p4info --p4runtime-format text \ |
| 39 | empty.p4 |
| 40 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 41 | ecmp-bmv2: ecmp.p4 |
| 42 | p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/ecmp.json \ |
Carmelo Cascone | fc3776d | 2017-08-21 23:17:22 +0200 | [diff] [blame] | 43 | --p4runtime-file p4c-out/ecmp.p4info --p4runtime-format text \ |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 44 | ecmp.p4 |
| 45 | |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 46 | ecmp-tofino: ecmp.p4 |
| 47 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/ecmp/mavericks $(MAVERICKS_OPTIONS) ecmp.p4 |
Carmelo Cascone | 6230a61 | 2017-09-13 03:25:41 +0200 | [diff] [blame] | 48 | sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/ecmp/mavericks/context/context.json |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 49 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/ecmp/montara $(MONTARA_OPTIONS) ecmp.p4 |
Carmelo Cascone | 6230a61 | 2017-09-13 03:25:41 +0200 | [diff] [blame] | 50 | sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/ecmp/montara/context/context.json |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 51 | cp p4c-out/ecmp.json p4c-out/tofino/ecmp/mavericks |
| 52 | cp p4c-out/ecmp.json p4c-out/tofino/ecmp/montara |
| 53 | cp p4c-out/ecmp.p4info p4c-out/tofino/ecmp/mavericks |
| 54 | cp p4c-out/ecmp.p4info p4c-out/tofino/ecmp/montara |
| 55 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/mavericks/ecmp.json |
| 56 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/montara/ecmp.json |
| 57 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/mavericks/ecmp.p4info |
| 58 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/montara/ecmp.p4info |
| 59 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 60 | wcmp-bmv2: wcmp.p4 |
| 61 | p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/wcmp.json \ |
Carmelo Cascone | 16de6db | 2017-08-22 00:27:57 +0200 | [diff] [blame] | 62 | --p4runtime-file p4c-out/wcmp.p4info --p4runtime-format text \ |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 63 | wcmp.p4 |
| 64 | |
| 65 | clean: |
| 66 | rm -rf p4c-out/*.json |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 67 | rm -rf p4c-out/*.p4info |