![]() |
P4C
The P4 Compiler
|
Public Member Functions | |
Clot () | |
JSON deserialization constructor. | |
Clot (cstring) | |
Clot (gress_t gress) | |
Clot (gress_t gress, unsigned tag) | |
Clot (JSONLoader &json) | |
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 |
![]() | |
OPERATOR (equal, Equal) | |
OPERATOR (not_equal, NotEqual) | |
bool | operator!= (const Clot &other) const |
![]() | |
OPERATOR (equal, Equal) | |
OPERATOR (not_equal, NotEqual) | |
bool | operator!= (const Clot &other) const |
![]() | |
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 Clot * | fromJSON (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 |
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).
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).
bool Clot::has_slice | ( | const PHV::FieldSlice * | slice | ) | const |
slice
. bool Clot::is_checksum_field | ( | const PHV::Field * | field | ) | const |
field
is a checksum field, and this CLOT has (a slice of) field
. bool Clot::is_first_field_in_clot | ( | const PHV::Field * | field | ) | const |
field
. bool Clot::is_phv_field | ( | const PHV::Field * | field | ) | const |
field
is a PHV-allocated field, and this CLOT has (a slice of) field
.
|
inlinevirtual |
Lexicographic ordering according to (gress, tag).
Implements LiftLess< Clot >.
|
inlinevirtual |
Equality based on gress and tag.
Implements LiftEqual< Clot >.
|
inline |
Return map which contains the field slices in the CLOT depending on which parser state the CLOT began in.
|
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