blob: 76323c2a8caadc89508715725b45c801789b56e6 [file] [log] [blame]
Carmelo Cascone04098db2018-01-30 18:10:32 -08001P4_SRC_DIR=$(ONOS_ROOT)/pipelines/fabric/src/main/resources
2
3MAVERICKS_CPU_PORT=320
Carmelo Cascone0fbc9082018-02-11 13:02:37 -08004MONTARA_CPU_PORT=192
Carmelo Cascone04098db2018-01-30 18:10:32 -08005
6MAVERICKS_OPTIONS=-DCPU_PORT=$(MAVERICKS_CPU_PORT)
Carmelo Cascone0fbc9082018-02-11 13:02:37 -08007MONTARA_OPTIONS=-DCPU_PORT=$(MONTARA_CPU_PORT)
Carmelo Cascone04098db2018-01-30 18:10:32 -08008
9all: fabric-tofino fabric-spgw-tofino
Carmelo Cascone04888222018-03-19 22:18:12 -070010int: fabric-int-tofino fabric-spgw-int-tofino
Carmelo Cascone04098db2018-01-30 18:10:32 -080011
12fabric-tofino:
13 p4c -x p4-16 -b tofino-v1model-barefoot \
14 -I $(P4_SRC_DIR) \
15 $(MAVERICKS_OPTIONS) -o p4c-out/tofino/fabric/mavericks \
16 --p4runtime-file p4c-out/tofino/fabric/mavericks/fabric.p4info \
17 --p4runtime-format text main.p4
18 p4c -x p4-16 -b tofino-v1model-barefoot \
19 -I $(P4_SRC_DIR) \
Carmelo Cascone0fbc9082018-02-11 13:02:37 -080020 $(MONTARA_OPTIONS) -o p4c-out/tofino/fabric/montara \
21 --p4runtime-file p4c-out/tofino/fabric/montara/fabric.p4info \
Carmelo Cascone04098db2018-01-30 18:10:32 -080022 --p4runtime-format text main.p4
23
24fabric-spgw-tofino:
25 p4c -x p4-16 -b tofino-v1model-barefoot \
26 -I $(P4_SRC_DIR) \
27 $(MAVERICKS_OPTIONS) -DWITH_SPGW -o p4c-out/tofino/fabric-spgw/mavericks \
28 --p4runtime-file p4c-out/tofino/fabric-spgw/mavericks/fabric.p4info \
29 --p4runtime-format text main.p4
30 p4c -x p4-16 -b tofino-v1model-barefoot \
31 -I $(P4_SRC_DIR) \
Carmelo Cascone0fbc9082018-02-11 13:02:37 -080032 $(MONTARA_OPTIONS) -DWITH_SPGW -o p4c-out/tofino/fabric-spgw/montara \
33 --p4runtime-file p4c-out/tofino/fabric-spgw/montara/fabric.p4info \
Carmelo Cascone04098db2018-01-30 18:10:32 -080034 --p4runtime-format text main.p4
35
Carmelo Casconee2c568f2018-03-24 15:03:40 -070036fabric-spgw-int-tofino: fabric-spgw-int-1-tofino fabric-spgw-int-2-tofino
37
38fabric-spgw-int-1-tofino:
Carmelo Cascone04888222018-03-19 22:18:12 -070039 p4c -x p4-16 -b tofino-v1model-barefoot \
40 -I $(P4_SRC_DIR) \
Carmelo Casconee2c568f2018-03-24 15:03:40 -070041 $(MAVERICKS_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=100 -o p4c-out/tofino/fabric-spgw-int-1/mavericks \
42 --p4runtime-file p4c-out/tofino/fabric-spgw-int-1/mavericks/fabric.p4info \
Carmelo Cascone04888222018-03-19 22:18:12 -070043 --p4runtime-format text main.p4
44 p4c -x p4-16 -b tofino-v1model-barefoot \
45 -I $(P4_SRC_DIR) \
Carmelo Casconee2c568f2018-03-24 15:03:40 -070046 $(MONTARA_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=100 -o p4c-out/tofino/fabric-spgw-int-1/montara \
47 --p4runtime-file p4c-out/tofino/fabric-spgw-int-1/montara/fabric.p4info \
Carmelo Cascone04888222018-03-19 22:18:12 -070048 --p4runtime-format text main.p4
Carmelo Casconee2c568f2018-03-24 15:03:40 -070049 sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/*.p4info
50 sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/*.p4info
51 sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/context.json
52 sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/context.json
53
54fabric-spgw-int-2-tofino:
55 p4c -x p4-16 -b tofino-v1model-barefoot \
56 -I $(P4_SRC_DIR) \
57 $(MAVERICKS_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=200 -o p4c-out/tofino/fabric-spgw-int-2/mavericks \
58 --p4runtime-file p4c-out/tofino/fabric-spgw-int-2/mavericks/fabric.p4info \
59 --p4runtime-format text main.p4
60 p4c -x p4-16 -b tofino-v1model-barefoot \
61 -I $(P4_SRC_DIR) \
62 $(MONTARA_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=200 -o p4c-out/tofino/fabric-spgw-int-2/montara \
63 --p4runtime-file p4c-out/tofino/fabric-spgw-int-2/montara/fabric.p4info \
64 --p4runtime-format text main.p4
65 sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/*.p4info
66 sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/*.p4info
67 sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/context.json
68 sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/context.json
Carmelo Cascone04888222018-03-19 22:18:12 -070069
70fabric-int-tofino:
71 p4c -x p4-16 -b tofino-v1model-barefoot \
72 -I $(P4_SRC_DIR) \
73 $(MAVERICKS_OPTIONS) -DWITH_INT_TRANSIT -o p4c-out/tofino/fabric-int/mavericks \
74 --p4runtime-file p4c-out/tofino/fabric-int/mavericks/fabric.p4info \
75 --p4runtime-format text main.p4
76 p4c -x p4-16 -b tofino-v1model-barefoot \
77 -I $(P4_SRC_DIR) \
78 $(MONTARA_OPTIONS) -DWITH_INT_TRANSIT -o p4c-out/tofino/fabric-int/montara \
79 --p4runtime-file p4c-out/tofino/fabric-int/montara/fabric.p4info \
80 --p4runtime-format text main.p4
81
Carmelo Cascone04098db2018-01-30 18:10:32 -080082clean:
83 rm -rf p4c-out/*