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" |
Carmelo Cascone | 0c8d73e | 2018-09-07 16:31:06 -0700 | [diff] [blame] | 6 | BMV2_PP_FLAGS="-DTARGET_BMV2 -DCPU_PORT=${BMV2_CPU_PORT} -DWITH_PORT_COUNTER" |
Carmelo Cascone | 228092b | 2018-06-15 20:41:10 +0200 | [diff] [blame] | 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 |
Carmelo Cascone | 6880ba6 | 2018-09-06 00:04:34 -0700 | [diff] [blame] | 21 | |
| 22 | echo ${BMV2_CPU_PORT} > ${OUT_DIR}/cpu_port.txt |