P4C
The P4 Compiler
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
HashExpr Class Referenceabstract

#include <hashexpr.h>

Inheritance diagram for HashExpr:
[legend]

Classes

class  Crc
 
class  Mask
 
class  PhvRef
 
class  Random
 
class  SExtend
 
class  Slice
 
class  Stripe
 
class  Xor
 
class  XorHash
 XOR hashing algorithm implemented on the hashing matrix. More...
 

Public Member Functions

virtual void build_algorithm ()=0
 
virtual bool check_ixbar (InputXbar *ix, InputXbar::HashTable ht)=0
 
virtual void dbprint (std::ostream &out) const
 
void find_input (Phv::Ref what, std::vector< ixbar_input_t > &inputs, InputXbar *ix, InputXbar::HashTable hash_table)
 
virtual void gen_data (bitvec &data, int bit, InputXbar *ix, InputXbar::HashTable hash_table)
 
void gen_ixbar_init (ixbar_init_t *ixbar_init, std::vector< ixbar_input_t > &inputs, std::vector< hash_matrix_output_t > &outputs, int logical_hash_bit, InputXbar *ix, InputXbar::HashTable hash_table)
 
virtual void gen_ixbar_inputs (std::vector< ixbar_input_t > &inputs, InputXbar *ix, InputXbar::HashTable hash_table)=0
 
virtual Phv::Refget_ghost_slice ()
 
std::vector< Phv::Refget_sources (int bit) const
 
virtual void get_sources (int bit, std::vector< Phv::Ref > &) const =0
 
virtual int input_size ()=0
 
virtual bool match_phvref (const Phv::Ref &ref)
 
bool operator!= (const HashExpr &a) const
 
virtual bool operator== (const HashExpr &) const =0
 
virtual int width ()=0
 
- Public Member Functions inherited from P4::IHasDbPrint
void print () const
 

Static Public Member Functions

static HashExprcreate (gress_t, int stage, const value_t &)
 

Public Attributes

bfn_hash_algorithm_t hash_algorithm = {}
 
int lineno
 

Protected Member Functions

 HashExpr (int l)
 

Detailed Description

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

Member Function Documentation

◆ dbprint()

virtual void HashExpr::dbprint ( std::ostream & out) const
inlinevirtual

Implements P4::IHasDbPrint.

◆ gen_data()

void HashExpr::gen_data ( bitvec & data,
int logical_hash_bit,
InputXbar * ix,
InputXbar::HashTable hash_table )
virtual

The function call for PhvRef, Random, Identity, and Crc functions. The input xbar is initialized, and the data returned writes out a vector of inputs. For Stripe, Slice, and others, they recursively will call this function

◆ gen_ixbar_init()

void HashExpr::gen_ixbar_init ( ixbar_init_t * ixbar_init,
std::vector< ixbar_input_t > & inputs,
std::vector< hash_matrix_output_t > & outputs,
int logical_hash_bit,
InputXbar * ix,
InputXbar::HashTable hash_table )

Generating a list of ixbar_input_t and hash_matrix_output_t to be sent to the dynamic_hash library. The vectors are part of the function call as they must be on the stack to avoid using new and delete