P4C
The P4 Compiler
Loading...
Searching...
No Matches
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  BuildResourceMap
 
class  CFG
 
class  CheckUnsupported
 
class  ControlConverter
 
struct  ConversionContext
 
class  ConvertGlobals
 
class  ConvertPsaToJson
 
class  DeparserConverter
 
class  DirectMeterMap
 
class  DiscoverStructure
 
class  EnumOn32Bits
 
class  ExpressionConverter
 
class  ExternConverter
 
class  HeaderConverter
 
class  InspectPsaProgram
 
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  ParsePsaArchitecture
 
class  ParserConverter
 
class  ParseV1Architecture
 
class  ProcessControls
 
class  ProgramStructure
 
class  PsaCodeGenerator
 
class  PsaEnumOn32Bits
 
class  PsaProgramStructure
 
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 PsaSwitchContext = P4CContextWithOptions<PsaSwitchOptions>
 
using ResourceMap = ordered_map<const IR::Node *, const IR::CompileTimeValue *>
 
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 , None ,
  Parser , Ingress , Egress , Deparser ,
  ChecksumCompute , ChecksumVerify
}
 
enum class  BlockConverted {
  None , Parser , Ingress , Egress ,
  Deparser , ChecksumCompute , ChecksumVerify , None ,
  Parser , Ingress , Egress , Deparser ,
  ChecksumCompute , ChecksumVerify
}
 
enum  gress_t { INGRESS , EGRESS }
 

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 * > 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 * 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