P4C
The P4 Compiler
|
Public Member Functions | |
void | dbprint (std::ostream &out) const |
bool | equiv (const P4HashFunction *) const |
bool | equiv_dyn (const P4HashFunction *func) const |
bool | equiv_inputs_alg (const P4HashFunction *func) const |
bool | is_dynamic () const |
bool | is_next_bit_of_hash (const P4HashFunction *) const |
cstring | name () const |
bool | overlap (const P4HashFunction *, le_bitrange *my_overlap, le_bitrange *hash_overlap) const |
int | size () const |
void | slice (le_bitrange hash_slice) |
Public Member Functions inherited from P4::IHasDbPrint | |
void | print () const |
Public Attributes | |
IR::MAU::HashFunction | algorithm |
cstring | dyn_hash_name |
le_bitrange | hash_bits |
const IR::Expression * | hash_gen_expr = nullptr |
safe_vector< const IR::Expression * > | inputs |
LTBitMatrix | symmetrically_hashed_inputs |
|
virtual |
Implements P4::IHasDbPrint.
bool P4HashFunction::equiv_inputs_alg | ( | const P4HashFunction * | func | ) | const |
Much tighter than the actual constraint, as things like identity functions could check for better overlaps as well as random functions wouldn't matter in terms of order, but this can be expanded much later on. This will work quickly for dynamic hashing
bool P4HashFunction::overlap | ( | const P4HashFunction * | func, |
le_bitrange * | my_overlap, | ||
le_bitrange * | hash_overlap ) const |
This hash function overlap is based on the equiv function which is much more strict than an actual equiv function. This may be further improved at a later time, but will also work quickly with anything dynamic
void P4HashFunction::slice | ( | le_bitrange | hash_slice | ) |
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