P4C
The P4 Compiler
Loading...
Searching...
No Matches
ArchSpec Class Reference

#include <arch_spec.h>

Inheritance diagram for ArchSpec:
[legend]

Public Types

enum  ArchType_t { TNA , T2NA }
 

Public Member Functions

 ArchSpec ()
 
void add_dprsr_md (gress_t gress, IntrinsicField f)
 
void add_md (gress_t gress, IntrinsicField f)
 
void add_outport_md (gress_t gress, IntrinsicField f)
 
void add_prsr_md (gress_t gress, IntrinsicField f)
 
void add_tm_md (gress_t gress, IntrinsicField f)
 
int getDeparserIntrinsicMetadataForDeparserParamIndex () const
 Get the index of the intrinsic metadata for deparser parameter in the deparser.
 
std::vector< IntrinsicParamgetDeparserIntrinsicTypes (gress_t g) const
 
std::vector< IntrinsicFieldgetEgressIntrinsicMetadata () const
 
std::vector< IntrinsicFieldgetEgressIntrinsicMetadataForDeparser () const
 
std::vector< IntrinsicFieldgetEgressIntrinsicMetadataForOutputPort () const
 
std::vector< IntrinsicFieldgetEgressIntrinsicMetadataForTM () const
 
std::vector< IntrinsicFieldgetEgressIntrinsicMetadataFromParser () const
 
std::vector< IntrinsicFieldgetIngressInstrinicMetadataForDeparser () const
 
std::vector< IntrinsicFieldgetIngressInstrinicMetadataForTM () const
 
std::vector< IntrinsicFieldgetIngressInstrinicMetadataFromParser () const
 
std::vector< IntrinsicFieldgetIngressIntrinsicMetadata () const
 
std::vector< IntrinsicParamgetMAUIntrinsicTypes (gress_t g) const
 
std::vector< IntrinsicParamgetParserIntrinsicTypes (gress_t g) const
 
std::vector< IntrinsicParamgetPPUIntrinsicTypes (gress_t g) const
 
void setTofinoIntrinsicTypes ()
 

Protected Attributes

int deparser_intrinsic_metadata_for_deparser_param_index = -1
 
std::vector< IntrinsicParamdeparser_intrinsic_types [GRESS_T_COUNT]
 
std::vector< IntrinsicFieldintrinsic_metadata [GRESS_T_COUNT]
 
std::vector< IntrinsicFieldintrinsic_metadata_for_deparser [GRESS_T_COUNT]
 
std::vector< IntrinsicFieldintrinsic_metadata_for_output_port [GRESS_T_COUNT]
 
std::vector< IntrinsicFieldintrinsic_metadata_for_tm [GRESS_T_COUNT]
 
std::vector< IntrinsicFieldintrinsic_metadata_from_parser [GRESS_T_COUNT]
 
std::vector< IntrinsicParammauppu_intrinsic_types [GRESS_T_COUNT]
 
std::vector< IntrinsicParamparser_intrinsic_types [GRESS_T_COUNT]
 

Detailed Description

This class is the architecture model for tofino devices. P4-16 architecture file exposes the user-configurable CSRs as intrinsic metadata to P4 programmers. Different generation of devies may have different set of CSRs, which is encapsulated in this class.

Constructor & Destructor Documentation

◆ ArchSpec()

ArchSpec::ArchSpec ( )

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

◆ getDeparserIntrinsicMetadataForDeparserParamIndex()

int ArchSpec::getDeparserIntrinsicMetadataForDeparserParamIndex ( ) const
inline

Get the index of the intrinsic metadata for deparser parameter in the deparser.

The parameter is the ingress_intrinsic_metadata_for_deparser_t or egress_intrinsic_metadata_for_deparser_t for the corresponding gress.

Returns
index of the intrinsic metadata for deparser parameter