Carmelo Cascone | a14a5d3 | 2018-05-30 16:56:04 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -x |
| 4 | |
| 5 | P4_SRC_DIR=$1 |
| 6 | MAVERICKS_OPTIONS=$2 |
| 7 | MONTARA_OPTIONS=$3 |
| 8 | OTHER_PP_FLAGS=$4 |
| 9 | NAME=$5 |
| 10 | |
| 11 | p4c -x p4-16 -b tofino-v1model-barefoot \ |
| 12 | -I ${P4_SRC_DIR} \ |
| 13 | ${MAVERICKS_OPTIONS} ${OTHER_PP_FLAGS} -o p4c-out/tofino/${NAME}/mavericks \ |
| 14 | --p4runtime-file p4c-out/tofino/${NAME}/mavericks/fabric.p4info \ |
| 15 | --p4runtime-format text main.p4 |
| 16 | p4c -x p4-16 -b tofino-v1model-barefoot \ |
| 17 | -I ${P4_SRC_DIR} \ |
| 18 | ${MONTARA_OPTIONS} ${OTHER_PP_FLAGS} -o p4c-out/tofino/${NAME}/montara \ |
| 19 | --p4runtime-file p4c-out/tofino/${NAME}/montara/fabric.p4info \ |
| 20 | --p4runtime-format text main.p4 |
| 21 | sed -i 's/FabricIngress\.//g' p4c-out/tofino/${NAME}/*/*.p4info |
| 22 | sed -i 's/FabricEgress\.//g' p4c-out/tofino/${NAME}/*/*.p4info |
| 23 | sed -i 's/FabricIngress\.//g' p4c-out/tofino/${NAME}/*/context.json |
| 24 | sed -i 's/FabricEgress\.//g' p4c-out/tofino/${NAME}/*/context.json |