Carmelo Cascone | 228092b | 2018-06-15 20:41:10 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
2 | |||||
3 | set -ex | ||||
4 | |||||
5 | BMV2_CPU_PORT="255" | ||||
6 | BMV2_PP_FLAGS="-DTARGET_BMV2 -DCPU_PORT=${BMV2_CPU_PORT}" | ||||
7 | |||||
8 | PROFILE=$1 | ||||
9 | OTHER_PP_FLAGS=$2 | ||||
10 | |||||
11 | OUT_DIR=./p4c-out/${PROFILE}/bmv2/default | ||||
12 | |||||
13 | mkdir -p ${OUT_DIR} | ||||
14 | |||||
15 | p4c-bm2-ss --arch v1model \ | ||||
16 | -o ${OUT_DIR}/bmv2.json \ | ||||
17 | ${BMV2_PP_FLAGS} ${OTHER_PP_FLAGS} \ | ||||
18 | --p4runtime-file ${OUT_DIR}/p4info.txt \ | ||||
19 | --p4runtime-format text \ | ||||
20 | fabric.p4 |