P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::BMV2 Namespace Reference

TODO: this is not really specific to BMV2, it should reside somewhere else. More...

Classes

class  ActionConverter
 
class  ArithmeticFixup
 
class  Backend
 Backend is a the base class for SimpleSwitchBackend and PortableSwitchBackend. More...
 
class  BMV2Options
 
class  CFG
 
class  CheckUnsupported
 
class  ControlConverter
 
struct  ConversionContext
 
class  ConvertGlobals
 
class  ConvertPnaToJson
 
class  ConvertPsaToJson
 
class  DeparserConverter
 
class  EnumOn32Bits
 
class  ExpressionConverter
 
class  ExternConverter
 
class  HeaderConverter
 
class  InspectPnaProgram
 
class  JsonObjects
 
class  LowerExpressions
 This pass rewrites expressions which are not supported natively on BMv2. More...
 
class  MatchImplementation
 
class  MidEnd
 
class  ParseAnnotations
 Parses BMV2-specific annotations. More...
 
class  ParsePnaArchitecture
 
class  ParserConverter
 
class  ParseV1Architecture
 
class  PnaCodeGenerator
 
class  PnaEnumOn32Bits
 
class  PnaNicBackend
 
class  PnaNicExpressionConverter
 
class  PnaNicMidEnd
 
class  PnaNicOptions
 
class  PnaProgramStructure
 
class  PortableCodeGenerator
 
class  PortableMidEnd
 
class  PortableOptions
 
class  ProcessControls
 
class  PsaCodeGenerator
 
class  PsaEnumOn32Bits
 
class  PsaSwitchBackend
 
class  PsaSwitchExpressionConverter
 
class  PsaSwitchMidEnd
 
class  PsaSwitchOptions
 
class  RemoveComplexExpressions
 
class  RenameUserMetadata
 
class  SharedActionSelectorCheck
 
class  SimpleSwitchBackend
 
class  SimpleSwitchExpressionConverter
 
class  SimpleSwitchMidEnd
 
class  SimpleSwitchOptions
 
class  SkipControls
 This class implements a policy suitable for the SynthesizeActions pass. More...
 
class  TableAttributes
 
class  V1ModelProperties
 
class  V1ProgramStructure
 

Typedefs

using BlockTypeMap = std::map<const IR::Block *, const IR::Type *>
 
using BMV2Context = P4CContextWithOptions<BMV2Options>
 
using PnaNicContext = P4CContextWithOptions<PnaNicOptions>
 
using PsaSwitchContext = P4CContextWithOptions<PsaSwitchOptions>
 
using SelectorInput = std::vector<const IR::Expression *>
 
using SimpleSwitchContext = P4CContextWithOptions<SimpleSwitchOptions>
 

Enumerations

enum  block_t {
  PARSER , PIPELINE , DEPARSER , V1_PARSER ,
  V1_DEPARSER , V1_INGRESS , V1_EGRESS , V1_VERIFY ,
  V1_COMPUTE
}
 
enum class  BlockConverted {
  None , Parser , Ingress , Egress ,
  Deparser , ChecksumCompute , ChecksumVerify
}
 
enum  gress_t { INGRESS , EGRESS }
 
enum  pna_block_t { MAIN_PARSER , MAIN_CONTROL , MAIN_DEPARSER }
 

Functions

const IR::ListExpression * convertToList (const IR::Expression *expr, P4::TypeMap *typeMap)
 Converts expr into a ListExpression or returns nullptr if not possible.
 
Util::JsonArraymkArrayField (Util::JsonObject *parent, cstring name)
 
Util::JsonArraymkParameters (Util::JsonObject *object)
 
Util::JsonObjectmkPrimitive (cstring name)
 
Util::JsonObjectmkPrimitive (cstring name, Util::JsonArray *appendTo)
 
unsigned nextId (cstring group)
 
Util::IJsonnodeName (const CFG::Node *node)
 
cstring stringRepr (big_int value, unsigned bytes)
 

Variables

const int JSON_MAJOR_VERSION = 2
 
const int JSON_MINOR_VERSION = 23
 

Detailed Description

TODO: this is not really specific to BMV2, it should reside somewhere else.

Typedef Documentation

◆ SelectorInput

typedef std::vector< const IR::Expression * > P4::BMV2::SelectorInput = std::vector<const IR::Expression *>

XXX(hanw): This convenience class stores pointers to the data structures that are commonly used during the program translation. Due to the limitation of current IR structure, these data structure are only refreshed by the evaluator pass. In the long term, integrating these data structures as part of the IR tree would simplify this kind of bookkeeping effort.

Function Documentation

◆ convertToList()

const IR::ListExpression * P4::BMV2::convertToList ( const IR::Expression * expr,
P4::TypeMap * typeMap )

Converts expr into a ListExpression or returns nullptr if not possible.

Converts expr into a ListExpression or returns nullptr if not possible