blob: 54830ea1cc72d879b2ac1b7791a2d4f44839c1d4 [file] [log] [blame]
#!/usr/bin/env bash
set -x
P4_SRC_DIR=$1
MAVERICKS_OPTIONS=$2
MONTARA_OPTIONS=$3
OTHER_PP_FLAGS=$4
NAME=$5
p4c -x p4-16 -b tofino-v1model-barefoot \
-I ${P4_SRC_DIR} \
${MAVERICKS_OPTIONS} ${OTHER_PP_FLAGS} -o p4c-out/tofino/${NAME}/mavericks \
--p4runtime-file p4c-out/tofino/${NAME}/mavericks/fabric.p4info \
--p4runtime-format text main.p4
p4c -x p4-16 -b tofino-v1model-barefoot \
-I ${P4_SRC_DIR} \
${MONTARA_OPTIONS} ${OTHER_PP_FLAGS} -o p4c-out/tofino/${NAME}/montara \
--p4runtime-file p4c-out/tofino/${NAME}/montara/fabric.p4info \
--p4runtime-format text main.p4
sed -i 's/FabricIngress\.//g' p4c-out/tofino/${NAME}/*/*.p4info
sed -i 's/FabricEgress\.//g' p4c-out/tofino/${NAME}/*/*.p4info
sed -i 's/FabricIngress\.//g' p4c-out/tofino/${NAME}/*/context.json
sed -i 's/FabricEgress\.//g' p4c-out/tofino/${NAME}/*/context.json