P4C
The P4 Compiler
Loading...
Searching...
No Matches
Clot Class Referencefinal
Inheritance diagram for Clot:
[legend]

Public Member Functions

 Clot ()
 JSON deserialization constructor.
 
 Clot (cstring)
 
 Clot (gress_t gress)
 
 Clot (gress_t gress, unsigned tag)
 
unsigned bit_offset (cstring parser_state, const PHV::FieldSlice *slice) const
 
unsigned byte_offset (cstring parser_state, const PHV::FieldSlice *slice) const
 
const std::set< const PHV::Field * > & checksum_fields () const
 Returns all fields that need to be replaced by a checksum when deparsed.
 
const ordered_map< const PHV::Field *, const PHV::FieldSlice * > & fields_to_slices () const
 Returns all fields that have slices in this CLOT, mapped to their corresponding slice.
 
bool has_slice (const PHV::FieldSlice *slice) const
 
bool is_checksum_field (const PHV::Field *field) const
 
bool is_first_field_in_clot (const PHV::Field *field) const
 
bool is_phv_field (const PHV::Field *field) const
 
unsigned length_in_bytes (cstring parser_state) const
 
bool operator< (const Clot &clot) const
 Lexicographic ordering according to (gress, tag).
 
bool operator== (const Clot &clot) const
 Equality based on gress and tag.
 
const std::map< cstring, std::vector< const PHV::FieldSlice * > > & parser_state_to_slices () const
 
void toJSON (JSONGenerator &json) const
 JSON serialization/deserialization.
 
cstring toString () const
 
- Public Member Functions inherited from LiftCompare< Clot >
 OPERATOR (equal, Equal)
 
 OPERATOR (not_equal, NotEqual)
 
bool operator!= (const Clot &other) const
 
- Public Member Functions inherited from LiftEqual< Clot >
 OPERATOR (equal, Equal)
 
 OPERATOR (not_equal, NotEqual)
 
bool operator!= (const Clot &other) const
 
- Public Member Functions inherited from LiftLess< Clot >
 OPERATOR (equal, Equal)
 
 OPERATOR (greater, Greater)
 
 OPERATOR (greater_equal, GreaterEqual)
 
 OPERATOR (less, Less)
 
 OPERATOR (less_equal, LessEqual)
 
 OPERATOR (not_equal, NotEqual)
 
bool operator!= (const Clot &other) const
 
bool operator<= (const Clot &other) const
 
bool operator== (const Clot &other) const
 
bool operator> (const Clot &other) const
 
bool operator>= (const Clot &other) const
 

Static Public Member Functions

static ClotfromJSON (JSONLoader &json)
 

Public Attributes

std::map< const PHV::Field *, unsigned > checksum_field_to_checksum_id
 
std::optional< unsigned > csum_unit
 Indicates the checksum engine (if any) that will deposit in this CLOT.
 
gress_t gress
 The gress to which this CLOT is assigned.
 
const IR::BFN::FieldLVal * pov_bit = nullptr
 
std::optional< unsigned > stack_depth = std::nullopt
 
std::optional< unsigned > stack_inc = std::nullopt
 
unsigned tag
 Identifies the hardware CLOT associated with this object.
 

Static Public Attributes

static std::map< gress_t, int > tag_count
 

Friends

class ClotInfo
 
class GreedyClotAllocator
 

Member Function Documentation

◆ bit_offset()

unsigned Clot::bit_offset ( cstring parser_state,
const PHV::FieldSlice * slice ) const

Returns the bit offset of a field slice within this CLOT. An error occurs if the CLOT does not contain the exact field slice (i.e., if the given field slice is not completely covered by this CLOT, or if the CLOT contains a larger slice of the field).

◆ byte_offset()

unsigned Clot::byte_offset ( cstring parser_state,
const PHV::FieldSlice * slice ) const

Returns the byte offset of a field slice within this CLOT. An error occurs if the CLOT does not contain the exact field slice (i.e., if the given field slice is not completely covered by this CLOT, or if the CLOT contains a larger slice of the field).

◆ has_slice()

bool Clot::has_slice ( const PHV::FieldSlice * slice) const
Returns
true when this CLOT has the exact slice.

◆ is_checksum_field()

bool Clot::is_checksum_field ( const PHV::Field * field) const
Returns
true when field is a checksum field, and this CLOT has (a slice of) field.

◆ is_first_field_in_clot()

bool Clot::is_first_field_in_clot ( const PHV::Field * field) const
Returns
true when the first slice in this CLOT is part of the given field field.

◆ is_phv_field()

bool Clot::is_phv_field ( const PHV::Field * field) const
Returns
true when field is a PHV-allocated field, and this CLOT has (a slice of) field.

◆ operator<()

bool Clot::operator< ( const Clot & clot) const
inlinevirtual

Lexicographic ordering according to (gress, tag).

Implements LiftLess< Clot >.

◆ operator==()

bool Clot::operator== ( const Clot & clot) const
inlinevirtual

Equality based on gress and tag.

Implements LiftEqual< Clot >.

◆ parser_state_to_slices()

const std::map< cstring, std::vector< const PHV::FieldSlice * > > & Clot::parser_state_to_slices ( ) const
inline

Return map which contains the field slices in the CLOT depending on which parser state the CLOT began in.

Member Data Documentation

◆ tag_count

std::map< gress_t, int > Clot::tag_count
static

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