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