19#ifndef BACKENDS_TOFINO_BF_P4C_ARCH_PSA_PSA_MODEL_H_
20#define BACKENDS_TOFINO_BF_P4C_ARCH_PSA_PSA_MODEL_H_
22#include "frontends/common/model.h"
23#include "frontends/p4/coreLibrary.h"
32 : ::Model::Enum_Model(
"PSA_PacketPath_t"_cs),
34 normal_unicast(
"NORMAL_UNICAST"_cs),
35 normal_multicast(
"NORMAL_MULTICAST"_cs),
36 clone_i2e(
"CLONE_I2E"_cs),
37 clone_e2e(
"CLONE_E2E"_cs),
38 resubmit(
"RESUBMIT"_cs),
39 recirculate(
"RECIRCULATE"_cs) {}
41 ::Model::Elem normal_unicast;
42 ::Model::Elem normal_multicast;
43 ::Model::Elem clone_i2e;
44 ::Model::Elem clone_e2e;
45 ::Model::Elem resubmit;
46 ::Model::Elem recirculate;
51 : ::Model::Enum_Model(
"PSA_MeterType_t"_cs), packets(
"PACKETS"_cs), bytes(
"PACKETS"_cs) {}
52 ::Model::Elem packets;
58 : ::Model::Enum_Model(
"PSA_MeterColor_t"_cs),
69 : ::Model::Enum_Model(
"PSA_CounterType_t"_cs),
70 packets(
"PACKETS"_cs),
72 both(
"PACKETS_AND_BYTES"_cs) {}
73 ::Model::Elem packets;
80 : ::Model::Enum_Model(
"PSA_HashAlgorithm_t"_cs),
81 identify(
"IDENTITY"_cs),
83 crc16_custom(
"CRC16_CUSTOM"_cs),
85 crc32_custom(
"CRC32_CUSTOM"_cs),
86 ones_complement16(
"ONES_COMPLEMENT16"_cs),
87 target_default(
"TARGET_DEFAULT"_cs) {}
88 ::Model::Elem identify;
90 ::Model::Elem crc16_custom;
92 ::Model::Elem crc32_custom;
93 ::Model::Elem ones_complement16;
94 ::Model::Elem target_default;
99 : ::Model::Type_Model(
"psa_ingress_parser_input_metadata_t"_cs),
100 ingress_port(
"ingress_port"_cs),
101 packet_path(
"packet_path"_cs) {}
102 ::Model::Elem ingress_port;
103 ::Model::Elem packet_path;
108 : ::Model::Type_Model(
"psa_egress_parser_input_metadata_t"_cs),
109 egress_port(
"egress_port"_cs),
110 packet_path(
"packet_path"_cs) {}
111 ::Model::Elem egress_port;
112 ::Model::Elem packet_path;
117 : ::Model::Type_Model(
"psa_ingress_input_metadata_t"_cs),
118 ingress_port(
"ingress_port"_cs),
119 packet_path(
"packet_path"_cs),
120 ingress_timestamp(
"ingress_timestamp"_cs),
121 parser_error(
"parser_error"_cs) {}
122 ::Model::Elem ingress_port;
123 ::Model::Elem packet_path;
124 ::Model::Elem ingress_timestamp;
125 ::Model::Elem parser_error;
130 : ::Model::Type_Model(
"psa_ingress_output_metadata_t"_cs),
131 class_of_service(
"class_of_service"_cs),
133 clone_session_id(
"clone_session_id"_cs),
135 resubmit(
"resubmit"_cs),
136 multicast_group(
"multicast_group"_cs),
137 egress_port(
"egress_port"_cs) {}
138 ::Model::Elem class_of_service;
140 ::Model::Elem clone_session_id;
142 ::Model::Elem resubmit;
143 ::Model::Elem multicast_group;
144 ::Model::Elem egress_port;
149 : ::Model::Type_Model(
"psa_egress_input_metadata_t"_cs),
150 class_of_service(
"class_of_service"_cs),
151 egress_port(
"egress_port"_cs),
152 packet_path(
"packet_path"_cs),
153 instance(
"instance"_cs),
154 egress_timestamp(
"egress_timestamp"_cs),
155 parser_error(
"parser_error"_cs) {}
156 ::Model::Elem class_of_service;
157 ::Model::Elem egress_port;
158 ::Model::Elem packet_path;
159 ::Model::Elem instance;
160 ::Model::Elem egress_timestamp;
161 ::Model::Elem parser_error;
166 : ::Model::Type_Model(
"psa_egress_deparser_input_metadata_t"_cs),
167 egress_port(
"egress_port"_cs) {}
168 ::Model::Elem egress_port;
173 : ::Model::Type_Model(
"psa_egress_output_metadata_t"_cs),
175 clone_session_id(
"clone_session_id"_cs),
178 ::Model::Elem clone_session_id;
184 : ::Model::Type_Model(
"compiler_generated_metadata_t"_cs),
186 mirror_id(
"mirror_id"_cs),
187 mirror_source(
"mirror_source"_cs),
188 clone_src(
"clone_src"_cs),
189 clone_digest_id(
"clone_digest_id"_cs) {}
190 ::Model::Elem instance_name;
191 ::Model::Elem mirror_id;
192 ::Model::Elem mirror_source;
193 ::Model::Elem clone_src;
194 ::Model::Elem clone_digest_id;
199 : Extern_Model(
"Checksum"_cs), clear(
"clear"_cs), update(
"update"_cs), get(
"get"_cs) {}
202 ::Model::Elem update;
208 : Extern_Model(
"InternetChecksum"_cs),
211 subtract(
"subtract"_cs),
213 get_state(
"get_state"_cs),
214 set_state(
"set_state"_cs) {}
218 ::Model::Elem subtract;
220 ::Model::Elem get_state;
221 ::Model::Elem set_state;
225 Hash_Model() : Extern_Model(
"Hash"_cs), get(
"get"_cs), get_with_base(
"get"_cs) {}
228 ::Model::Elem get_with_base;
232 Random_Model() : Extern_Model(
"Random"_cs), get(
"get"_cs) {}
237 Counter_Model() : Extern_Model(
"Counter"_cs), counterType(), count(
"count"_cs) {}
243 DirectCounter_Model() : Extern_Model(
"DirectCounter"_cs), counterType(), count(
"count"_cs) {}
249 Meter_Model() : Extern_Model(
"Meter"_cs), meterType(), execute(
"execute"_cs) {}
251 ::Model::Elem execute;
255 DirectMeter_Model() : Extern_Model(
"DirectMeter"_cs), meterType(), execute(
"execute"_cs) {}
257 ::Model::Elem execute;
262 : Extern_Model(
"Register"_cs),
263 sizeParam(
"size"_cs),
264 size_type(IR::Type_Bits::get(32)),
267 ::Model::Elem sizeParam;
268 const IR::Type *size_type;
275 : Extern_Model(
"ActionProfile"_cs),
276 sizeType(IR::Type_Bits::get(32)),
277 sizeParam(
"size"_cs) {}
278 const IR::Type *sizeType;
279 ::Model::Elem sizeParam;
284 : Extern_Model(
"ActionSelector"_cs),
286 sizeType(IR::Type_Bits::get(32)),
287 sizeParam(
"size"_cs),
288 outputWidthType(IR::Type_Bits::get(32)),
289 outputWidthParam(
"outputWidth"_cs) {}
291 const IR::Type *sizeType;
292 ::Model::Elem sizeParam;
293 const IR::Type *outputWidthType;
294 ::Model::Elem outputWidthParam;
298 Digest_Model() : Extern_Model(
"Digest"_cs), pack(
"pack"_cs) {}
304 : tableImplementation(
"implementation"_cs),
305 counters(
"counters"_cs),
308 supportTimeout(
"support_timeout"_cs) {}
309 ::Model::Elem tableImplementation;
310 ::Model::Elem counters;
311 ::Model::Elem meters;
313 ::Model::Elem supportTimeout;
314 const unsigned defaultTableSize = 1024;
322 packetParam(
"buffer"_cs, P4::P4CoreLibrary::instance().packetIn, 0),
323 headersParam(
"parsed_hdr"_cs, headersType, 1),
324 metadataParam(
"user_meta"_cs, userMetaType, 2),
325 istdParam(
"istd"_cs, istdType, 3),
326 resubmitParam(
"resubmit_meta"_cs, resubmitMetaType, 4),
327 recircParam(
"recirculate_meta"_cs, recircMetaType, 5) { }
328 ::Model::Param_Model packetParam;
329 ::Model::Param_Model headersParam;
330 ::Model::Param_Model metadataParam;
331 ::Model::Param_Model istdParam;
332 ::Model::Param_Model resubmitParam;
333 ::Model::Param_Model recircParam;
340 headersParam(
"hdr"_cs, headersType, 0),
341 metadataParam(
"user_meta"_cs, userMetaType, 1),
342 istdParam(
"istd"_cs, istdType, 2),
343 ostdParam(
"ostd"_cs, ostdType, 3) { }
344 ::Model::Param_Model headersParam;
345 ::Model::Param_Model metadataParam;
346 ::Model::Param_Model istdParam;
347 ::Model::Param_Model ostdParam;
355 packetParam(
"buffer"_cs, P4::P4CoreLibrary::instance().packetIn, 0),
356 cloneParam(
"clone_i2e_meta"_cs, cloneType, 1),
357 resubmitParam(
"resubmit_meta"_cs, resubmitMetaType, 2),
358 normalMetaParam(
"normal_meta"_cs, bridgeMetaType, 3),
359 headersParam(
"hdr"_cs, headersType, 4),
360 metadataParam(
"meta"_cs, userMetaType, 5),
361 istdParam(
"istd"_cs, istdType, 6) { }
362 ::Model::Param_Model packetParam;
363 ::Model::Param_Model cloneParam;
364 ::Model::Param_Model resubmitParam;
365 ::Model::Param_Model normalMetaParam;
366 ::Model::Param_Model headersParam;
367 ::Model::Param_Model metadataParam;
368 ::Model::Param_Model istdParam;
376 packetParam(
"buffer"_cs, P4::P4CoreLibrary::instance().packetIn, 0),
377 headersParam(
"parsed_hdr"_cs, headersType, 1),
378 metadataParam(
"user_meta"_cs, userMetaType, 2),
379 istdMetaParam(
"istd"_cs, istdMetaType, 3),
380 normalMetaParam(
"normal_meta"_cs, bridgeMetaType, 4),
381 cloneI2EMetaParam(
"clone_i2e_meta"_cs, cloneI2EMetaType, 5),
382 cloneE2EMetaParam(
"clone_e2e_meta"_cs, cloneE2EMetaType, 6) { }
383 ::Model::Param_Model packetParam;
384 ::Model::Param_Model headersParam;
385 ::Model::Param_Model metadataParam;
386 ::Model::Param_Model istdMetaParam;
387 ::Model::Param_Model normalMetaParam;
388 ::Model::Param_Model cloneI2EMetaParam;
389 ::Model::Param_Model cloneE2EMetaParam;
396 headersParam(
"hdr"_cs, headersType, 0),
397 metadataParam(
"user_meta"_cs, userMetaType, 1),
398 istdParam(
"istd"_cs, istdType, 2),
399 ostdParam(
"ostd"_cs, ostdType, 3) { }
400 ::Model::Param_Model headersParam;
401 ::Model::Param_Model metadataParam;
402 ::Model::Param_Model istdParam;
403 ::Model::Param_Model ostdParam;
411 packetParam(
"buffer"_cs, P4::P4CoreLibrary::instance().packetIn, 0),
412 cloneE2EMetaParam(
"clone_e2e_meta"_cs, cloneE2EMetaType, 1),
413 recircMetaParam(
"recirculate_meta"_cs, recircMetaType, 2),
414 headersParam(
"hdr"_cs, headersType, 3),
415 metadataParam(
"meta"_cs, userMetaType, 4),
416 istdParam(
"istd"_cs, istdType, 5),
417 edstdParam(
"edstd"_cs, edstdType, 6) { }
418 ::Model::Param_Model packetParam;
419 ::Model::Param_Model cloneE2EMetaParam;
420 ::Model::Param_Model recircMetaParam;
421 ::Model::Param_Model headersParam;
422 ::Model::Param_Model metadataParam;
423 ::Model::Param_Model istdParam;
424 ::Model::Param_Model edstdParam;
430 ingressParser(
"ingress_parser"_cs),
431 ingress(
"ingress"_cs),
432 ingressDeparser(
"ingress_deparser"_cs),
433 packetReplicationEngine(
"pre"_cs),
434 egressParser(
"egress_parser"_cs),
436 egressDeparser(
"egress_deparser"_cs),
437 bufferingQueueingEngine(
"bqe"_cs) { }
438 ::Model::Elem ingressParser;
439 ::Model::Elem ingress;
440 ::Model::Elem ingressDeparser;
441 ::Model::Elem packetReplicationEngine;
442 ::Model::Elem egressParser;
443 ::Model::Elem egress;
444 ::Model::Elem egressDeparser;
445 ::Model::Elem bufferingQueueingEngine;
454 headersType(
"headers"_cs),
455 metadataType(
"metadata"_cs),
456 resubmitMetaType(
"resubmit_meta"_cs),
457 recircMetaType(
"recirc_meta"_cs),
458 cloneI2EMetaType(
"clone_i2e_meta"_cs),
459 cloneE2EMetaType(
"clone_e2e_meta"_cs),
460 bridgeMetaType(
"bridge_meta"_cs),
461 compilerGeneratedType(
"compiler_generated_meta"_cs),
462 ingress_parser(headersType, metadataType, igParserInputMetaType, resubmitMetaType,
464 ingress(headersType, metadataType, igInputMetaType, igOutputMetaType),
465 ingress_deparser(cloneI2EMetaType, resubmitMetaType, bridgeMetaType, headersType,
466 metadataType, igOutputMetaType),
467 egress_parser(headersType, metadataType, egParserInputMetaType, bridgeMetaType,
468 cloneI2EMetaType, cloneE2EMetaType),
469 egress(headersType, metadataType, egInputMetaType, egOutputMetaType),
470 egress_deparser(cloneE2EMetaType, recircMetaType, headersType, metadataType,
471 egOutputMetaType, egDeparserInputMetaType),
476 ::Model::Type_Model headersType;
477 ::Model::Type_Model metadataType;
487 ::Model::Type_Model resubmitMetaType;
488 ::Model::Type_Model recircMetaType;
489 ::Model::Type_Model cloneI2EMetaType;
490 ::Model::Type_Model cloneE2EMetaType;
491 ::Model::Type_Model bridgeMetaType;
Definition psa_model.h:449
Definition frontends/common/model.h:64
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
Definition psa_model.h:273
Definition psa_model.h:282
Definition psa_model.h:197
Definition psa_model.h:236
Definition psa_model.h:67
Definition psa_model.h:297
Definition psa_model.h:242
Definition psa_model.h:254
Definition psa_model.h:406
Definition psa_model.h:392
Definition psa_model.h:371
Definition psa_model.h:224
Definition psa_model.h:78
Definition psa_model.h:350
Definition psa_model.h:336
Definition psa_model.h:317
Definition psa_model.h:206
Definition psa_model.h:248
Definition psa_model.h:56
Definition psa_model.h:49
Definition psa_model.h:30
Definition psa_model.h:427
Definition psa_model.h:231
Definition psa_model.h:260
Definition psa_model.h:302
Definition frontends/common/model.h:28
Definition frontends/common/model.h:42