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 |
| 24 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/default/montara $(MONTARA_OPTIONS) default.p4 |
| 25 | cp p4c-out/default.json p4c-out/tofino/default/mavericks |
| 26 | cp p4c-out/default.json p4c-out/tofino/default/montara |
| 27 | cp p4c-out/default.p4info p4c-out/tofino/default/mavericks |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 28 | cp p4c-out/default.p4info p4c-out/tofino/default/montara |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 29 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/mavericks/default.json |
| 30 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/montara/default.json |
| 31 | 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] | 32 | 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] | 33 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 34 | empty-bmv2: empty.p4 |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 35 | p4c-bm2-ss --p4v 14 -o p4c-out/empty.json \ |
| 36 | --p4runtime-file p4c-out/empty.p4info --p4runtime-format text \ |
| 37 | empty.p4 |
| 38 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 39 | ecmp-bmv2: ecmp.p4 |
| 40 | p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/ecmp.json \ |
Carmelo Cascone | fc3776d | 2017-08-21 23:17:22 +0200 | [diff] [blame] | 41 | --p4runtime-file p4c-out/ecmp.p4info --p4runtime-format text \ |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 42 | ecmp.p4 |
| 43 | |
Carmelo Cascone | f1d0a42 | 2017-09-07 17:21:46 +0200 | [diff] [blame] | 44 | ecmp-tofino: ecmp.p4 |
| 45 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/ecmp/mavericks $(MAVERICKS_OPTIONS) ecmp.p4 |
| 46 | p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/ecmp/montara $(MONTARA_OPTIONS) ecmp.p4 |
| 47 | cp p4c-out/ecmp.json p4c-out/tofino/ecmp/mavericks |
| 48 | cp p4c-out/ecmp.json p4c-out/tofino/ecmp/montara |
| 49 | cp p4c-out/ecmp.p4info p4c-out/tofino/ecmp/mavericks |
| 50 | cp p4c-out/ecmp.p4info p4c-out/tofino/ecmp/montara |
| 51 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/mavericks/ecmp.json |
| 52 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/montara/ecmp.json |
| 53 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/mavericks/ecmp.p4info |
| 54 | sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/montara/ecmp.p4info |
| 55 | |
Carmelo Cascone | 54fb90e | 2017-08-31 21:07:25 +0200 | [diff] [blame] | 56 | wcmp-bmv2: wcmp.p4 |
| 57 | p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/wcmp.json \ |
Carmelo Cascone | 16de6db | 2017-08-22 00:27:57 +0200 | [diff] [blame] | 58 | --p4runtime-file p4c-out/wcmp.p4info --p4runtime-format text \ |
Carmelo Cascone | b752427 | 2017-06-05 16:53:13 -0400 | [diff] [blame] | 59 | wcmp.p4 |
| 60 | |
| 61 | clean: |
| 62 | rm -rf p4c-out/*.json |
Carmelo Cascone | 5db3968 | 2017-09-07 16:36:42 +0200 | [diff] [blame] | 63 | rm -rf p4c-out/*.p4info |