P4C
The P4 Compiler
|
Typedefs | |
using | DigestFieldList |
using | EndStates = std::map<cstring, ordered_map<cstring, ordered_set<cstring>>> |
using | ExtractToState = assoc::map<const IR::Member *, const IR::ParserState *> |
using | StateToExtracts = assoc::map<const IR::ParserState *, std::vector<const IR::Member *>> |
Functions | |
void | add_custom_enum_if_crc_poly (const IR::Expression *expr, IR::Vector< IR::Argument > &declArgs) |
void | add_custom_enum_if_crc_poly (const IR::Expression *expr, IR::Vector< IR::Argument > *declArgs) |
unsigned long | computeHashOverFieldList (const IR::Expression *expr, std::map< unsigned long, unsigned > &hashIndexMap, bool reserve_entry_zero) |
CONVERT_PRIMITIVE (add,) | |
CONVERT_PRIMITIVE (add_header,) | |
CONVERT_PRIMITIVE (add_to_field,) | |
CONVERT_PRIMITIVE (bit_and,) | |
CONVERT_PRIMITIVE (bit_andca,) | |
CONVERT_PRIMITIVE (bit_andcb,) | |
CONVERT_PRIMITIVE (bit_nand,) | |
CONVERT_PRIMITIVE (bit_nor,) | |
CONVERT_PRIMITIVE (bit_not,) | |
CONVERT_PRIMITIVE (bit_or,) | |
CONVERT_PRIMITIVE (bit_orca,) | |
CONVERT_PRIMITIVE (bit_orcb,) | |
CONVERT_PRIMITIVE (bit_xnor,) | |
CONVERT_PRIMITIVE (bit_xor,) | |
CONVERT_PRIMITIVE (bypass_egress) | |
CONVERT_PRIMITIVE (bypass_egress, 1) | |
CONVERT_PRIMITIVE (clone_e2e, 1) | |
CONVERT_PRIMITIVE (clone_e2e,) | |
CONVERT_PRIMITIVE (clone_egress_pkt_to_egress, 1) | |
CONVERT_PRIMITIVE (clone_egress_pkt_to_egress,) | |
CONVERT_PRIMITIVE (clone_i2e, 1) | |
CONVERT_PRIMITIVE (clone_i2e,) | |
CONVERT_PRIMITIVE (clone_ingress_pkt_to_egress, 1) | |
CONVERT_PRIMITIVE (clone_ingress_pkt_to_egress,) | |
CONVERT_PRIMITIVE (copy_header,) | |
CONVERT_PRIMITIVE (count,) | |
CONVERT_PRIMITIVE (count_from_hash) | |
CONVERT_PRIMITIVE (count_from_hash, 2) | |
CONVERT_PRIMITIVE (drop, 1) | |
CONVERT_PRIMITIVE (drop,) | |
CONVERT_PRIMITIVE (execute_meter, 5) | |
CONVERT_PRIMITIVE (execute_meter, 6) | |
CONVERT_PRIMITIVE (execute_meter,) | |
CONVERT_PRIMITIVE (execute_meter_from_hash) | |
CONVERT_PRIMITIVE (execute_meter_from_hash, 1) | |
CONVERT_PRIMITIVE (execute_meter_from_hash_with_or) | |
CONVERT_PRIMITIVE (execute_meter_from_hash_with_or, 1) | |
CONVERT_PRIMITIVE (execute_meter_with_or) | |
CONVERT_PRIMITIVE (execute_meter_with_or, 1) | |
CONVERT_PRIMITIVE (exit,) | |
CONVERT_PRIMITIVE (funnel_shift_right,) | |
CONVERT_PRIMITIVE (generate_digest, 1) | |
CONVERT_PRIMITIVE (generate_digest,) | |
CONVERT_PRIMITIVE (invalidate) | |
CONVERT_PRIMITIVE (invalidate, 1) | |
CONVERT_PRIMITIVE (invalidate_digest) | |
CONVERT_PRIMITIVE (invalidate_digest, 1) | |
CONVERT_PRIMITIVE (mark_for_drop, 1) | |
CONVERT_PRIMITIVE (mark_for_drop,) | |
CONVERT_PRIMITIVE (mark_to_drop, 1) | |
CONVERT_PRIMITIVE (max,) | |
CONVERT_PRIMITIVE (min,) | |
CONVERT_PRIMITIVE (modify_field,) | |
CONVERT_PRIMITIVE (modify_field_conditionally,) | |
CONVERT_PRIMITIVE (modify_field_from_rng,) | |
CONVERT_PRIMITIVE (modify_field_rng_uniform, 2) | |
CONVERT_PRIMITIVE (modify_field_rng_uniform,) | |
CONVERT_PRIMITIVE (modify_field_with_hash_based_offset, 1) | |
CONVERT_PRIMITIVE (modify_field_with_hash_based_offset, 2) | |
CONVERT_PRIMITIVE (modify_field_with_hash_based_offset,) | |
CONVERT_PRIMITIVE (modify_field_with_shift,) | |
CONVERT_PRIMITIVE (no_op,) | |
CONVERT_PRIMITIVE (pop,) | |
CONVERT_PRIMITIVE (push,) | |
CONVERT_PRIMITIVE (recirculate, 5) | |
CONVERT_PRIMITIVE (recirculate, 8) | |
CONVERT_PRIMITIVE (recirculate,) | |
CONVERT_PRIMITIVE (recirculate_preserving_field_list, 5) | |
CONVERT_PRIMITIVE (register_read,) | |
CONVERT_PRIMITIVE (register_write,) | |
CONVERT_PRIMITIVE (remove_header,) | |
CONVERT_PRIMITIVE (resubmit, 1) | |
CONVERT_PRIMITIVE (resubmit,) | |
CONVERT_PRIMITIVE (sample_e2e) | |
CONVERT_PRIMITIVE (sample_e2e, 1) | |
CONVERT_PRIMITIVE (shift_left,) | |
CONVERT_PRIMITIVE (shift_right,) | |
CONVERT_PRIMITIVE (subtract,) | |
CONVERT_PRIMITIVE (subtract_from_field,) | |
CONVERT_PRIMITIVE (swap) | |
CONVERT_PRIMITIVE (swap, 1) | |
CONVERT_PRIMITIVE (truncate,) | |
IR::BlockStatement * | generate_arch_neutral_hash_block_statement (P4V1::ProgramStructure *structure, const IR::Primitive *prim, const cstring temp, ExpressionConverter &conv, unsigned num_ops) |
IR::BlockStatement * | generate_hash_block_statement (P4V1::ProgramStructure *structure, const IR::Primitive *prim, const cstring temp, ExpressionConverter &conv, unsigned num_ops) |
const IR::BlockStatement * | generate_recirc_port_assignment (const IR::Expression *port) |
IR::BlockStatement * | generate_tna_hash_block_statement (P4V1::TnaProgramStructure *structure, const IR::Primitive *prim, const cstring temp, ExpressionConverter &conv, unsigned num_ops, const IR::Expression *dest=nullptr) |
bool | use_v1model () |
Variables | |
const std::map< cstring, int > | intrinsic_metadata |
const std::vector< std::tuple< cstring, cstring, IR::Direction > > | intrinsic_metadata_type |
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
using P4::P4V1::DigestFieldList |
void P4::P4V1::add_custom_enum_if_crc_poly | ( | const IR::Expression * | expr, |
IR::Vector< IR::Argument > * | declArgs ) |
TNA hash extern has two constructors: Hash(HashAlgorithm_t) Hash(HashAlgorithm_t, CRCPolynomial)
The second constructor could be Hash(crc_poly) if the frontend implements a more intelligent name lookup that is not only based on number of arguments. For now, we will insert an HashAlgorithm_t.CUSTOM.
IR::BlockStatement * P4::P4V1::generate_arch_neutral_hash_block_statement | ( | P4V1::ProgramStructure * | structure, |
const IR::Primitive * | prim, | ||
const cstring | temp, | ||
ExpressionConverter & | conv, | ||
unsigned | num_ops ) |
Generate code template that bypasses architecture definition and uses internal architecture independent definition for hashes.
IR::BlockStatement * P4::P4V1::generate_tna_hash_block_statement | ( | P4V1::TnaProgramStructure * | structure, |
const IR::Primitive * | prim, | ||
const cstring | temp, | ||
ExpressionConverter & | conv, | ||
unsigned | num_ops, | ||
const IR::Expression * | dest = nullptr ) |
Generate code template that matches to TNA architecture.
const std::map<cstring, int> P4::P4V1::intrinsic_metadata |