P4C
The P4 Compiler
Loading...
Searching...
No Matches
PardeSpec Class Referenceabstract

#include <parde_spec.h>

Inheritance diagram for PardeSpec:
[legend]

Public Member Functions

size_t bitIngressPrePacketPaddingSize () const
 
virtual unsigned bitMaxClotPos () const =0
 The maximum offset+length a CLOT can have, in bits.
 
virtual unsigned bitMinClotPos (gress_t) const =0
 The minimum offset a CLOT can have, in bits.
 
size_t bitPhase0Size () const
 
size_t bitResubmitSize () const
 
size_t bitResubmitTagSize () const
 
virtual const nw_bitrange bitScratchRegisterRange (const MatchRegister &reg) const =0
 
size_t byteIngressIntrinsicMetadataSize () const
 
virtual size_t byteIngressPrePacketPaddingSize () const =0
 
nw_byterange byteInputBufferMetadataRange () const
 
int byteInputBufferSize () const
 The size of input buffer, in bytes.
 
virtual unsigned byteInterClotGap () const =0
 The minimum number of bytes required between consecutive CLOTs.
 
virtual unsigned byteMaxClotSize () const =0
 The maximum number of bytes a CLOT can hold.
 
virtual size_t bytePhase0Size () const =0
 
size_t byteResubmitSize () const
 
size_t byteResubmitTagSize () const
 
virtual bool byteScratchRegisterRangeValid (nw_byterange range) const =0
 
size_t byteTotalIngressMetadataSize () const
 
virtual double clkFreq () const =0
 Clock frequency.
 
virtual unsigned deparserChunkGroupSize () const =0
 
virtual unsigned deparserChunkSize () const =0
 
virtual const std::map< unsigned, unsigned > & extractorSpec () const =0
 
virtual unsigned lineRate () const =0
 Max line rate per-port (Gbps)
 
virtual const std::vector< MatchRegister > matchRegisters () const =0
 Specifies the available match registers.
 
virtual unsigned maxClotsLivePerGress () const =0
 The maximum number of CLOTs that can be live for each packet in each gress.
 
virtual unsigned maxClotsPerState () const =0
 The maximum number of CLOTs that can be generated in each parser state.
 
virtual size_t maxParseDepth (gress_t) const
 The maximum parse depth for the given gress.
 
virtual const std::vector< std::string > & mdpValidVecFields () const =0
 Unused.
 
virtual const std::unordered_set< std::string > & mdpValidVecFieldsSet () const =0
 Unused.
 
virtual size_t minParseDepth (gress_t) const
 The minimum parse depth for the given gress.
 
virtual unsigned numClotsPerDeparserGroup () const =0
 
virtual unsigned numClotsPerGress () const =0
 The number of CLOTs available for allocation in each gress.
 
virtual unsigned numDeparserChecksumUnits () const =0
 
virtual unsigned numDeparserChunkGroups () const =0
 
virtual unsigned numDeparserConstantBytes () const =0
 
virtual unsigned numDeparserInvertChecksumUnits () const =0
 
virtual int numParsers () const =0
 Total parsers supported ingress/egress.
 
virtual int numTcamRows () const =0
 Total TCAM Rows supported ingress/egress.
 
virtual bool parserAllExtractorsSupportSingleByte () const =0
 Do all extractors support single-byte extracts?
 
virtual const std::vector< MatchRegister > scratchRegisters () const =0
 Specifies the available scracth registers.
 

Detailed Description

Midend passes

Midend passes related to deparsing:

  • BFN::CheckHeaderAlignment (in BFN::PadFlexibleField) - Ensures that headers are byte aligned.
  • DesugarVarbitExtract - Generates emit statements for variable-length headers.
  • BFN::ParserEnforceDepthReq - Adds emit statements for padding headers to ensure the minimum parse depth.
  • P4::SimplifyNestedIf - Simplifies nested if statements into simple if statements that the deparser can process.

Backend passes

Backend passes related to deparsing:

  • AddDeparserMetadata - Adds deparser metadata parameters.
  • AddMetadataPOV - Adds POV bits for metadata used by the deparser (Tofino 2+). Tofino 1 uses the valid bit associated with each PHV; Tofino 2+ use POV bits instead.
  • BFN::AsmOutput - Outputs the deparser assembler. Uses DeparserAsmOutput and the passes it invokes.
  • CollectClotInfo - Collects information for generating CLOTs.
  • DeparserCopyOpt - Optimize copy assigned fields prior to deparsing.
  • ExtractChecksum - Replaces EmitField with EmitChecksum emits in deparser. Also creates tables and optimizes conditions and fields that the checksum uses. Invoked from BFN::BackendConverter.
  • BFN::ExtractDeparser - Convert IR::BFN::TnaDeparser objects to IR::BFN::Deparser objects. The pass generates emit and digest objects as part of this process.
  • GreedyClotAllocator - CLOT allocation. Enforces deparser CLOT rules during allocation.
  • InsertParserClotChecksums - Identifies CLOT fields used in deparser checksums to allow the checksum to be calculated in the parser (Tofino 2).
  • LowerParser - Replaces high-level parser and deparser IR that operate on fields with low-level parser and deparser IR that operate on PHV containers.
  • ResetInvalidatedChecksumHeaders - Reset fields that are used in deparser checksum operations and that are invalidated in the MAU (Tofino 1).

Member Function Documentation

◆ bitMaxClotPos()

virtual unsigned PardeSpec::bitMaxClotPos ( ) const
pure virtual

The maximum offset+length a CLOT can have, in bits.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ bitMinClotPos()

virtual unsigned PardeSpec::bitMinClotPos ( gress_t ) const
pure virtual

The minimum offset a CLOT can have, in bits.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ bitResubmitSize()

size_t PardeSpec::bitResubmitSize ( ) const
inline
Returns
the size in bits or bytes of the resubmit data on this device.

◆ bitResubmitTagSize()

size_t PardeSpec::bitResubmitTagSize ( ) const
inline
Returns
the size in bits or bytes of the reserved resubmit tag on this device.

◆ byteIngressIntrinsicMetadataSize()

size_t PardeSpec::byteIngressIntrinsicMetadataSize ( ) const
inline
Returns
the size in bytes of the ingress intrinsic metadata header WARNING this should match "ingress_intrinsic_metadata_t" in tofino.p4

◆ byteIngressPrePacketPaddingSize()

virtual size_t PardeSpec::byteIngressPrePacketPaddingSize ( ) const
pure virtual
Returns
the size in bytes of the padding between the ingress static per-port metadata and the beginning of the packet.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ byteInputBufferMetadataRange()

nw_byterange PardeSpec::byteInputBufferMetadataRange ( ) const
inline

The region of the input buffer that contains special intrinsic metadata rather than packet data. In bytes.

◆ byteInterClotGap()

virtual unsigned PardeSpec::byteInterClotGap ( ) const
pure virtual

The minimum number of bytes required between consecutive CLOTs.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ byteMaxClotSize()

virtual unsigned PardeSpec::byteMaxClotSize ( ) const
pure virtual

The maximum number of bytes a CLOT can hold.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ bytePhase0Size()

virtual size_t PardeSpec::bytePhase0Size ( ) const
pure virtual
Returns
the size in bytes of the ingress static per-port metadata on this device. (This is the "phase 0" data.) On resubmitted packets, the same region is used for resubmit metadata.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ byteTotalIngressMetadataSize()

size_t PardeSpec::byteTotalIngressMetadataSize ( ) const
inline
Returns
the total size of all ingress metadata on this device.

◆ clkFreq()

virtual double PardeSpec::clkFreq ( ) const
pure virtual

Clock frequency.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ extractorSpec()

virtual const std::map< unsigned, unsigned > & PardeSpec::extractorSpec ( ) const
pure virtual

Specifies the available kinds of extractors, specified as sizes in bits, and the number of extractors of each kind available in each hardware parser state.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ lineRate()

virtual unsigned PardeSpec::lineRate ( ) const
pure virtual

Max line rate per-port (Gbps)

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ matchRegisters()

virtual const std::vector< MatchRegister > PardeSpec::matchRegisters ( ) const
pure virtual

Specifies the available match registers.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ maxClotsLivePerGress()

virtual unsigned PardeSpec::maxClotsLivePerGress ( ) const
pure virtual

The maximum number of CLOTs that can be live for each packet in each gress.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ maxClotsPerState()

virtual unsigned PardeSpec::maxClotsPerState ( ) const
pure virtual

The maximum number of CLOTs that can be generated in each parser state.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ maxParseDepth()

virtual size_t PardeSpec::maxParseDepth ( gress_t ) const
inlinevirtual

The maximum parse depth for the given gress.

Reimplemented in TofinoPardeSpec.

◆ mdpValidVecFields()

virtual const std::vector< std::string > & PardeSpec::mdpValidVecFields ( ) const
pure virtual

Unused.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ mdpValidVecFieldsSet()

virtual const std::unordered_set< std::string > & PardeSpec::mdpValidVecFieldsSet ( ) const
pure virtual

Unused.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ minParseDepth()

virtual size_t PardeSpec::minParseDepth ( gress_t ) const
inlinevirtual

The minimum parse depth for the given gress.

Reimplemented in TofinoPardeSpec.

◆ numClotsPerGress()

virtual unsigned PardeSpec::numClotsPerGress ( ) const
pure virtual

The number of CLOTs available for allocation in each gress.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ numParsers()

virtual int PardeSpec::numParsers ( ) const
pure virtual

Total parsers supported ingress/egress.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ numTcamRows()

virtual int PardeSpec::numTcamRows ( ) const
pure virtual

Total TCAM Rows supported ingress/egress.

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ parserAllExtractorsSupportSingleByte()

virtual bool PardeSpec::parserAllExtractorsSupportSingleByte ( ) const
pure virtual

Do all extractors support single-byte extracts?

Implemented in JBayPardeSpec, and TofinoPardeSpec.

◆ scratchRegisters()

virtual const std::vector< MatchRegister > PardeSpec::scratchRegisters ( ) const
pure virtual

Specifies the available scracth registers.

Implemented in JBayPardeSpec, and TofinoPardeSpec.