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

#include <device.h>

Inheritance diagram for Device:
[legend]

Classes

struct  GatewaySpec
 
struct  StatefulAluSpec
 

Public Types

enum  Device_t { TOFINO , JBAY }
 

Static Public Member Functions

static RangeIter< gress_t > allGresses ()
 
static int alwaysRunIMemAddr ()
 
static const ArchSpecarchSpec ()
 
static int cloneSessionIdWidth ()
 
static Device_t currentDevice ()
 
static unsigned int egressIntrinsicMetadataMinLen ()
 
static const GatewaySpecgatewaySpec ()
 
static const Deviceget ()
 
static bool hasAlwaysRunInstr ()
 
static bool hasCompareInstructions ()
 
static bool hasEgressParser ()
 
static bool hasGhostThread ()
 
static bool hasIngressDeparser ()
 
static bool hasLongBranches ()
 
static bool hasMetadataPOV ()
 
static bool hasMirrorIOSelect ()
 
static const IMemSpecimemSpec ()
 
static void init (cstring name)
 
static int isMemoryCoreSplit ()
 
static const IXBarSpecixbarSpec ()
 
static const MauPowerSpecmauPowerSpec ()
 
static const MauSpecmauSpec ()
 
static unsigned maxCloneId (gress_t gress)
 
static unsigned maxDigestId ()
 
static unsigned maxDigestSizeInBytes ()
 
static gress_t maxGress ()
 
static int maxParserMatchBits ()
 
static unsigned maxResubmitId ()
 
static int metaGlobalTimestampLen ()
 
static int metaGlobalTimestampStart ()
 
static int metaGlobalVersionLen ()
 
static int metaGlobalVersionStart ()
 
static int mirrorTypeWidth ()
 
static cstring name ()
 
static int numClots ()
 
static int numLogTablesPerStage ()
 
static int numLongBranchTags ()
 
static int numMaxChannels ()
 
static int numParsersPerPipe ()
 
static int numPipes ()
 
static int numStages ()
 
static void overrideNumStages (int num)
 
static const PardeSpecpardeSpec ()
 
static const PhvSpecphvSpec ()
 
static int portBitWidth ()
 
static int queueIdWidth ()
 
static int sramColumnAdjust ()
 
static int sramMaxPackEntries ()
 
static int sramMaxPackEntriesPerRow ()
 
static int sramMinPackEntries ()
 
static const StatefulAluSpecstatefulAluSpec ()
 
static bool threadsSharePipe (gress_t a, gress_t b)
 

Protected Member Functions

 Device (cstring name)
 
virtual Device_t device_type () const =0
 
virtual cstring get_name () const =0
 
virtual int getAlwaysRunIMemAddr () const =0
 
virtual const ArchSpecgetArchSpec () const =0
 
virtual int getCloneSessionIdWidth () const =0
 
virtual unsigned int getEgressIntrinsicMetadataMinLen () const =0
 
virtual const GatewaySpecgetGatewaySpec () const =0
 
virtual bool getHasCompareInstructions () const =0
 
virtual bool getHasEgressParser () const =0
 
virtual bool getHasGhostThread () const =0
 
virtual bool getHasIngressDeparser () const =0
 
virtual bool getHasMetadataPOV () const =0
 
virtual bool getHasMirrorIOSelect () const =0
 
virtual bool getIfMemoryCoreSplit () const =0
 
virtual int getLongBranchTags () const =0
 
virtual const MauPowerSpecgetMauPowerSpec () const =0
 
virtual const MauSpecgetMauSpec () const =0
 
virtual unsigned getMaxCloneId (gress_t) const =0
 
virtual unsigned getMaxDigestId () const =0
 
virtual unsigned getMaxDigestSizeInBytes () const =0
 
virtual gress_t getMaxGress () const =0
 
virtual int getMaxParserMatchBits () const =0
 
virtual unsigned getMaxResubmitId () const =0
 
virtual int getMetaGlobalTimestampLen () const =0
 
virtual int getMetaGlobalTimestampStart () const =0
 
virtual int getMetaGlobalVersionLen () const =0
 
virtual int getMetaGlobalVersionStart () const =0
 
virtual int getMirrorTypeWidth () const =0
 
virtual int getNumChannelsPerPort () const =0
 
virtual int getNumLogTablesPerStage () const =0
 
virtual int getNumMaxChannels () const =0
 
virtual int getNumPipes () const =0
 
virtual int getNumPortsPerPipe () const =0
 
virtual int getNumStages () const =0
 
virtual const PardeSpecgetPardeSpec () const =0
 
virtual const PhvSpecgetPhvSpec () const =0
 
virtual int getPortBitWidth () const =0
 
virtual int getQueueIdWidth () const =0
 
virtual int getSramColumnAdjust () const =0
 
virtual int getSramMaxPackEntries () const =0
 
virtual int getSramMaxPackEntriesPerRow () const =0
 
virtual int getSramMinPackEntries () const =0
 
virtual const StatefulAluSpecgetStatefulAluSpec () const =0
 
virtual bool getThreadsSharePipe (gress_t a, gress_t b) const =0
 

Detailed Description

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


Class Documentation

◆ Device::GatewaySpec

struct Device::GatewaySpec
Class Members
bool ByteSwizzle
int ExactShifts
int HashBits
int MaxRows
int PerByteMatch
int PhvBytes
int PredicateBits
bool SupportRange
bool SupportXor
unsigned XorByteSlots

Member Function Documentation

◆ getGatewaySpec()

virtual const GatewaySpec & Device::getGatewaySpec ( ) const
protectedpure virtual

Implemented in TofinoDevice.

◆ getStatefulAluSpec()

virtual const StatefulAluSpec & Device::getStatefulAluSpec ( ) const
protectedpure virtual

Implemented in TofinoDevice.

◆ init()

void Device::init ( cstring name)
static

Initialize the global device context for the provided target - e.g. "Tofino" or "JBay".

This should be called as early as possible at startup, since the Device singleton is available everywhere in the compiler.