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

Classes

class  ActionAnalysisTest
 
class  ActionMutexTest
 
class  ActionPhv
 
class  ActionSourceTrackerTest
 
class  AddAlwaysRunTest
 
class  BackendTest
 A GTest fixture base class for backend targets. More...
 
class  BuildSuperCluster
 
class  ByteRotateMerge
 
class  ClotTest
 
class  ConstrainedFieldMapBuilderTest
 
class  ContainerAction
 
class  ContainerSizeExtractorTest
 
class  CriticalPathClustersTest
 
class  Dark
 
class  DarkCannotSourceActionRAM
 
class  Darker
 
class  DarkSource
 
class  DepositFieldContigousMask
 
class  DominatorTreeTest
 
class  DynamicDepTest
 
class  EquivalentAlignExtractorTest
 
class  ErrorReporterTest
 
class  EventLoggerTest
 
class  EventLoggerTestable
 
class  FieldDefUseTest
 
class  FieldSliceLiveRangeTest
 
class  GatewayControlFlowTest
 
class  InputXbarAlloc
 
class  JBayBackendTest
 A GTest fixture for JBay tests. More...
 
class  JBayContainerAction
 
class  JBayPhvContainer
 
class  JBayPhvCrush
 
class  MauGroupExtractorTest
 
class  MauIndirectExternsSingleActionTest
 
class  MetadataLiveRangeTest
 
struct  MidendTestCase
 
class  MochaAnalysisTest
 
class  MultipleActionFromMeter
 
class  MultipleApplyTest
 
class  NextTablePropTest
 
class  NoCoPack
 
class  PaAtomicPragmaTest
 
class  PaBytePackPragmaTest
 
class  PaContainerSizePragmaTest
 
class  PaContainerTypePragmaTest
 
class  PaMutuallyExclusivePragmaTest
 
class  PaNoOverlayPragmaTest
 
class  ParserConstantExtractTest
 
class  ParserCriticalPathTest
 
class  PaSolitaryPragmaTest
 
struct  SliceSpec
 
class  SlidesExamples
 
class  StaticEntriesConstPropTest
 
class  TableDependencyGraphTest
 
class  TableDependencyGraphTestForTofino2
 
class  TableFlowGraphTest
 
class  TableMutexTest
 
class  TestCode
 
class  TestWrite
 
class  TofinoBackendTest
 A GTest fixture for Tofino tests. More...
 
class  TofinoBitvec
 
class  TofinoComputedChecksum
 
class  TofinoContainerAction
 
class  TofinoField
 
class  TofinoFieldAlignment
 
class  TofinoFieldSlice
 
class  TofinoPhvContainer
 
class  TofinoPhvCrush
 
class  TofinoPhvSlicingIterator
 
struct  TofinoPipeTestCase
 
class  TofinoSccToposort
 
class  TPHVSliceTest
 
class  V1ModelStdMetaTranslateIngressExitTest
 
class  V1ModelStdMetaTranslateNegativeTest
 
class  V1ModelStdMetaTranslateTest
 
class  V1ModelStdMetaTranslateTestBase
 

Typedefs

using ExpectedAllocation = std::set<ExpectedClot>
 
using ExpectedClot = std::vector<SliceSpec>
 

Functions

void BasicRotation_test1 (ActionData::RamSection *ad, ActionData::Argument *arg)
 
void BasicRotation_test2 (ActionData::RamSection *ad, ActionData::Argument *arg)
 
std::regex bfrt_regex_bitstring (".*" "\\{\\n" ".*" "\"name\"" ".*:.*" "\"pipeline.ingress_parser.tpids\"" ",\\n" ".*" "\"id\"" ".*:.*" ",\\n" ".*" "\"table_type\"" ".*:.*" "\"ParserValueSet\"" ",\\n" ".*" "\"size\"" ".*:.*" "4" ",\\n" ".*" "\"annotations\"" ".*:.*" ",\\n" ".*" "\"depends_on\"" ".*:.*" ",\\n" ".*" "key" ".*:.*" "\\[\\n" ".*" "\\{\\n" ".*" "\"id\"" ".*:.*" "1" ",\\n" ".*" "\"name\"" ".*:.*" "\"f1\"" ",\\n" ".*" "\"repeated\"" ".*:.*" ",\\n" ".*" "\"annotations\"" ".*:.*" ",\\n" ".*" "\"mandatory\"" ".*:.*" ",\\n" ".*" "\"match_type\"" ".*:.*" "\"Ternary\"" ",\\n" ".*" "\"type\"" ".*:.*" "\\{\\n" ".*" "\"type\"" ".*:.*" "\"bytes\"" ",\\n" ".*" "\"width\"" ".*:.*" "16" "\\n" ".*" "\\}\\n" ".*" "\\}\\n" ".*" "\\],\\n")
 
std::regex bfrt_regex_struct (".*" "\\{\\n" ".*" "\"name\"" ".*:.*" "\"pipeline.ingress_parser.tpids\"" ",\\n" ".*" "\"id\"" ".*:.*" ",\\n" ".*" "\"table_type\"" ".*:.*" "\"ParserValueSet\"" ",\\n" ".*" "\"size\"" ".*:.*" "4" ",\\n" ".*" "\"annotations\"" ".*:.*" ",\\n" ".*" "\"depends_on\"" ".*:.*" ",\\n" ".*" "key" ".*:.*" "\\[\\n" ".*" "\\{\\n" ".*" "\"id\"" ".*:.*" "1" ",\\n" ".*" "\"name\"" ".*:.*" "\"ether_type\"" ",\\n" ".*" "\"repeated\"" ".*:.*" ",\\n" ".*" "\"annotations\"" ".*:.*" ",\\n" ".*" "\"mandatory\"" ".*:.*" ",\\n" ".*" "\"match_type\"" ".*:.*" "\"Ternary\"" ",\\n" ".*" "\"type\"" ".*:.*" "\\{\\n" ".*" "\"type\"" ".*:.*" "\"bytes\"" ",\\n" ".*" "\"width\"" ".*:.*" "16" "\\n" ".*" "\\}\\n" ".*" "\\},\\n" ".*" "\\{\\n" ".*" "\"id\"" ".*:.*" "2" ",\\n" ".*" "\"name\"" ".*:.*" "\"multicast\"" ",\\n" ".*" "\"repeated\"" ".*:.*" ",\\n" ".*" "\"annotations\"" ".*:.*" ",\\n" ".*" "\"mandatory\"" ".*:.*" ",\\n" ".*" "\"match_type\"" ".*:.*" "\"Ternary\"" ",\\n" ".*" "\"type\"" ".*:.*" "\\{\\n" ".*" "\"type\"" ".*:.*" "\"bytes\"" ",\\n" ".*" "\"width\"" ".*:.*" "1" "\\n" ".*" "\\}\\n" ".*" "\\}\\n" ".*" "\\],\\n")
 
void ConditionalArgs_Test (ActionData::Parameter *arg1, ActionData::Parameter *arg1_cond1, ActionData::Parameter *arg1_cond2, ActionData::Parameter *arg1_extend_cond1)
 
void Contains_test1 (ActionData::RamSection *ad_outside, ActionData::RamSection *ad_inside)
 
void Contains_test2 (ActionData::RamSection *ad_outside, ActionData::RamSection *ad_inside)
 
void Contains_test3 (ActionData::RamSection *ad_outside, ActionData::RamSection *ad_inside)
 
void Contains_test4 (ActionData::RamSection *ad_outside, ActionData::RamSection *ad_inside)
 
void Contains_test5 (ActionData::RamSection *ad_outside, ActionData::RamSection *ad_inside)
 
void Contains_test6 (ActionData::RamSection *ad_outside, ActionData::RamSection *ad_inside)
 
std::optional< TofinoPipeTestCasecreateMultipleApplyFullIngTest (const std::string &ingress)
 
std::optional< TofinoPipeTestCasecreateMultipleApplyTest (const std::string &ingressApply)
 
void CrossSizeMerge_test1 (ActionData::RamSection *ad_8bit, ActionData::RamSection *ad_16bit)
 
void CrossSizeMerge_test2 (ActionData::RamSection *ad_8bit, ActionData::RamSection *ad_16bit)
 
void CrossSizeMerge_test3 (ActionData::RamSection *ad_8bit, ActionData::RamSection *ad_16bit)
 
 EXPECT_EQ (customStream.str(), ERROR)
 
 EXPECT_EQ (reporter.verify_checks(), BfErrorReporter::CheckResult::FAILURE)
 
void generate_bfrt (TestCode &test)
 
std::string get_field_container (std::string field, std::string phv_section)
 
std::map< gress_t, std::map< cstring, UniqueId > > getTables (std::optional< TofinoPipeTestCase > test)
 
 INSTANTIATE_TEST_CASE_P (IngressExitStatementTest, V1ModelStdMetaTranslateIngressExitTest, ::testing::Values(R"( exit; )", R"( if (sm.ingress_port == 1) { exit; } )", R"( if (sm.ingress_port == 1) { meta.m1 = 0; } else { exit; } )", R"( if (sm.ingress_port == 1) { meta.m1 = 0; } exit; )"))
 
 INSTANTIATE_TEST_CASE_P (TranslatedFields, V1ModelStdMetaTranslateTest, ::testing::Values(std::make_tuple("sm.deq_qdepth", 19, "egress"), std::make_tuple("sm.ingress_global_timestamp", 48, "ingress")))
 
void LayeredRotation_test1 (ActionData::RamSection *ad, ActionData::Argument *arg1, ActionData::Argument *arg2, ActionData::Argument *arg3)
 
void LayeredRotation_test2 (ActionData::RamSection *ad, ActionData::Argument *arg1, ActionData::Argument *arg2, ActionData::Argument *arg3)
 
std::ostream & operator<< (std::ostream &out, const SliceSpec &sliceSpec)
 
void OverlapMerge_test1 (ActionData::RamSection *ad1, ActionData::RamSection *ad2)
 
std::string prog_shell ()
 
std::string prog_shell_parser_elim_zero ()
 
void RandomNumberMultipleActions ()
 
void RandomNumberOverlaps ()
 
void RandomNumberRamSection ()
 
void RandomNumberSingleAction ()
 
void RotateIntoRange_test1 (ActionData::RamSection *ad, ActionData::Argument *arg)
 
void runClotTest (std::optional< TofinoPipeTestCase > test, ExpectedAllocation expectedAlloc, ExpectedAllocation expectedAliases={})
 
const IR::BFN::Pipe * runCustomPassManager (const IR::BFN::Pipe *pipe, const BFN_Options &option, PhvInfo *phv)
 
const IR::BFN::Pipe * runInitialPassManager (const IR::BFN::Pipe *pipe, const BFN_Options &option, PhvInfo *phv)
 
void runTest (std::optional< TofinoPipeTestCase > test, ordered_map< gress_t, ConstraintMap > tablesToAdd)
 Common test functionality.
 
reporter setOutputStream (backup)
 
void SimpleMerge_test1 (ActionData::RamSection *ad1, ActionData::RamSection *ad2)
 
void StaticEntryBitmaskedSet ()
 
void StaticEntryConstants ()
 
void StaticEntryMaskParams ()
 
void StaticEntryOneParameterMultipleTimes ()
 
void StaticEntryStandardOperation ()
 
const char * t2na_header ()
 
 TEST (action_constraint_solver, bitmasked_set_only)
 
 TEST (action_constraint_solver, bitmasked_set_only_but_disabled)
 
 TEST (action_constraint_solver, byte_rotate_merge_byte_reversed)
 
 TEST (action_constraint_solver, byte_rotate_merge_half_reversed_1)
 
 TEST (action_constraint_solver, byte_rotate_merge_half_reversed_2)
 
 TEST (action_constraint_solver, byte_rotate_merge_mixed)
 
 TEST (action_constraint_solver, byte_rotate_merge_reversed_from_other_field)
 
 TEST (action_constraint_solver, dark_solver)
 
 TEST (action_constraint_solver, invalid_assign_to_bits_not_live)
 
 TEST (action_constraint_solver, invalid_missing_container_spec)
 
 TEST (action_constraint_solver, invalid_out_of_range_assign)
 
 TEST (action_constraint_solver, invalid_range_not_equal)
 
 TEST (action_constraint_solver, mocha_solver)
 
 TEST (action_constraint_solver, one_field_assign)
 
 TEST (action_constraint_solver, one_field_assign_rot_aligned)
 
 TEST (action_constraint_solver, three_field_assign_one_unallocated)
 
 TEST (action_constraint_solver, three_field_assign_one_unallocated_with_other_live_bits)
 
 TEST (action_constraint_solver, two_field_assign_dest_no_live_bits)
 
 TEST (action_constraint_solver, two_field_assign_src2_ne_dest)
 
 TEST (action_constraint_solver, two_field_one_container_assign)
 
 TEST (action_constraint_solver, unallocated_src_optimization_byte_rotate_merge_ok1)
 
 TEST (action_constraint_solver, unallocated_src_optimization_byte_rotate_merge_ok2)
 
 TEST (action_constraint_solver, unallocated_src_optimization_deposit_field_1)
 
 TEST (action_constraint_solver, unallocated_src_optimization_deposit_field_2)
 
 TEST (action_constraint_solver, wrap_around_1)
 
 TEST (action_constraint_solver, wrap_around_2)
 
 TEST (action_constraint_solver, wrap_around_3)
 
 TEST (ActionFormatHelper, BasicRotation)
 
 TEST (ActionFormatHelper, ConditionalArgs)
 
 TEST (ActionFormatHelper, ConstantOverlap)
 
 TEST (ActionFormatHelper, Contains)
 
 TEST (ActionFormatHelper, CrossSizeMerge)
 
 TEST (ActionFormatHelper, DataSubset)
 
 TEST (ActionFormatHelper, LayeredRotation)
 
 TEST (ActionFormatHelper, OverlapMerge)
 
 TEST (ActionFormatHelper, RandomNumberTests)
 
 TEST (ActionFormatHelper, RotateIntoRange)
 
 TEST (ActionFormatHelper, SimpleMerge)
 
 TEST (ActionFormatHelper, StaticEntryTests)
 
 TEST (AnnotateWithInHash, actionKeyNoParam)
 
 TEST (AttachedInfo, BuildSplitMaps)
 
 TEST (BfrtPvs, BitString)
 
 TEST (BfrtPvs, SerializableEnum)
 
 TEST (BfrtPvs, Struct)
 
 TEST (CopyHeaders, IgnoreUnusedHeaderIndirect1)
 
 TEST (CopyHeaders, IgnoreUnusedHeaderIndirect2)
 
 TEST (CopyHeaders, IgnoreUnusedHeaderInline)
 
 TEST (CopyHeaders, Lower$valid)
 
 TEST (CustomHeaderStackName, Test1)
 
 TEST (EgIntrMdOpt, CompareCmdOptionWithPragma)
 
 TEST (ElimCast, AssignBooleanExpr)
 
 TEST (ElimCast, AssignBooleanExpr2)
 
 TEST (ElimCast, AssignCast)
 
 TEST (ElimCast, AssignCastSubexpression)
 
 TEST (ElimCast, AssignConcat)
 
 TEST (ElimCast, AssignExplicitSlice)
 
 TEST (ElimCast, AssignExplicitSlicePlus)
 
 TEST (ElimCast, AssignFunnelShift)
 
 TEST (ElimCast, AssignMultiple)
 
 TEST (ElimCast, AssignNone)
 
 TEST (ElimCast, AssignSubexpr)
 
 TEST (ElimCast, AssignSubexprNonLogical)
 
 TEST (ElimCast, AssignSubexprNonLogicalPlus)
 
 TEST (ElimCast, AssignSubexprPlus)
 
 TEST (ElimCast, AssignSwap)
 
 TEST (ElimCast, AssignZeroExtNonSliceable)
 
 TEST (ElimCast, AssignZeroExtSliceable)
 
 TEST (ElimCast, EquLeft)
 
 TEST (ElimCast, EquLeftRightAsymmetric)
 
 TEST (ElimCast, EquLeftRightSymmetric)
 
 TEST (ElimCast, EquNone)
 
 TEST (ElimCast, EquRight)
 
 TEST (ElimCast, EquSubExpression)
 
 TEST (ElimCast, EquSubExpressionPlus)
 
 TEST (ElimCast, NeqLeft)
 
 TEST (ElimCast, NeqLeftRightAsymmetric)
 
 TEST (ElimCast, NeqLeftRightSymmetric)
 
 TEST (ElimCast, NeqNone)
 
 TEST (ElimCast, NeqRight)
 
 TEST (ElimCast, NeqSubExpression)
 
 TEST (FoldConstantHashes, CRC32)
 
 TEST (FoldConstantHashes, Custom)
 
 TEST (FoldConstantHashes, Identity16bConstant)
 
 TEST (FoldConstantHashes, Identity16bTuple)
 
 TEST (FoldConstantHashes, Identity16bTupleTupleTuple)
 
 TEST (FoldConstantHashes, UnusedResult)
 
 TEST (HiddenMerged, HiddenMerged)
 
 TEST (InitializeMirrorIOSelect, Tofino1ParserBody)
 
 TEST (InitializeMirrorIOSelect, Tofino1ParserParams)
 
 TEST (InitializeMirrorIOSelect, Tofino2ParserBody)
 
 TEST (InitializeMirrorIOSelect, Tofino2ParserBodyCompleteMeta)
 
 TEST (InitializeMirrorIOSelect, Tofino2ParserBodyPartialMeta)
 
 TEST (InitializeMirrorIOSelect, Tofino2ParserParams)
 
 TEST (InitializeMirrorIOSelect, Tofino2ParserParamsCompleteMeta)
 
 TEST (InitializeMirrorIOSelect, Tofino2ParserParamsPartialMeta)
 
 TEST (IRUtils, bigBitMask_good)
 
 TEST (IRUtils, bigBitMask_negative)
 
 TEST (IRUtils, bitMask_good)
 
 TEST (IRUtils, bitMask_negative)
 
 TEST (IRUtils, bitMask_too_big)
 
 TEST (ixbar_imbalanced_alignment, case0)
 
 TEST (ixbar_imbalanced_alignment, case1)
 
 TEST (MaskExactMatchHashBitsTest, NoExclusion)
 
 TEST (MaskExactMatchHashBitsTest, PartialFieldExclusion)
 
 TEST (MaskExactMatchHashBitsTest, TotalFieldExclusion)
 
 TEST (MauControlFlowVisit, GatewayRunTableAndFallthrough)
 
 TEST (MauControlFlowVisit, GatewayRunTableAndNext)
 
 TEST (MultipipeBFRuntime, Test1)
 
 TEST (MultiplePragmas, Test1)
 
 TEST (NormalizeHashList, NestedStatements)
 
 TEST (ParserContainerValidTest, Tof1SetHeaderFieldZero)
 
 TEST (ParserElimLoweredZeroExtracts, ZeroBeforeAndAfterNonZero)
 
 TEST (ParserElimLoweredZeroExtracts, ZeroBeforeNonZero)
 
 TEST (ParserEnforceDepthReqTest, MaxDepthViolated)
 
 TEST (ParserEnforceDepthReqTest, PadStates)
 
 TEST (ParserExtractOverlay, DontPackWithIngressPort_AltPhv)
 
 TEST (ParserExtractOverlay, DontPackWithIngressPort_Traditional)
 
 TEST (ParserExtractReorder, VerifySplitStates)
 
 TEST (ParserStateMergeTest, CheckStateInPhvJsonAfterMerge)
 
 TEST (ParserStateMergeTest, ConsiderLoopInMergeDecision)
 
 TEST (ParserStateMergeTest, DoNotMergeStallStates)
 
 TEST (PayloadGateway, DoubleKeyValueMask)
 
 TEST (PayloadGateway, KeyValueMask)
 
 TEST (PayloadGateway, KeyValueMaskSingleBit)
 
 TEST (PayloadGateway, TooBigToFit)
 
 TEST (PostMidendConstantFolding, ConstConstSizeInBytes)
 
 TEST (PostMidendConstantFolding, ConstSizeInBytesConst)
 
 TEST (PostMidendConstantFolding, SizeInBytesConstConst)
 
 TEST (PostMidendConstantFolding, SizeInBytesConstConstExplicitParentheses)
 
 TEST (PowerSchemaDotPrefix, Test1)
 
 TEST (PragmaNoGatewayConversion, WithoutPragma)
 
 TEST (PragmaNoGatewayConversion, WithPragma)
 
 TEST (PragmaSepGat, PragmaSepGat)
 
 TEST (PragmaSepGat, PragmaSepGat2)
 
 TEST (PragmaStage, PragmaStage)
 
 TEST (RegisterAction, SignedNegative)
 
 TEST (RegisterAction, UnsignedBitInt)
 
 TEST (RegisterReadWrite, ApplyBlockWriteAfterRead)
 
 TEST (RegisterReadWrite, ReadDowncast)
 
 TEST (RegisterReadWrite, ReadRead)
 
 TEST (RegisterReadWrite, ReadSlice)
 
 TEST (RegisterReadWrite, ReadUpcast)
 
 TEST (RegisterReadWrite, ReadWrite)
 
 TEST (RegisterReadWrite, RegisterParamRegisterReadWrite)
 
 TEST (RegisterReadWrite, WriteWrite)
 
 TEST (SimplifyKeyElimCasts, KeyElementConcatConstantPathExpression)
 
 TEST (SimplifyKeyElimCasts, KeyElementConcatPathExpressions)
 
 TEST (SimplifyKeyElimCasts, KeyElementNarrowingCast)
 
 TEST (SimplifyKeyElimCasts, KeyElementSlice)
 
 TEST (SimplifyKeyElimCasts, KeyElementWideningCast)
 
 TEST (SimplifyKeyElimCasts, KeyElementWideningCastSlice)
 
 TEST (SimplifyKeyElimCasts, KeyElementWideningCastSliceNonzeroLsb)
 
 TEST (slice, MakeSlice)
 
 TEST (SliceComparison, SliceComparison1)
 
 TEST (SliceComparison, SliceComparison2)
 
 TEST (symbolic_bitvec_tests, basic)
 
 TEST (testBfGtestHelper, MatchConvetToRegex)
 
 TEST (testBfGtestHelper, MatchFindNextBlock)
 
 TEST (testBfGtestHelper, MatchFindNextEnd)
 
 TEST (testBfGtestHelper, MatchGetEnds)
 
 TEST (testBfGtestHelper, MatchMatch)
 
 TEST (testBfGtestHelper, MatchMatchBasic)
 
 TEST (testBfGtestHelper, MatchResult)
 
 TEST (testBfGtestHelper, MatchTrimAnnotations)
 
 TEST (testBfGtestHelper, MatchTrimWhiteSpace)
 
 TEST (testBfGtestHelper, TestAsmCodeMatch)
 
 TEST (testBfGtestHelper, TestCodeApplyPassConst)
 
 TEST (testBfGtestHelper, TestCodeApplyPassMutating)
 
 TEST (testBfGtestHelper, TestCodeApplyPreconstructedPasses)
 
 TEST (testBfGtestHelper, TestCodeGetBlock)
 
 TEST (testBfGtestHelper, TestCodeTestCodeBad)
 
 TEST (testBfGtestHelper, TestCodeTestCodeGood)
 
 TEST (testBfGtestHelper, TestCodeTestControlBlock)
 
 TEST (testBfGtestHelper, TestP4CodeMatch)
 
 TEST (testBfGtestHelperDeathTest, TestCodeTestCodeOptions)
 
 TEST (TofinoWriteContext, DeparserEmit)
 
 TEST (TofinoWriteContext, DeparserEmitChecksum)
 
 TEST (TofinoWriteContext, Read)
 
 TEST (TofinoWriteContext, Write)
 
 TEST (UnionFind, copy)
 
 TEST (UnionFind, move)
 
 TEST (UnionFind, ops)
 
 TEST_F (ActionAnalysisTest, ParallelAction)
 
 TEST_F (ActionMutexTest, Basic)
 
 TEST_F (ActionMutexTest, ConstDefaultAction)
 
 TEST_F (ActionMutexTest, DefaultNext)
 
 TEST_F (ActionMutexTest, MissingDefault)
 
 TEST_F (ActionMutexTest, NextTableProperties)
 
 TEST_F (ActionMutexTest, SingleDefaultPath)
 
 TEST_F (ActionMutexTest, Tofino2NextTableTest)
 
 TEST_F (ActionMutexTest, TwoActionsSameChain)
 
 TEST_F (ActionPhv, IngressMultipleTablesReads)
 
 TEST_F (ActionPhv, IngressMultipleTablesSharedWrites)
 
 TEST_F (ActionPhv, IngressSingleTableSharedWrites)
 
 TEST_F (ActionSourceTrackerTest, basic)
 
 TEST_F (AddAlwaysRunTest, BasicControlFlow)
 Basic test case.
 
 TEST_F (AddAlwaysRunTest, ConditionalTest)
 
 TEST_F (AddAlwaysRunTest, MultipleApply1)
 
 TEST_F (AddAlwaysRunTest, TableSeqAlias1)
 
 TEST_F (AddAlwaysRunTest, TableSeqAlias2)
 
 TEST_F (AddAlwaysRunTest, TableSeqAlias3)
 
 TEST_F (BuildSuperCluster, basic)
 
 TEST_F (ByteRotateMerge, one_const_and_one_source)
 
 TEST_F (ClotTest, AdjacentHeaders1)
 
 TEST_F (ClotTest, AdjacentHeaders2)
 
 TEST_F (ClotTest, AdjacentMultiheaderVariableSize)
 
 TEST_F (ClotTest, AdjacentMultiheaderVariableSizeHeaderStack)
 
 TEST_F (ClotTest, Basic1)
 
 TEST_F (ClotTest, ExtractConstantsBetweenTwoClots)
 
 TEST_F (ClotTest, FieldPragma)
 
 TEST_F (ClotTest, HeaderPragma)
 
 TEST_F (ClotTest, HeaderRemoval1)
 
 TEST_F (ClotTest, HeaderRemoval2)
 
 TEST_F (ClotTest, Insertion1)
 
 TEST_F (ClotTest, Insertion2)
 
 TEST_F (ClotTest, MergeVarbitValidsForClots)
 
 TEST_F (ClotTest, MutualExclusion1)
 
 TEST_F (ClotTest, NotAdjacentMultiheaderVariableSize)
 
 TEST_F (ClotTest, NotAdjacentMultiheaderVariableSizeHeaderStack)
 
 TEST_F (ClotTest, Reorder1)
 
 TEST_F (ClotTest, Reorder2)
 
 TEST_F (ClotTest, ZeroInitAndExtractConstantBetweenTwoClots)
 
 TEST_F (ClotTest, ZeroInitsBetweenTwoClots)
 
 TEST_F (ConstrainedFieldMapBuilderTest, ShouldInitializeFieldConstraints)
 
 TEST_F (ConstrainedFieldMapBuilderTest, ShouldInitializeFields)
 
 TEST_F (ConstrainedFieldMapBuilderTest, ShouldInitializeSliceConstraints)
 
 TEST_F (ConstrainedFieldMapBuilderTest, ShouldInitializeSlices)
 
 TEST_F (ContainerSizeExtractorTest, CanBindConstraintToField)
 
 TEST_F (ContainerSizeExtractorTest, CanBindConstraintToField2)
 
 TEST_F (ContainerSizeExtractorTest, CanBindConstraintToSlices)
 
 TEST_F (ContainerSizeExtractorTest, CanComputeSlicing)
 
 TEST_F (ContainerSizeExtractorTest, CanReturnSortedSlicePointers)
 
 TEST_F (ContainerSizeExtractorTest, CanUpdateFieldSlices)
 
 TEST_F (ContainerSizeExtractorTest, GetFieldSizeWorks)
 
 TEST_F (ContainerSizeExtractorTest, IsLoggableOnFieldWorks)
 
 TEST_F (CriticalPathClustersTest, DISABLED_Basic)
 
 TEST_F (Dark, test1)
 
 TEST_F (Dark, test2)
 
 TEST_F (Dark, test3)
 
 TEST_F (Dark, test4)
 
 TEST_F (Dark, test5)
 
 TEST_F (DarkCannotSourceActionRAM, test1)
 
 TEST_F (DarkCannotSourceActionRAM, test2)
 
 TEST_F (DarkCannotSourceActionRAM, test3)
 
 TEST_F (DarkCannotSourceActionRAM, test4)
 
 TEST_F (Darker, test1)
 
 TEST_F (Darker, test2)
 
 TEST_F (Darker, test3)
 
 TEST_F (Darker, test4)
 
 TEST_F (Darker, test5)
 
 TEST_F (DarkSource, test1)
 
 TEST_F (DarkSource, test2)
 
 TEST_F (DepositFieldContigousMask, test1)
 
 TEST_F (DepositFieldContigousMask, test2)
 
 TEST_F (DominatorTreeTest, BasicControlFlow)
 
 TEST_F (DynamicDepTest, CanPlaceCDS)
 
 TEST_F (DynamicDepTest, DownwardProp1)
 
 TEST_F (EquivalentAlignExtractorTest, ExtractsAlignedClusterWithMoreItems)
 
 TEST_F (EquivalentAlignExtractorTest, IgnoresAlignedClusterWithSingleItem)
 
 TEST_F (ErrorReporterTest, ErrorAndWarningSameLine)
 
 TEST_F (ErrorReporterTest, ErrorAssertionSuccess)
 
 TEST_F (ErrorReporterTest, ErrorCheckNotMatched)
 
 TEST_F (ErrorReporterTest, ErrorHelperPlainFormatsCorrectly)
 
 TEST_F (ErrorReporterTest, NoAssertions)
 
 TEST_F (ErrorReporterTest, ParserErrorConformsToExpectedFormat)
 
 TEST_F (ErrorReporterTest, UnexpectedError)
 
 TEST_F (ErrorReporterTest, WarningsConformToExpectedFormat)
 
 TEST_F (ErrorReporterTest, WarningWithSuffixConformToExpectedFormat)
 
 TEST_F (EventLoggerTest, DoesNotExportEventsWhenDisabled)
 
 TEST_F (EventLoggerTest, DoesNothingWithoutInit)
 
 TEST_F (EventLoggerTest, ExportsDeduplicatedPassChange)
 
 TEST_F (EventLoggerTest, ExportsEnabledEventLogProperties)
 
 TEST_F (EventLoggerTest, ExportsEventCompilationError)
 
 TEST_F (EventLoggerTest, ExportsEventCompilationWarning)
 
 TEST_F (EventLoggerTest, ExportsEventDebug)
 
 TEST_F (EventLoggerTest, ExportsEventDecision)
 
 TEST_F (EventLoggerTest, ExportsIterationChange)
 
 TEST_F (EventLoggerTest, ExportsParserError)
 
 TEST_F (EventLoggerTest, ExportsPipeChange)
 
 TEST_F (EventLoggerTest, InitializedButDisabled)
 
 TEST_F (FieldDefUseTest, ComplexSliceTest1)
 
 TEST_F (FieldDefUseTest, ComplexSliceTest2)
 
 TEST_F (FieldDefUseTest, ComplexSliceTest3)
 
 TEST_F (FieldDefUseTest, ComplexSliceTest4)
 
 TEST_F (FieldDefUseTest, ComplexSliceTest5)
 
 TEST_F (FieldDefUseTest, ComplexSliceTest6)
 
 TEST_F (FieldDefUseTest, ComplexUseSlice1)
 
 TEST_F (FieldDefUseTest, ComplexUseSlice2)
 
 TEST_F (FieldDefUseTest, ComplexUseSlice3)
 
 TEST_F (FieldDefUseTest, ComplexUseSlice4)
 
 TEST_F (FieldDefUseTest, ComplexUseSlice5)
 
 TEST_F (FieldDefUseTest, SimpleSliceTest)
 
 TEST_F (FieldDefUseTest, SimpleTest)
 
 TEST_F (FieldSliceLiveRangeTest, can_overlay)
 
 TEST_F (FieldSliceLiveRangeTest, disjoint_ranges)
 
 TEST_F (FieldSliceLiveRangeTest, merge_invalid_ranges)
 
 TEST_F (GatewayControlFlowTest, Basic)
 
 TEST_F (InputXbarAlloc, hello)
 
 TEST_F (InputXbarAlloc, TestXbarUseByteVisualizationDetail)
 
 TEST_F (JBayPhvContainer, JSON)
 
 TEST_F (JBayPhvContainer, Resources)
 
 TEST_F (JBayPhvContainer, Types)
 
 TEST_F (JBayPhvCrush, makeDeviceAllocation)
 
 TEST_F (MauGroupExtractorTest, ExtractFieldInMultipleGroups)
 
 TEST_F (MauGroupExtractorTest, ExtractsPartialSlices)
 
 TEST_F (MauGroupExtractorTest, ExtractsWholeSlices)
 
 TEST_F (MauGroupExtractorTest, GetGroupThrowsOnEmpty)
 
 TEST_F (MauGroupExtractorTest, IgnoresSuperClustersWithSingleField)
 
 TEST_F (MauIndirectExternsSingleActionTest, Basic)
 
 TEST_F (MetadataLiveRangeTest, BasicControlFlow)
 
 TEST_F (MochaAnalysisTest, AnalyzeMochaCandidates)
 
 TEST_F (MultipleActionFromMeter, test_1)
 
 TEST_F (MultipleActionFromMeter, test_2)
 
 TEST_F (MultipleActionFromMeter, test_3)
 
 TEST_F (MultipleApplyTest, ChainedApplications)
 
 TEST_F (MultipleApplyTest, CommonTail)
 
 TEST_F (MultipleApplyTest, CommonTail2)
 
 TEST_F (MultipleApplyTest, DirectAction)
 
 TEST_F (MultipleApplyTest, LogicallyMutuallyExclusive)
 
 TEST_F (MultipleApplyTest, NonMatchingSequences)
 
 TEST_F (MultipleApplyTest, NonMutuallyExclusive)
 
 TEST_F (MultipleApplyTest, SWI_2941_example1)
 
 TEST_F (MultipleApplyTest, SWI_2941_example2)
 
 TEST_F (MultipleApplyTest, SWI_2941_example3)
 
 TEST_F (MultipleApplyTest, SWI_2941_example4)
 
 TEST_F (MultipleApplyTest, SWI_2941_example5)
 
 TEST_F (NextTablePropTest, OffGressFullOverlapDumbTables)
 
 TEST_F (NextTablePropTest, OffGressPartialOverlapDumbTables)
 
 TEST_F (NextTablePropTest, OffGressPartialOverlapMultiUseDumbTables)
 
 TEST_F (NextTablePropTest, OffGressPartialOverlapMultiUseDumbTables2)
 
 TEST_F (NextTablePropTest, OnGressFullOverlapDumbTables)
 
 TEST_F (NextTablePropTest, OnGressOverlapLB)
 
 TEST_F (NextTablePropTest, OnGressPartialOverlapDumbTables)
 
 TEST_F (NextTablePropTest, OnGressPartialOverlapDumbTables2)
 
 TEST_F (NextTablePropTest, TightOffGressMerge)
 
 TEST_F (NextTablePropTest, TightOffGressOverlap)
 
 TEST_F (NextTablePropTest, TightOnGressMerge)
 
 TEST_F (NoCoPack, Sanity)
 
 TEST_F (PaAtomicPragmaTest, Basic)
 
 TEST_F (PaBytePackPragmaTest, BasicCase)
 
 TEST_F (PaBytePackPragmaTest, ErrorHeaderField)
 
 TEST_F (PaBytePackPragmaTest, ErrorInvalidPaddingSize)
 
 TEST_F (PaBytePackPragmaTest, ErrorInvalidTotalSize)
 
 TEST_F (PaBytePackPragmaTest, WarnParsedField)
 
 TEST_F (PaContainerSizePragmaTest, SliceRequirement)
 
 TEST_F (PaContainerTypePragmaTest, Basic)
 
 TEST_F (PaMutuallyExclusivePragmaTest, P4_16)
 
 TEST_F (PaMutuallyExclusivePragmaTest, P4_16_NoMatchingPhvField)
 
 TEST_F (PaNoOverlayPragmaTest, P4_16)
 
 TEST_F (ParserConstantExtractTest, Test1)
 
 TEST_F (ParserCriticalPathTest, SinglePath)
 
 TEST_F (ParserCriticalPathTest, TwoPath)
 
 TEST_F (PaSolitaryPragmaTest, Basic)
 
 TEST_F (SlidesExamples, a1)
 
 TEST_F (SlidesExamples, a10)
 
 TEST_F (SlidesExamples, a11)
 
 TEST_F (SlidesExamples, a12)
 
 TEST_F (SlidesExamples, a2)
 
 TEST_F (SlidesExamples, a3)
 
 TEST_F (SlidesExamples, a4)
 
 TEST_F (SlidesExamples, a5)
 
 TEST_F (SlidesExamples, a6)
 
 TEST_F (SlidesExamples, a7)
 
 TEST_F (SlidesExamples, a8)
 
 TEST_F (SlidesExamples, a9)
 
 TEST_F (SlidesExamples, b1)
 
 TEST_F (SlidesExamples, b10)
 
 TEST_F (SlidesExamples, b11)
 
 TEST_F (SlidesExamples, b2)
 
 TEST_F (SlidesExamples, b3)
 
 TEST_F (SlidesExamples, b4)
 
 TEST_F (SlidesExamples, b5)
 
 TEST_F (SlidesExamples, b6)
 
 TEST_F (SlidesExamples, b7)
 
 TEST_F (SlidesExamples, b8)
 
 TEST_F (SlidesExamples, b9)
 
 TEST_F (SlidesExamples, c1)
 
 TEST_F (SlidesExamples, c2)
 
 TEST_F (SlidesExamples, c3)
 
 TEST_F (SlidesExamples, c4)
 
 TEST_F (SlidesExamples, c5)
 
 TEST_F (SlidesExamples, c6)
 
 TEST_F (StaticEntriesConstPropTest, TestMultipleConstEntry)
 
 TEST_F (StaticEntriesConstPropTest, TestUniqueConstEntry)
 
 TEST_F (StaticEntriesConstPropTest, TestUniqueConstEntryIsDefaultAction)
 
 TEST_F (TableDependencyGraphTest, AntiGraph1)
 
 TEST_F (TableDependencyGraphTest, AntiGraph2)
 
 TEST_F (TableDependencyGraphTest, ControlPathwayValidation)
 
 TEST_F (TableDependencyGraphTest, DomFrontier1)
 
 TEST_F (TableDependencyGraphTest, DomFrontier2)
 
 TEST_F (TableDependencyGraphTest, ExitGraph1)
 
 TEST_F (TableDependencyGraphTest, ExitGraph2)
 
 TEST_F (TableDependencyGraphTest, ExitGraph3)
 
 TEST_F (TableDependencyGraphTest, ExitGraph4)
 
 TEST_F (TableDependencyGraphTest, ExitGraph5)
 
 TEST_F (TableDependencyGraphTest, ExitTest)
 
 TEST_F (TableDependencyGraphTest, GraphA)
 
 TEST_F (TableDependencyGraphTest, GraphEdgeAnnotations)
 
 TEST_F (TableDependencyGraphTest, GraphInjectedControl)
 
 TEST_F (TableDependencyGraphTest, GraphLayeredControl)
 
 TEST_F (TableDependencyGraphTest, GraphMinStage)
 
 TEST_F (TableDependencyGraphTest, HitMissValidation)
 
 TEST_F (TableDependencyGraphTest, LogicalThruControl)
 
 TEST_F (TableDependencyGraphTest, LogicalThruControl2)
 
 TEST_F (TableDependencyGraphTest, LogicalVsPhysicalTest)
 
 TEST_F (TableDependencyGraphTest, P4C_2716_Test1)
 
 TEST_F (TableDependencyGraphTest, PredicationBasedEdges1)
 
 TEST_F (TableDependencyGraphTest, PredicationBasedEdges2)
 
 TEST_F (TableDependencyGraphTest, PredicationBasedEdges3)
 
 TEST_F (TableDependencyGraphTestForTofino2, Tofino2GraphTest)
 
 TEST_F (TableFlowGraphTest, BasicControlFlow)
 Basic test case.
 
 TEST_F (TableFlowGraphTest, InconsistentApplyOrder)
 Tests case where tables are not applied in consistent order on all branches.
 
 TEST_F (TableFlowGraphTest, MultipleApplies)
 Tests case where tables are applied multiple times.
 
 TEST_F (TableFlowGraphTest, NoDefaultNext)
 Tests case where there cannot be a default-next table.
 
 TEST_F (TableMutexTest, BasicMutex)
 
 TEST_F (TableMutexTest, DifferingNextTableChains)
 
 TEST_F (TableMutexTest, ExitTableMutex1)
 
 TEST_F (TableMutexTest, IndirectAttachedActionAnalysis)
 
 TEST_F (TableMutexTest, MultiLevelNextTableChain)
 
 TEST_F (TableMutexTest, OneChainFromTwoActions)
 
 TEST_F (TableMutexTest, SharedNextTable)
 
 TEST_F (TableMutexTest, Tofino2MultiApplyChain)
 
 TEST_F (TableMutexTest, TwoActionsSameNextTable)
 
 TEST_F (TofinoComputedChecksum, ChecksumFieldInChecksum)
 
 TEST_F (TofinoComputedChecksum, DISABLED_ErrorEmptyChecksum)
 
 TEST_F (TofinoComputedChecksum, DISABLED_ErrorUnexpectedStatement)
 
 TEST_F (TofinoComputedChecksum, DuplicateHeader)
 
 TEST_F (TofinoComputedChecksum, DuplicateHeader2)
 
 TEST_F (TofinoComputedChecksum, EmittedTwice)
 
 TEST_F (TofinoComputedChecksum, ErrorDestFieldMismatch)
 
 TEST_F (TofinoComputedChecksum, ErrorDestFieldNot16Bit)
 
 TEST_F (TofinoComputedChecksum, ErrorNoDestField)
 
 TEST_F (TofinoComputedChecksum, ErrorSourceFieldMismatch)
 
 TEST_F (TofinoComputedChecksum, ErrorSourceFieldMismatchWithoutIsValid)
 
 TEST_F (TofinoComputedChecksum, MultipleChecksumsInOneHeader)
 
 TEST_F (TofinoComputedChecksum, NotEmitted)
 
 TEST_F (TofinoComputedChecksum, SimpleWithIsValid)
 
 TEST_F (TofinoComputedChecksum, SimpleWithoutIsValid)
 
 TEST_F (TofinoContainerAction, sanity)
 
 TEST_F (TofinoField, byteAlignedRangeInBits)
 
 TEST_F (TofinoField, foreach_byte)
 
 TEST_F (TofinoFieldAlignment, ByteAlignedFields)
 
 TEST_F (TofinoFieldAlignment, LargeUnalignedFields)
 
 TEST_F (TofinoFieldAlignment, NonPardeFieldsDoNotForceAlignment)
 
 TEST_F (TofinoFieldAlignment, SmallUnalignedFields)
 
 TEST_F (TofinoFieldSlice, field_size_lt_valid_range)
 
 TEST_F (TofinoPhvContainer, JSON)
 
 TEST_F (TofinoPhvContainer, JSONWithVirtualPhv)
 
 TEST_F (TofinoPhvContainer, Resources)
 
 TEST_F (TofinoPhvContainer, ResourcesWithVirtualPhv)
 
 TEST_F (TofinoPhvContainer, Types)
 
 TEST_F (TofinoPhvContainer, TypesWithVirtualPhv)
 
 TEST_F (TofinoPhvCrush, clusterAlignment)
 
 TEST_F (TofinoPhvCrush, makeDeviceAllocation)
 
 TEST_F (TofinoPhvCrush, slicesByLiveness)
 
 TEST_F (TofinoPhvCrush, sliceSuperCluster)
 
 TEST_F (TofinoPhvCrush, Transaction)
 
 TEST_F (TofinoPhvSlicingIterator, make_split_meta)
 
 TEST_F (TofinoSccToposort, basic_4_nodes)
 
 TEST_F (TofinoSccToposort, circular_nodes)
 
 TEST_F (TofinoSccToposort, circular_single_node)
 
 TEST_F (TofinoSccToposort, empty)
 
 TEST_F (TofinoSccToposort, single_node)
 
 TEST_F (TPHVSliceTest, Basic)
 
 TEST_F (V1ModelStdMetaTranslateNegativeTest, DeqTimedelta)
 
 TEST_P (V1ModelStdMetaTranslateIngressExitTest, IngressExitStatement)
 
 TEST_P (V1ModelStdMetaTranslateTest, OtherGress)
 
 TEST_P (V1ModelStdMetaTranslateTest, SameGress)
 
const char * tna_header ()
 
bool valid_instruction_constant (unsigned value, int max_bits, int min_bits, int container_size, int constant_size)
 

Variables

auto * backup = DiagnosticTestSetup(reporter, CODE)
 
auto CaptureStderr = ::testing::internal::CaptureStderr
 
const std::string ERROR
 
auto Stderr = ::testing::internal::GetCapturedStderr
 

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

Specifically for running GTests to verify and validate the long branch allocation in a very simple way. Every table in the program should be provided a logical id within a stage and a stage itself

Function Documentation

◆ get_field_container()

std::string P4::Test::get_field_container ( std::string field,
std::string phv_section )

Find the container corresponding to a given field string

◆ getTables()

std::map< gress_t, std::map< cstring, UniqueId > > P4::Test::getTables ( std::optional< TofinoPipeTestCase > test)
Returns
a map for each gress from external table names to their unique IDs.

◆ RandomNumberMultipleActions()

void P4::Test::RandomNumberMultipleActions ( )

Test to make sure Random Numbers across actions can be merged, and their subsets work appropriately

◆ RandomNumberOverlaps()

void P4::Test::RandomNumberOverlaps ( )

Test to make sure RandomNumbers overlap function works properly

◆ RandomNumberSingleAction()

void P4::Test::RandomNumberSingleAction ( )

Test to make sure RandomNumbers in the same action cannot merge

◆ TEST() [1/12]

P4::Test::TEST ( ActionFormatHelper ,
BasicRotation  )

Guarantee that the can_rotate function can work on a single level

◆ TEST() [2/12]

P4::Test::TEST ( ActionFormatHelper ,
CrossSizeMerge  )

Validates that the merging of the three examples in the "Action Data Packing Notes" document in the Compilers Google Drive. After their merge, the PackingConstraints are correct.

◆ TEST() [3/12]

P4::Test::TEST ( ActionFormatHelper ,
LayeredRotation  )

Verifies that the can_rotate function can work through multiple levels of RecursiveConstraints

◆ TEST() [4/12]

P4::Test::TEST ( NormalizeHashList ,
NestedStatements  )

Verify that initialization is correctly inserted when we have a nested statement, such as a hash.get inside of an if statement.

◆ TEST() [5/12]

P4::Test::TEST ( ParserElimLoweredZeroExtracts ,
ZeroBeforeAndAfterNonZero  )

Verify that a zero-assignment before other assignments is eliminated, but a zero-assignment after other assignments is not

◆ TEST() [6/12]

P4::Test::TEST ( ParserElimLoweredZeroExtracts ,
ZeroBeforeNonZero  )

Verify that a zero-assignment before other assignments is eliminated

◆ TEST() [7/12]

P4::Test::TEST ( ParserEnforceDepthReqTest ,
MaxDepthViolated  )

Verify that pad states are inserted for a program that doesn't exceed max.

◆ TEST() [8/12]

P4::Test::TEST ( ParserEnforceDepthReqTest ,
PadStates  )

Verify that pad states are inserted for a program that doesn't exceed max.

◆ TEST() [9/12]

P4::Test::TEST ( ParserExtractOverlay ,
DontPackWithIngressPort_AltPhv  )

Verify that fields are not packed in with the ingress port. Until a recent fix, checksum validation results were being packed with the ingress port, and these potentially overlap with the version and/or recirc bits.

◆ TEST() [10/12]

P4::Test::TEST ( ParserExtractOverlay ,
DontPackWithIngressPort_Traditional  )

Verify that fields are not packed in with the ingress port. Until a recent fix, checksum validation results were being packed with the ingress port, and these potentially overlap with the version and/or recirc bits.

◆ TEST() [11/12]

P4::Test::TEST ( ParserExtractReorder ,
VerifySplitStates  )

Verify that fields are not packed in with the ingress port. Until a recent fix, checksum validation results were being packed with the ingress port, and these potentially overlap with the version and/or recirc bits.

◆ TEST() [12/12]

P4::Test::TEST ( ParserStateMergeTest ,
CheckStateInPhvJsonAfterMerge  )

This test checks that correct state is dumped in phv.json for header fields in case the state which they are extracted in is merged.

◆ TEST_F() [1/29]

P4::Test::TEST_F ( ActionMutexTest ,
Tofino2NextTableTest  )

Added to work with the new IR limits determined necessary for the Tofino2 based operations

◆ TEST_F() [2/29]

P4::Test::TEST_F ( ActionMutexTest ,
TwoActionsSameChain  )

Two actions for the same chain

◆ TEST_F() [3/29]

P4::Test::TEST_F ( FieldSliceLiveRangeTest ,
disjoint_ranges  )

tailing writes

◆ TEST_F() [4/29]

P4::Test::TEST_F ( MultipleApplyTest ,
ChainedApplications  )

This is just an example that should completely work

◆ TEST_F() [5/29]

P4::Test::TEST_F ( MultipleApplyTest ,
CommonTail  )

The tail of the TableSeqs match up, so we can split off the common tail giviing a common invokation of the table

◆ TEST_F() [6/29]

P4::Test::TEST_F ( MultipleApplyTest ,
CommonTail2  )

The tail of the TableSeqs match up, so we can split off the common tail giviing a common invokation of the table

◆ TEST_F() [7/29]

P4::Test::TEST_F ( MultipleApplyTest ,
DirectAction  )

Currently direct action calls are created as separate tables, and some equivalence check would be needed on these tables to wrap them together. Unnecessary in the short-term for p4_14 anyways, as this functionality is only in p4_16

◆ TEST_F() [8/29]

P4::Test::TEST_F ( MultipleApplyTest ,
LogicallyMutuallyExclusive  )

Even though the conditionals of t2 are logically exclusive, the mutually exclusive algorithm is not smart enough yet to figure this out

◆ TEST_F() [9/29]

P4::Test::TEST_F ( MultipleApplyTest ,
NonMatchingSequences  )

Because the control flow of t2 and t3 are different, these sequences are not replaceable with each other.

◆ TEST_F() [10/29]

P4::Test::TEST_F ( MultipleApplyTest ,
NonMutuallyExclusive  )

All applies of a table must be mutually exclusive

◆ TEST_F() [11/29]

P4::Test::TEST_F ( MultipleApplyTest ,
SWI_2941_example5  )

Corresponds to the comments written in MultipleApply above check_all_gws, to validate that pass.

◆ TEST_F() [12/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
AntiGraph1  )

The dependency graph is the following:

A                C
|                |
| Data           | Control
|                |
V     Anti       V
B -------------> D

Thus the min stage of D must be 1, as the min stage of B is 1, and the ANTI dependency pushes the min stage of D forward.

◆ TEST_F() [13/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
AntiGraph2  )

The dependency graph is the following:

A                C
|                |
| Anti           | Anti
|                |
V     Data       V
B -------------> D

Thus the min stage of D must be 1, as the min stage of B is 0, and the ANTI dependency pushes the min stage of D forward.

◆ TEST_F() [14/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
ControlPathwayValidation  )

This is to verify the control pathways and next table pathways, which are eventually added into the dependency graph for correct chain lengths

There are pathways down from the table, i.e. the control dominating set, and the tables that have control dependents

◆ TEST_F() [15/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
DomFrontier1  )

The dependency graph is the following:

A                C
|                |
| Data           | Control
|                | Data
V     Anti       V
B -------------> D

Thus the min stage of D must be 1, as the min stage of B is 1, and the ANTI dependency pushes the min stage of D forward.

◆ TEST_F() [16/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
DomFrontier2  )

The dependency graph is the following:

A ---------------------
| Data      |          |
| Control   | Control  | Control
|           |          |
V   Anti    V   Data   V
B --------> C -------> D

Thus the min stage of D must be 1, as the min stage of B is 1, and the ANTI dependency pushes the min stage of D forward.

◆ TEST_F() [17/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
ExitGraph1  )

This tests the length of dependency chains induced by "exit". The dependency graph is the following:

      Anti*           Anti*           Data
A ------------> B ------------> C ------------> D
              exits                             ^
                |                               |
                +-------------------------------+
                              Anti*
  • - induced by exit

We expect the following chain lengths.

A: 1 B: 1 C: 1 D: 0

◆ TEST_F() [18/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
ExitGraph2  )

This tests the length of dependency chains induced by "exit". The dependency graph is the following:

                      Data
A               C ============> D
|             exits   Anti*
|               ^
| Control       | Anti*
v               |
B --------------+
  • - induced by exit

We expect the following chain lengths.

A: 1 B: 1 C: 1 D: 0

◆ TEST_F() [19/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
ExitGraph3  )

This tests the length of dependency chains induced by "exit". The dependency graph is the following:

           Anti*          Data
    A   +---------> C ------------> E
    |   |           |               ^

Control | | | Control | Anti* v | v | B –+ D -----------—+ exits

  • - induced by exit

We expect the following chain lengths.

A: 1 B: 1 C: 1 D: 0 E: 0

◆ TEST_F() [20/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
ExitGraph4  )

This tests the length of dependency chains induced by "exit". The dependency graph is the following:

                      Data
A               C ------------> D
|               ^               ^
|               |               |
| Control       | Anti*         | Anti*
v               |               |
B ==============+---------------+

exits

  • - induced by exit

We expect the following chain lengths.

A: 1 B: 1 C: 1 D: 0

◆ TEST_F() [21/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
ExitGraph5  )

This tests the length of dependency chains induced by "exit". The dependency graph is the following: Data A B F ------------> G ^ /|\ Control / | \ Control / | \ v v v C D E exits exits

with the following anti-dependency edges induced:

A -> C A -> D A -> E C -> F D -> F E -> F C -> G D -> G E -> G

We expect the following chain lengths.

A: 1 B: 1 C: 1 D: 1 E: 1 F: 1 G: 0

◆ TEST_F() [22/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
GraphA  )

This should test the following graph: A --> B --> D | ^ v | C -— | v E

◆ TEST_F() [23/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
LogicalThruControl  )

The graph is following for this program:

    CONTROL

A ------------> B | DATA | | ANTI | V C | | DATA | V D

Due to the next table propagation limitations, the ANTI dependency forces C to be placed after A, and thus B, which pushes C into stage 1.

◆ TEST_F() [24/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
LogicalThruControl2  )

The graph is following for this program:

    CONTROL

A ------------> B DATA | | | DATA | CONTROL V C ------------> D

Through next table propagation, in Tofino (not Tofino2), an ANTI dependency exists between table A and C, (which is captured by the TableSeqDeps information)

◆ TEST_F() [25/29]

P4::Test::TEST_F ( TableDependencyGraphTest ,
PredicationBasedEdges1  )

The goal of any PredicationBasedEdges tests was to test the PredicationBasedControlEdges pass in order to guarantee that the dependencies necessary for Tofino1 are captured. These dependencies are explained in the comments in that pass.

◆ TEST_F() [26/29]

P4::Test::TEST_F ( TofinoSccToposort ,
basic_4_nodes  )

1 <- 2 <- 3 <-> 4

◆ TEST_F() [27/29]

P4::Test::TEST_F ( TofinoSccToposort ,
circular_nodes  )

1 <- 2 <- 3 ---------->

◆ TEST_F() [28/29]

P4::Test::TEST_F ( TofinoSccToposort ,
circular_single_node  )

1 <- 1

◆ TEST_F() [29/29]

P4::Test::TEST_F ( TofinoSccToposort ,
single_node  )

1

Variable Documentation

◆ ERROR

const std::string P4::Test::ERROR
Initial value:
=
"[--Werror=not-found] error: Unmatched check: Expected error message \"Example multi\n"
"line \\\"error\\\" message\" at line 2 not reported.\n"