Nulling Blocks - 2022.2 English - UG1308

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Version
2022.2 English
Revision

The following code shows examples of how to "null" each engine.

// TRANSLATED TO P4 BY XILINX
#include <core.p4>
#include <xsa.p4>


// ********************************************************************** //
// ************************ S T R U C T U R E S  ************************ //
// ********************************************************************** //

// header structure
struct headers {
}

// User metadata structure
struct metadata {
 
}


// ********************************************************************** //
// *************************** P A R S E R  ***************************** //
// ********************************************************************** //

parser NullParser(packet_in packet, 
                out headers hdr, 
                inout metadata meta, 
                inout standard_metadata_t smeta) {
    
    state start {
        transition accept;
    }
}

// ********************************************************************** //
// ***************  M A T C H  A C T I O N  E N G I N E  **************** //
// ********************************************************************** //

control NullMAPipe(inout headers hdr, 
                     inout metadata meta, 
                     inout standard_metadata_t smeta) {
                     
    apply {
    }                     
}                   
                     
// ********************************************************************** //
// ***************************  D E P A R S E R  ************************ //
// ********************************************************************** //

control NullDeparser(packet_out packet, 
                   in headers hdr,
                   inout metadata meta, 
                   inout standard_metadata_t smeta) {
    apply {
    }
}

// ********************************************************************** //
// ******************************  M A I N  ***************************** //
// ********************************************************************** //

XilinxPipeline(
    NullParser(), 
    NullMAPipe(), 
    NullDeparser()
) main;