diff --git a/pr-preview/4876/_json_objects_8h_source.html b/pr-preview/4876/_json_objects_8h_source.html index 07718fed15b..8573830cff2 100644 --- a/pr-preview/4876/_json_objects_8h_source.html +++ b/pr-preview/4876/_json_objects_8h_source.html @@ -6,7 +6,7 @@ -
►NP4 | TODO: this is not really specific to BMV2, it should reside somewhere else |
►NP4 | TODO: this is not really specific to BMV2, it should reside somewhere else |
Cpsa_ingress_output_metadata_t | |
Cpsa_ingress_parser_input_metadata_t | INGRESS data types |
CRefCheckContext | |
Csk_buff | Simple descriptor which replaces the kernel sk_buff structure |
Csk_buff | Simple descriptor which replaces the kernel sk_buff structure |
CUT_hash_bucket | |
CUT_hash_handle | |
CUT_hash_table |
+ |
+ P4C
+
+ The P4 Compiler
+ |
+
This is a back-end which generates code for the Behavioral Model version 2 (BMv2).
+It can accept either P4_14 programs, or P4_16 programs written for the v1model.p4
switch model.
To run and test this back-end you need some additional tools:
+sudo ldconfig
sudo pip3 install scapy
Here are some unsupported features we are aware of. We will update this list as more features get supported in the bmv2 compiler backend and as we discover more issues.
+bit<>
or int<>
)v1model.p4
The backends/bmv2/pna_nic
directory contains components specific to the BMv2's PNA NIC (Portable NIC Architecture) backend in the P4C compiler. The files in this folder depend on each other, on the files in the bmv2/common
and portable_common
directories. Most of the classes are inherited from the classes in the portable_common
directory.
Output Binary: p4c-bm2-pna
File(s) | Description |
---|---|
pnaProgramStructure.h , pnaProgramStructure.cpp | Defines and implements the program structure (metadata, parsers, controls, and deparsers) and parsing logic specific to the BMv2's PNA NIC backend. |
midend.h , midend.cpp | Defines the mid-end processing of the PNA NIC compiler. Performs various transformations and optimizations on the program's Intermediate Representation (IR). |
options.h , options.cpp | Manages the command-line options for the PNA NIC compiler. |
pnaNic.h , pnaNic.cpp | Provides backend implementation to the BMv2's PNA NIC compiler. |
main.cpp | Sets up compilation environment, integrates various components, and executes the PNA NIC compiler. |
version.h.cmake | Defines macros containing version information for the PNA NIC compiler. |
The portable_common
directory contains reusable components common to both the psa_switch
and pna_nic
backends.
File Name | Description |
---|---|
midend.h, midend.cpp | Defines the common mid-end processing of both the psa_switch and pna_nic backends. |
options.h, options.cpp | Defines the common command-line options of both the psa_switch and pna_nic backends. |
portable.h, portable.cpp | Defines common functionalities that generate representations of P4 programs. |
portableProgramStructure.h, portableProgramStructure.cpp | Defines and implements the common program structure of both the psa_switch and pna_nic backends. These files are located in the backends/common directory. |
+ |
+ P4C
+
+ The P4 Compiler
+ |
+
We follow a monthly release cadence. Our versioning scheme is as follows:
++
+
- Note
- The commit history prior to the release 1.2.2.1 is not included here but is available in the commit history.
loc_t::operator<
when parent
is nullptr
[view] (Kyle Cripps)LocationSet
s to program locations (loc_t
) instead of IR::Expression*
s [view] (Kyle Cripps)memoizeDeclsByName
[view] (Anton Korobeynikov)Click here to find Full Changelog
+IR::SwitchCase
label
expressions, instead of delaying constant folding of all IR::Mux
expressions [view]BUG_CHECK
internals [view]Click here to find Full Changelog
+MethodCallStatement
s if child MethodCallExpression
resolves to a compile-time constant. [view]dpdk
p4include files to the binary directory [view]IR::Annotation::nameAnnotation
everywhere instead of hard-coding @name
annotation name [view]ptf.log
at the same time. [view]output_to_genfiles = True
. [view]@p4runtime_translation
and @p4runtime_translation_mappings
. [view]ResolveReferences
[view]MethodCallExpression
[view]--Wdisable
or --Wwarn
to demote errors. Allow --Winfo=diagnostic
to work for diagnostic
s that can be both warnings and errors. [view]dynamic_cast
usage in the codebase in favor of ICastable interface [view]RemoveRedundantParsers
pass. [view]BaseListExpression
[view]StructExpression
[view]incompatible_use_toolchain_transition
. [view].txtpb
[view]protoc
binary [view]priority
can be used in expressions [view]addr2line
: fcntl
calls in pipe
initializations fixed. [view]For each action that is invoked keep the list of arguments that it's called with. There must be only one call of each action; this is done by LocalizeActions.
+For each action that is invoked keep the list of arguments that it's called with. There must be only one call of each action; this is done by LocalizeActions.
Scans the P4 program, run the evaluator pass, and derives the P4Runtime Ids from the top level blocks produced by the evaluator pass. The pass then computes IDs for P4Runtime nodes that are missing an ID and attaches the computed ID to the node.
+Scans the P4 program, run the evaluator pass, and derives the P4Runtime Ids from the top level blocks produced by the evaluator pass. The pass then computes IDs for P4Runtime nodes that are missing an ID and attaches the computed ID to the node.
Find P4-14 pragmas or P4-16 annotations which specify compiler or diagnostic options and generate a sequence of command-line-like arguments which can be processed by CompilerOptions or its subclasses.
-The analysis of the pragmas themselves is delegated to an IOptionPragmaParser object which can be customized by backends as needed.
+Find P4-14 pragmas or P4-16 annotations which specify compiler or diagnostic options and generate a sequence of command-line-like arguments which can be processed by CompilerOptions or its subclasses.
+The analysis of the pragmas themselves is delegated to an IOptionPragmaParser object which can be customized by backends as needed.
Although P4-16 annotations are attached to a specific program construct, this pass doesn't care what they're attached to; only their order in the program matters. This allows these annotations to be used as if they were top-level, standalone directives, and provides a natural translation path from P4-14, where truly standalone pragmas are often used. Annotations which really are specific to a certain program construct should be handled using a different approach.
Transforms a P4Info @typeSpec to a list of JSON objects matching the BF-RT format. @instanceType and @instanceName are used for logging error messages. This method currenty only supports fixed-width bitstrings as well as non-nested structs and tuples. All field names are prefixed with @prefix and suffixed with @suffix. Field ids are assigned incrementally starting at @idOffset. Field names are taken from the P4 program when possible; for tuples they are autogenerated (f1, f2, ...) unless supplied through @fieldNames.
+Transforms a P4Info @typeSpec to a list of JSON objects matching the BF-RT format. @instanceType and @instanceName are used for logging error messages. This method currenty only supports fixed-width bitstrings as well as non-nested structs and tuples. All field names are prefixed with @prefix and suffixed with @suffix. Field ids are assigned incrementally starting at @idOffset. Field names are taken from the P4 program when possible; for tuples they are autogenerated (f1, f2, ...) unless supplied through @fieldNames.
Backend is a the base class for SimpleSwitchBackend and PortableSwitchBackend. +
Backend is a the base class for SimpleSwitchBackend and PortableSwitchBackend. More...
#include <backend.h>
Backend is a the base class for SimpleSwitchBackend and PortableSwitchBackend.
+Backend is a the base class for SimpleSwitchBackend and PortableSwitchBackend.
This CFG models the BMV2 notion of control-flow graph. In BMv2 there are only 2 types of nodes: If and Table.
+This CFG models the BMV2 notion of control-flow graph. In BMv2 there are only 2 types of nodes: If and Table.
BMv2 is very restricted in the kinds of graphs it supports. Thie method checks whether a CFG is implementable.
+BMv2 is very restricted in the kinds of graphs it supports. Thie method checks whether a CFG is implementable.
A CFG Edge; can be an in-edge or out-edge. +
A CFG Edge; can be an in-edge or out-edge. More...
#include <controlFlowGraph.h>
Check if this destination appears in this edgeset. Importantly, a TableNode is a destination if it points to the same table as an existing destination (pointer equality is not enough).
+Check if this destination appears in this edgeset. Importantly, a TableNode is a destination if it points to the same table as an existing destination (pointer equality is not enough).
diff --git a/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_c_f_g_1_1_if_node-members.html b/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_c_f_g_1_1_if_node-members.html index 082469d3660..16ce88bd81a 100644 --- a/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_c_f_g_1_1_if_node-members.html +++ b/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_c_f_g_1_1_if_node-members.html @@ -6,7 +6,7 @@ -This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums that are not part of the v1model. Use 32-bit values for all enums.
+This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums that are not part of the v1model. Use 32-bit values for all enums.
Each architecture typically has some special parameters that requires special handling. The examples are standard_metadata in the v1model and packet path related metadata in PSA. Each target should subclass the ExpressionConverter and implement this function with target-specific handling code to deal with the special parameters.
+Each architecture typically has some special parameters that requires special handling. The examples are standard_metadata in the v1model and packet path related metadata in PSA. Each target should subclass the ExpressionConverter and implement this function with target-specific handling code to deal with the special parameters.
Implemented in P4::BMV2::SimpleSwitchExpressionConverter.
diff --git a/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_extern_converter-members.html b/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_extern_converter-members.html index abf8013f977..bc7563e2ad4 100644 --- a/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_extern_converter-members.html +++ b/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_extern_converter-members.html @@ -6,7 +6,7 @@ -Adds program information to the top-level JsonObject.
+Adds program information to the top-level JsonObject.
This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums that are not part of the psa. Use 32-bit values for all enums. Also convert PSA_PacketPath_t to bit<32>
+This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums that are not part of the psa. Use 32-bit values for all enums. Also convert PSA_PacketPath_t to bit<32>
Each architecture typically has some special parameters that requires special handling. The examples are standard_metadata in the v1model and packet path related metadata in PSA. Each target should subclass the ExpressionConverter and implement this function with target-specific handling code to deal with the special parameters.
+Each architecture typically has some special parameters that requires special handling. The examples are standard_metadata in the v1model and packet path related metadata in PSA. Each target should subclass the ExpressionConverter and implement this function with target-specific handling code to deal with the special parameters.
Implements P4::BMV2::ExpressionConverter.
diff --git a/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_simple_switch_mid_end-members.html b/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_simple_switch_mid_end-members.html index 267a4f10c0a..6b8a4ef425c 100644 --- a/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_simple_switch_mid_end-members.html +++ b/pr-preview/4876/class_p4_1_1_b_m_v2_1_1_simple_switch_mid_end-members.html @@ -6,7 +6,7 @@ -This class implements a policy suitable for the SynthesizeActions pass. +
This class implements a policy suitable for the SynthesizeActions pass. More...
#include <backend.h>
This class implements a policy suitable for the SynthesizeActions pass.
+This class implements a policy suitable for the SynthesizeActions pass.
are in the specified set. For example, we expect that the code in the deparser will not use any tables or actions.
The name of BMV2's valid field. This is a hidden bit<1> field automatically added by BMV2 to all header types; reading from it tells you whether the header is valid, just as if you had called isValid().
+The name of BMV2's valid field. This is a hidden bit<1> field automatically added by BMV2 to all header types; reading from it tells you whether the header is valid, just as if you had called isValid().
A base compilation context which provides members needed by code in libp4ctoolkit
. Compilation context types should normally inherit from BaseCompileContext.
A base compilation context which provides members needed by code in libp4ctoolkit
. Compilation context types should normally inherit from BaseCompileContext.
P4::error()
. P4::error()
. P4::info()
. P4::info()
. Reimplemented in P4::P4CContext.
@@ -295,7 +295,7 @@P4::warning()
. P4::warning()
. Reimplemented in P4::P4CContext.
diff --git a/pr-preview/4876/class_p4_1_1_base_location-members.html b/pr-preview/4876/class_p4_1_1_base_location-members.html index 1fb3090a02f..96a25436372 100644 --- a/pr-preview/4876/class_p4_1_1_base_location-members.html +++ b/pr-preview/4876/class_p4_1_1_base_location-members.html @@ -6,7 +6,7 @@ -Base class for EqualityConstraint and CanBeImplicitlyCastConstraint. +
Base class for EqualityConstraint and CanBeImplicitlyCastConstraint. More...
#include <typeConstraints.h>
Base class for EqualityConstraint and CanBeImplicitlyCastConstraint.
+Base class for EqualityConstraint and CanBeImplicitlyCastConstraint.
The resource map represents the mapping from IR::Node to IR::Block. This pass relies on the information generated by the most recent Evaluator pass. The Evaluator pass generates a mapping from IR::Block to IR::Node. This pass provides a reversed map.
+The resource map represents the mapping from IR::Node to IR::Block. This pass relies on the information generated by the most recent Evaluator pass. The Evaluator pass generates a mapping from IR::Block to IR::Node. This pass provides a reversed map.
Base class which can be used to prepare classes for checking constraints for invocations of externs (both methods and pure functions) in parsers and control blocks.
This class contains basic operations which should be common for checkers used for various targets and architectures.
-Example class which inherits from this base class can be seen in backends/dpdk/dpdkCheckExternInvocation.h.
+Example class which inherits from this base class can be seen in backends/dpdk/dpdkCheckExternInvocation.h.
Method used to initialize the constraints.
-Method setPipeConstraints() can be used in implementation of initPipeConstraints() method to initialize the constraints.
-Method initPipeConstraints() should be called in the constructor of inheriting class.
+Method setPipeConstraints() can be used in implementation of initPipeConstraints() method to initialize the constraints.
+Method initPipeConstraints() should be called in the constructor of inheriting class.
@@ -676,7 +676,7 @@Set the pipe (parser/control block) constraints.
-Should be used in the initPipeConstraints() method.
+Should be used in the initPipeConstraints() method.
extType | Name of the extern object or function for which we set constraints. |
bool | isv1 () const |
True if we are compiling a P4 v1.0 or v1.1 program. | |
True if we are compiling a P4 v1.0 or v1.1 program. | |
std::optional< ParserOptions::PreprocessorResult > | preprocess () const |
Builds a CallGraph of ParserState nodes.
+Builds a CallGraph of ParserState nodes.
FieldIdAllocator is used to allocate ids for non top-level P4Info objects that need them (match fields, action parameters, packet IO metadata fields). Some of these ids can come from the P4 program (@id annotation), the rest is auto-generated.
+class P4::ControlPlaneAPI::FieldIdAllocator< T >FieldIdAllocator is used to allocate ids for non top-level P4Info objects that need them (match fields, action parameters, packet IO metadata fields). Some of these ids can come from the P4 program (@id annotation), the rest is auto-generated.
diff --git a/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_flatten_header-members.html b/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_flatten_header-members.html index 26557003999..d71f9741736 100644 --- a/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_flatten_header-members.html +++ b/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_flatten_header-members.html @@ -6,7 +6,7 @@ -
@@ -160,7 +160,7 @@
| |
This object maps P4 control plane names to their P4Runtime IDs and vice versa. It uses the P4Info object to populate the maps. Since ids for action parameters and table keys are not unique, we use a pairing function to compute a unique identifier. This pairing function uses the id of the parent object (e.g., a table or action) and combines it with the id of the parameter or key element to create a unique identifier.
+This object maps P4 control plane names to their P4Runtime IDs and vice versa. It uses the P4Info object to populate the maps. Since ids for action parameters and table keys are not unique, we use a pairing function to compute a unique identifier. This pairing function uses the id of the parent object (e.g., a table or action) and combines it with the id of the parameter or key element to create a unique identifier.
An analyzer which translates the information available in the P4 IR into a representation of the control plane API which is consumed by P4Runtime.
+An analyzer which translates the information available in the P4 IR into a representation of the control plane API which is consumed by P4Runtime.
Sets the pkg_info field of the P4Info message, using the annotations on the P4 program package.
+Sets the pkg_info field of the P4Info message, using the annotations on the P4 program package.
Analyze a P4 program and generate a P4Runtime control plane API.
+Analyze a P4 program and generate a P4Runtime control plane API.
program | The P4 program to analyze. |
program | The P4 program to analyze. |
evaluatedProgram | An up-to-date evaluated version of the program. |
refMap | An up-to-date reference map. |
refMap | An up-to-date type map. |
archHandler | An implementation of P4RuntimeArchHandlerIface which handles architecture-specific constructs (e.g. externs). |
archHandler | An implementation of P4RuntimeArchHandlerIface which handles architecture-specific constructs (e.g. externs). |
arch | The name of the P4_16 architecture the program was written against. |
The interface for defining the P4Info serialization logic for a specific P4 architecture. The goal is to reduce code duplication between architectures. The P4RuntimeSerializer will call these methods when generating the P4Info message to handle architecture-specific parts. P4RuntimeSerializer generates the P4Info in two passes: first it collects all the control-plane visible symbols from the program into the symbol table, then it builds the P4Info message by adding each collected entity to the Protobuf message. The collect* methods are called in the first pass, the add* methods are called in the second pass.
+The interface for defining the P4Info serialization logic for a specific P4 architecture. The goal is to reduce code duplication between architectures. The P4RuntimeSerializer will call these methods when generating the P4Info message to handle architecture-specific parts. P4RuntimeSerializer generates the P4Info in two passes: first it collects all the control-plane visible symbols from the program into the symbol table, then it builds the P4Info message by adding each collected entity to the Protobuf message. The collect* methods are called in the first pass, the add* methods are called in the second pass.
A converter which translates the 'entries' or 'const entries' for P4 tables (if any) into a P4Runtime WriteRequest message which can be used by a target to initialize its tables.
+A converter which translates the 'entries' or 'const entries' for P4 tables (if any) into a P4Runtime WriteRequest message which can be used by a target to initialize its tables.
This approach of constructing the symbol table is intended to encourage correct usage. The symbol table should be used in phases: first, we collect symbols and populate the table. Then, ids are assigned. Finally, the P4Runtime serialization code can read the ids from the table as needed. To ensure that no code accidentally adds new symbols after ids are assigned, create() enforces that only code that runs before id assignment has access to a non-const reference to the symbol table.
+This approach of constructing the symbol table is intended to encourage correct usage. The symbol table should be used in phases: first, we collect symbols and populate the table. Then, ids are assigned. Finally, the P4Runtime serialization code can read the ids from the table as needed. To ensure that no code accidentally adds new symbols after ids are assigned, create() enforces that only code that runs before id assignment has access to a non-const reference to the symbol table.
diff --git a/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_p4_runtime_symbol_table_iface-members.html b/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_p4_runtime_symbol_table_iface-members.html index b9836fbdf9a..832c1a2014e 100644 --- a/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_p4_runtime_symbol_table_iface-members.html +++ b/pr-preview/4876/class_p4_1_1_control_plane_a_p_i_1_1_p4_runtime_symbol_table_iface-members.html @@ -6,7 +6,7 @@ -Base class for the different types introduced by the P4 architecture. The class includes static factory methods for all the built-in P4 types common to all architectures. When defining the P4Info serialization logic for a new architecture, the first step is to inherit from this class and add factory methods for architecture-specific types. The class is used to separate all symbols by type in the symbol table which is responsible for control-plane id assignment.
+Base class for the different types introduced by the P4 architecture. The class includes static factory methods for all the built-in P4 types common to all architectures. When defining the P4Info serialization logic for a new architecture, the first step is to inherit from this class and add factory methods for architecture-specific types. The class is used to separate all symbols by type in the symbol table which is responsible for control-plane id assignment.
Parent class for P4RuntimeArchHandlerV1Model and P4RuntimeArchHandlerPSA; it includes all the common code between the two architectures (which is only dependent on the @arch template parameter. The major difference at the moment is handling of digest, which is an extern function in v1model and an extern type in PSA.
+class P4::ControlPlaneAPI::Standard::P4RuntimeArchHandlerCommon< arch >Parent class for P4RuntimeArchHandlerV1Model and P4RuntimeArchHandlerPSA; it includes all the common code between the two architectures (which is only dependent on the @arch template parameter. The major difference at the moment is handling of digest, which is an extern function in v1model and an extern type in PSA.
Implements P4RuntimeArchHandlerIface for the UBPF architecture. We re-use PSA to handle externs. Rationale: The only configurable extern object in ubpf_model.p4 is Register. The Register is defined exactly the same as for PSA. Therefore, we can re-use PSA.
+Implements P4RuntimeArchHandlerIface for the UBPF architecture. We re-use PSA to handle externs. Rationale: The only configurable extern object in ubpf_model.p4 is Register. The Register is defined exactly the same as for PSA. Therefore, we can re-use PSA.
Extends P4RuntimeSymbolType for the DPDK extern types. +
Extends P4RuntimeSymbolType for the DPDK extern types. More...
#include <bfruntime_arch_handler.h>
Extends P4RuntimeSymbolType for the DPDK extern types.
+Extends P4RuntimeSymbolType for the DPDK extern types.
CollectNodes iterates across selected nodes in the P4 program and collects them in a "CoverageSet". The nodes to collect are specified as options to the collector.
+CollectNodes iterates across selected nodes in the P4 program and collects them in a "CoverageSet". The nodes to collect are specified as options to the collector.
This recursion requires the pass of ConvertLogicalExpression. This pass will transform the logical experssion to a form that this function use as presumption. The presumption of this function is that the left side of the logical expression can be a simple expression(expression that is not +
This recursion requires the pass of ConvertLogicalExpression. This pass will transform the logical experssion to a form that this function use as presumption. The presumption of this function is that the left side of the logical expression can be a simple expression(expression that is not LAnd or LOr) or a nested expression(LAnd or LOr). The right side can be a nested expression or {simple one if left side is simple as well}.
This function convert IfStatement to dpdk asm. Based on the return value of BranchingInstructionGeneration's recursion function, this function decides whether the true or false code block will go first. This is important because following optimization pass might eliminate some redundant jmps and labels.
+This function convert IfStatement to dpdk asm. Based on the return value of BranchingInstructionGeneration's recursion function, this function decides whether the true or false code block will go first. This is important because following optimization pass might eliminate some redundant jmps and labels.
diff --git a/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_dpdk_arch-members.html b/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_dpdk_arch-members.html index 4f6208e626d..ffbced57c85 100644 --- a/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_dpdk_arch-members.html +++ b/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_dpdk_arch-members.html @@ -6,7 +6,7 @@ -This function checks if a table satisfies the DPDK limitations mentioned below:
This function checks if a table satisfies the DPDK limitations mentioned below:
Insert the metadata structure updated with tmp variables created during parser conversion Add all the structures to DPDK structtype.
+Insert the metadata structure updated with tmp variables created during parser conversion Add all the structures to DPDK structtype.
diff --git a/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_string-members.html b/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_string-members.html index 44a0825e52c..3a0921ec9f0 100644 --- a/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_string-members.html +++ b/pr-preview/4876/class_p4_1_1_d_p_d_k_1_1_convert_to_string-members.html @@ -6,7 +6,7 @@ -This Pass emits Table config consumed by dpdk target in a text file if const entries are present in p4 program. Most of the code taken from control-plane/p4RuntimeSerializer.h/.cpp
+This Pass emits Table config consumed by dpdk target in a text file if const entries are present in p4 program. Most of the code taken from control-plane/p4RuntimeSerializer.h/.cpp
This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums to bit<32>
+This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums to bit<32>
This class implements a policy suitable for the ConvertErrors pass. The policy is: convert all errors to specified width.
+This class implements a policy suitable for the ConvertErrors pass. The policy is: convert all errors to specified width.
DPDK implements pass metadata using "recircid" instruction. All occurrences of pass metadata usage should be prepended with recircid instruction to fetch the latest pass_id from the target.
+DPDK implements pass metadata using "recircid" instruction. All occurrences of pass metadata usage should be prepended with recircid instruction to fetch the latest pass_id from the target.
Common code between SplitActionSelectorTable and SplitActionProfileTable
+Common code between SplitActionSelectorTable and SplitActionProfileTable
create P4Table object that represents the matching part of the original P4 table. This table sets the internal group_id or member_id which are used for subsequent table lookup.
+create P4Table object that represents the matching part of the original P4 table. This table sets the internal group_id or member_id which are used for subsequent table lookup.
Checks for the use of symbols that are marked as
Checks for the use of symbols that are marked as
implement a pass to convert Type_Enum to Type_Bits
-User must provide a class to extend ChooseEnumRepresentation to specify the width of the generated Type_Bits. User must also implement a policy to decide whether an Enum type shall be converted.
+User must provide a class to extend ChooseEnumRepresentation to specify the width of the generated Type_Bits. User must also implement a policy to decide whether an Enum type shall be converted.
Example:
enum e { A, B, }
struct st { // Type_Name A a; }
diff --git a/pr-preview/4876/class_p4_1_1_do_convert_errors-members.html b/pr-preview/4876/class_p4_1_1_do_convert_errors-members.html index 71b38a9e865..eb2f90127d4 100644 --- a/pr-preview/4876/class_p4_1_1_do_convert_errors-members.html +++ b/pr-preview/4876/class_p4_1_1_do_convert_errors-members.html @@ -6,7 +6,7 @@ -Flatten header union stack variabls into its individual elements. All occurrences of the header union stack variables are replaced by the elements in the stack. For ex: header_union U { Hdr1 h1; Hdr2 h2; }
struct Headers { Hdr1 h1; U[2] u; }
is replaced by struct Headers { Hdr1 h1; U u0; U u1; } References to u[0] are replaced by u0. Likewise for all stack elements.
-This pass assumes that HSIndexSimplifier, ParsersUnroll passes are run before this and all indices for header union stack variables are constants.
+This pass assumes that HSIndexSimplifier, ParsersUnroll passes are run before this and all indices for header union stack variables are constants.
This pass operates on action bodies and is ran right after the Inspector pass. It propagates the values for variables that got their values assigned to them before the action call.
+This pass operates on action bodies and is ran right after the Inspector pass. It propagates the values for variables that got their values assigned to them before the action call.
Local copy propagation and dead code elimination within a single pass. This pass is designed to be run after all declarations have received unique internal names. This is important because the locals map uses only the declaration name, and not the full path.
Requires that all declaration names be globally unique (obtained by running UniqueNames).
-Requires that all variable declarations are at the top-level control scope (obtained using MoveDeclarations).
+Requires that all declaration names be globally unique (obtained by running UniqueNames).
+Requires that all variable declarations are at the top-level control scope (obtained using MoveDeclarations).
policy | |
This visitor removes "exit" calls. It is significantly more involved than return removal, since an exit in an action causes the calling control to terminate. This pass assumes that each statement in a control block can exit only once – so it should be run after a pass that enforces this, e.g., SideEffectOrdering. (E.g., it does not handle: if (t1.apply().hit && t2.apply().hit) { ... } It also assumes that there are no global actions and that action calls have been inlined.
+This visitor removes "exit" calls. It is significantly more involved than return removal, since an exit in an action causes the calling control to terminate. This pass assumes that each statement in a control block can exit only once – so it should be run after a pass that enforces this, e.g., SideEffectOrdering. (E.g., it does not handle: if (t1.apply().hit && t2.apply().hit) { ... } It also assumes that there are no global actions and that action calls have been inlined.
This pass also handles header fields in variables of derived types, like structs and unions.
-s = { { 1, 2 } };
is converted to:
s.h.setValid(); s = { { 1, 2 } };
-Transform complex table keys into simpler expressions.
+Transform complex table keys into simpler expressions.
Converts select(a, b, c) into select(a ++ b ++ c) &&& (maska ++ maskb ++ maskc). A similar transformation is done for the labels.
Converts select(a, b, c) into select(a ++ b ++ c) &&& (maska ++ maskb ++ maskc). A similar transformation is done for the labels.
f.isValid()
: @name("f.isValid()")
f[3:0]
: @name("f[3:0]")
@name
annotations.Emit a compilation error if the program contains complex key expressions without @name
annotations.
Represents a target compiled by bcc that uses the TC. +
Represents a target compiled by bcc that uses the TC. More...
#include <target.h>
Represents a target compiled by bcc that uses the TC.
+Represents a target compiled by bcc that uses the TC.
This method generates a C code that is responsible for updating a CRC check value from a given data.
-From following P4 code: Checksum<bit<32>>(PSA_HashAlgorithm_t.CRC32) checksum; checksum.update(parsed_hdr.crc.f1); There will be generated a C code: crc32_update(&c_0_reg, (u8 *) &(parsed_hdr->crc.f1), 5, 0xEDB88320); Where: c_0_reg - a checksum internal state (CRC register) parsed_hdr->field1 - a data on which CRC is calculated 5 - a field size in bytes 0xEDB88320 - a polynomial in a reflected bit order.
+From following P4 code: Checksum<bit<32>>(PSA_HashAlgorithm_t.CRC32) checksum; checksum.update(parsed_hdr.crc.f1); There will be generated a C code: crc32_update(&c_0_reg, (u8 *) &(parsed_hdr->crc.f1), 5, 0xEDB88320); Where: c_0_reg - a checksum internal state (CRC register) parsed_hdr->field1 - a data on which CRC is calculated 5 - a field size in bytes 0xEDB88320 - a polynomial in a reflected bit order.
Implements P4::EBPF::EBPFHashAlgorithmPSA.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_code_builder-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_code_builder-members.html index 04264d246a7..817ff0a0efc 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_code_builder-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_code_builder-members.html @@ -6,7 +6,7 @@ -Visitor for generating C for EBPF. This visitor is invoked on various subtrees.
+Visitor for generating C for EBPF. This visitor is invoked on various subtrees.
Since CodeGenInspector also generates C comments, this variable keeps track of the current comment depth.
+Since CodeGenInspector also generates C comments, this variable keeps track of the current comment depth.
P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_checksum_p_s_a-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_checksum_p_s_a-members.html index cd099d009e2..349d853e3ec 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_checksum_p_s_a-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_checksum_p_s_a-members.html @@ -6,7 +6,7 @@ -EBPFEgressPipeline represents a hook-independent EBPF-based egress pipeline. It includes common definitions for TC and XDP.
+EBPFEgressPipeline represents a hook-independent EBPF-based egress pipeline. It includes common definitions for TC and XDP.
P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_error_type-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_error_type-members.html index 05384593222..f88418c95b7 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_error_type-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_error_type-members.html @@ -6,7 +6,7 @@ -P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_hash_algorithm_p_s_a-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_hash_algorithm_p_s_a-members.html index 9d17687f101..3b150f8fa88 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_hash_algorithm_p_s_a-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_hash_algorithm_p_s_a-members.html @@ -6,7 +6,7 @@ -EBPFIngressPipeline represents a hook-independent EBPF-based ingress pipeline. It includes common definitions for TC and XDP.
+EBPFIngressPipeline represents a hook-independent EBPF-based ingress pipeline. It includes common definitions for TC and XDP.
Base class for EBPF objects. +
Base class for EBPF objects. More...
#include <ebpfObject.h>
Base class for EBPF objects.
+Base class for EBPF objects.
EBPFPipeline represents a single eBPF program in the TC/XDP hook. +
EBPFPipeline represents a single eBPF program in the TC/XDP hook. More...
#include <ebpfPipeline.h>
EBPFPipeline represents a single eBPF program in the TC/XDP hook.
+EBPFPipeline represents a single eBPF program in the TC/XDP hook.
Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
+Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
Reimplemented in P4::EBPF::TCIngressPipeline, P4::EBPF::TCTrafficManagerForXDP, P4::EBPF::XDPEgressPipeline, P4::EBPF::XDPIngressPipeline, and P4::TC::TCIngressPipelinePNA.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_program-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_program-members.html index a24afddfce0..74539cbfa49 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_program-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_program-members.html @@ -6,7 +6,7 @@ -P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_stack_type-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_stack_type-members.html index 367d418b3f3..868f0abd178 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_stack_type-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_stack_type-members.html @@ -6,7 +6,7 @@ -P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_struct_type-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_struct_type-members.html index 94cc00da448..d5bc0a50779 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_struct_type-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_struct_type-members.html @@ -6,7 +6,7 @@ -P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table-members.html index f585d28b1b8..f9d34d1ba8d 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table-members.html @@ -6,7 +6,7 @@ -We use vectors to keep an order of Direct Meters or Counters from a P4 program. This order is important from CLI tool point of view.
+We use vectors to keep an order of Direct Meters or Counters from a P4 program. This order is important from CLI tool point of view.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table_p_s_a_direct_counter_property_visitor-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table_p_s_a_direct_counter_property_visitor-members.html index 9e1c5263490..d8599a8661f 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table_p_s_a_direct_counter_property_visitor-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_table_p_s_a_direct_counter_property_visitor-members.html @@ -6,7 +6,7 @@ -Base class for EBPF types. +
Base class for EBPF types. More...
#include <ebpfType.h>
Base class for EBPF types.
+Base class for EBPF types.
This should not always implement IHasWidth, but it may... +
This should not always implement IHasWidth, but it may... More...
#include <ebpfType.h>
This should not always implement IHasWidth, but it may...
+This should not always implement IHasWidth, but it may...
P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_value_set-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_value_set-members.html index bf1405047b2..0a5948bbc2e 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_value_set-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_e_b_p_f_value_set-members.html @@ -6,7 +6,7 @@ -P4 width.
+P4 width.
Implemented in P4::EBPF::EBPFBoolType, P4::EBPF::EBPFEnumType, P4::EBPF::EBPFErrorType, P4::EBPF::EBPFScalarType, P4::EBPF::EBPFStackType, P4::EBPF::EBPFStructType, P4::EBPF::EBPFTypeName, and P4::UBPF::UBPFListType.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_ingress_deparser_p_s_a-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_ingress_deparser_p_s_a-members.html index 30342659b32..7b09636c3b8 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_ingress_deparser_p_s_a-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_ingress_deparser_p_s_a-members.html @@ -6,7 +6,7 @@ -This pass rewrites expressions which are not supported natively on EBPF. +
This pass rewrites expressions which are not supported natively on EBPF. More...
#include <lower.h>
This pass rewrites expressions which are not supported natively on EBPF.
+This pass rewrites expressions which are not supported natively on EBPF.
Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
+Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
Reimplemented from P4::EBPF::EBPFPipeline.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_t_c_traffic_manager_for_x_d_p-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_t_c_traffic_manager_for_x_d_p-members.html index d818eaa7a72..005ea424606 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_t_c_traffic_manager_for_x_d_p-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_t_c_traffic_manager_for_x_d_p-members.html @@ -6,7 +6,7 @@ -Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
+Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
Reimplemented from P4::EBPF::TCIngressPipeline.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_target-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_target-members.html index f4ccb67ac79..8d99a24f470 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_target-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_target-members.html @@ -6,7 +6,7 @@ -Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
+Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
Reimplemented from P4::EBPF::EBPFPipeline.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_x_d_p_help_program-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_x_d_p_help_program-members.html index c1ad71623df..8343f269896 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_x_d_p_help_program-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_x_d_p_help_program-members.html @@ -6,7 +6,7 @@ -Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
+Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
Reimplemented from P4::EBPF::EBPFPipeline.
diff --git a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_xdp_target-members.html b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_xdp_target-members.html index cc61f6016f5..d8e48b87f09 100644 --- a/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_xdp_target-members.html +++ b/pr-preview/4876/class_p4_1_1_e_b_p_f_1_1_xdp_target-members.html @@ -6,7 +6,7 @@ -Target XDP. +
Target XDP. More...
#include <target.h>
Target XDP.
+Target XDP.
This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums that are not part of the v1model. Use 32-bit values for all enums.
+This class implements a policy suitable for the ConvertEnums pass. The policy is: convert all enums that are not part of the v1model. Use 32-bit values for all enums.
P4::info()
. P4::info()
. P4::warning()
. P4::warning()
. P4::info()
. P4::info()
. P4::warning()
. P4::warning()
. Optional constructor argument expandHeader determines whether headers are expanded or not. See also description in class DoExpandLookahead.
+Optional constructor argument expandHeader determines whether headers are expanded or not. See also description in class DoExpandLookahead.
Builds a SpecializationMap of instantiations with constant values for type and constructor arguments.
+Builds a SpecializationMap of instantiations with constant values for type and constructor arguments.
Global copy propagation, currently only operationg on control blocks where it optimizes the bodies of actions by propagating literal values for variables used in those actions. Pass is limited to only optimizing actions called in the 'apply' body of the control block and has no effect on actions found in tables. This pass is designed as an extension of the LocalCopyPropagation pass, but the logic has been separated into a standalone pass to avoid additionally complicating the LocalCopyProp pass. GlobalCopyPropagation pass was made with the intent of being used together with the existing LocalCopyPropagation pass, and therefore doesn't introduce some of the features of that pass.
-The logic of this pass is divided into 2 passes, an Inspector pass that collects information on the variables used in the program and their values at the time of the action call and a Transformer pass that uses this information to edit the action bodies. The nature of the below mentionied optimization is such that it requires retroactive transformations to the action bodies, and this was the reason for having 2 separate passes.
+Global copy propagation, currently only operationg on control blocks where it optimizes the bodies of actions by propagating literal values for variables used in those actions. Pass is limited to only optimizing actions called in the 'apply' body of the control block and has no effect on actions found in tables. This pass is designed as an extension of the LocalCopyPropagation pass, but the logic has been separated into a standalone pass to avoid additionally complicating the LocalCopyProp pass. GlobalCopyPropagation pass was made with the intent of being used together with the existing LocalCopyPropagation pass, and therefore doesn't introduce some of the features of that pass.
+The logic of this pass is divided into 2 passes, an Inspector pass that collects information on the variables used in the program and their values at the time of the action call and a Transformer pass that uses this information to edit the action bodies. The nature of the below mentionied optimization is such that it requires retroactive transformations to the action bodies, and this was the reason for having 2 separate passes.
The main situation that this pass optimizes is given below: ... control ing(out bit<16> y, ...) { bit<16> x; action do_action() { y = x; }
apply { x = 16w5; do_action(); } } ...
, and after optimization: ... control ing(out bit<16> y, ...) { action do_action() { y = 16w5; }
apply { do_action(); } } ...
-Passmanager to group necessary passes for flattening header unions
Indicates whether to enable the a - constant
to a + (-constant)
in StrengthReduction.
Indicates whether to enable the a - constant
to a + (-constant)
in StrengthReduction.
Get policy for the constant folding pass.
Get policy for the constant folding pass.
Inline functions. This must be executed after SideEffectOrdering and RemoveReturns.
+Inline functions. This must be executed after SideEffectOrdering and RemoveReturns.
Handy type conversion methods that can be inherited by various base classes. In order to use ICastable one also need to provide intrusive lightweight RTTI metadata for the given class hierarchy. See docs/C++.md
for more information, but in short, one need to use DECLARE_TYPEINFO() macro for this. There is no DECLARE_TYPEINFO for ICastable itself as we are not expecting pointers neither to ICastable nor to RTTI::Base to appear within the codebase. As the same time, one should not cast to ICastable as well (via e.g. ->to<ICastable>()
. Use DECLARE_TYPEINFO without bases to specify the base class for a given herarchy.
Handy type conversion methods that can be inherited by various base classes. In order to use ICastable one also need to provide intrusive lightweight RTTI metadata for the given class hierarchy. See docs/C++.md
for more information, but in short, one need to use DECLARE_TYPEINFO() macro for this. There is no DECLARE_TYPEINFO for ICastable itself as we are not expecting pointers neither to ICastable nor to RTTI::Base to appear within the codebase. As the same time, one should not cast to ICastable as well (via e.g. ->to<ICastable>()
. Use DECLARE_TYPEINFO without bases to specify the base class for a given herarchy.
An interface for compiler option pragma parsers; used to customize the behavior of ApplyOptionsPragmas.
+An interface for compiler option pragma parsers; used to customize the behavior of ApplyOptionsPragmas.
A Vector which holds objects which are instances of IDeclaration, and keeps an index so that they can be quickly looked up by name.
+class P4::IR::IndexedVector< T >A Vector which holds objects which are instances of IDeclaration, and keeps an index so that they can be quickly looked up by name.
Appends the provided node or vector of nodes to the end of this Vector.
+Appends the provided node or vector of nodes to the end of this Vector.
item | A node to append; if this is a Vector, its contents will be appended. |
item | A node to append; if this is a Vector, its contents will be appended. |
This pass is an adaptation of the midend code SimplifyKey. If a key computation involves side effects then all key field computations are lifted prior to the table application. We need to lift all key field computations since the order of side-effects needs to be preserved.
+This pass is an adaptation of the midend code SimplifyKey. If a key computation involves side effects then all key field computations are lifted prior to the table application. We need to lift all key field computations since the order of side-effects needs to be preserved.
This class is very useful for extracting information out of MethodCallExpressions. Since there are no function pointers in P4, methods can completely be resolved at compilation time. The static method 'resolve' will categorize each method call into one of several kinds:
This class is very useful for extracting information out of MethodCallExpressions. Since there are no function pointers in P4, methods can completely be resolved at compilation time. The static method 'resolve' will categorize each method call into one of several kinds:
See also the ConstructorCall class and the MethodCallDescription class below.
+See also the ConstructorCall class and the MethodCallDescription class below.
Moves all local declarations in a control or parser to the "top", including the ones in the control body and parser states. Also, if the control has nested actions, move the declarations from the actions to the enclosing control.
-After MoveDeclarations, some variable declarations in the "local" section of a parser and control may still have initializers; these are moved into a new start state, and to the beginning of the apply body repectively.
-After MoveDeclarations, some variable declarations in the "local" section of a parser and control may still have initializers; these are moved into a new start state, and to the beginning of the apply body repectively.
+A KeyIsSimple policy formed by combining two other policies with a logical 'or'.
+A KeyIsSimple policy formed by combining two other policies with a logical 'or'.
A P4CConfiguration is a set of parameters to the compiler that cannot be changed via user options. Implementations should be singleton classes.
+A P4CConfiguration is a set of parameters to the compiler that cannot be changed via user options. Implementations should be singleton classes.
P4::info()
. P4::info()
. P4::warning()
. P4::warning()
. P4::info()
. P4::info()
. Reimplemented from P4::BaseCompileContext.
@@ -322,7 +322,7 @@P4::warning()
. P4::warning()
. Reimplemented from P4::BaseCompileContext.
diff --git a/pr-preview/4876/class_p4_1_1_p4_c_context_with_options-members.html b/pr-preview/4876/class_p4_1_1_p4_c_context_with_options-members.html index 17d739ec35f..92cf1333980 100644 --- a/pr-preview/4876/class_p4_1_1_p4_c_context_with_options-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_c_context_with_options-members.html @@ -6,7 +6,7 @@ -P4::info()
. P4::info()
. P4::warning()
. P4::warning()
. A utility template which can be used to easily make subclasses of P4CContext which expose a particular subclass of CompilerOptions. This is provided as a convenience since this is all many backends need.
+class P4::P4CContextWithOptions< OptionsType >A utility template which can be used to easily make subclasses of P4CContext which expose a particular subclass of CompilerOptions. This is provided as a convenience since this is all many backends need.
An IOptionPragmaParser implementation that supports basic pragmas that all backends can support.
-P4COptionPragmaParser recognizes:
An IOptionPragmaParser implementation that supports basic pragmas that all backends can support.
+P4COptionPragmaParser recognizes:
pragma diagnostic [diagnostic name] [disable|warn|error]
@diagnostic([diagnostic name], ["disable"|"warn"|"error"])
error
declaration. error
declaration. The top-level nodes that make up the P4 program (or program fragment) we're parsing.
+The top-level nodes that make up the P4 program (or program fragment) we're parsing.
diff --git a/pr-preview/4876/class_p4_1_1_p4_runtime_serializer-members.html b/pr-preview/4876/class_p4_1_1_p4_runtime_serializer-members.html index 0cd93ed9752..aae81c08a5b 100644 --- a/pr-preview/4876/class_p4_1_1_p4_runtime_serializer-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_runtime_serializer-members.html @@ -6,7 +6,7 @@ -The namespace context in the IR for the current state. The innermost element is the P4 program, representing the top-level namespace.
+The namespace context in the IR for the current state. The innermost element is the P4 program, representing the top-level namespace.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_abstract_p4c_tool-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_abstract_p4c_tool-members.html index a6f1701d2c9..c64411ace19 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_abstract_p4c_tool-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_abstract_p4c_tool-members.html @@ -6,7 +6,7 @@ -Abstract class for all compiler-based tools. Implementations should instantiate this template on a subclass of AbstractP4cToolOptions.
+class P4::P4Tools::AbstractP4cTool< Options, typename >Abstract class for all compiler-based tools. Implementations should instantiate this template on a subclass of AbstractP4cToolOptions.
program | The P4 program after mid-end processing. |
program | The P4 program after mid-end processing. |
Specifies a canonical representation of the target pipeline as documented in P4 code. +
Specifies a canonical representation of the target pipeline as documented in P4 code. More...
#include <arch_spec.h>
@@ -158,7 +158,7 @@
| |
Specifies a canonical representation of the target pipeline as documented in P4 code.
+Specifies a canonical representation of the target pipeline as documented in P4 code.
An ArchMember represents a construct in the pipe. It has a name and parameters.
+An ArchMember represents a construct in the pipe. It has a name and parameters.
Class Members | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_compile_context-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_compile_context-members.html
index 10cefb3fcff..d3bc0bc5cfa 100644
--- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_compile_context-members.html
+++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_compile_context-members.html
@@ -6,7 +6,7 @@
-
- A compilation context for P4Tools that provides a custom compiler configuration. + A compilation context for P4Tools that provides a custom compiler configuration. More...
|
void | setDefaultInfoDiagnosticAction (DiagnosticAction action) | | set the default diagnostic action for calls to | P4::info() . | set the default diagnostic action for calls to | P4::info() . |
void | setDefaultWarningDiagnosticAction (DiagnosticAction action) | | set the default diagnostic action for calls to | P4::warning() . | set the default diagnostic action for calls to | P4::warning() . |
void | setDiagnosticAction (std::string_view diagnostic, DiagnosticAction action) | |
A compilation context for P4Tools that provides a custom compiler configuration.
+class P4::P4Tools::CompileContext< OptionsType >A compilation context for P4Tools that provides a custom compiler configuration.
A P4CConfiguration implementation that increases the maximum width for a bit field or integer.
+A P4CConfiguration implementation that increases the maximum width for a bit field or integer.
An extensible result object which is returned by the CompilerTarget. In its simplest form, this holds the transformed P4 program after the front- and midend passes.
+An extensible result object which is returned by the CompilerTarget. In its simplest form, this holds the transformed P4 program after the front- and midend passes.
Encapsulates the details of invoking the P4 compiler for a target device and architecture. +
Encapsulates the details of invoking the P4 compiler for a target device and architecture. More...
#include <compiler_target.h>
Encapsulates the details of invoking the P4 compiler for a target device and architecture.
+Encapsulates the details of invoking the P4 compiler for a target device and architecture.
Initializes the P4 compiler with the given compiler-specific command-line arguments.
+Initializes the P4 compiler with the given compiler-specific command-line arguments.
Runs the P4 compiler to produce an IR and various other kinds of information on the input program.
+Runs the P4 compiler to produce an IR and various other kinds of information on the input program.
Runs the P4 compiler to produce an IR and other information for the given source code.
+Runs the P4 compiler to produce an IR and other information for the given source code.
Reimplemented in P4::P4Tools::P4Testgen::TestgenTarget.
@@ -455,7 +455,7 @@Runs the front end of the P4 compiler on the given program.
+Runs the front end of the P4 compiler on the given program.
Parses the P4 program specified on the command line.
+Parses the P4 program specified on the command line.
Implements a generic mid end for all targets. If needed, targets can customize this to implement things like targets-specific conversion of P4 enums to bit<n>.
+Implements a generic mid end for all targets. If needed, targets can customize this to implement things like targets-specific conversion of P4 enums to bit<n>.
Mid-end implementations must establish certain invariants in the IR.
TODO: Document these invariants. So far, we have:
Provides a target-specific pass that converts P4 enums to bit<n>. The default implementation returns P4::ConvertEnums, instantiated with the policy provided by @mkChooseEnumRepresentation.
+Provides a target-specific pass that converts P4 enums to bit<n>. The default implementation returns P4::ConvertEnums, instantiated with the policy provided by @mkChooseEnumRepresentation.
Provides a target-specific policy for converting P4 enums to bit<n>. The default implementation converts all enums to bit<32>.
+Provides a target-specific policy for converting P4 enums to bit<n>. The default implementation converts all enums to bit<32>.
Implements the default enum-conversion policy, which converts all enums to bit<32>.
@@ -580,7 +580,7 @@Provides a target-specific policy for converting P4 error to bit<n>. The default implementation converts all errors to bit<32>.
+Provides a target-specific policy for converting P4 error to bit<n>. The default implementation converts all errors to bit<32>.
Implements the default enum-conversion policy, which converts all enums to bit<32>.
@@ -607,7 +607,7 @@Provides a target-specific pass that converts P4 errors to bit<n>. The default implementation returns P4Tools::ConvertErrors, instantiated with the policy provided by @mkChooseEnumRepresentation.
+Provides a target-specific pass that converts P4 errors to bit<n>. The default implementation returns P4Tools::ConvertErrors, instantiated with the policy provided by @mkChooseEnumRepresentation.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_model-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_model-members.html index 1f1acd8ae28..cba3c76d9c1 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_model-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_model-members.html @@ -6,7 +6,7 @@ -Represents a solution found by the solver. A model is a concretized form of a symbolic environment. All the expressions in a Model must be of type IR::Literal.
+Represents a solution found by the solver. A model is a concretized form of a symbolic environment. All the expressions in a Model must be of type IR::Literal.
Evaluates a P4 expression in the context of this model.
+Evaluates a P4 expression in the context of this model.
A BUG occurs if the given expression refers to a variable that is not bound by this model. If the input list
resolvedExpressions | is not null, we also collect the resolved value of this expression. |
program | The P4 program after mid-end processing. |
program | The P4 program after mid-end processing. |
Write the necessary #include directives and other helpful constructs to the specified stream.
+Write the necessary include directives and other helpful constructs to the specified stream.
Implemented in P4::P4Tools::P4Smith::BMv2::Bmv2PsaSmithTarget, P4::P4Tools::P4Smith::BMv2::Bmv2V1modelSmithTarget, P4::P4Tools::P4Smith::Generic::GenericCoreSmithTarget, P4::P4Tools::P4Smith::Nic::DpdkPnaSmithTarget, and P4::P4Tools::P4Smith::Tofino::TofinoTnaSmithTarget.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_statement_generator-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_statement_generator-members.html index 0825d903563..7688b920ac7 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_statement_generator-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_statement_generator-members.html @@ -6,7 +6,7 @@ -Write the necessary #include directives and other helpful constructs to the specified stream.
+Write the necessary include directives and other helpful constructs to the specified stream.
Implements P4::P4Tools::P4Smith::SmithTarget.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_wordlist-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_wordlist-members.html index baf83e1541b..84076f384e9 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_wordlist-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_smith_1_1_wordlist-members.html @@ -6,7 +6,7 @@ -Transition function for a symbolic value. Expressions in the metalanguage include P4 non-expressions. Because of this, the given node does not necessarily need to be an instance of IR::Expression.
+Transition function for a symbolic value. Expressions in the metalanguage include P4 non-expressions. Because of this, the given node does not necessarily need to be an instance of IR::Expression.
Extends the CompilerResult with information specific to the V1Model running on BMv2. +
Extends the CompilerResult with information specific to the V1Model running on BMv2. More...
#include <compiler_result.h>
Extends the CompilerResult with information specific to the V1Model running on BMv2.
+Extends the CompilerResult with information specific to the V1Model running on BMv2.
Bmv2TestFramework provides common utility functions for BMv2-style test frameworks. +
Bmv2TestFramework provides common utility functions for BMv2-style test frameworks. More...
#include <common.h>
Bmv2TestFramework provides common utility functions for BMv2-style test frameworks.
+Bmv2TestFramework provides common utility functions for BMv2-style test frameworks.
Implements P4::P4Tools::P4Testgen::CmdStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_expr_stepper-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_expr_stepper-members.html index 590d1a52496..8c17516219c 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_expr_stepper-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_expr_stepper-members.html @@ -6,7 +6,7 @@ -Compute the series of nodes corresponding to the in-order execution of top-level pipeline-component instantiations. For a standard v1model, this produces the parser, the checksum verifier, the MAU pipeline, the checksum calculator, and finally the deparser. This sequence also includes nodes that handle transitions between the individual component instantiations.
-Sending a too short packet in BMV2 produces nonsense, so we require the packet size to be larger than 32 bits.This number needs to be raised to the size of the ethernet header for the PTF and PROTOBUF back ends.
+Sending a too short packet in BMV2 produces nonsense, so we require the packet size to be larger than 32 bits.This number needs to be raised to the size of the ethernet header for the PTF and PROTOBUF back ends.
Finally, set the target constraints.
@@ -356,7 +356,7 @@Implements P4::P4Tools::P4Testgen::ProgramInfo.
@@ -388,7 +388,7 @@Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
+Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
Reimplemented from P4::P4Tools::P4Testgen::TableStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_testgen_target-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_testgen_target-members.html index 6f7d70e7f68..415f904e2c9 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_testgen_target-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_v1_model_testgen_target-members.html @@ -6,7 +6,7 @@ -Implements P4::P4Tools::P4Testgen::TestgenTarget.
@@ -302,7 +302,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
@@ -339,7 +339,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_index_expression-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_index_expression-members.html index 9cb1f01d649..332d94211ab 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_index_expression-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_index_expression-members.html @@ -6,7 +6,7 @@ -
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_lexer-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_lexer-members.html
index 233edd4d158..f8c11c809c1 100644
--- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_lexer-members.html
+++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_lexer-members.html
@@ -6,7 +6,7 @@
-Extracts information from the @testSpec to emit a Metadata test case. + Extracts information from the @testSpec to emit a Metadata test case. More...
| Metadata (const TestBackendConfiguration &testBackendConfiguration) | |
void | writeTestToFile (const TestSpec *spec, cstring selectedBranches, size_t testId, float currentCoverage) override | |
Produce a Metadata test. | ||
Produce a Metadata test. | ||
Public Member Functions inherited from P4::P4Tools::P4Testgen::Bmv2::Bmv2TestFramework | ||
@@ -217,7 +217,7 @@ | ||
Extracts information from the @testSpec to emit a Metadata test case.
+Extracts information from the @testSpec to emit a Metadata test case.
Produce a Metadata test.
+Produce a Metadata test.
Implements P4::P4Tools::P4Testgen::TestFramework.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_metadata_collection-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_metadata_collection-members.html index 87751d0892b..8653373a019 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_metadata_collection-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_metadata_collection-members.html @@ -6,7 +6,7 @@ -Extracts information from the @testSpec to emit a PTF test case.
+Extracts information from the @testSpec to emit a PTF test case.
Produce a PTF test.
+Produce a PTF test.
Implements P4::P4Tools::P4Testgen::TestFramework.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_propagate_p4_runtime_translation-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_propagate_p4_runtime_translation-members.html index 4bd6d42539c..70eea7b9c1d 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_propagate_p4_runtime_translation-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_propagate_p4_runtime_translation-members.html @@ -6,7 +6,7 @@ -Extracts information from the @testSpec to emit a Protobuf test case. +
Extracts information from the @testSpec to emit a Protobuf test case. More...
#include <protobuf.h>
Extracts information from the @testSpec to emit a Protobuf test case.
+Extracts information from the @testSpec to emit a Protobuf test case.
The method used to output the test case to be implemented by all the test frameworks (eg. STF, PTF, etc.).
The method used to output the test case to be implemented by all the test frameworks (eg. STF, PTF, etc.).
spec | the testcase specification to be outputted. |
selectedBranches | string describing branches selected for this testcase. |
Extracts information from the @testSpec to emit a Protobuf IR test case.
+Extracts information from the @testSpec to emit a Protobuf IR test case.
The method used to output the test case to be implemented by all the test frameworks (eg. STF, PTF, etc.).
The method used to output the test case to be implemented by all the test frameworks (eg. STF, PTF, etc.).
spec | the testcase specification to be outputted. |
selectedBranches | string describing branches selected for this testcase. | STF (const TestBackendConfiguration &testBackendConfiguration) |
void | writeTestToFile (const TestSpec *spec, cstring selectedBranches, size_t testId, float currentCoverage) override |
Produce an STF test. | |
Produce an STF test. | |
Public Member Functions inherited from P4::P4Tools::P4Testgen::Bmv2::Bmv2TestFramework | |
@@ -205,7 +205,7 @@ | |
Extracts information from the @testSpec to emit a STF test case.
+Extracts information from the @testSpec to emit a STF test case.
Produce an STF test.
+Produce an STF test.
Implements P4::P4Tools::P4Testgen::TestFramework.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_token-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_token-members.html index 2a9e81e0e5f..8a30836d08a 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_token-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_token-members.html @@ -6,7 +6,7 @@ -Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelCmdStepper, P4::P4Tools::P4Testgen::EBPF::EBPFCmdStepper, and P4::P4Tools::P4Testgen::Pna::PnaDpdkCmdStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_command_visitor-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_command_visitor-members.html index 18cf1c384d2..80e029fcc03 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_command_visitor-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_command_visitor-members.html @@ -6,7 +6,7 @@ -Thrown when an exit statement is encountered.
Thrown when a select expression fails to match. This models P4's error.NoMatch.
+Thrown when a select expression fails to match. This models P4's error.NoMatch.
Thrown when the parser reaches the reject state.
This is an internal interpreter exception to express drop semantics.
Thrown on premature packet end. Models P4's error.PacketTooShort.
+Thrown on premature packet end. Models P4's error.PacketTooShort.
Thrown when the target terminates.
Expressions in the metalanguage include P4 non-expressions. Because of this, the value (if provided) does not necessarily need to be an instance of IR::Expression.
+Expressions in the metalanguage include P4 non-expressions. Because of this, the value (if provided) does not necessarily need to be an instance of IR::Expression.
Creates a visitor for Commands that substitutes the given value for the given parameter.
CoverableNodesScanner is similar to CollectNodes. It collects all the nodes present in a particular node. However, compared to CollectNodes, it traverses the entire subsequent parser DAG for a particular parser state. If there is a loop in the parser state, it will terminate. TODO: Consider caching this information.
+CoverableNodesScanner is similar to CollectNodes. It collects all the nodes present in a particular node. However, compared to CollectNodes, it traverses the entire subsequent parser DAG for a particular parser state. If there is a loop in the parser state, it will terminate. TODO: Consider caching this information.
Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
+Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
Implements P4::P4Tools::P4Testgen::SymbolicExecutor.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_cmd_stepper-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_cmd_stepper-members.html index 384cdf9b34d..ad7dee5f8df 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_cmd_stepper-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_cmd_stepper-members.html @@ -6,7 +6,7 @@ -Implements P4::P4Tools::P4Testgen::CmdStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_concolic-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_concolic-members.html index be65522c322..815b0424369 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_concolic-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_concolic-members.html @@ -6,7 +6,7 @@ -Implements P4::P4Tools::P4Testgen::ProgramInfo.
@@ -473,7 +473,7 @@Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
+Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
Reimplemented from P4::P4Tools::P4Testgen::TableStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_test_backend-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_test_backend-members.html index 4e483ed024e..8dcc9495776 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_test_backend-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_e_b_p_f_test_backend-members.html @@ -6,7 +6,7 @@ -Implements P4::P4Tools::P4Testgen::TestgenTarget.
@@ -302,7 +302,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
@@ -339,7 +339,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_s_t_f-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_s_t_f-members.html index 7ef1053b9bc..91c8654a105 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_s_t_f-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_e_b_p_f_1_1_s_t_f-members.html @@ -6,7 +6,7 @@ -Extracts information from the @testSpec to emit a STF test case.
+Extracts information from the @testSpec to emit a STF test case.
Produce an STF test.
+Produce an STF test.
Implements P4::P4Tools::P4Testgen::TestFramework.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_exact-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_exact-members.html index ae2e87ce28c..420b54b32d6 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_exact-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_exact-members.html @@ -6,7 +6,7 @@ -Pops the topmost frame in the stack of continuations. From the popped frame, the continuation (after ÎČ reduction) becomes the current body, and the namespace context becomes the current namespace context. A BUG occurs if the continuation stack is empty.
-Expressions in the metalanguage include P4 non-expressions. Because of this, the argument (if provided) does not necessarily need to be an instance of IR::Expression.
+Expressions in the metalanguage include P4 non-expressions. Because of this, the argument (if provided) does not necessarily need to be an instance of IR::Expression.
@@ -497,7 +497,7 @@
| | We delegate evaluation to the TableStepper, which needs to access protected members. | | |
@@ -535,7 +535,7 @@
Protected Attributes inherited from P4::P4Tools::P4Testgen::AbstractStepper | | Target-specific information about the P4 program being evaluated. | | |
Evaluates a call to an extern method that only exists in the interpreter. These are helper functions used to execute custom operations and specific control flow. They do not exist as P4 code or call.
+Evaluates a call to an extern method that only exists in the interpreter. These are helper functions used to execute custom operations and specific control flow. They do not exist as P4 code or call.
call | the original method call expression, can be used for stepInto calls. |
const IR::MethodCallExpression & | originalCall |
Reference to the original P4 extern call. | |
Reference to the original P4 extern call. | |
This class defines parameters useful for the invocation of P4 extern and P4Testgen-internal functions.
+This class defines parameters useful for the invocation of P4 extern and P4Testgen-internal functions.
Greedy path selection strategy, which, at branch points, picks the first execution state which has covered or potentially will cover program nodes which have not been visited yet. Potential nodes are computed using the CoverableNodesScanner visitor, which collects nodes in the top-level statement of the execution state. These nodes are latent because execution is not guaranteed. They may be guarded by an if condition or select expression. If the strategy does not find a new statement, it falls back to random. Similarly, if the strategy cycles without a test for a specific threshold, it will fall back to random. This is to prevent getting caught in a parser cycle.
+Greedy path selection strategy, which, at branch points, picks the first execution state which has covered or potentially will cover program nodes which have not been visited yet. Potential nodes are computed using the CoverableNodesScanner visitor, which collects nodes in the top-level statement of the execution state. These nodes are latent because execution is not guaranteed. They may be guarded by an if condition or select expression. If the strategy does not find a new statement, it falls back to random. Similarly, if the strategy cycles without a test for a specific threshold, it will fall back to random. This is to prevent getting caught in a parser cycle.
Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
+Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
Implements P4::P4Tools::P4Testgen::SymbolicExecutor.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_l_p_m-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_l_p_m-members.html index a1af55b3e69..b333c91b864 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_l_p_m-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_l_p_m-members.html @@ -6,7 +6,7 @@ -Extracts information from the @testSpec to emit a Metadata test case. +
Extracts information from the @testSpec to emit a Metadata test case. More...
#include <metadata.h>
Extracts information from the @testSpec to emit a Metadata test case.
+Extracts information from the @testSpec to emit a Metadata test case.
Produce a Metadata test.
+Produce a Metadata test.
Implements P4::P4Tools::P4Testgen::TestFramework.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_metadata_collection-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_metadata_collection-members.html index f5260290531..d9c4f26beec 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_metadata_collection-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_metadata_collection-members.html @@ -6,7 +6,7 @@ -Extracts information from the @testSpec to emit a PTF test case.
+Extracts information from the @testSpec to emit a PTF test case.
Produce a PTF test.
+Produce a PTF test.
Implements P4::P4Tools::P4Testgen::TestFramework.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_constants-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_constants-members.html index fac9baacc2f..1d17fa61516 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_constants-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_constants-members.html @@ -6,7 +6,7 @@ -Implements P4::P4Tools::P4Testgen::CmdStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_dpdk_concolic-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_dpdk_concolic-members.html index dc18aba95e5..1031a726c91 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_dpdk_concolic-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_dpdk_concolic-members.html @@ -6,7 +6,7 @@ -Implements P4::P4Tools::P4Testgen::ProgramInfo.
@@ -370,7 +370,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
@@ -302,7 +302,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
@@ -339,7 +339,7 @@Implements P4::P4Tools::P4Testgen::TestgenTarget.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_symbolic_vars-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_symbolic_vars-members.html index 140c5fda568..16e2d7bbdf1 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_symbolic_vars-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_pna_symbolic_vars-members.html @@ -6,7 +6,7 @@ -Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
+Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
Reimplemented from P4::P4Tools::P4Testgen::TableStepper.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_program_info-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_program_info-members.html index 2d818dd782d..3e845ab6eeb 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_program_info-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_program_info-members.html @@ -6,7 +6,7 @@ -Stores target-specific information about a P4 program. +
Stores target-specific information about a P4 program. More...
#include <program_info.h>
Stores target-specific information about a P4 program.
+Stores target-specific information about a P4 program.
Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
+Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
Implements P4::P4Tools::P4Testgen::SymbolicExecutor.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_selected_branches-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_selected_branches-members.html index fd4453f993c..1e6bf725a28 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_selected_branches-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_selected_branches-members.html @@ -6,7 +6,7 @@ -Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
+Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
Implements P4::P4Tools::P4Testgen::SymbolicExecutor.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_small_step_evaluator-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_small_step_evaluator-members.html index 5322eac20ab..d0a4ec0e38d 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_small_step_evaluator-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_small_step_evaluator-members.html @@ -6,7 +6,7 @@ -The main class that implements small-step operational semantics. Delegates to implementations of AbstractStepper.
+The main class that implements small-step operational semantics. Delegates to implementations of AbstractStepper.
Callbacks are invoked when the P4 program terminates. If the callback returns true, execution halts. Otherwise, execution of the P4 program continues on a different random path.
+Callbacks are invoked when the P4 program terminates. If the callback returns true, execution halts. Otherwise, execution of the P4 program continues on a different random path.
Handles processing at the end of a P4 program.
+Handles processing at the end of a P4 program.
Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
+Executes the P4 program along a randomly chosen path. When the program terminates, the given callback is invoked. If the callback returns true, then the executor terminates. Otherwise, execution of the P4 program continues on a different random path.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_table_config-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_table_config-members.html index 7e55c44992a..a39d7bb1d2a 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_table_config-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_table_config-members.html @@ -6,7 +6,7 @@ -Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
+Collects properties that may be set per table. Target back end may have different semantics for table execution that need to be collect before evaluation the table.
Reimplemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelTableStepper, P4::P4Tools::P4Testgen::EBPF::EBPFTableStepper, and P4::P4Tools::P4Testgen::Pna::SharedPnaTableStepper.
@@ -327,7 +327,7 @@Table implementations in P4 are rather flexible. Eval is a delegation function that chooses the right implementation depending on the properties of the table. For example, immutable tables can not be programmed using the control plane. If an table key is tainted, we can also not predict, which action is tainted. Some frameworks may have implementation details such as annotations, action profiles/selectors that may alter semantics, too.
+Table implementations in P4 are rather flexible. Eval is a delegation function that chooses the right implementation depending on the properties of the table. For example, immutable tables can not be programmed using the control plane. If an table key is tainted, we can also not predict, which action is tainted. Some frameworks may have implementation details such as annotations, action profiles/selectors that may alter semantics, too.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_ternary-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_ternary-members.html index 1a8739e7f41..3e2d575d5f9 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_ternary-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_ternary-members.html @@ -6,7 +6,7 @@ -Reimplemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2TestBackend, P4::P4Tools::P4Testgen::EBPF::EBPFTestBackend, and P4::P4Tools::P4Testgen::Pna::PnaTestBackend.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_test_framework-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_test_framework-members.html index 1114cc8a477..037b1d2f5f0 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_test_framework-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_test_framework-members.html @@ -6,7 +6,7 @@ -Invokes P4Testgen and returns a list of abstract tests which are generated based on the input TestgenOptions. The abstract tests can be further specialized depending on the select test back end. CompilerOptions is required to invoke the correct preprocessor and P4 compiler. It is assumed that .file
in the compiler options is set.
Invokes P4Testgen and returns a list of abstract tests which are generated based on the input TestgenOptions. The abstract tests can be further specialized depending on the select test back end. CompilerOptions is required to invoke the correct preprocessor and P4 compiler. It is assumed that .file
in the compiler options is set.
Invokes P4Testgen and returns a list of abstract tests which are generated based on the input TestgenOptions. The abstract tests can be further specialized depending on the select test back end. CompilerOptions is required to invoke the correct P4 compiler. This function assumes that
Invokes P4Testgen and returns a list of abstract tests which are generated based on the input TestgenOptions. The abstract tests can be further specialized depending on the select test back end. CompilerOptions is required to invoke the correct P4 compiler. This function assumes that
program | is already preprocessed. P4Testgen will directly parse the input program. |
program | The P4 program after mid-end processing. |
program | The P4 program after mid-end processing. |
Invokes P4Testgen and writes a list of abstract tests to a specified output directory which are generated based on the input TestgenOptions. The abstract tests can be further specialized depending on the select test back end. CompilerOptions is required to invoke the correct preprocessor and P4 compiler. It is assumed that .file
in the compiler options is set.
Invokes P4Testgen and writes a list of abstract tests to a specified output directory which are generated based on the input TestgenOptions. The abstract tests can be further specialized depending on the select test back end. CompilerOptions is required to invoke the correct preprocessor and P4 compiler. It is assumed that .file
in the compiler options is set.
Invokes P4Testgen and writes a list of abstract tests to a specified output directory which are generated based on the input TestgenOptions. CompilerOptions is required to invoke the correct P4 compiler. This function assumes that
Invokes P4Testgen and writes a list of abstract tests to a specified output directory which are generated based on the input TestgenOptions. CompilerOptions is required to invoke the correct P4 compiler. This function assumes that
program | is already preprocessed. P4Testgen will directly parse the input program. |
Extends the CompilerResult with the associated P4RuntimeApi. +
Extends the CompilerResult with the associated P4RuntimeApi. More...
#include <compiler_result.h>
Extends the CompilerResult with the associated P4RuntimeApi.
+Extends the CompilerResult with the associated P4RuntimeApi.
Specifies general options which IR nodes to track for coverage in the targeted P4 program. Multiple options are possible. Currently supported: STATEMENTS, TABLE_ENTRIES.
+Specifies general options which IR nodes to track for coverage in the targeted P4 program. Multiple options are possible. Currently supported: STATEMENTS, TABLE_ENTRIES.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_target-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_target-members.html index 72735c31bfd..30d1abccd3e 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_target-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_target-members.html @@ -6,7 +6,7 @@ -Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelTestgenTarget, P4::P4Tools::P4Testgen::EBPF::EBPFTestgenTarget, and P4::P4Tools::P4Testgen::Pna::PnaDpdkTestgenTarget.
@@ -326,7 +326,7 @@Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelTestgenTarget, P4::P4Tools::P4Testgen::EBPF::EBPFTestgenTarget, and P4::P4Tools::P4Testgen::Pna::PnaDpdkTestgenTarget.
@@ -363,7 +363,7 @@Implemented in P4::P4Tools::P4Testgen::Bmv2::Bmv2V1ModelTestgenTarget, P4::P4Tools::P4Testgen::EBPF::EBPFTestgenTarget, and P4::P4Tools::P4Testgen::Pna::PnaDpdkTestgenTarget.
@@ -391,7 +391,7 @@Produces a @ProgramInfo for the given P4 program.
+Produces a @ProgramInfo for the given P4 program.
Collect coverage information about the program.
Reimplemented from P4::P4Tools::CompilerTarget.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_unimplemented-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_unimplemented-members.html index 4927c8c4018..c743c5abca6 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_unimplemented-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_testgen_unimplemented-members.html @@ -6,7 +6,7 @@ -Default constructor, where dcg is a control flow graph builded by P4ProgramDCGCreator, reachabilityExpression is a user's pattern wrote in the syntax presented above, eliminateAnnotations is true if after detection of the annotations it should to store corresponding parent IR::Node in a reachability engine state.
+Default constructor, where dcg is a control flow graph builded by P4ProgramDCGCreator, reachabilityExpression is a user's pattern wrote in the syntax presented above, eliminateAnnotations is true if after detection of the annotations it should to store corresponding parent IR::Node in a reachability engine state.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_reachability_engine_state-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_reachability_engine_state-members.html index c98171abc96..477bf0873cc 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_reachability_engine_state-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_reachability_engine_state-members.html @@ -6,7 +6,7 @@ -Creates and registers a new Target instance for the given @toolName, @deviceName, and @archName.
+Creates and registers a new Target instance for the given @toolName, @deviceName, and @archName.
diff --git a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_trace_event-members.html b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_trace_event-members.html index a9fc268a6e7..53ba22ad52e 100644 --- a/pr-preview/4876/class_p4_1_1_p4_tools_1_1_trace_event-members.html +++ b/pr-preview/4876/class_p4_1_1_p4_tools_1_1_trace_event-members.html @@ -6,7 +6,7 @@ -An event in a trace of the execution of a P4 program. +
An event in a trace of the execution of a P4 program. More...
#include <trace_event.h>
An event in a trace of the execution of a P4 program.
+An event in a trace of the execution of a P4 program.
A Z3-based implementation of AbstractSolver. Encapsulates a z3::solver and a z3::context. +
A Z3-based implementation of AbstractSolver. Encapsulates a z3::solver and a z3::context. More...
#include <z3_solver.h>
A Z3-based implementation of AbstractSolver. Encapsulates a z3::solver and a z3::context.
+A Z3-based implementation of AbstractSolver. Encapsulates a z3::solver and a z3::context.
Z3Solver specific checkSat function. Calls check on the solver. Only useful in incremental mode.
+Z3Solver specific checkSat function. Calls check on the solver. Only useful in incremental mode.
Z3Solver specific checkSat function. Calls check on the input z3::expr_vector. Only relies on the incrementality mode of the Z3 solver.
+Z3Solver specific checkSat function. Calls check on the input z3::expr_vector. Only relies on the incrementality mode of the Z3 solver.
Translates P4 expressions into Z3. Any variables encountered are declared to a Z3 instance. +
Translates P4 expressions into Z3. Any variables encountered are declared to a Z3 instance. More...
#include <z3_solver.h>
Translates P4 expressions into Z3. Any variables encountered are declared to a Z3 instance.
+Translates P4 expressions into Z3. Any variables encountered are declared to a Z3 instance.
' annotation for the | |||||||||||||||||
Extend the provided set of annotations with an ' given name. This is used to preserve the original, P4-14 object names. -In general, because P4-14 names do not have the hierarchical structure that P4-16 names do, you should use addGlobalNameAnnotation() rather than this method. The exception is type names; these are already global in P4-16, so there isn't much to be gained, and there is currently some code that doesn't handling "." prefixes in type names well. +In general, because P4-14 names do not have the hierarchical structure that P4-16 names do, you should use addGlobalNameAnnotation() rather than this method. The exception is type names; these are already global in P4-16, so there isn't much to be gained, and there is currently some code that doesn't handling "." prefixes in type names well. XXX(seth): For uniformity, we should probably fix the issues with "." in type names and get rid of this method.
|
Pattern matcher for IR::Expression trees.
-Build pattern expressions with Pattern
to match subtrees or leaves, and combine them with C++ operators to build larger patterns that can match tree fragments
Pattern matcher for IR::Expression trees.
+Build pattern expressions with Pattern
to match subtrees or leaves, and combine them with C++ operators to build larger patterns that can match tree fragments
Represents all the compile-time information about a P4-16 program that is common to all P4 targets (in particular simple switch and psa switch).
+Represents all the compile-time information about a P4-16 program that is common to all P4 targets (in particular simple switch and psa switch).
Computes the SetOfLocations read and written by an expression. +
Computes the SetOfLocations read and written by an expression. More...
#include <alias.h>
Computes the SetOfLocations read and written by an expression.
+Computes the SetOfLocations read and written by an expression.
Iterates RemoveUnusedDeclarations until convergence. +
Iterates RemoveUnusedDeclarations until convergence. More...
#include <unusedDeclarations.h>
Iterates RemoveUnusedDeclarations until convergence.
+Iterates RemoveUnusedDeclarations until convergence.
If @warn is true, emit compiler warnings if an unused instance of an IR::P4Table or IR::Declaration_Instance is removed.
is replaced by
T v_t1; T v_t2; f(v_t1, { v_t1, v_t2 });
This does not work if the second argument of f is out or inout, since the list expression is not a l-value. This pass cannot be used in this case. This can arise only if there are extern functions that can have out arguments with types that are structs.
-Iterates DoRemoveParserControlFlow and SimplifyControlFlow until convergence.
+Iterates DoRemoveParserControlFlow and SimplifyControlFlow until convergence.
This pass wraps RemoveParserControlFlow by establishing the preconditions that need to be present before running it.
+This pass wraps RemoveParserControlFlow by establishing the preconditions that need to be present before running it.
Additionally, IR::Declaration_Instance nodes for extern instances are not removed but still trigger warnings.
If @warned is non-null, unused IR::P4Table and IR::Declaration_Instance nodes are stored in @warned if they are unused and removed by this pass. A compilation warning is emitted when a new node is added to @warned, preventing duplicate warnings per node.
-Get new name of the given declaration or nullptr if the declaration is not to be renamed.
decl | Declaration in the original/non-transformed P4 IR. |
decl | Declaration in the original/non-transformed P4 IR. |
This pass flattens any nested struct inside a P4 header. This pass will fail if a header with nested fields is used as a left-value.
+This pass flattens any nested struct inside a P4 header. This pass will fail if a header with nested fields is used as a left-value.
Should be run before the flattenInterfaceStructs pass.
For example, see the data structures below.
struct alt_t { bit<1> valid; bit<7> port; };
diff --git a/pr-preview/4876/class_p4_1_1_replace_index_refs-members.html b/pr-preview/4876/class_p4_1_1_replace_index_refs-members.html index 6b750cf25fb..db871c82021 100644 --- a/pr-preview/4876/class_p4_1_1_replace_index_refs-members.html +++ b/pr-preview/4876/class_p4_1_1_replace_index_refs-members.html @@ -6,7 +6,7 @@ -This pass transforms the type signatures of instantiated controls, parsers, and packages. It does not transform methods, functions or actions. It starts from package instantiations: every type argument that is a nested structure is replaced with "simpler" flat type.
This pass cannot handle methods or functions that return structs, or that take an out argument of type struct. If there are such structures the pass will report an error.
-Should be run after the NestedStructs pass.
+Should be run after the NestedStructs pass.
struct S { bit b; } struct T { S s; }
control c(inout T arg) { apply { ... arg.s.b ... } }
control proto<V>(inout V arg); package top<V>(proto<V> ctrl);
diff --git a/pr-preview/4876/class_p4_1_1_replace_type_uses-members.html b/pr-preview/4876/class_p4_1_1_replace_type_uses-members.html index 4e648348786..d7ea529be5b 100644 --- a/pr-preview/4876/class_p4_1_1_replace_type_uses-members.html +++ b/pr-preview/4876/class_p4_1_1_replace_type_uses-members.html @@ -6,7 +6,7 @@ -Invokes TypeChecking followed by DoResetHeaders. +
Invokes TypeChecking followed by DoResetHeaders. More...
#include <resetHeaders.h>
Invokes TypeChecking followed by DoResetHeaders.
+Invokes TypeChecking followed by DoResetHeaders.
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context. +
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context. More...
#include <resolveReferences.h>
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
+Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
Inspector that computes refMap
: a map from paths to declarations.
Inspector that computes refMap
: a map from paths to declarations.
refMap
We represent a set of location set as a set of LocationPath objects.
+We represent a set of location set as a set of LocationPath objects.
Determines whether an expression may have method or constructor invocations.
-The TypeMap and ReferenceMap arguments may be null, in which case every method call expression is counted. With type information, invocations of isValid()
are ignored.
The TypeMap and ReferenceMap arguments may be null, in which case every method call expression is counted. With type information, invocations of isValid()
are ignored.
This gets translated to the following p4_16: hdr.field = hdr.field & ~mask | parameter & mask;
which in term could be further simplified to a vector of simple assignments over slices. This extensions could be folded to any combinations of Binary Ors and Binary Ands as long as the masks never have any collisions.
Maintains a map from invocation to a SpecializationInfo object. +
Maintains a map from invocation to a SpecializationInfo object. More...
#include <specialize.h>
Maintains a map from invocation to a SpecializationInfo object.
+Maintains a map from invocation to a SpecializationInfo object.
Instantiations with constructor arguments that are not constant values are ignored—see SpecializeAll for details.
+Instantiations with constructor arguments that are not constant values are ignored—see SpecializeAll for details.
Note that this pass handles type substitution for instantiating generic Parser or Control types, which is an experimental feature.
For example:
Specializes each Parser and Control by substituting type arguments and constructor parameters.
-The primary goal of this pass is to specialize Control and Parser types with instantiations that supply constructor parameters, which is accomplished via Specialize.
-This is an iterative process, however: Specialize will only substitute constant values for constructor parameters, but constructor calls may have (a) expressions and (b) other constructor parameters as arguments. Hence, each iteration applies constant folding and then specialization until reaching convergence.
+The primary goal of this pass is to specialize Control and Parser types with instantiations that supply constructor parameters, which is accomplished via Specialize.
+This is an iterative process, however: Specialize will only substitute constant values for constructor parameters, but constructor calls may have (a) expressions and (b) other constructor parameters as arguments. Hence, each iteration applies constant folding and then specialization until reaching convergence.
Eventually, all instantiations of Control or Parser type declarations with constructor parameters will be replaced by instantiations of specialized type declarations, at which point it is safe to remove the original (now unused) type declarations.
SplitFlowVisit_base is base class for doing coroutine-like processing of of flows in a visitor. A visit_children method (or a preorder override) can instantiate a local SplitFlowVist subclass to record the various children that need to be visited, and the chain of currently in existence SplitFlowVisit objects will be recorded in split_link. When flows need to be joined (to visit a Dag node with mulitple parents), processing of the node can be 'paused' and other children from the SplitFlowVist can be visited, in order to visit all parents before the child is visited.
+SplitFlowVisit_base is base class for doing coroutine-like processing of of flows in a visitor. A visit_children method (or a preorder override) can instantiate a local SplitFlowVist subclass to record the various children that need to be visited, and the chain of currently in existence SplitFlowVisit objects will be recorded in split_link. When flows need to be joined (to visit a Dag node with mulitple parents), processing of the node can be 'paused' and other children from the SplitFlowVist can be visited, in order to visit all parents before the child is visited.
Class with hash function for StackVariable. +
Class with hash function for StackVariable. More...
#include <parserUnroll.h>
Class with hash function for StackVariable.
+Class with hash function for StackVariable.
Backend code generation from midend IR
+Backend code generation from midend IR
Implements P4::TC::PNAEbpfGenerator.
@@ -313,7 +313,7 @@Implements P4::TC::PNAEbpfGenerator.
diff --git a/pr-preview/4876/class_p4_1_1_t_c_1_1_p_n_a_ebpf_generator-members.html b/pr-preview/4876/class_p4_1_1_t_c_1_1_p_n_a_ebpf_generator-members.html index 1d763890c27..ac935660e11 100644 --- a/pr-preview/4876/class_p4_1_1_t_c_1_1_p_n_a_ebpf_generator-members.html +++ b/pr-preview/4876/class_p4_1_1_t_c_1_1_p_n_a_ebpf_generator-members.html @@ -6,7 +6,7 @@ -Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
+Generates a pointer to skb->cb and maps it to psa_global_metadata to access global metadata shared between pipelines.
Reimplemented from P4::EBPF::TCIngressPipeline.
diff --git a/pr-preview/4876/class_p4_1_1_t_c_1_1_t_c_options-members.html b/pr-preview/4876/class_p4_1_1_t_c_1_1_t_c_options-members.html index eccb643d898..f1e0f7b635c 100644 --- a/pr-preview/4876/class_p4_1_1_t_c_1_1_t_c_options-members.html +++ b/pr-preview/4876/class_p4_1_1_t_c_1_1_t_c_options-members.html @@ -6,7 +6,7 @@ -GTest for P4 Tools tests. +
GTest for P4 Tools tests. More...
#include <gtest_utils.h>
GTest for P4 Tools tests.
+GTest for P4 Tools tests.
This pass converts a P4-16 IR into a P4 source (text) program. It can optionally emit as comments a representation of the program IR.
+This pass converts a P4-16 IR into a P4 source (text) program. It can optionally emit as comments a representation of the program IR.
Performs together reference resolution and type checking by calling TypeInference. If updateExpressions is true, after type checking it will update all Expression objects, writing the result type into the Expression::type field.
+Performs together reference resolution and type checking by calling TypeInference. If updateExpressions is true, after type checking it will update all Expression objects, writing the result type into the Expression::type field.
P4 width.
+P4 width.
Implements P4::EBPF::IHasWidth.
diff --git a/pr-preview/4876/class_p4_1_1_u_b_p_f_1_1_u_b_p_f_model-members.html b/pr-preview/4876/class_p4_1_1_u_b_p_f_1_1_u_b_p_f_model-members.html index 9ca15f4a46a..27af81674e0 100644 --- a/pr-preview/4876/class_p4_1_1_u_b_p_f_1_1_u_b_p_f_model-members.html +++ b/pr-preview/4876/class_p4_1_1_u_b_p_f_1_1_u_b_p_f_model-members.html @@ -6,7 +6,7 @@ -Type-erased Enumerator interface. +
Type-erased Enumerator interface. More...
#include <enumerator.h>
Type-erased Enumerator interface.
+class P4::Util::Enumerator< T >Type-erased Enumerator interface.
Information about all the input sources that comprise a P4 program that is being compiled. The inputSources can be seen as a simple file produced by the preprocessor, but also as a set of fragments of input files which were stitched by the preprocessor.
+Information about all the input sources that comprise a P4 program that is being compiled. The inputSources can be seen as a simple file produced by the preprocessor, but also as a set of fragments of input files which were stitched by the preprocessor.
The mutable part of the API is tailored for interaction with the lexer. After the lexer is done this object can be "sealed" and never changes again.
This class implements a singleton pattern: there is a single instance of this class.
Hide this option from –help message.
If this option requires an argument, it may be omitted. Options with this flag set can only accept their argument with the syntax --foo=bar
; --foo bar
will be treated as if the argument to --foo
were omitted. If the argument is omitted, null will be passed to the OptionProcessor.
If this option requires an argument, it may be omitted. Options with this flag set can only accept their argument with the syntax --foo=bar
; --foo bar
will be treated as if the argument to --foo
were omitted. If the argument is omitted, null will be passed to the OptionProcessor.
Information about the source position of a language element - a range of position within an InputSources. Can only be interpreted relative to some InputSources.
+Information about the source position of a language element - a range of position within an InputSources. Can only be interpreted relative to some InputSources.
For a program element, the start is inclusive and the end is exclusive (the first position after the language element).
-SourceInfo can also be "invalid"
+SourceInfo can also be "invalid"
A SourceInfo that spans both this and rhs. However, if this or rhs is invalid, it is not taken into account
+A SourceInfo that spans both this and rhs. However, if this or rhs is invalid, it is not taken into account
A character position within some InputSources: a pair of line/column positions. Can only be interpreted in the context of some InputSources.
+A character position within some InputSources: a pair of line/column positions. Can only be interpreted in the context of some InputSources.
In files line numbering starts at 1, so 0 is reserved for "invalid" source positions. As a consequence, invalid source position are the "smallest", which is a reasonable choice.
Checks to see if there are any unknown properties.
Assists visitors in traversing the IR.
-A ChangeTracker object assists visitors traversing the IR by tracking each node. The start
method begins tracking, and finish
ends it. The done
method determines whether the node has been visited, and result
returns the new IR if it changed.
A ChangeTracker object assists visitors traversing the IR by tracking each node. The start
method begins tracking, and finish
ends it. The done
method determines whether the node has been visited, and result
returns the new IR if it changed.
Util::CompilerBug | This method fails if `start(@orig)` has not previously been invoked. |
Util::CompilerBug | This method fails if `start(@orig)` has not previously been invoked. |
Assists visitors in traversing the IR.
-A Tracker object assists visitors traversing the IR by tracking each node. The start
method begins tracking, and finish
ends it. The done
method determines whether the node has been visited.
A Tracker object assists visitors traversing the IR by tracking each node. The start
method begins tracking, and finish
ends it. The done
method determines whether the node has been visited.
Util::CompilerBug | This method fails if `start( + |
Util::CompilerBug | This method fails if `start( )` has not previously been invoked. |
Designed to imitate the std::rotate/std::rotate_copy function for vectors. Return a bitvec which has the bit at rotation_idx appear at start_bit, and the corresponding data between start_bit and end_bit rotated. Similar to std::rotate/std::rotate_copy, end_bit is exclusive
+Designed to imitate the std::rotate/stdrotate_copy function for vectors. Return a bitvec which has the bit at rotation_idx appear at start_bit, and the corresponding data between start_bit and end_bit rotated. Similar to std::rotate/stdrotate_copy, end_bit is exclusive
diff --git a/pr-preview/4876/class_p4_1_1bitvec_1_1const__bitref-members.html b/pr-preview/4876/class_p4_1_1bitvec_1_1const__bitref-members.html index a333c96f2de..7b7065a150b 100644 --- a/pr-preview/4876/class_p4_1_1bitvec_1_1const__bitref-members.html +++ b/pr-preview/4876/class_p4_1_1bitvec_1_1const__bitref-members.html @@ -6,7 +6,7 @@ -For this particular implementation:
As the map is ordered, two maps are only considered equal if the elements are inserted in the same order. Same as with ordered_map though.
+As the map is ordered, two maps are only considered equal if the elements are inserted in the same order. Same as with ordered_map though.
diff --git a/pr-preview/4876/class_p4_test_options-members.html b/pr-preview/4876/class_p4_test_options-members.html index 794b4649d67..4eb2b77d55d 100644 --- a/pr-preview/4876/class_p4_test_options-members.html +++ b/pr-preview/4876/class_p4_test_options-members.html @@ -6,7 +6,7 @@ -+ |
+ P4C
+
+ The P4 Compiler
+ |
+
Thank you for considering contributing to the P4 Compiler Project (P4C)! Your contributions are valuable and help improve the project for everyone. Before getting started, please take a moment to review the following guidelines.
+The P4 organizations uses DCO for contributions. Please take a look at our guidelines.
+To sign off the last commit quickly use the git commit --amend --signoff
command. The failing check will also include instructions on how to sign off all commits in two steps (using git rebase HEAD~$NUM_COMMITS --signoff
). The Developer Community DCO guide also provides helpful tips on fixing DCO inconveniences. Setting up a commit hook in the P4C repository will automate adding the DCO signoff.
Please note that this project adheres to the P4 Coding Standard Philosophy. By participating, you are expected to uphold this code.
+We welcome and appreciate new contributions. Check out git usage to get started.
+cmake --build . --target clang-format cpplint black isort
produces no errors.If you encounter any issues or have suggestions for improvement, please open an issue with a clear description and, if possible, steps to reproduce.
+We welcome feature requests! Please open an issue and provide as much detail as possible about the requested feature and its use case.
+Happy coding!
+When writing code in any language the most important consideration is readability. Code will be read by many more people and many more times than it will be written. So the goal is to write code that clearly and concisely describes what the code is doing, in terms of data structures, algorithms and interfaces. Expressing why the code is organized the way it is and how it achieves its goals is also necessary, and should be done in supporting documentation, as it cannot generally be expressed directly in the structure of the code. Having good supporting documentation is not an excuse for poorly written code, and well written code cannot make up for lacking documentation.
+There are multiple modes in which people read code. They may read the code in depth to try to understand the algorithms used in the code, or they may scan over the code looking to understand the structure and interfaces of the code. Good coding style supports both kinds of readers. When writing code, you need to consider how that code appears to readers who have limited understanding of the code as well as readers who already mostly understand it. It should be easy for first-time readers to find where to start and for experienced readers to find the details they are looking for.
+There are many different kinds of code involved in any project. Some code is important algorithms that program uses. Other code is primarily about building and managing data structures that algorithms operate on. Much code is "boilerplate"; code that exists primarily to make the compiler or build system work properly and is not really relevant to understanding the program or what it is trying to do. Code should ideally be designed so the scanning eye can easily separate the relevant, important code from the boilerplate.
+Code should therefor be organized in "chunks" that can be though of as corresponding to paragraphs in written text. These chunks should be visible blocks in a superficial scan of the code, separated from each other by vertical white-space (blank lines). A chunk should be at least 3-5 lines (less than that doesn't convey adequate information or stand out enough from blank space), and at most 20-40 lines. These limits are not hard and fast rules, but guidelines – when writing code try to see how it appears to a surface scan trying to organize it visually in paragraph-style chunks.
+Applying this to C++ code, a function may naturally express a chunk, or multiple chunks, or multiple small, related functions may be a chunk. Similarly, a class or struct definition may naturally be one or multiple chunks. This chunking informs where the brace characters should be placed, as brace by itself on a line makes a vertical space that separates chunks. So braces can be placed by themselves when they coincide with a chunk boundary, and should be placed with other text (generally the line above) when they do not.
+Oftentimes, boilerplate code does not fit naturally into this chunking style – while you can have a chunk of boilerplate followed by a chunk of "real" code, doing this can interfere with readability. To the extent possible, boilerplate should be separated, to become part of the white-space between chunks. A one or two line (too small to be a real chunk) element between two chunks can be good for this.
+C++ code contains many nested constructs (loops, conditions, classes, functions) that are delineated by brace ({..}) characters. These punctuation characters are easily missed on a quick scan or read of the code, so it is important to use indentation to make this nesting clear. Indentation should ALWAYS be kept consistent with code structure as defined by the braces, so the braces themselves can be ignored by the reader. At the same time, this nesting (and indentation) is really independent of the chunk/paragraph structuring of the code, so individual chunks can both contain indentation (for nested structure within a chunk) and be independently indented (for nested structures encapsulating multiple chunks). Too much indentation results in chunks that don't look like chunks, obscuring the vertical spacing that splits chunks, so any time indentation gets to more than 4-6 levels, it is a good indication that the code should be refactored.
+When you look at a visual item with a repeating pattern, the brain tends to accentuate the pattern and edit out the differences. When you have code that is repetitive, this is pretty much exactly wrong – in repetitive code, the differences between the repeated things are usually what is important, while the repeating pattern is mostly less important. Thus, repeating (visual) patterns should usually be avoided. This is an aspect of the DRY (do not repeat yourself) principle in software engineering, since any repetition tends to lead to repeating patterns that are then harder to read.
+Code comments should be meaningful and aid to the understanding of the code. We use Doxygen style comments. Comments should reflect the programmer's intention (rather than enumerating the code) and the reasoning behind certain decisions. Comments should also capture invariants that are not directly visible in the code. There are arguments that code should be self-documenting, and indeed we encourage the writing of clean self-explanatory code. Comments should contribute the additional meaning that helps extensibility and maintainability by a large group of developers.
+The main goal of issuing errors and warnings is for the programmer to write correct P4 code. Errors and warnings should be actionable, i.e., the programmer needs to understand what was wrong with the program and if possible, get an idea on how to fix the problem. While error messages are not intended to replace learning the language and reading the language specification, there are many instances in which the compiler messages really help emphasizing certain semantics aspects that are overlooked. Therefore, please take the time to think through the information you want to convey and write good, explicit error messages.
+An additional goal of the P4C compiler is to provide as many error messages as possible in one go. Therefore, while there is support for FATAL_ERROR
s, it is desirable to try to continue execution and report all possible errors, using the error
and warning
calls. With the free form implementation of error messages, repeated passes of the compiler will then issue the same message multiple times. This results in frustrating the programmer.
To address the repeated message issue, as of Dec 2018, we introduce error/warning types. They classify the errors and impose a format that allows the compiler to automatically filter repeated messages. The filtering is based on the type of error and the source code location of the object that reports the error. Thus, it allows multiple error types per source code line, and ensures that only one error is reported even if the message is raised multiple times. We encourage compiler developers to use this method for issuing errors. The error codes and formats are defined in lib/error_catalog.[h,cpp]
. Backends can extend the codes and formats as needed (and they are encouraged to do so).
Most of the errors as of Dec 2018 are written in free form: they use the boost::format
for the format argument, which has some compatibility for printf
arguments. These functions handle IR and SourceInfo objects smartly. Here is an example:
output:
+To ease the transition to typed errors and warnings, free form messages whose first argument (%1%
) is an IR::Node
(or more precisely a class that implements Util::IHasSourceInfo
interface), will be converted automatically to typed errors that use the format argument of the message rather than the error catalog predefined formats.
Git histories are a beautiful tool to understand design decisions and build a knowledge base for resolving issues. Commit messages allow relating issues to resolutions and to explain the resolutions to everyone. Writing good commit messages takes some practice, fortunately, there are a number of simple guideline steps that go a long way. Universally, the recommendation is to use a 50 character summary line, followed by a detailed explanation of your commit, why it is necessary (link to the relevant issue), how it addresses the issue, what are its implications. For a more detailed exposure, including guidelines on how to express the text, see this blog post.
+Github pull requests (PRs) created based on a single commit will inherit the commit message, and thus allow your reviewers to understand the work done without chasing multiple other issues, email messages, etc. Multi-commit PRs do not have this feature, however, we encourage you to cut and paste from your commit messages and provide a synopsis of what the PR is trying to accomplish. It is also strongly recommended that multi-commit PRs squash all their commits in to a single commit when merged. The Github web interface makes it very easy to do, and allows you to edit the final commit message directly in the browser.
+diff --git a/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.map b/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.map index d486d7e3fd4..61ef8fd0ed2 100644 --- a/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.map +++ b/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.map @@ -1,9 +1,8 @@ diff --git a/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.md5 b/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.md5 index 74156a7abd2..a1f1a685e81 100644 --- a/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.md5 +++ b/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.md5 @@ -1 +1 @@ -277f246d9080db8dc647bce658109553 \ No newline at end of file +3265ec6cb92ae4f70e2ee035c7b4ece8 \ No newline at end of file diff --git a/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.svg b/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.svg index 4579c5af11b..85de8fb7668 100644 --- a/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.svg +++ b/pr-preview/4876/dir_83a8e6017e6647ab2aa86dac60c1c317_dep.svg @@ -4,8 +4,8 @@ - |