17#ifndef BACKENDS_TC_INTROSPECTION_H_
18#define BACKENDS_TC_INTROSPECTION_H_
20#include "frontends/p4/parseAnnotations.h"
21#include "frontends/p4/parserCallGraph.h"
24#include "lib/nullstream.h"
26#include "tcAnnotations.h"
37 schemaVersion =
nullptr;
38 pipelineName =
nullptr;
40 void initIntrospectionInfo(IR::TCPipeline *tcPipeline) {
41 schemaVersion =
"1.0.0";
42 pipelineName = tcPipeline->pipelineName;
51 unsigned int bitwidth;
70 unsigned int dataType;
71 unsigned int bitwidth;
79enum ActionScope { TableOnly, DefaultOnly, TableAndDefault };
92 scope = TableAndDefault;
101 unsigned int tentries;
102 unsigned int numMask;
103 unsigned int keysize;
119 IR::TCPipeline *tcPipeline;
128 : tcPipeline(tcPipeline), refMap(refMap), typeMap(typeMap) {}
129 void postorder(
const IR::P4Table *t);
133 void collectTableInfo();
134 void collectKeyInfo(
const IR::Key *k,
struct TableAttributes *tableinfo);
135 void collectActionInfo(
const IR::ActionList *actionlist,
struct TableAttributes *tableinfo,
136 const IR::P4Table *p4table,
const IR::TCTable *table);
139 bool serializeIntrospectionJson(std::ostream &destination);
140 std::optional<cstring> checkValidTcType(
const IR::StringLiteral *sl);
141 cstring externalName(
const IR::IDeclaration *declaration);
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
This pass generates introspection JSON into user specified file.
Definition introspection.h:118
Definition ordered_map.h:30
Definition safe_vector.h:25
This file defines functions for the pass to generate the introspection file.
Definition backend.cpp:24
Definition introspection.h:81
Definition introspection.h:67
Definition introspection.h:61
Definition introspection.h:33
Definition introspection.h:46
Definition introspection.h:98