blob: 0fede1c09ac9699b60e6180521869640f186ec83 [file] [log] [blame]
Carmelo Cascone228092b2018-06-15 20:41:10 +02001#!/usr/bin/env bash
2
3set -ex
4
5BMV2_CPU_PORT="255"
Carmelo Cascone0c8d73e2018-09-07 16:31:06 -07006BMV2_PP_FLAGS="-DTARGET_BMV2 -DCPU_PORT=${BMV2_CPU_PORT} -DWITH_PORT_COUNTER"
Carmelo Cascone228092b2018-06-15 20:41:10 +02007
8PROFILE=$1
9OTHER_PP_FLAGS=$2
10
11OUT_DIR=./p4c-out/${PROFILE}/bmv2/default
12
13mkdir -p ${OUT_DIR}
14
15p4c-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 Cascone6880ba62018-09-06 00:04:34 -070021
22echo ${BMV2_CPU_PORT} > ${OUT_DIR}/cpu_port.txt