-
Notifications
You must be signed in to change notification settings - Fork 3
/
2486.p4
373 lines (366 loc) · 12.3 KB
/
2486.p4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
/*Invoking preprocessor
cpp -C -undef -nostdinc -x assembler-with-cpp -I/mnt/windows/Projekte/p4_tv/modules/p4c/build/p4include bugs/crash/conditional_execution_p4test.p4.txt
FrontEnd_0_P4V1::getV1ModelVersion
ParseAnnotationBodies_0_ParseAnnotations
ParseAnnotationBodies_1_ClearTypeMap
FrontEnd_1_ParseAnnotationBodies
FrontEnd_2_PrettyPrint
FrontEnd_3_ValidateParsedProgram
FrontEnd_4_CreateBuiltins
FrontEnd_5_ResolveReferences
ConstantFolding_0_DoConstantFolding
FrontEnd_6_ConstantFolding
InstantiateDirectCalls_0_ResolveReferences
InstantiateDirectCalls_1_DoInstantiateCalls
FrontEnd_7_InstantiateDirectCalls
FrontEnd_8_ResolveReferences
Deprecated_0_ResolveReferences
Deprecated_1_CheckDeprecated
FrontEnd_9_Deprecated
FrontEnd_10_CheckNamedArgs
FrontEnd_11_TypeInference
FrontEnd_12_ValidateMatchAnnotations
BindTypeVariables_0_ClearTypeMap
BindTypeVariables_1_ResolveReferences
BindTypeVariables_2_TypeInference
BindTypeVariables_3_DoBindTypeVariables
FrontEnd_13_BindTypeVariables
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
DefaultArguments_0_TypeChecking
DefaultArguments_1_DoDefaultArguments
FrontEnd_14_DefaultArguments
FrontEnd_15_ResolveReferences
FrontEnd_16_TypeInference
RemoveParserControlFlow_0_DoRemoveParserControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
RemoveParserControlFlow_1_SimplifyControlFlow
FrontEnd_17_RemoveParserControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
StructInitializers_0_TypeChecking
StructInitializers_1_CreateStructInitializers
StructInitializers_2_ClearTypeMap
FrontEnd_18_StructInitializers
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SpecializeGenericFunctions_0_TypeChecking
SpecializeGenericFunctions_1_FindFunctionSpecializations
SpecializeGenericFunctions_2_SpecializeFunctions
FrontEnd_19_SpecializeGenericFunctions
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
TableKeyNames_0_TypeChecking
TableKeyNames_1_DoTableKeyNames
FrontEnd_20_TableKeyNames
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
ConstantFolding_0_TypeChecking
ConstantFolding_1_DoConstantFolding
ConstantFolding_2_ClearTypeMap
PassRepeated_0_ConstantFolding
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
P4::TypeChecking_2_ApplyTypesToExpressions
P4::TypeChecking_3_ResolveReferences
P4::StrengthReduction_0_TypeChecking
P4::StrengthReduction_1_StrengthReduction
PassRepeated_1_StrengthReduction
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
UselessCasts_0_TypeChecking
UselessCasts_1_RemoveUselessCasts
PassRepeated_2_UselessCasts
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
ConstantFolding_3_TypeChecking
ConstantFolding_4_DoConstantFolding
ConstantFolding_5_ClearTypeMap
PassRepeated_3_ConstantFolding
P4::TypeChecking_4_ResolveReferences
P4::TypeChecking_5_TypeInference
P4::TypeChecking_6_ApplyTypesToExpressions
P4::TypeChecking_7_ResolveReferences
P4::StrengthReduction_2_TypeChecking
P4::StrengthReduction_3_StrengthReduction
PassRepeated_4_StrengthReduction
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
UselessCasts_2_TypeChecking
UselessCasts_3_RemoveUselessCasts
PassRepeated_5_UselessCasts
FrontEnd_21_PassRepeated
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
FrontEnd_22_SimplifyControlFlow
FrontEnd_23_SwitchAddDefault
FrontEnd_24_FrontEndDump
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
PassRepeated_2_ResolveReferences
PassRepeated_3_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
FrontEnd_25_RemoveAllUnusedDeclarations
SimplifyParsers_0_ResolveReferences
SimplifyParsers_1_DoSimplifyParsers
FrontEnd_26_SimplifyParsers
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
ResetHeaders_0_TypeChecking
ResetHeaders_1_DoResetHeaders
FrontEnd_27_ResetHeaders
UniqueNames_0_ResolveReferences
UniqueNames_1_FindSymbols
UniqueNames_2_RenameSymbols
FrontEnd_28_UniqueNames
FrontEnd_29_MoveDeclarations
FrontEnd_30_MoveInitializers
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SideEffectOrdering_0_TypeChecking
SideEffectOrdering_1_DoSimplifyExpressions
FrontEnd_31_SideEffectOrdering
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SetHeaders_0_TypeChecking
SetHeaders_1_DoSetHeaders
FrontEnd_32_SetHeaders
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
SimplifyControlFlow_2_TypeChecking
SimplifyControlFlow_3_DoSimplifyControlFlow
FrontEnd_33_SimplifyControlFlow
FrontEnd_34_MoveDeclarations
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyDefUse_0_TypeChecking
SimplifyDefUse_1_DoSimplifyDefUse
FrontEnd_35_SimplifyDefUse
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
UniqueParameters_0_TypeChecking
UniqueParameters_1_(anonymous namespace)::FindActionCalls
UniqueParameters_2_FindParameters
UniqueParameters_3_RenameSymbols
UniqueParameters_4_ClearTypeMap
FrontEnd_36_UniqueParameters
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
FrontEnd_37_SimplifyControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
ConstantFolding_0_TypeChecking
ConstantFolding_1_DoConstantFolding
ConstantFolding_2_ClearTypeMap
SpecializeAll_0_ConstantFolding
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SpecializeAll_1_TypeChecking
SpecializeAll_2_FindSpecializations
SpecializeAll_3_Specialize
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
SpecializeAll_4_RemoveAllUnusedDeclarations
FrontEnd_38_SpecializeAll
RemoveParserControlFlow_0_DoRemoveParserControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
RemoveParserControlFlow_1_SimplifyControlFlow
FrontEnd_39_RemoveParserControlFlow
RemoveReturns_0_ResolveReferences
RemoveReturns_1_DoRemoveReturns
FrontEnd_40_RemoveReturns
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
RemoveDontcareArgs_0_TypeChecking
RemoveDontcareArgs_1_DontcareArgs
RemoveDontcareArgs_2_ClearTypeMap
FrontEnd_41_RemoveDontcareArgs
MoveConstructors_0_ResolveReferences
MoveConstructors_1_MoveConstructorsImpl
FrontEnd_42_MoveConstructors
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
FrontEnd_43_RemoveAllUnusedDeclarations
FrontEnd_44_ClearTypeMap
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
P4::TypeChecking_1_TypeInference
EvaluatorPass_0_TypeChecking
EvaluatorPass_0_TypeChecking
EvaluatorPass_1_Evaluator
EvaluatorPass_1_Evaluator
FrontEnd_45_EvaluatorPass
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
P4::InlinePass_0_TypeChecking
P4::InlinePass_1_DiscoverInlining
P4::InlinePass_2_InlineDriver
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
P4::InlinePass_3_RemoveAllUnusedDeclarations
P4::Inline_0_InlinePass
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
P4::TypeChecking_3_TypeInference
EvaluatorPass_2_TypeChecking
EvaluatorPass_2_TypeChecking
EvaluatorPass_3_Evaluator
EvaluatorPass_3_Evaluator
P4::Inline_1_EvaluatorPass
FrontEnd_46_Inline
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
InlineActions_0_TypeChecking
InlineActions_1_DiscoverActionsInlining
InlineActions_2_InlineDriver
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
InlineActions_3_RemoveAllUnusedDeclarations
FrontEnd_47_InlineActions
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
InlineFunctions_0_TypeChecking
InlineFunctions_1_DiscoverFunctionsInlining
InlineFunctions_2_InlineDriver
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
InlineFunctions_3_RemoveAllUnusedDeclarations
FrontEnd_48_InlineFunctions
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
CheckConstants_0_TypeChecking
CheckConstants_1_DoCheckConstants
FrontEnd_49_CheckConstants
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
FrontEnd_50_SimplifyControlFlow
RemoveParserControlFlow_0_DoRemoveParserControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
RemoveParserControlFlow_1_SimplifyControlFlow
FrontEnd_51_RemoveParserControlFlow
UniqueNames_0_ResolveReferences
UniqueNames_1_FindSymbols
UniqueNames_2_RenameSymbols
FrontEnd_52_UniqueNames
LocalizeAllActions_0_TagGlobalActions
PassRepeated_0_ResolveReferences
PassRepeated_1_FindGlobalActionUses
PassRepeated_2_LocalizeActions
LocalizeAllActions_1_PassRepeated
LocalizeAllActions_2_ResolveReferences
LocalizeAllActions_3_FindRepeatedActionUses
LocalizeAllActions_4_DuplicateActions
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
PassRepeated_2_ResolveReferences
PassRepeated_3_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
LocalizeAllActions_5_RemoveAllUnusedDeclarations
FrontEnd_53_LocalizeAllActions
UniqueNames_0_ResolveReferences
UniqueNames_1_FindSymbols
UniqueNames_2_RenameSymbols
FrontEnd_54_UniqueNames
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
UniqueParameters_0_TypeChecking
UniqueParameters_1_(anonymous namespace)::FindActionCalls
UniqueParameters_2_FindParameters
UniqueParameters_3_RenameSymbols
UniqueParameters_4_ClearTypeMap
FrontEnd_55_UniqueParameters
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
FrontEnd_56_SimplifyControlFlow
FrontEnd_57_HierarchicalNames
FrontEnd_58_FrontEndLast
MidEnd_0_RemoveMiss
MidEnd_1_EliminateNewtype
MidEnd_2_EliminateSerEnums
MidEnd_3_RemoveActionParameters
MidEnd_4_SimplifyKey
MidEnd_5_RemoveExits
MidEnd_6_ConstantFolding
MidEnd_7_SimplifySelectCases
MidEnd_8_ExpandLookahead
MidEnd_9_ExpandEmit
MidEnd_10_HandleNoMatch
MidEnd_11_SimplifyParsers
MidEnd_12_StrengthReduction
MidEnd_13_EliminateTuples
MidEnd_14_SimplifyComparisons
MidEnd_15_CopyStructures
MidEnd_16_NestedStructs
MidEnd_17_SimplifySelectList
MidEnd_18_RemoveSelectBooleans
MidEnd_19_FlattenHeaders
MidEnd_20_FlattenInterfaceStructs
MidEnd_21_ReplaceSelectRange
bugs/crash/conditional_execution_p4test.p4.txt(25): [--Werror=target-error] error: swap.setValid: Conditional execution in actions unsupported on this target
ethernet_t swap = { h.eth_hdr.src_addr, h.eth_hdr.dst_addr, h.eth_hdr.eth_type };
^^^^
bugs/crash/conditional_execution_p4test.p4.txt(25): [--Werror=target-error] error: swap.setValid: Conditional execution in actions unsupported on this target
ethernet_t swap = { h.eth_hdr.src_addr, h.eth_hdr.dst_addr, h.eth_hdr.eth_type };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Done.*/
#include <core.p4>
header ethernet_t {
bit<48> dst_addr;
bit<48> src_addr;
bit<16> eth_type;
}
struct Headers {
ethernet_t eth_hdr;
}
parser p(packet_in pkt, out Headers hdr) {
state start {
transition parse_hdrs;
}
state parse_hdrs {
pkt.extract(hdr.eth_hdr);
transition accept;
}
}
control ingress(inout Headers h) {
action dummy_action() {
if(h.eth_hdr.eth_type == 0xDEAD) {
ethernet_t swap = { h.eth_hdr.src_addr, h.eth_hdr.dst_addr, h.eth_hdr.eth_type };
h.eth_hdr = swap;
}
}
apply {
dummy_action();
}
}
parser Parser(packet_in b, out Headers hdr);
control Ingress(inout Headers hdr);
package top(Parser p, Ingress ig);
top(p(), ingress()) main;