blob: 54830ea1cc72d879b2ac1b7791a2d4f44839c1d4 [file] [log] [blame]
Carmelo Casconea14a5d32018-05-30 16:56:04 -07001#!/usr/bin/env bash
2
3set -x
4
5P4_SRC_DIR=$1
6MAVERICKS_OPTIONS=$2
7MONTARA_OPTIONS=$3
8OTHER_PP_FLAGS=$4
9NAME=$5
10
11p4c -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