| BMV2_CPU_PORT=255 |
| MAVERICKS_CPU_PORT=320 |
| MONTARA_CPU_PORT=192 |
| |
| ECMP_GROUP_SIZE=2 |
| |
| MAVERICKS_OPTIONS=-DCPU_PORT=$(MAVERICKS_CPU_PORT) -DECMP_GROUP_SIZE=$(ECMP_GROUP_SIZE) |
| MONTARA_OPTIONS=-DCPU_PORT=$(MONTARA_CPU_PORT) -DECMP_GROUP_SIZE=$(ECMP_GROUP_SIZE) |
| BMV2_OPTIONS=-DDO_BMV2_BUILD -DCPU_PORT=$(BMV2_CPU_PORT) -DECMP_GROUP_SIZE=$(ECMP_GROUP_SIZE) |
| |
| all: bmv2 |
| |
| bmv2: default-bmv2 empty-bmv2 ecmp-bmv2 wcmp-bmv2 |
| |
| tofino: default-tofino ecmp-tofino |
| |
| default-bmv2: default.p4 |
| p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/default.json \ |
| --p4runtime-file p4c-out/default.p4info --p4runtime-format text \ |
| default.p4 |
| |
| default-tofino: default.p4 |
| p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/default/mavericks $(MAVERICKS_OPTIONS) default.p4 |
| sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/default/mavericks/context/context.json |
| p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/default/montara $(MONTARA_OPTIONS) default.p4 |
| sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/default/montara/context/context.json |
| cp p4c-out/default.json p4c-out/tofino/default/mavericks |
| cp p4c-out/default.json p4c-out/tofino/default/montara |
| cp p4c-out/default.p4info p4c-out/tofino/default/mavericks |
| cp p4c-out/default.p4info p4c-out/tofino/default/montara |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/mavericks/default.json |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/montara/default.json |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/mavericks/default.p4info |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/default/montara/default.p4info |
| |
| empty-bmv2: empty.p4 |
| p4c-bm2-ss --p4v 14 -o p4c-out/empty.json \ |
| --p4runtime-file p4c-out/empty.p4info --p4runtime-format text \ |
| empty.p4 |
| |
| ecmp-bmv2: ecmp.p4 |
| p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/ecmp.json \ |
| --p4runtime-file p4c-out/ecmp.p4info --p4runtime-format text \ |
| ecmp.p4 |
| |
| ecmp-tofino: ecmp.p4 |
| p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/ecmp/mavericks $(MAVERICKS_OPTIONS) ecmp.p4 |
| sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/ecmp/mavericks/context/context.json |
| p4c-tofino --verbose 2 --new_ctx_json -o p4c-out/tofino/ecmp/montara $(MONTARA_OPTIONS) ecmp.p4 |
| sed -i -e 's/hash_action/match_with_no_key/g' p4c-out/tofino/ecmp/montara/context/context.json |
| cp p4c-out/ecmp.json p4c-out/tofino/ecmp/mavericks |
| cp p4c-out/ecmp.json p4c-out/tofino/ecmp/montara |
| cp p4c-out/ecmp.p4info p4c-out/tofino/ecmp/mavericks |
| cp p4c-out/ecmp.p4info p4c-out/tofino/ecmp/montara |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/mavericks/ecmp.json |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/montara/ecmp.json |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/mavericks/ecmp.p4info |
| sed -i -e 's/standard_metadata/ig_intr_md/g' p4c-out/tofino/ecmp/montara/ecmp.p4info |
| |
| wcmp-bmv2: wcmp.p4 |
| p4c-bm2-ss $(BMV2_OPTIONS) --p4v 14 -o p4c-out/wcmp.json \ |
| --p4runtime-file p4c-out/wcmp.p4info --p4runtime-format text \ |
| wcmp.p4 |
| |
| clean: |
| rm -rf p4c-out/*.json |
| rm -rf p4c-out/*.p4info |