P4C
The P4 Compiler
|
Classes | |
struct | ClearLoweredParserMatch |
class | ComputeBufferRequirements |
Computes the number of bytes which must be available for each parser match to avoid a stall. More... | |
class | ComputeInitZeroContainers |
Computes containers that have fields relying on parser zero initialization. More... | |
struct | ComputeLoweredDeparserIR |
Generates lowered deparser IR with container references. More... | |
struct | ComputeLoweredParserIR |
Combines the high-level parser IR and the results of PHV allocation to produce a low-level, target-specific representation of the parser program. More... | |
class | ComputeMultiWriteContainers |
Collects all containers that are written more than once by the parser. More... | |
struct | EliminateEmptyStates |
Eliminates empty states. More... | |
struct | ExtractSimplifier |
Helper class that splits extract operations into multiple smaller extracts, such that each extract writes to exactly one PHV container. More... | |
struct | FindNegativeDeposits |
Find all of the states that do a checksum deposit but also do not extract/shift before doing it (= the end_pos is negative) and also all of the states from which we can get via 0 shift to a state that does this negative checksum deposit. More... | |
class | HoistCommonMatchOperations |
After parser lowering, we have converted the parser IR from P4 semantic (action->match) to hardware semantic (match->action), there may still be opportunities where we can merge matches where we could not before lowering (without breaking the P4 semantic). More... | |
struct | LowerDeparserIR |
struct | LowerParserIR |
struct | MergeLoweredParserStates |
After parser lowering, we have converted the parser IR from P4 semantic (action->match) to HW semantic (match->action), there may still be opportunities where we can merge states where we couldn't before lowering (without breaking the P4 semantic). More... | |
struct | RemoveNegativeDeposits |
Updates the IR so that every checksum deposit can also shift by at least one. More... | |
struct | ReplaceDeparserIR |
Replace deparser IR with lowered version. More... | |
struct | ReplaceParserIR |
The pass that replaces an IR::BRN::Parser node with an IR::BFN::LoweredParser node. More... | |
class | ResolveParserConstants |
Resolves constants in parser. More... | |
struct | RewriteEmitClot |
Replace Emits covered in a CLOT with EmitClot. More... | |
struct | RightShiftCsumMask |
struct | RightShiftPacketRVal |
struct | SplitGreedyParserStates |
This pass is used to ensure that there will be no conflicting partial_hdr_err_proc at the time the LoweredParserMatch is created. More... | |
class | WarnTernaryMatchFields |
Issues warning for invalid container participating in ternary match. More... | |
Functions | |
const safe_vector< IR::BFN::DigestField > * | computeControlPlaneFormat (const PhvInfo &phv, const IR::Vector< IR::BFN::FieldLVal > &fields) |
cstring | debugInfoFor (const cstring fieldName, const PHV::AllocSlice &slice, bool includeContainerInfo) |
cstring | debugInfoFor (const IR::BFN::Extract *extract, const PHV::AllocSlice &slice, const le_bitrange &pov_range, const cstring pov_type_string) |
cstring | debugInfoFor (const IR::BFN::Extract *extract, const PHV::AllocSlice &slice, const nw_bitrange &bufferRange, bool includeRangeInfo) |
cstring | debugInfoFor (const IR::BFN::ParserLVal *lval, const PHV::AllocSlice &slice, bool includeContainerInfo) |
std::map< PHV::Container, unsigned > | getChecksumPhvSwap (const PhvInfo &phv, const IR::BFN::EmitChecksum *emitChecksum) |
std::pair< IR::Vector< IR::BFN::ContainerRef >, std::vector< Clot * > > | lowerFields (const PhvInfo &phv, const ClotInfo &clotInfo, const IR::Vector< IR::BFN::FieldLVal > &fields, bool is_checksum) |
const IR::BFN::ContainerBitRef * | lowerSingleBit (const PhvInfo &phv, const IR::BFN::FieldLVal *fieldRef, const PHV::AllocContext *ctxt) |
const IR::BFN::ContainerRef * | lowerUnsplittableField (const PhvInfo &phv, const ClotInfo &clotInfo, const IR::BFN::FieldLVal *fieldRef, const char *unsplittableReason) |
cstring | sanitizeName (StringRef name) |
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
const safe_vector< IR::BFN::DigestField > * Parde::Lowered::computeControlPlaneFormat | ( | const PhvInfo & | phv, |
const IR::Vector< IR::BFN::FieldLVal > & | fields ) |
Given a sequence of fields, construct a packing format describing how the fields will be laid out once they're lowered to containers.
The container into which the last field was placed.
The number of unused bits which remain on the LSB side of the container after the last field was placed.
cstring Parde::Lowered::debugInfoFor | ( | const cstring | fieldName, |
const PHV::AllocSlice & | slice, | ||
bool | includeContainerInfo = true ) |
Construct debugging information describing a slice of a field.
fieldName | Field name. |
slice | An alloc_slice mapping a range of bits in the field to a range of bits in a container. |
includeContainerInfo | If true, the result will include information about which bits in the container the field slice was mapped to. |
cstring Parde::Lowered::debugInfoFor | ( | const IR::BFN::Extract * | extract, |
const PHV::AllocSlice & | slice, | ||
const le_bitrange & | pov_range, | ||
const cstring | pov_type_string ) |
Construct a string describing how an Extract
primitive was mapped to a hardware extract operation (in case of extract from POV (state/flags) bits).
extract | The original Extract primitive, with a field as the destination. |
slice | An alloc_slice mapping a range of bits in the field to a range of bits in a container. |
pov_range | The range corresponding to the bits from POV state/flags bits. |
pov_type_string | Optional string with info about type of POV (state/flags). |
Extract
. Describe the value that's being written into the destination container.
Describe the field slice that we're writing to.
cstring Parde::Lowered::debugInfoFor | ( | const IR::BFN::Extract * | extract, |
const PHV::AllocSlice & | slice, | ||
const nw_bitrange & | bufferRange, | ||
bool | includeRangeInfo ) |
Construct a string describing how an Extract
primitive was mapped to a hardware extract operation.
extract | The original Extract primitive, with a field as the destination. |
slice | An alloc_slice mapping a range of bits in the field to a range of bits in a container. |
bufferRange | For extracts that read from the input buffer, an input buffer range corresponding to the range of bits in the alloc_slice . |
includeRangeInfo | If true, the range of bits being extracted into the destination container is printed even if it matches the size of the container exactly. |
Extract
. cstring Parde::Lowered::debugInfoFor | ( | const IR::BFN::ParserLVal * | lval, |
const PHV::AllocSlice & | slice, | ||
bool | includeContainerInfo ) |
Construct debugging information describing a slice of a field.
lval | A reference to a field. |
slice | An alloc_slice mapping a range of bits in the field to a range of bits in a container. |
includeContainerInfo | If true, the result will include information about which bits in the container the field slice was mapped to. |
std::pair< IR::Vector< IR::BFN::ContainerRef >, std::vector< Clot * > > Parde::Lowered::lowerFields | ( | const PhvInfo & | phv, |
const ClotInfo & | clotInfo, | ||
const IR::Vector< IR::BFN::FieldLVal > & | fields, | ||
bool | is_checksum = false ) |
Maps a sequence of fields to a sequence of PHV containers. The sequence of fields is treated as ordered and non-overlapping; the resulting container sequence is the shortest one which maintains these properties.
const IR::BFN::ContainerBitRef * Parde::Lowered::lowerSingleBit | ( | const PhvInfo & | phv, |
const IR::BFN::FieldLVal * | fieldRef, | ||
const PHV::AllocContext * | ctxt ) |
Maps a POV bit field to a single bit within a container, represented as a ContainerBitRef. Checks that the allocation for the POV bit field is sane.
const IR::BFN::ContainerRef * Parde::Lowered::lowerUnsplittableField | ( | const PhvInfo & | phv, |
const ClotInfo & | clotInfo, | ||
const IR::BFN::FieldLVal * | fieldRef, | ||
const char * | unsplittableReason ) |
Maps a field which cannot be split between multiple containers to a single container, represented as a ContainerRef. Checks that the allocation for the field is sane.